diff --git a/packages/flutter_test/test/accessibility_test.dart b/packages/flutter_test/test/accessibility_test.dart index 37e6c34f38..40c57e76a5 100644 --- a/packages/flutter_test/test/accessibility_test.dart +++ b/packages/flutter_test/test/accessibility_test.dart @@ -583,9 +583,11 @@ void main() { theme: ThemeData.light(), home: Scaffold( backgroundColor: Colors.white, - body: RaisedButton( - color: const Color(0xFFFBBC04), - elevation: 0, + body: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: const Color(0xFFFBBC04), + elevation: 0, + ), onPressed: () {}, child: const Text('Button', style: TextStyle(color: Colors.black)), ), diff --git a/packages/flutter_test/test/accessibility_window_test.dart b/packages/flutter_test/test/accessibility_window_test.dart index 5524948621..e84dd2ce46 100644 --- a/packages/flutter_test/test/accessibility_window_test.dart +++ b/packages/flutter_test/test/accessibility_window_test.dart @@ -10,11 +10,13 @@ void main() { tester.binding.window.devicePixelRatioTestValue = 1.2; tester.binding.window.physicalSizeTestValue = const Size(250, 300); - final RaisedButton invalidButton = RaisedButton( + final Widget invalidButton = ElevatedButton( onPressed: () {}, + style: ElevatedButton.styleFrom( + primary: Colors.orangeAccent, // background fill color + onPrimary: Colors.orange, // text foreground color + ), child: const Text('Button'), - textColor: Colors.orange, - color: Colors.orangeAccent, ); await tester.pumpWidget(MaterialApp(home: Scaffold(body: invalidButton))); @@ -26,15 +28,17 @@ void main() { tester.binding.window.devicePixelRatioTestValue = 4.2; tester.binding.window.physicalSizeTestValue = const Size(2500, 3000); - final RaisedButton invalidButton = RaisedButton( + final Widget invalidButton = ElevatedButton( onPressed: () {}, + style: ElevatedButton.styleFrom( + primary: Colors.orangeAccent, // background fill color + onPrimary: Colors.orange, // text foreground color + ), child: const Text('Button'), - textColor: Colors.orange, - color: Colors.orangeAccent, ); await tester.pumpWidget(MaterialApp(home: Scaffold(body: invalidButton))); final Evaluation result = await textContrastGuideline.evaluate(tester); expect(result.passed, false); }); -} \ No newline at end of file +} diff --git a/packages/flutter_test/test/controller_test.dart b/packages/flutter_test/test/controller_test.dart index eb3aa1c918..8bf9ddab14 100644 --- a/packages/flutter_test/test/controller_test.dart +++ b/packages/flutter_test/test/controller_test.dart @@ -63,7 +63,7 @@ void main() { MaterialApp( home: Scaffold( body: Container( - child: OutlineButton( + child: OutlinedButton( onPressed: () { }, child: const Text('hello'), ), @@ -85,7 +85,7 @@ void main() { MaterialApp( home: Scaffold( body: Container( - child: OutlineButton( + child: OutlinedButton( onPressed: () { }, child: const Text('hello'), ), diff --git a/packages/flutter_test/test/finders_test.dart b/packages/flutter_test/test/finders_test.dart index 941b60019c..b02ddc9c8f 100644 --- a/packages/flutter_test/test/finders_test.dart +++ b/packages/flutter_test/test/finders_test.dart @@ -41,7 +41,7 @@ void main() { Semantics( label: 'Add', button: true, - child: const FlatButton( + child: const TextButton( child: Text('+'), onPressed: null, ), diff --git a/packages/flutter_test/test/live_widget_controller_test.dart b/packages/flutter_test/test/live_widget_controller_test.dart index 1b9ea2362e..31067f03ea 100644 --- a/packages/flutter_test/test/live_widget_controller_test.dart +++ b/packages/flutter_test/test/live_widget_controller_test.dart @@ -18,7 +18,7 @@ class _CountButtonState extends State { int counter = 0; @override Widget build(BuildContext context) { - return RaisedButton( + return ElevatedButton( child: Text('Counter $counter'), onPressed: () { setState(() { diff --git a/packages/flutter_test/test/widget_tester_test.dart b/packages/flutter_test/test/widget_tester_test.dart index bd91a48d6b..a1ec080513 100644 --- a/packages/flutter_test/test/widget_tester_test.dart +++ b/packages/flutter_test/test/widget_tester_test.dart @@ -375,7 +375,7 @@ void main() { home: Center( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( child: const Text('Next'), onPressed: () { Navigator.push(context, MaterialPageRoute(