Skip to content

Commit

Permalink
fix: migrate MaterialStateProperty usage
Browse files Browse the repository at this point in the history
  • Loading branch information
drown0315 committed Apr 16, 2024
1 parent 6557620 commit 239f677
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 13 deletions.
6 changes: 3 additions & 3 deletions examples/todos/lib/main.dart
Expand Up @@ -157,7 +157,7 @@ class Toolbar extends HookConsumerWidget {
style: ButtonStyle(
visualDensity: VisualDensity.compact,
foregroundColor:
MaterialStateProperty.all(textColorFor(TodoListFilter.all)),
WidgetStatePropertyAll(textColorFor(TodoListFilter.all)),
),
child: const Text('All'),
),
Expand All @@ -170,7 +170,7 @@ class Toolbar extends HookConsumerWidget {
TodoListFilter.active,
style: ButtonStyle(
visualDensity: VisualDensity.compact,
foregroundColor: MaterialStateProperty.all(
foregroundColor: WidgetStatePropertyAll(
textColorFor(TodoListFilter.active),
),
),
Expand All @@ -185,7 +185,7 @@ class Toolbar extends HookConsumerWidget {
TodoListFilter.completed,
style: ButtonStyle(
visualDensity: VisualDensity.compact,
foregroundColor: MaterialStateProperty.all(
foregroundColor: WidgetStatePropertyAll(
textColorFor(TodoListFilter.completed),
),
),
Expand Down
Expand Up @@ -47,7 +47,7 @@ class _ExampleState extends ConsumerState<Example> {
ElevatedButton(
style: ButtonStyle(
// If there is an error, we show the button in red
backgroundColor: MaterialStateProperty.all(
backgroundColor: WidgetStatePropertyAll(
isErrored ? Colors.red : null,
),
),
Expand Down
Expand Up @@ -41,7 +41,7 @@ class Example extends HookConsumerWidget {
ElevatedButton(
style: ButtonStyle(
// If there is an error, we show the button in red
backgroundColor: MaterialStateProperty.all(
backgroundColor: WidgetStatePropertyAll(
isErrored ? Colors.red : null,
),
),
Expand Down
Expand Up @@ -46,7 +46,7 @@ class _ExampleState extends ConsumerState<Example> {
ElevatedButton(
style: ButtonStyle(
// Se c'è stato un errore mostriamo il bottone in rosso
backgroundColor: MaterialStateProperty.all(
backgroundColor: WidgetStatePropertyAll(
isErrored ? Colors.red : null,
),
),
Expand Down
Expand Up @@ -41,7 +41,7 @@ class Example extends HookConsumerWidget {
ElevatedButton(
style: ButtonStyle(
// Se c'è stato un errore mostriamo il bottone in rosso
backgroundColor: MaterialStateProperty.all(
backgroundColor: WidgetStatePropertyAll(
isErrored ? Colors.red : null,
),
),
Expand Down
Expand Up @@ -46,7 +46,7 @@ class _ExampleState extends ConsumerState<Example> {
ElevatedButton(
style: ButtonStyle(
// 오류가 있는 경우 버튼이 빨간색으로 표시됩니다.
backgroundColor: MaterialStateProperty.all(
backgroundColor: WidgetStatePropertyAll(
isErrored ? Colors.red : null,
),
),
Expand Down
Expand Up @@ -41,7 +41,7 @@ class Example extends HookConsumerWidget {
ElevatedButton(
style: ButtonStyle(
// 오류가 있는 경우 버튼을 빨간색으로 표시합니다.
backgroundColor: MaterialStateProperty.all(
backgroundColor: WidgetStatePropertyAll(
isErrored ? Colors.red : null,
),
),
Expand Down
Expand Up @@ -47,7 +47,7 @@ class _ExampleState extends ConsumerState<Example> {
ElevatedButton(
style: ButtonStyle(
// 如果出现错误,我们会将该按钮显示为红色
backgroundColor: MaterialStateProperty.all(
backgroundColor: WidgetStatePropertyAll(
isErrored ? Colors.red : null,
),
),
Expand All @@ -74,5 +74,4 @@ class _ExampleState extends ConsumerState<Example> {
},
);
}
}
/* SNIPPET END */
} /* SNIPPET END */
Expand Up @@ -41,7 +41,7 @@ class Example extends HookConsumerWidget {
ElevatedButton(
style: ButtonStyle(
// 如果出现错误,我们会将该按钮显示为红色
backgroundColor: MaterialStateProperty.all(
backgroundColor: WidgetStatePropertyAll(
isErrored ? Colors.red : null,
),
),
Expand Down

0 comments on commit 239f677

Please sign in to comment.