From aeb0a5d8eac490c310cadcff3770936f3768286c Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sat, 5 Aug 2023 14:12:03 -0400 Subject: [PATCH] Make delete confirmation button red (#741) --- lib/components/generated_form_modal.dart | 8 +++++++- lib/providers/apps_provider.dart | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/components/generated_form_modal.dart b/lib/components/generated_form_modal.dart index f44acc4..838b187 100644 --- a/lib/components/generated_form_modal.dart +++ b/lib/components/generated_form_modal.dart @@ -11,7 +11,8 @@ class GeneratedFormModal extends StatefulWidget { this.initValid = false, this.message = '', this.additionalWidgets = const [], - this.singleNullReturnButton}); + this.singleNullReturnButton, + this.primaryActionColour}); final String title; final String message; @@ -19,6 +20,7 @@ class GeneratedFormModal extends StatefulWidget { final bool initValid; final List additionalWidgets; final String? singleNullReturnButton; + final Color? primaryActionColour; @override State createState() => _GeneratedFormModalState(); @@ -71,6 +73,10 @@ class _GeneratedFormModalState extends State { : widget.singleNullReturnButton!)), widget.singleNullReturnButton == null ? TextButton( + style: widget.primaryActionColour == null + ? null + : TextButton.styleFrom( + foregroundColor: widget.primaryActionColour), onPressed: !valid ? null : () { diff --git a/lib/providers/apps_provider.dart b/lib/providers/apps_provider.dart index 9c8d7db..ec9c104 100644 --- a/lib/providers/apps_provider.dart +++ b/lib/providers/apps_provider.dart @@ -892,6 +892,7 @@ class AppsProvider with ChangeNotifier { context: context, builder: (BuildContext ctx) { return GeneratedFormModal( + primaryActionColour: Theme.of(context).colorScheme.error, title: plural('removeAppQuestion', apps.length), items: !showUninstallOption ? []