material-components / material-components-flutter-codelabs

Codelabs for Material Components for Flutter
212 stars 247 forks source link

Low contrast color in login page #246

Closed ineol closed 3 years ago

ineol commented 3 years ago

PR #236 replaces FlatButton by TextButton. This has the effect of having the text of the button becoming light pink (primary color), which is not readable.

One solution is to change textButtonTheme in the custom theme?

guidezpl commented 3 years ago

Thanks for flagging, the solution we went for was to add a foregroundColor to the button

                  style: ButtonStyle(
                    foregroundColor: MaterialStateProperty.all(
                      Theme.of(context).colorScheme.secondary,
                    ),
                    shape: MaterialStateProperty.all(
                      const BeveledRectangleBorder(
                        borderRadius: BorderRadius.all(Radius.circular(7.0)),
                      ),
                    ),
                  ),