I have got redirected from https://github.com/flutter/flutter/issues/28138 to here.
Generally my problem is that I don´t think that FloatingActionButton backgroundColor and FlatButton text color are inherited from right values defined in ThemeData.
- Create an app where you will use primary red color (appbar, button bg, card), yellow for accent (icons, appbar title), black for general text, white/light grey for backgrounds like scaffold body.
- Set AppBar BG color to red using using theme (primaryColor)
- Set AppBar title color to yellow using theme (accentColor)
- Set color of icons to same color as accentColor, since if primary color is used they will be invisible in AppBar
- Create a floatingActionButton with an icon.
- Icon in floatingActionButton is not visible because backgroundColor for the widget uses the ThemeData.accentColor, which is yellow, instead of the ThemeData.primaryColor
Both foreground and background defaults to accentColor.
/// The color to use when filling the button.
///
/// Defaults to **[ThemeData.accentColor**] for the current theme.
final Color backgroundColor;
I found similar issue with FlatButton in Dialog, by default color of text is accent color, which is yellow (on white background), if i override it to primary, it´s red, but I don´t want to have it red since the delete button next to it is red. So I need to set it to normal, so it´s black which is correct, but:
flat_button.dart:127
textStyle: theme.textTheme.button.copyWith(color: buttonTheme.getTextColor(this)),
My theme:
buttonTheme: ButtonThemeData(
textTheme: ButtonTextTheme.normal,
buttonColor: primary, // Red
),
textTheme: TextTheme(
...
button: TextStyle(color: black), // Black
),
new FlatButton(
//textTheme: ButtonTextTheme.normal,
child: new Text("Ponechať"),
onPressed: () {
Navigator.of(context).pop();
onKeep();
},
)
In theory my FlatButton in the popup dialog should be black and or red. But it´s yellow the accent color.
To reproduce try to following example: https://gist.github.com/erikkubica/45fc8acdce1f8a25cd5258e8b3a0e1f3