From d169880278e903f6c4e3bc648610ced496b07e94 Mon Sep 17 00:00:00 2001 From: Darren Austin Date: Tue, 28 Jul 2020 11:01:04 -0700 Subject: [PATCH] Updated references to the old button classes to the new ones in comments and documentation for tests in the material and cupertino libraries. (#62164) --- .../flutter/test/cupertino/dialog_test.dart | 4 +- .../flutter/test/material/app_bar_test.dart | 2 +- packages/flutter/test/material/app_test.dart | 6 +- .../flutter/test/material/banner_test.dart | 16 ++--- .../test/material/banner_theme_test.dart | 8 +-- .../material/bottom_navigation_bar_test.dart | 2 +- .../test/material/bottom_sheet_test.dart | 2 +- .../test/material/date_picker_test.dart | 14 ++--- .../test/material/date_range_picker_test.dart | 4 +- .../flutter/test/material/dialog_test.dart | 58 +++++++++---------- .../test/material/dialog_theme_test.dart | 2 +- .../material/floating_action_button_test.dart | 2 +- .../test/material/inherited_theme_test.dart | 26 ++++----- .../test/material/ink_splash_test.dart | 5 +- .../flutter/test/material/material_test.dart | 5 +- packages/flutter/test/material/page_test.dart | 4 +- .../material/page_transitions_theme_test.dart | 12 ++-- .../persistent_bottom_sheet_test.dart | 2 +- .../test/material/popup_menu_test.dart | 10 ++-- .../test/material/range_slider_test.dart | 4 +- .../flutter/test/material/scaffold_test.dart | 6 +- .../flutter/test/material/slider_test.dart | 6 +- packages/flutter/test/material/tabs_test.dart | 2 +- .../flutter/test/material/theme_test.dart | 4 +- .../test/material/time_picker_test.dart | 18 +++--- .../test/material/time_picker_theme_test.dart | 2 +- .../flutter/test/material/will_pop_test.dart | 14 ++--- 27 files changed, 119 insertions(+), 121 deletions(-) diff --git a/packages/flutter/test/cupertino/dialog_test.dart b/packages/flutter/test/cupertino/dialog_test.dart index b307328a50..ef508a0af7 100644 --- a/packages/flutter/test/cupertino/dialog_test.dart +++ b/packages/flutter/test/cupertino/dialog_test.dart @@ -1170,7 +1170,7 @@ Widget createAppWithButtonThatLaunchesDialog({ WidgetBuilder dialogBuilder }) { home: Material( child: Center( child: Builder(builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { showDialog( context: context, @@ -1196,7 +1196,7 @@ Widget createAppWithCenteredButton(Widget child) { return MaterialApp( home: Material( child: Center( - child: RaisedButton( + child: ElevatedButton( onPressed: null, child: child ), diff --git a/packages/flutter/test/material/app_bar_test.dart b/packages/flutter/test/material/app_bar_test.dart index 3ea6249e45..93938a43a3 100644 --- a/packages/flutter/test/material/app_bar_test.dart +++ b/packages/flutter/test/material/app_bar_test.dart @@ -1729,7 +1729,7 @@ void main() { floating: true, snap: snap, actions: [ - FlatButton( + TextButton( child: const Text('snap=false'), onPressed: () { setState(() { diff --git a/packages/flutter/test/material/app_test.dart b/packages/flutter/test/material/app_test.dart index 0335d24422..15fb11bd1c 100644 --- a/packages/flutter/test/material/app_test.dart +++ b/packages/flutter/test/material/app_test.dart @@ -98,7 +98,7 @@ void main() { home: Builder( builder: (BuildContext context) { return Material( - child: RaisedButton( + child: ElevatedButton( child: const Text('X'), onPressed: () { Navigator.of(context).pushNamed('/next'); }, ), @@ -255,7 +255,7 @@ void main() { home: Builder( builder: (BuildContext context) { return Material( - child: RaisedButton( + child: ElevatedButton( child: const Text('X'), onPressed: () async { result = Navigator.of(context).pushNamed('/a'); @@ -267,7 +267,7 @@ void main() { routes: { '/a': (BuildContext context) { return Material( - child: RaisedButton( + child: ElevatedButton( child: const Text('Y'), onPressed: () { Navigator.of(context).pop('all done'); diff --git a/packages/flutter/test/material/banner_test.dart b/packages/flutter/test/material/banner_test.dart index a4025ae4e3..9a65246653 100644 --- a/packages/flutter/test/material/banner_test.dart +++ b/packages/flutter/test/material/banner_test.dart @@ -17,7 +17,7 @@ void main() { backgroundColor: color, content: const Text('I am a banner'), actions: [ - FlatButton( + TextButton( child: const Text('Action'), onPressed: () { }, ), @@ -39,7 +39,7 @@ void main() { contentTextStyle: contentTextStyle, content: const Text(contentText), actions: [ - FlatButton( + TextButton( child: const Text('Action'), onPressed: () { }, ), @@ -60,11 +60,11 @@ void main() { home: MaterialBanner( content: const Text(contentText), actions: [ - FlatButton( + TextButton( child: const Text('Action 1'), onPressed: () { }, ), - FlatButton( + TextButton( child: const Text('Action 2'), onPressed: () { }, ), @@ -87,7 +87,7 @@ void main() { home: MaterialBanner( content: const Text(contentText), actions: [ - FlatButton( + TextButton( child: const Text('Action'), onPressed: () { }, ), @@ -109,7 +109,7 @@ void main() { home: MaterialBanner( content: const Text('Content'), actions: [ - FlatButton( + TextButton( child: const Text('Action'), onPressed: () { }, ), @@ -132,7 +132,7 @@ void main() { child: MaterialBanner( content: const Text('Content'), actions: [ - FlatButton( + TextButton( child: const Text('Action'), onPressed: () { }, ), @@ -156,7 +156,7 @@ void main() { forceActionsBelow: true, content: const Text(contentText), actions: [ - FlatButton( + TextButton( child: const Text('Action'), onPressed: () { }, ), diff --git a/packages/flutter/test/material/banner_theme_test.dart b/packages/flutter/test/material/banner_theme_test.dart index 7e8bc3ff6a..882d396f39 100644 --- a/packages/flutter/test/material/banner_theme_test.dart +++ b/packages/flutter/test/material/banner_theme_test.dart @@ -57,7 +57,7 @@ void main() { body: MaterialBanner( content: const Text(contentText), actions: [ - FlatButton( + TextButton( child: const Text('Action'), onPressed: () { }, ), @@ -83,7 +83,7 @@ void main() { leading: const Icon(Icons.ac_unit), content: const Text(contentText), actions: [ - FlatButton( + TextButton( child: const Text('Action'), onPressed: () { }, ), @@ -122,7 +122,7 @@ void main() { padding: const EdgeInsets.all(10), leadingPadding: const EdgeInsets.all(10), actions: [ - FlatButton( + TextButton( child: const Text('Action'), onPressed: () { }, ), @@ -153,7 +153,7 @@ void main() { body: MaterialBanner( content: const Text('Content'), actions: [ - FlatButton( + TextButton( child: const Text('Action'), onPressed: () { }, ), diff --git a/packages/flutter/test/material/bottom_navigation_bar_test.dart b/packages/flutter/test/material/bottom_navigation_bar_test.dart index 25865fd3ab..ab401140b2 100644 --- a/packages/flutter/test/material/bottom_navigation_bar_test.dart +++ b/packages/flutter/test/material/bottom_navigation_bar_test.dart @@ -1338,7 +1338,7 @@ void main() { builder: (BuildContext context, StateSetter setState) { return Scaffold( body: Center( - child: RaisedButton( + child: ElevatedButton( child: const Text('green'), onPressed: () { setState(() { diff --git a/packages/flutter/test/material/bottom_sheet_test.dart b/packages/flutter/test/material/bottom_sheet_test.dart index 6df0203301..47ccc2c55d 100644 --- a/packages/flutter/test/material/bottom_sheet_test.dart +++ b/packages/flutter/test/material/bottom_sheet_test.dart @@ -738,7 +738,7 @@ class _TestPage extends StatelessWidget { @override Widget build(BuildContext context) { return Center( - child: FlatButton( + child: TextButton( child: const Text('Show bottom sheet'), onPressed: () { if (useRootNavigator != null) { diff --git a/packages/flutter/test/material/date_picker_test.dart b/packages/flutter/test/material/date_picker_test.dart index 3cd811216d..9654f0b43e 100644 --- a/packages/flutter/test/material/date_picker_test.dart +++ b/packages/flutter/test/material/date_picker_test.dart @@ -93,7 +93,7 @@ void main() { home: Material( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { buttonContext = context; }, @@ -211,7 +211,7 @@ void main() { child: Center( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( child: const Text('X'), onPressed: () { showDatePicker( @@ -265,7 +265,7 @@ void main() { onGenerateRoute: (RouteSettings settings) { return MaterialPageRoute( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { showDatePicker( context: context, @@ -285,7 +285,7 @@ void main() { )); // Open the dialog. - await tester.tap(find.byType(RaisedButton)); + await tester.tap(find.byType(ElevatedButton)); expect(rootObserver.datePickerCount, 0); expect(nestedObserver.datePickerCount, 1); @@ -304,7 +304,7 @@ void main() { home: Center( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( child: const Text('X'), onPressed: () { showDatePicker( @@ -339,7 +339,7 @@ void main() { home: Center( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( child: const Text('X'), onPressed: () { showDatePicker( @@ -705,7 +705,7 @@ void main() { home: Material( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { buttonContext = context; }, diff --git a/packages/flutter/test/material/date_range_picker_test.dart b/packages/flutter/test/material/date_range_picker_test.dart index 772c4d3e54..9a2e6bc60d 100644 --- a/packages/flutter/test/material/date_range_picker_test.dart +++ b/packages/flutter/test/material/date_range_picker_test.dart @@ -60,7 +60,7 @@ void main() { home: Material( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { buttonContext = context; }, @@ -629,7 +629,7 @@ void main() { home: Material( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { buttonContext = context; }, diff --git a/packages/flutter/test/material/dialog_test.dart b/packages/flutter/test/material/dialog_test.dart index 039aae6c4a..ba95df9891 100644 --- a/packages/flutter/test/material/dialog_test.dart +++ b/packages/flutter/test/material/dialog_test.dart @@ -20,7 +20,7 @@ MaterialApp _buildAppWithDialog(Widget dialog, { ThemeData theme, double textSca child: Builder( builder: (BuildContext context) { return Center( - child: RaisedButton( + child: ElevatedButton( child: const Text('X'), onPressed: () { showDialog( @@ -61,7 +61,7 @@ void main() { color: Colors.green[500], ), actions: [ - FlatButton( + TextButton( onPressed: () { didPressOk = true; }, @@ -224,7 +224,7 @@ void main() { const MaterialApp( home: Material( child: Center( - child: RaisedButton( + child: ElevatedButton( onPressed: null, child: Text('Go'), ), @@ -333,7 +333,7 @@ void main() { const MaterialApp( home: Material( child: Center( - child: RaisedButton( + child: ElevatedButton( onPressed: null, child: Text('Go'), ), @@ -427,7 +427,7 @@ void main() { const MaterialApp( home: Material( child: Center( - child: RaisedButton( + child: ElevatedButton( onPressed: null, child: Text(buttonText), ), @@ -461,7 +461,7 @@ void main() { title: const Text('title'), content: const Text('content'), actions: [ - RaisedButton( + ElevatedButton( onPressed: () {}, child: const Text('button'), ), @@ -494,7 +494,7 @@ void main() { title: const Text('title'), content: const Text('content'), actions: [ - RaisedButton( + ElevatedButton( onPressed: () {}, child: const Text('button'), ), @@ -531,12 +531,12 @@ void main() { title: const Text('title'), content: const Text('content'), actions: [ - RaisedButton( + ElevatedButton( key: key1, onPressed: () {}, child: const Text('button 1'), ), - RaisedButton( + ElevatedButton( key: key2, onPressed: () {}, child: const Text('button 2'), @@ -591,12 +591,12 @@ void main() { title: const Text('title'), content: const Text('content'), actions: [ - RaisedButton( + ElevatedButton( key: key1, onPressed: () {}, child: const Text('button 1'), ), - RaisedButton( + ElevatedButton( key: key2, onPressed: () {}, child: const Text('button 2'), @@ -765,7 +765,7 @@ void main() { key: contentKey, ); final List actions = [ - RaisedButton( + ElevatedButton( onPressed: () {}, child: const Text('button'), ), @@ -1049,12 +1049,12 @@ void main() { title: const Text('title'), content: const Text('content'), actions: [ - RaisedButton( + ElevatedButton( key: key1, onPressed: () {}, child: const Text('Looooooooooooooong button 1'), ), - RaisedButton( + ElevatedButton( key: key2, onPressed: () {}, child: const Text('Looooooooooooooong button 2'), @@ -1072,7 +1072,7 @@ void main() { final Rect buttonOneRect = tester.getRect(find.byKey(key1)); final Rect buttonTwoRect = tester.getRect(find.byKey(key2)); - // Second [RaisedButton] should appear above the first. + // Second [ElevatedButton] should appear above the first. expect(buttonTwoRect.bottom, lessThanOrEqualTo(buttonOneRect.top)); }); @@ -1084,12 +1084,12 @@ void main() { title: const Text('title'), content: const Text('content'), actions: [ - RaisedButton( + ElevatedButton( key: key1, onPressed: () {}, child: const Text('Looooooooooooooong button 1'), ), - RaisedButton( + ElevatedButton( key: key2, onPressed: () {}, child: const Text('Looooooooooooooong button 2'), @@ -1117,12 +1117,12 @@ void main() { title: const Text('title'), content: const Text('content'), actions: [ - RaisedButton( + ElevatedButton( key: key1, onPressed: () {}, child: const Text('Looooooooooooooong button 1'), ), - RaisedButton( + ElevatedButton( key: key2, onPressed: () {}, child: const Text('Looooooooooooooong button 2'), @@ -1283,7 +1283,7 @@ void main() { child: Builder( builder: (BuildContext context) { return Center( - child: RaisedButton( + child: ElevatedButton( child: const Text('X'), onPressed: () { showDialog( @@ -1333,13 +1333,13 @@ void main() { builder: (BuildContext context) { return AlertDialog( actions: [ - FlatButton( + TextButton( child: const Text('TRUE'), onPressed: () { Navigator.pop(context, true); // showDialog() returns true }, ), - FlatButton( + TextButton( child: const Text('FALSE'), onPressed: () { Navigator.pop(context, false); // showDialog() returns false @@ -1460,7 +1460,7 @@ void main() { child: Builder( key: builderKey, builder: (BuildContext outerContext) { - return RaisedButton( + return ElevatedButton( onPressed: () { showDialog( context: outerContext, @@ -1480,7 +1480,7 @@ void main() { await tester.pumpWidget(buildFrame(UniqueKey())); // Open the dialog. - await tester.tap(find.byType(RaisedButton)); + await tester.tap(find.byType(ElevatedButton)); await tester.pumpAndSettle(); // Force the Builder to be recreated (new key) which causes outerContext to @@ -1542,7 +1542,7 @@ void main() { onGenerateRoute: (RouteSettings settings) { return MaterialPageRoute( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { showDialog( context: context, @@ -1560,7 +1560,7 @@ void main() { )); // Open the dialog. - await tester.tap(find.byType(RaisedButton)); + await tester.tap(find.byType(ElevatedButton)); expect(rootObserver.dialogCount, 1); expect(nestedObserver.dialogCount, 0); @@ -1577,7 +1577,7 @@ void main() { onGenerateRoute: (RouteSettings settings) { return MaterialPageRoute( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { showDialog( context: context, @@ -1596,7 +1596,7 @@ void main() { )); // Open the dialog. - await tester.tap(find.byType(RaisedButton)); + await tester.tap(find.byType(ElevatedButton)); expect(rootObserver.dialogCount, 0); expect(nestedObserver.dialogCount, 1); @@ -1694,7 +1694,7 @@ void main() { ], home: const Material( child: Center( - child: RaisedButton( + child: ElevatedButton( onPressed: null, child: Text('Go'), ), diff --git a/packages/flutter/test/material/dialog_theme_test.dart b/packages/flutter/test/material/dialog_theme_test.dart index 6a7031f8f9..40eabba1bf 100644 --- a/packages/flutter/test/material/dialog_theme_test.dart +++ b/packages/flutter/test/material/dialog_theme_test.dart @@ -15,7 +15,7 @@ MaterialApp _appWithDialog(WidgetTester tester, Widget dialog, { ThemeData theme child: Builder( builder: (BuildContext context) { return Center( - child: RaisedButton( + child: ElevatedButton( child: const Text('X'), onPressed: () { showDialog( diff --git a/packages/flutter/test/material/floating_action_button_test.dart b/packages/flutter/test/material/floating_action_button_test.dart index 7de234dad4..02da70dd11 100644 --- a/packages/flutter/test/material/floating_action_button_test.dart +++ b/packages/flutter/test/material/floating_action_button_test.dart @@ -678,7 +678,7 @@ void main() { onPressed: () { }, ), body: Center( - child: RaisedButton( + child: ElevatedButton( child: const Text('POP'), onPressed: () { Navigator.pop(context); diff --git a/packages/flutter/test/material/inherited_theme_test.dart b/packages/flutter/test/material/inherited_theme_test.dart index 52ed3b02af..d1f0c1dc2f 100644 --- a/packages/flutter/test/material/inherited_theme_test.dart +++ b/packages/flutter/test/material/inherited_theme_test.dart @@ -40,7 +40,7 @@ void main() { child: Column( mainAxisSize: MainAxisSize.min, children: [ - RaisedButton( + ElevatedButton( child: const Text('push unwrapped'), onPressed: () { Navigator.of(context).push( @@ -51,7 +51,7 @@ void main() { ); }, ), - RaisedButton( + ElevatedButton( child: const Text('push wrapped'), onPressed: () { Navigator.of(context).push( @@ -169,7 +169,7 @@ void main() { final Widget banner = MaterialBanner( content: const Text('hello'), actions: [ - FlatButton( + TextButton( child: const Text('action'), onPressed: () { }, ), @@ -193,7 +193,7 @@ void main() { child: Column( mainAxisSize: MainAxisSize.min, children: [ - RaisedButton( + ElevatedButton( child: const Text('push unwrapped'), onPressed: () { Navigator.of(context).push( @@ -204,7 +204,7 @@ void main() { ); }, ), - RaisedButton( + ElevatedButton( child: const Text('push wrapped'), onPressed: () { Navigator.of(context).push( @@ -283,7 +283,7 @@ void main() { child: Column( mainAxisSize: MainAxisSize.min, children: [ - RaisedButton( + ElevatedButton( child: const Text('push unwrapped'), onPressed: () { Navigator.of(context).push( @@ -294,7 +294,7 @@ void main() { ); }, ), - RaisedButton( + ElevatedButton( child: const Text('push wrapped'), onPressed: () { Navigator.of(context).push( @@ -387,7 +387,7 @@ void main() { child: Column( mainAxisSize: MainAxisSize.min, children: [ - RaisedButton( + ElevatedButton( child: const Text('push unwrapped'), onPressed: () { Navigator.of(context).push( @@ -398,7 +398,7 @@ void main() { ); }, ), - RaisedButton( + ElevatedButton( child: const Text('push wrapped'), onPressed: () { Navigator.of(context).push( @@ -487,7 +487,7 @@ void main() { child: Column( mainAxisSize: MainAxisSize.min, children: [ - RaisedButton( + ElevatedButton( child: const Text('push unwrapped'), onPressed: () { Navigator.of(context).push( @@ -498,7 +498,7 @@ void main() { ); }, ), - RaisedButton( + ElevatedButton( child: const Text('push wrapped'), onPressed: () { Navigator.of(context).push( @@ -572,7 +572,7 @@ void main() { child: Column( mainAxisSize: MainAxisSize.min, children: [ - RaisedButton( + ElevatedButton( child: const Text('push unwrapped'), onPressed: () { Navigator.of(context).push( @@ -583,7 +583,7 @@ void main() { ); }, ), - RaisedButton( + ElevatedButton( child: const Text('push wrapped'), onPressed: () { Navigator.of(context).push( diff --git a/packages/flutter/test/material/ink_splash_test.dart b/packages/flutter/test/material/ink_splash_test.dart index 67b097a1c2..bbece80366 100644 --- a/packages/flutter/test/material/ink_splash_test.dart +++ b/packages/flutter/test/material/ink_splash_test.dart @@ -14,12 +14,9 @@ void main() { home: Scaffold( appBar: AppBar(title: const Text('Button Border Test')), body: Center( - child: RaisedButton( + child: ElevatedButton( child: const Text('Test'), onPressed: () { }, - shape: Border.all( - color: Colors.blue, - ), ), ), ))); diff --git a/packages/flutter/test/material/material_test.dart b/packages/flutter/test/material/material_test.dart index 65caff7a9f..3a8658463d 100644 --- a/packages/flutter/test/material/material_test.dart +++ b/packages/flutter/test/material/material_test.dart @@ -229,10 +229,11 @@ void main() { home: Scaffold( body: Stack( children: [ - RaisedButton( + ElevatedButton( onPressed: () { pressed = true; }, + child: null, ), Material( type: MaterialType.transparency, @@ -246,7 +247,7 @@ void main() { ), ), ); - await tester.tap(find.byType(RaisedButton)); + await tester.tap(find.byType(ElevatedButton)); expect(pressed, isTrue); }); diff --git a/packages/flutter/test/material/page_test.dart b/packages/flutter/test/material/page_test.dart index f4c744c523..3bc6a377bd 100644 --- a/packages/flutter/test/material/page_test.dart +++ b/packages/flutter/test/material/page_test.dart @@ -282,7 +282,7 @@ void main() { testWidgets('back gesture while OS changes', (WidgetTester tester) async { final Map routes = { '/': (BuildContext context) => Material( - child: FlatButton( + child: TextButton( child: const Text('PUSH'), onPressed: () { Navigator.of(context).pushNamed('/b'); }, ), @@ -582,7 +582,7 @@ void main() { home: Scaffold( key: scaffoldKey, body: Center( - child: RaisedButton( + child: ElevatedButton( onPressed: () { Navigator.push(scaffoldKey.currentContext, MaterialPageRoute( builder: (BuildContext context) { diff --git a/packages/flutter/test/material/page_transitions_theme_test.dart b/packages/flutter/test/material/page_transitions_theme_test.dart index ba1efc32c6..a27381a1d2 100644 --- a/packages/flutter/test/material/page_transitions_theme_test.dart +++ b/packages/flutter/test/material/page_transitions_theme_test.dart @@ -26,7 +26,7 @@ void main() { testWidgets('Default PageTransitionsTheme builds a CupertionPageTransition', (WidgetTester tester) async { final Map routes = { '/': (BuildContext context) => Material( - child: FlatButton( + child: TextButton( child: const Text('push'), onPressed: () { Navigator.of(context).pushNamed('/b'); }, ), @@ -52,7 +52,7 @@ void main() { testWidgets('Default PageTransitionsTheme builds a _FadeUpwardsPageTransition for android', (WidgetTester tester) async { final Map routes = { '/': (BuildContext context) => Material( - child: FlatButton( + child: TextButton( child: const Text('push'), onPressed: () { Navigator.of(context).pushNamed('/b'); }, ), @@ -85,7 +85,7 @@ void main() { testWidgets('PageTransitionsTheme override builds a _OpenUpwardsPageTransition', (WidgetTester tester) async { final Map routes = { '/': (BuildContext context) => Material( - child: FlatButton( + child: TextButton( child: const Text('push'), onPressed: () { Navigator.of(context).pushNamed('/b'); }, ), @@ -125,7 +125,7 @@ void main() { testWidgets('PageTransitionsTheme override builds a _ZoomPageTransition', (WidgetTester tester) async { final Map routes = { '/': (BuildContext context) => Material( - child: FlatButton( + child: TextButton( child: const Text('push'), onPressed: () { Navigator.of(context).pushNamed('/b'); }, ), @@ -169,7 +169,7 @@ void main() { final Map routes = { '/': (BuildContext context) => Material( - child: FlatButton( + child: TextButton( child: const Text('push'), onPressed: () { Navigator.of(context).pushNamed('/b'); }, ), @@ -177,7 +177,7 @@ void main() { '/b': (BuildContext context) => StatefulBuilder( builder: (BuildContext context, StateSetter setState) { builtCount++; // Increase [builtCount] each time the widget build - return FlatButton( + return TextButton( child: const Text('pop'), onPressed: () { Navigator.pop(context); }, ); diff --git a/packages/flutter/test/material/persistent_bottom_sheet_test.dart b/packages/flutter/test/material/persistent_bottom_sheet_test.dart index 2256a4fcad..8e1c995169 100644 --- a/packages/flutter/test/material/persistent_bottom_sheet_test.dart +++ b/packages/flutter/test/material/persistent_bottom_sheet_test.dart @@ -433,7 +433,7 @@ void main() { height: 200.0, child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( child: const Text('showModalBottomSheet'), onPressed: () { showModalBottomSheet( diff --git a/packages/flutter/test/material/popup_menu_test.dart b/packages/flutter/test/material/popup_menu_test.dart index 30e1bb7174..df817df69a 100644 --- a/packages/flutter/test/material/popup_menu_test.dart +++ b/packages/flutter/test/material/popup_menu_test.dart @@ -1101,7 +1101,7 @@ void main() { child: Center( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { // Ensure showMenu throws an assertion without a position expect(() { @@ -1440,7 +1440,7 @@ void main() { onGenerateRoute: (RouteSettings settings) { return MaterialPageRoute( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { showMenu( context: context, @@ -1461,7 +1461,7 @@ void main() { )); // Open the dialog. - await tester.tap(find.byType(RaisedButton)); + await tester.tap(find.byType(ElevatedButton)); expect(rootObserver.menuCount, 0); expect(nestedObserver.menuCount, 1); @@ -1478,7 +1478,7 @@ void main() { onGenerateRoute: (RouteSettings settings) { return MaterialPageRoute( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { showMenu( context: context, @@ -1500,7 +1500,7 @@ void main() { )); // Open the dialog. - await tester.tap(find.byType(RaisedButton)); + await tester.tap(find.byType(ElevatedButton)); expect(rootObserver.menuCount, 1); expect(nestedObserver.menuCount, 0); diff --git a/packages/flutter/test/material/range_slider_test.dart b/packages/flutter/test/material/range_slider_test.dart index 1f44778550..ead1948257 100644 --- a/packages/flutter/test/material/range_slider_test.dart +++ b/packages/flutter/test/material/range_slider_test.dart @@ -1370,13 +1370,13 @@ void main() { divisions: divisions, onChanged: onChanged, ), - RaisedButton( + ElevatedButton( child: const Text('Next'), onPressed: () { Navigator.of(context).pushReplacement( MaterialPageRoute( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( child: const Text('Inner page'), onPressed: () { Navigator.of(context).pop(); }, ); diff --git a/packages/flutter/test/material/scaffold_test.dart b/packages/flutter/test/material/scaffold_test.dart index 65166f2bcd..98ed8a18e9 100644 --- a/packages/flutter/test/material/scaffold_test.dart +++ b/packages/flutter/test/material/scaffold_test.dart @@ -431,7 +431,7 @@ void main() { ), ), persistentFooterButtons: [ - FlatButton( + TextButton( onPressed: () { didPressButton = true; }, @@ -657,7 +657,7 @@ void main() { child: MediaQuery( data: const MediaQueryData(), child: Scaffold( - body: FlatButton( + body: TextButton( key: testKey, onPressed: () { }, child: const Text(''), @@ -665,7 +665,7 @@ void main() { ), ), )); - expect(tester.element(find.byKey(testKey)).size, const Size(88.0, 48.0)); + expect(tester.element(find.byKey(testKey)).size, const Size(64.0, 48.0)); expect(tester.renderObject(find.byKey(testKey)).localToGlobal(Offset.zero), const Offset(0.0, 0.0)); }); diff --git a/packages/flutter/test/material/slider_test.dart b/packages/flutter/test/material/slider_test.dart index 12ba23b698..afba7eeff6 100644 --- a/packages/flutter/test/material/slider_test.dart +++ b/packages/flutter/test/material/slider_test.dart @@ -2041,13 +2041,13 @@ void main() { value = newValue; }, ), - RaisedButton( + ElevatedButton( child: const Text('Next'), onPressed: () { Navigator.of(context).pushReplacement( MaterialPageRoute( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( child: const Text('Inner page'), onPressed: () { Navigator.of(context).pop(); }, ); @@ -2100,7 +2100,7 @@ void main() { ), ); - // Represents the RaisedButton with inner Text, inner page. + // Represents the ElevatedButton with inner Text, inner page. expect(valueIndicatorBox, paintsExactlyCountTimes(#drawPath, 1)); expect(valueIndicatorBox, paintsExactlyCountTimes(#drawParagraph, 1)); diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index 052563acdd..5c1c2884ea 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -2463,7 +2463,7 @@ void main() { tabs: List.generate(controller.length, (int index) => Tab(text: 'Tab$index')), ), actions: [ - FlatButton( + TextButton( child: const Text('Change TabController length'), onPressed: () { setState(() { diff --git a/packages/flutter/test/material/theme_test.dart b/packages/flutter/test/material/theme_test.dart index f90ab9cff4..275125a75f 100644 --- a/packages/flutter/test/material/theme_test.dart +++ b/packages/flutter/test/material/theme_test.dart @@ -164,7 +164,7 @@ void main() { body: Center( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { showModalBottomSheet( context: context, @@ -201,7 +201,7 @@ void main() { body: Center( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { showDialog( context: context, diff --git a/packages/flutter/test/material/time_picker_test.dart b/packages/flutter/test/material/time_picker_test.dart index 95e4e5e3cf..68dbf897ba 100644 --- a/packages/flutter/test/material/time_picker_test.dart +++ b/packages/flutter/test/material/time_picker_test.dart @@ -39,7 +39,7 @@ class _TimePickerLauncher extends StatelessWidget { child: Center( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( child: const Text('X'), onPressed: () async { onChanged(await showTimePicker( @@ -69,7 +69,7 @@ Future startPicker( } Future finishPicker(WidgetTester tester) async { - final MaterialLocalizations materialLocalizations = MaterialLocalizations.of(tester.element(find.byType(RaisedButton))); + final MaterialLocalizations materialLocalizations = MaterialLocalizations.of(tester.element(find.byType(ElevatedButton))); await tester.tap(find.text(materialLocalizations.okButtonLabel)); await tester.pumpAndSettle(const Duration(seconds: 1)); } @@ -499,7 +499,7 @@ void _tests() { child: Center( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( child: const Text('X'), onPressed: () { showTimePicker( @@ -551,7 +551,7 @@ void _tests() { onGenerateRoute: (RouteSettings settings) { return MaterialPageRoute( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { showTimePicker( context: context, @@ -567,7 +567,7 @@ void _tests() { )); // Open the dialog. - await tester.tap(find.byType(RaisedButton)); + await tester.tap(find.byType(ElevatedButton)); expect(rootObserver.pickerCount, 1); expect(nestedObserver.pickerCount, 0); @@ -584,7 +584,7 @@ void _tests() { onGenerateRoute: (RouteSettings settings) { return MaterialPageRoute( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( onPressed: () { showTimePicker( context: context, @@ -601,7 +601,7 @@ void _tests() { )); // Open the dialog. - await tester.tap(find.byType(RaisedButton)); + await tester.tap(find.byType(ElevatedButton)); expect(rootObserver.pickerCount, 0); expect(nestedObserver.pickerCount, 1); @@ -616,7 +616,7 @@ void _tests() { child: Center( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( child: const Text('X'), onPressed: () async { await showTimePicker( @@ -805,7 +805,7 @@ Future mediaQueryBoilerplate( child: Navigator( onGenerateRoute: (RouteSettings settings) { return MaterialPageRoute(builder: (BuildContext context) { - return FlatButton( + return TextButton( onPressed: () { showTimePicker( context: context, diff --git a/packages/flutter/test/material/time_picker_theme_test.dart b/packages/flutter/test/material/time_picker_theme_test.dart index ff35bf9f7b..9e23dc38b0 100644 --- a/packages/flutter/test/material/time_picker_theme_test.dart +++ b/packages/flutter/test/material/time_picker_theme_test.dart @@ -426,7 +426,7 @@ class _TimePickerLauncher extends StatelessWidget { child: Center( child: Builder( builder: (BuildContext context) { - return RaisedButton( + return ElevatedButton( child: const Text('X'), onPressed: () async { await showTimePicker( diff --git a/packages/flutter/test/material/will_pop_test.dart b/packages/flutter/test/material/will_pop_test.dart index 545e48d119..e0484396d5 100644 --- a/packages/flutter/test/material/will_pop_test.dart +++ b/packages/flutter/test/material/will_pop_test.dart @@ -84,7 +84,7 @@ void main() { body: Builder( builder: (BuildContext context) { return Center( - child: FlatButton( + child: TextButton( child: const Text('X'), onPressed: () { showDialog( @@ -138,7 +138,7 @@ void main() { body: Builder( builder: (BuildContext context) { return Center( - child: FlatButton( + child: TextButton( child: const Text('X'), onPressed: () { Navigator.of(context).push(MaterialPageRoute( @@ -183,7 +183,7 @@ void main() { body: Builder( builder: (BuildContext context) { return Center( - child: FlatButton( + child: TextButton( child: const Text('X'), onPressed: () { Navigator.of(context).push(MaterialPageRoute( @@ -236,11 +236,11 @@ void main() { builder: (BuildContext context) { return AlertDialog( actions: [ - FlatButton( + TextButton( child: const Text('YES'), onPressed: () { Navigator.of(context).pop(true); }, ), - FlatButton( + TextButton( child: const Text('NO'), onPressed: () { Navigator.of(context).pop(false); }, ), @@ -257,7 +257,7 @@ void main() { body: Builder( builder: (BuildContext context) { return Center( - child: FlatButton( + child: TextButton( child: const Text('X'), onPressed: () { Navigator.of(context).push(MaterialPageRoute( @@ -343,7 +343,7 @@ void main() { body: Builder( builder: (BuildContext context) { return Center( - child: FlatButton( + child: TextButton( child: const Text('X'), onPressed: () { Navigator.of(context).push(route);