Deprecate ThemeData errorColor and backgroundColor (#110162)

This commit is contained in:
Pierre-Louis
2022-09-02 06:02:55 +02:00
committed by GitHub
parent 0c2f7bc2a2
commit 8853926601
18 changed files with 696 additions and 117 deletions

View File

@@ -41,7 +41,7 @@ class InputDecoratorExample extends StatelessWidget {
// is in its error state.
floatingLabelStyle: MaterialStateTextStyle.resolveWith(
(Set<MaterialState> states) {
final Color color = states.contains(MaterialState.error) ? Theme.of(context).errorColor: Colors.orange;
final Color color = states.contains(MaterialState.error) ? Theme.of(context).colorScheme.error: Colors.orange;
return TextStyle(color: color, letterSpacing: 1.3);
}
),

View File

@@ -41,7 +41,7 @@ class InputDecoratorExample extends StatelessWidget {
// is in its error state.
labelStyle: MaterialStateTextStyle.resolveWith(
(Set<MaterialState> states) {
final Color color = states.contains(MaterialState.error) ? Theme.of(context).errorColor: Colors.orange;
final Color color = states.contains(MaterialState.error) ? Theme.of(context).colorScheme.error: Colors.orange;
return TextStyle(color: color, letterSpacing: 1.3);
}
),