File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 11import 'package:flutter/material.dart' ;
22import 'package:flutter/cupertino.dart' ;
33
4+ class DialogBtnColor {
5+ static const Color btnDefault = const Color (0xff353535 );
6+ static const Color btnPrimary = const Color (0xff09bb07 );
7+ }
8+
49class DialogActions {
5- DialogActions ({this .text, this .onPressed});
10+ DialogActions ({this .text, this .onPressed, this .color = DialogBtnColor .btnPrimary });
611 final String text;
712 final VoidCallback onPressed;
13+ final Color color;
814}
915
1016class _AndroidDialog extends StatelessWidget {
@@ -25,7 +31,10 @@ class _AndroidDialog extends StatelessWidget {
2531 ),
2632 actions: actions
2733 .map ((action) => FlatButton (
28- child: Text (action.text),
34+ child: Text (
35+ action.text,
36+ style: TextStyle (color: action.color),
37+ ),
2938 highlightColor: Color (0xFFDEDEDE ),
3039 onPressed: () {
3140 Navigator .pop (context);
@@ -51,7 +60,10 @@ class _IosDialog extends StatelessWidget {
5160 actions: actions
5261 .map (
5362 (action) => CupertinoDialogAction (
54- child: Text (action.text),
63+ child: Text (
64+ action.text,
65+ style: TextStyle (color: action.color),
66+ ),
5567 isDefaultAction: true ,
5668 onPressed: () {
5769 Navigator .pop (context);
You can’t perform that action at this time.
0 commit comments