Make delete confirmation button red (#741)

This commit is contained in:
Imran Remtulla
2023-08-05 14:12:03 -04:00
parent 09fe7f3ecd
commit aeb0a5d8ea
2 changed files with 8 additions and 1 deletions

View File

@ -11,7 +11,8 @@ class GeneratedFormModal extends StatefulWidget {
this.initValid = false, this.initValid = false,
this.message = '', this.message = '',
this.additionalWidgets = const [], this.additionalWidgets = const [],
this.singleNullReturnButton}); this.singleNullReturnButton,
this.primaryActionColour});
final String title; final String title;
final String message; final String message;
@ -19,6 +20,7 @@ class GeneratedFormModal extends StatefulWidget {
final bool initValid; final bool initValid;
final List<Widget> additionalWidgets; final List<Widget> additionalWidgets;
final String? singleNullReturnButton; final String? singleNullReturnButton;
final Color? primaryActionColour;
@override @override
State<GeneratedFormModal> createState() => _GeneratedFormModalState(); State<GeneratedFormModal> createState() => _GeneratedFormModalState();
@ -71,6 +73,10 @@ class _GeneratedFormModalState extends State<GeneratedFormModal> {
: widget.singleNullReturnButton!)), : widget.singleNullReturnButton!)),
widget.singleNullReturnButton == null widget.singleNullReturnButton == null
? TextButton( ? TextButton(
style: widget.primaryActionColour == null
? null
: TextButton.styleFrom(
foregroundColor: widget.primaryActionColour),
onPressed: !valid onPressed: !valid
? null ? null
: () { : () {

View File

@ -892,6 +892,7 @@ class AppsProvider with ChangeNotifier {
context: context, context: context,
builder: (BuildContext ctx) { builder: (BuildContext ctx) {
return GeneratedFormModal( return GeneratedFormModal(
primaryActionColour: Theme.of(context).colorScheme.error,
title: plural('removeAppQuestion', apps.length), title: plural('removeAppQuestion', apps.length),
items: !showUninstallOption items: !showUninstallOption
? [] ? []