Skip to content

Commit 47dc6d0

Browse files
authored
fix(flutterfire_ui): Fix Flutter Cupertino button color bug. (#8315)
1 parent 9a042e5 commit 47dc6d0

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

packages/flutterfire_ui/lib/src/auth/widgets/internal/loading_button.dart

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,19 @@ class LoadingButton extends StatelessWidget {
5656
);
5757
}
5858

59-
return CupertinoTheme(
60-
data: CupertinoTheme.of(context).copyWith(
61-
primaryColor: color ?? CupertinoColors.activeBlue,
62-
),
63-
child: CupertinoButton.filled(
64-
onPressed: onTap,
65-
child: child,
66-
),
59+
final button = CupertinoButton.filled(
60+
onPressed: onTap,
61+
child: child,
6762
);
63+
64+
return color != null
65+
? CupertinoTheme(
66+
data: CupertinoTheme.of(context).copyWith(
67+
primaryColor: color,
68+
),
69+
child: button,
70+
)
71+
: button;
6872
}
6973

7074
if (icon != null) {

0 commit comments

Comments
 (0)