Skip to content

Commit dc02a04

Browse files
chore: replace deprecated MaterialStateProperty + MaterialStateColor with WidgetStateProperty + WidgetStateColor (#347)
1 parent 848b66c commit dc02a04

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Diff for: packages/firebase_ui_auth/example/lib/main.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ class FirebaseAuthUIExample extends StatelessWidget {
7878
@override
7979
Widget build(BuildContext context) {
8080
final buttonStyle = ButtonStyle(
81-
padding: MaterialStateProperty.all(const EdgeInsets.all(12)),
82-
shape: MaterialStateProperty.all(
81+
padding: WidgetStateProperty.all(const EdgeInsets.all(12)),
82+
shape: WidgetStateProperty.all(
8383
RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
8484
),
8585
);

Diff for: packages/firebase_ui_shared/lib/src/universal_button.dart

+6-6
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,20 @@ class UniversalButton extends PlatformWidget {
120120
ButtonStyle? style;
121121

122122
if (materialColor != null) {
123-
MaterialStateColor? foregroundColor;
124-
MaterialStateColor? backgroundColor;
123+
WidgetStateColor? foregroundColor;
124+
WidgetStateColor? backgroundColor;
125125

126126
if (variant == ButtonVariant.text) {
127-
foregroundColor = MaterialStateColor.resolveWith((_) => materialColor!);
127+
foregroundColor = WidgetStateColor.resolveWith((_) => materialColor!);
128128
} else {
129-
foregroundColor = MaterialStateColor.resolveWith((_) => contentColor!);
130-
backgroundColor = MaterialStateColor.resolveWith((_) => materialColor!);
129+
foregroundColor = WidgetStateColor.resolveWith((_) => contentColor!);
130+
backgroundColor = WidgetStateColor.resolveWith((_) => materialColor!);
131131
}
132132

133133
style = ButtonStyle(
134134
foregroundColor: foregroundColor,
135135
backgroundColor: backgroundColor,
136-
overlayColor: MaterialStateColor.resolveWith(
136+
overlayColor: WidgetStateColor.resolveWith(
137137
(states) => materialColor!.withAlpha(20),
138138
),
139139
);

0 commit comments

Comments
 (0)