Apply flat button styling globally, ie. dialogs
This commit is contained in:
parent
d6cd740532
commit
47e3f76bca
|
|
@ -20,17 +20,21 @@ class AppTextButton extends StatelessWidget {
|
|||
final store = StoreProvider.of<AppState>(context);
|
||||
final state = store.state;
|
||||
|
||||
final ButtonStyle flatButtonStyle = TextButton.styleFrom(
|
||||
primary: onPressed == null
|
||||
? null
|
||||
: color != null
|
||||
? color
|
||||
: isInHeader
|
||||
? state.headerTextColor
|
||||
: state.prefState.enableDarkMode
|
||||
? Colors.white
|
||||
: Colors.black87,
|
||||
);
|
||||
Color primaryColor;
|
||||
if (onPressed == null) {
|
||||
//
|
||||
} else if (color != null) {
|
||||
primaryColor = color;
|
||||
} else if (isInHeader) {
|
||||
primaryColor = state.headerTextColor;
|
||||
} else if (state.prefState.enableDarkMode) {
|
||||
primaryColor = Colors.white;
|
||||
} else {
|
||||
primaryColor = Colors.black87;
|
||||
}
|
||||
|
||||
final ButtonStyle flatButtonStyle =
|
||||
TextButton.styleFrom(primary: primaryColor);
|
||||
|
||||
return TextButton(
|
||||
style: flatButtonStyle,
|
||||
|
|
|
|||
Loading…
Reference in New Issue