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

@@ -7,7 +7,7 @@ import 'package:flutter_api_samples/material/input_decorator/input_decoration.fl
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('InputDecorator label uses errorColor', (WidgetTester tester) async {
testWidgets('InputDecorator label uses error color', (WidgetTester tester) async {
await tester.pumpWidget(
const example.MyApp(),
);
@@ -17,6 +17,6 @@ void main() {
await tester.pumpAndSettle();
final AnimatedDefaultTextStyle label = tester.firstWidget(find.ancestor(of: find.text('Name'), matching: find.byType(AnimatedDefaultTextStyle)));
expect(label.style.color, theme.data.errorColor);
expect(label.style.color, theme.data.colorScheme.error);
});
}

View File

@@ -7,13 +7,13 @@ import 'package:flutter_api_samples/material/input_decorator/input_decoration.la
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('InputDecorator label uses errorColor', (WidgetTester tester) async {
testWidgets('InputDecorator label uses error color', (WidgetTester tester) async {
await tester.pumpWidget(
const example.MyApp(),
);
final Theme theme = tester.firstWidget(find.byType(Theme));
final AnimatedDefaultTextStyle label = tester.firstWidget(find.ancestor(of: find.text('Name'), matching: find.byType(AnimatedDefaultTextStyle)));
expect(label.style.color, theme.data.errorColor);
expect(label.style.color, theme.data.colorScheme.error);
});
}