Apply flat button styling globally, ie. dialogs

This commit is contained in:
Hillel Coren 2021-05-02 13:03:00 +03:00
parent d6cd740532
commit 47e3f76bca
1 changed files with 15 additions and 11 deletions

View File

@ -20,17 +20,21 @@ class AppTextButton extends StatelessWidget {
final store = StoreProvider.of<AppState>(context); final store = StoreProvider.of<AppState>(context);
final state = store.state; final state = store.state;
final ButtonStyle flatButtonStyle = TextButton.styleFrom( Color primaryColor;
primary: onPressed == null if (onPressed == null) {
? null //
: color != null } else if (color != null) {
? color primaryColor = color;
: isInHeader } else if (isInHeader) {
? state.headerTextColor primaryColor = state.headerTextColor;
: state.prefState.enableDarkMode } else if (state.prefState.enableDarkMode) {
? Colors.white primaryColor = Colors.white;
: Colors.black87, } else {
); primaryColor = Colors.black87;
}
final ButtonStyle flatButtonStyle =
TextButton.styleFrom(primary: primaryColor);
return TextButton( return TextButton(
style: flatButtonStyle, style: flatButtonStyle,