From c14e328c266bc9366a3cf9121351431dfbe327f6 Mon Sep 17 00:00:00 2001 From: Darren Austin Date: Tue, 28 Jul 2020 10:46:10 -0700 Subject: [PATCH] Updated references to the old button classes to the new ones in comments and documentation for classes in the widgets, services and rendering libraries. (#62099) --- packages/flutter/lib/src/rendering/proxy_box.dart | 2 +- packages/flutter/lib/src/services/system_chrome.dart | 2 +- packages/flutter/lib/src/widgets/actions.dart | 2 +- .../flutter/lib/src/widgets/animated_switcher.dart | 2 +- packages/flutter/lib/src/widgets/basic.dart | 2 +- packages/flutter/lib/src/widgets/editable_text.dart | 2 +- packages/flutter/lib/src/widgets/focus_manager.dart | 2 +- packages/flutter/lib/src/widgets/focus_scope.dart | 2 +- packages/flutter/lib/src/widgets/form.dart | 4 ++-- packages/flutter/lib/src/widgets/framework.dart | 2 +- .../flutter/lib/src/widgets/implicit_animations.dart | 2 +- packages/flutter/lib/src/widgets/navigator.dart | 2 +- packages/flutter/lib/src/widgets/page_view.dart | 10 ++++------ packages/flutter/lib/src/widgets/routes.dart | 6 +++--- packages/flutter/lib/src/widgets/scroll_view.dart | 2 +- packages/flutter/lib/src/widgets/sliver_fill.dart | 2 +- packages/flutter/lib/src/widgets/text.dart | 2 +- 17 files changed, 23 insertions(+), 25 deletions(-) diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart index 804107261d..d505b94776 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -2980,7 +2980,7 @@ class RenderRepaintBoundary extends RenderProxyBox { /// return RepaintBoundary( /// key: globalKey, /// child: Center( - /// child: FlatButton( + /// child: TextButton( /// child: Text('Hello World', textDirection: TextDirection.ltr), /// onPressed: _capturePng, /// ), diff --git a/packages/flutter/lib/src/services/system_chrome.dart b/packages/flutter/lib/src/services/system_chrome.dart index 520fd7a084..0536235394 100644 --- a/packages/flutter/lib/src/services/system_chrome.dart +++ b/packages/flutter/lib/src/services/system_chrome.dart @@ -375,7 +375,7 @@ class SystemChrome { /// return AnnotatedRegion( /// value: _currentStyle, /// child: Center( - /// child: RaisedButton( + /// child: ElevatedButton( /// child: const Text('Change Color'), /// onPressed: _changeColor, /// ), diff --git a/packages/flutter/lib/src/widgets/actions.dart b/packages/flutter/lib/src/widgets/actions.dart index fb37261ce5..edf7c2907d 100644 --- a/packages/flutter/lib/src/widgets/actions.dart +++ b/packages/flutter/lib/src/widgets/actions.dart @@ -863,7 +863,7 @@ class _ActionsMarker extends InheritedWidget { /// children: [ /// Padding( /// padding: const EdgeInsets.all(8.0), -/// child: FlatButton(onPressed: () {}, child: Text('Press Me')), +/// child: TextButton(onPressed: () {}, child: Text('Press Me')), /// ), /// Padding( /// padding: const EdgeInsets.all(8.0), diff --git a/packages/flutter/lib/src/widgets/animated_switcher.dart b/packages/flutter/lib/src/widgets/animated_switcher.dart index 4a2b5d5165..ac9bd9dcc1 100644 --- a/packages/flutter/lib/src/widgets/animated_switcher.dart +++ b/packages/flutter/lib/src/widgets/animated_switcher.dart @@ -120,7 +120,7 @@ typedef AnimatedSwitcherLayoutBuilder = Widget Function(Widget currentChild, Lis /// style: Theme.of(context).textTheme.headline4, /// ), /// ), -/// RaisedButton( +/// ElevatedButton( /// child: const Text('Increment'), /// onPressed: () { /// setState(() { diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 5df22117fb..caf51601a1 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -6204,7 +6204,7 @@ class MouseRegion extends StatefulWidget { /// Widget build(BuildContext context) { /// return Column( /// children: [ - /// RaisedButton( + /// ElevatedButton( /// onPressed: () { /// setState(() { key = UniqueKey(); }); /// }, diff --git a/packages/flutter/lib/src/widgets/editable_text.dart b/packages/flutter/lib/src/widgets/editable_text.dart index 497d453b37..c3a7d3d005 100644 --- a/packages/flutter/lib/src/widgets/editable_text.dart +++ b/packages/flutter/lib/src/widgets/editable_text.dart @@ -926,7 +926,7 @@ class EditableText extends StatefulWidget { /// title: const Text('Thats correct!'), /// content: Text ('13 is the right answer.'), /// actions: [ - /// FlatButton( + /// TextButton( /// onPressed: () { Navigator.pop(context); }, /// child: const Text('OK'), /// ), diff --git a/packages/flutter/lib/src/widgets/focus_manager.dart b/packages/flutter/lib/src/widgets/focus_manager.dart index ab96d9f3f8..171cc91d8a 100644 --- a/packages/flutter/lib/src/widgets/focus_manager.dart +++ b/packages/flutter/lib/src/widgets/focus_manager.dart @@ -823,7 +823,7 @@ class FocusNode with DiagnosticableTreeMixin, ChangeNotifier { /// ], /// ); /// }), - /// OutlineButton( + /// OutlinedButton( /// child: const Text('UNFOCUS'), /// onPressed: () { /// setState(() { diff --git a/packages/flutter/lib/src/widgets/focus_scope.dart b/packages/flutter/lib/src/widgets/focus_scope.dart index 03dafce920..34f30a84ed 100644 --- a/packages/flutter/lib/src/widgets/focus_scope.dart +++ b/packages/flutter/lib/src/widgets/focus_scope.dart @@ -801,7 +801,7 @@ class _FocusState extends State { /// children: [ /// // This button would be not visible, but still focusable from /// // the foreground pane without the FocusScope. -/// RaisedButton( +/// ElevatedButton( /// onPressed: () => print('You pressed the other button!'), /// child: Text('ANOTHER BUTTON TO FOCUS'), /// ), diff --git a/packages/flutter/lib/src/widgets/form.dart b/packages/flutter/lib/src/widgets/form.dart index b7df198138..defcd138e8 100644 --- a/packages/flutter/lib/src/widgets/form.dart +++ b/packages/flutter/lib/src/widgets/form.dart @@ -20,7 +20,7 @@ import 'will_pop_scope.dart'; /// /// {@tool dartpad --template=stateful_widget_scaffold} /// This example shows a [Form] with one [TextFormField] to enter an email -/// address and a [RaisedButton] to submit the form. A [GlobalKey] is used here +/// address and an [ElevatedButton] to submit the form. A [GlobalKey] is used here /// to identify the [Form] and validate input. /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/widgets/form.png) @@ -48,7 +48,7 @@ import 'will_pop_scope.dart'; /// ), /// Padding( /// padding: const EdgeInsets.symmetric(vertical: 16.0), -/// child: RaisedButton( +/// child: ElevatedButton( /// onPressed: () { /// // Validate will return true if the form is valid, or false if /// // the form is invalid. diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 2843f0568b..5a04eacd63 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -2041,7 +2041,7 @@ typedef ElementVisitor = void Function(Element element); /// appBar: AppBar(title: Text('Demo')), /// body: Builder( /// builder: (BuildContext context) { -/// return FlatButton( +/// return TextButton( /// child: Text('BUTTON'), /// onPressed: () { /// // here, Scaffold.of(context) returns the locally created Scaffold diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart index 75b8246a4c..da3cb2e46c 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -1305,7 +1305,7 @@ class _AnimatedPositionedDirectionalState extends AnimatedWidgetBaseState extends TransitionDelegate { /// return Scaffold( /// appBar: AppBar(title: Text('My Page')), /// body: Center( -/// child: FlatButton( +/// child: TextButton( /// child: Text('POP'), /// onPressed: () { /// Navigator.pop(context); diff --git a/packages/flutter/lib/src/widgets/page_view.dart b/packages/flutter/lib/src/widgets/page_view.dart index a73c2fe91c..4c4d75d09e 100644 --- a/packages/flutter/lib/src/widgets/page_view.dart +++ b/packages/flutter/lib/src/widgets/page_view.dart @@ -44,7 +44,7 @@ import 'viewport.dart'; /// {@tool snippet} /// /// This widget introduces a [MaterialApp], [Scaffold] and [PageView] with two pages -/// using the default constructor. Both pages contain a [RaisedButton] allowing you +/// using the default constructor. Both pages contain an [ElevatedButton] allowing you /// to animate the [PageView] using a [PageController]. /// /// ```dart @@ -79,8 +79,7 @@ import 'viewport.dart'; /// Container( /// color: Colors.red, /// child: Center( -/// child: RaisedButton( -/// color: Colors.white, +/// child: ElevatedButton( /// onPressed: () { /// if (_pageController.hasClients) { /// _pageController.animateToPage( @@ -97,8 +96,7 @@ import 'viewport.dart'; /// Container( /// color: Colors.blue, /// child: Center( -/// child: RaisedButton( -/// color: Colors.white, +/// child: ElevatedButton( /// onPressed: () { /// if (_pageController.hasClients) { /// _pageController.animateToPage( @@ -660,7 +658,7 @@ class PageView extends StatefulWidget { /// child: Row( /// mainAxisAlignment: MainAxisAlignment.center, /// children: [ - /// FlatButton( + /// TextButton( /// onPressed: () => _reverse(), /// child: Text('Reverse items'), /// ), diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index b85993ff71..d5dcc17e82 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -523,7 +523,7 @@ mixin LocalHistoryRoute on Route { /// children: [ /// Text('HomePage'), /// // Press this button to open the SecondPage. - /// RaisedButton( + /// ElevatedButton( /// child: Text('Second Page >'), /// onPressed: () { /// Navigator.pushNamed(context, '/second_page'); @@ -568,7 +568,7 @@ mixin LocalHistoryRoute on Route { /// height: 100.0, /// color: Colors.red, /// ) - /// : RaisedButton( + /// : ElevatedButton( /// child: Text('Show Rectangle'), /// onPressed: _navigateLocallyToShowRectangle, /// ); @@ -579,7 +579,7 @@ mixin LocalHistoryRoute on Route { /// mainAxisAlignment: MainAxisAlignment.center, /// children: [ /// localNavContent, - /// RaisedButton( + /// ElevatedButton( /// child: Text('< Back'), /// onPressed: () { /// // Pop a route. If this is pressed while the red rectangle is diff --git a/packages/flutter/lib/src/widgets/scroll_view.dart b/packages/flutter/lib/src/widgets/scroll_view.dart index 7742216866..f00a6233e4 100644 --- a/packages/flutter/lib/src/widgets/scroll_view.dart +++ b/packages/flutter/lib/src/widgets/scroll_view.dart @@ -1278,7 +1278,7 @@ class ListView extends BoxScrollView { /// child: Row( /// mainAxisAlignment: MainAxisAlignment.center, /// children: [ - /// FlatButton( + /// TextButton( /// onPressed: () => _reverse(), /// child: Text('Reverse items'), /// ), diff --git a/packages/flutter/lib/src/widgets/sliver_fill.dart b/packages/flutter/lib/src/widgets/sliver_fill.dart index dbe3d08520..bced696508 100644 --- a/packages/flutter/lib/src/widgets/sliver_fill.dart +++ b/packages/flutter/lib/src/widgets/sliver_fill.dart @@ -373,7 +373,7 @@ class _RenderSliverFractionalPadding extends RenderSliverEdgeInsetsPadding { /// alignment: Alignment.bottomCenter, /// child: Padding( /// padding: const EdgeInsets.all(16.0), -/// child: RaisedButton( +/// child: ElevatedButton( /// onPressed: () { /// /* Place your onPressed code here! */ /// }, diff --git a/packages/flutter/lib/src/widgets/text.dart b/packages/flutter/lib/src/widgets/text.dart index eb91a7a5ce..ac82fbe479 100644 --- a/packages/flutter/lib/src/widgets/text.dart +++ b/packages/flutter/lib/src/widgets/text.dart @@ -322,7 +322,7 @@ class DefaultTextHeightBehavior extends InheritedTheme { /// To make [Text] react to touch events, wrap it in a [GestureDetector] widget /// with a [GestureDetector.onTap] handler. /// -/// In a material design application, consider using a [FlatButton] instead, or +/// In a material design application, consider using a [TextButton] instead, or /// if that isn't appropriate, at least using an [InkWell] instead of /// [GestureDetector]. ///