Skip to content

Commit 7c9c894

Browse files
committed
login: Use ColorScheme.secondaryContainer for web-auth buttons
The web-auth icons are images loaded from the server, and we don't have URLs for dark-theme variants. This new background color will give better contrast in dark mode, while preserving contrast in light mode.
1 parent 5c70c76 commit 7c9c894

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/widgets/login.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ class _LoginPageState extends State<LoginPage> {
414414
@override
415415
Widget build(BuildContext context) {
416416
assert(!PerAccountStoreWidget.debugExistsOf(context));
417+
final colorScheme = Theme.of(context).colorScheme;
417418
final zulipLocalizations = ZulipLocalizations.of(context);
418419

419420
final externalAuthenticationMethods = widget.serverSettings.externalAuthenticationMethods;
@@ -425,13 +426,17 @@ class _LoginPageState extends State<LoginPage> {
425426
...externalAuthenticationMethods.map((method) {
426427
final icon = method.displayIcon;
427428
return OutlinedButton.icon(
429+
style: ButtonStyle(
430+
backgroundColor: WidgetStatePropertyAll(colorScheme.secondaryContainer)),
428431
icon: icon != null
429432
? Image.network(icon, width: 24, height: 24)
430433
: null,
431434
onPressed: !_inProgress
432435
? () => _beginWebAuth(method)
433436
: null,
434-
label: Text(zulipLocalizations.signInWithFoo(method.displayName)));
437+
label: Text(
438+
style: TextStyle(color: colorScheme.onSecondaryContainer),
439+
zulipLocalizations.signInWithFoo(method.displayName)));
435440
}),
436441
],
437442
]);

0 commit comments

Comments
 (0)