From c1e7176d243aa7dd8eadddf32a16a9f68902ec7d Mon Sep 17 00:00:00 2001 From: Darren Austin Date: Tue, 28 Jul 2020 10:41:06 -0700 Subject: [PATCH] Updated references to the old button classes to the new ones in comments and documentation for classes in the material library. (#62092) --- packages/flutter/lib/src/material/banner.dart | 2 +- packages/flutter/lib/src/material/bottom_sheet.dart | 4 ++-- packages/flutter/lib/src/material/chip.dart | 4 ++-- packages/flutter/lib/src/material/dialog.dart | 12 ++++++------ packages/flutter/lib/src/material/dropdown.dart | 2 +- packages/flutter/lib/src/material/ink_well.dart | 4 ++-- packages/flutter/lib/src/material/text_theme.dart | 2 +- packages/flutter/lib/src/material/theme_data.dart | 3 +++ 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/packages/flutter/lib/src/material/banner.dart b/packages/flutter/lib/src/material/banner.dart index ceea0956f53..80312cdaf6d 100644 --- a/packages/flutter/lib/src/material/banner.dart +++ b/packages/flutter/lib/src/material/banner.dart @@ -65,7 +65,7 @@ class MaterialBanner extends StatelessWidget { /// The set of actions that are displayed at the bottom or trailing side of /// the [MaterialBanner]. /// - /// Typically this is a list of [FlatButton] widgets. + /// Typically this is a list of [TextButton] widgets. /// /// These widgets will be wrapped in a [ButtonBar], which introduces 8 pixels /// of padding on each side. diff --git a/packages/flutter/lib/src/material/bottom_sheet.dart b/packages/flutter/lib/src/material/bottom_sheet.dart index 1a2da99ba90..9c4fdda2056 100644 --- a/packages/flutter/lib/src/material/bottom_sheet.dart +++ b/packages/flutter/lib/src/material/bottom_sheet.dart @@ -600,7 +600,7 @@ class _BottomSheetSuspendedCurve extends ParametricCurve { /// ```dart /// Widget build(BuildContext context) { /// return Center( -/// child: RaisedButton( +/// child: ElevatedButton( /// child: const Text('showModalBottomSheet'), /// onPressed: () { /// showModalBottomSheet( @@ -615,7 +615,7 @@ class _BottomSheetSuspendedCurve extends ParametricCurve { /// mainAxisSize: MainAxisSize.min, /// children: [ /// const Text('Modal BottomSheet'), -/// RaisedButton( +/// ElevatedButton( /// child: const Text('Close BottomSheet'), /// onPressed: () => Navigator.pop(context), /// ) diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index bfd74e5ee4e..adcdd870e8c 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -1259,8 +1259,8 @@ class FilterChip extends StatelessWidget /// Action chips are displayed after primary content, such as below a card or /// persistently at the bottom of a screen. /// -/// The material button widgets, [RaisedButton], [FlatButton], and -/// [OutlineButton], are an alternative to action chips, which should appear +/// The material button widgets, [ElevatedButton], [TextButton], and +/// [OutlinedButton], are an alternative to action chips, which should appear /// statically and consistently in a UI. /// /// Requires one of its ancestors to be a [Material] widget. diff --git a/packages/flutter/lib/src/material/dialog.dart b/packages/flutter/lib/src/material/dialog.dart index 9ef31d26d69..685ebe4b845 100644 --- a/packages/flutter/lib/src/material/dialog.dart +++ b/packages/flutter/lib/src/material/dialog.dart @@ -208,7 +208,7 @@ class Dialog extends StatelessWidget { /// ), /// ), /// actions: [ -/// FlatButton( +/// TextButton( /// child: Text('Approve'), /// onPressed: () { /// Navigator.of(context).pop(); @@ -311,9 +311,9 @@ class AlertDialog extends StatelessWidget { /// The (optional) set of actions that are displayed at the bottom of the /// dialog. /// - /// Typically this is a list of [FlatButton] widgets. It is recommended to + /// Typically this is a list of [TextButton] widgets. It is recommended to /// set the [textAlign] to [TextAlign.end] for the [Text] within the - /// [FlatButton], so that buttons whose labels wrap to an extra line align + /// [TextButton], so that buttons whose labels wrap to an extra line align /// with the overall [ButtonBar]'s alignment within the dialog. /// /// These widgets will be wrapped in a [ButtonBar], which introduces 8 pixels @@ -341,8 +341,8 @@ class AlertDialog extends StatelessWidget { /// title: Text('Title'), /// content: Container(width: 200, height: 200, color: Colors.green), /// actions: [ - /// RaisedButton(onPressed: () {}, child: Text('Button 1')), - /// RaisedButton(onPressed: () {}, child: Text('Button 2')), + /// ElevatedButton(onPressed: () {}, child: Text('Button 1')), + /// ElevatedButton(onPressed: () {}, child: Text('Button 2')), /// ], /// actionsPadding: EdgeInsets.symmetric(horizontal: 8.0), /// ) @@ -613,7 +613,7 @@ class AlertDialog extends StatelessWidget { /// /// * [SimpleDialog], for a dialog in which to use this widget. /// * [showDialog], which actually displays the dialog and returns its result. -/// * [FlatButton], which are commonly used as actions in other kinds of +/// * [TextButton], which are commonly used as actions in other kinds of /// dialogs, such as [AlertDialog]s. /// * class SimpleDialogOption extends StatelessWidget { diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart index 82f257baa2e..1d5bed0d35a 100644 --- a/packages/flutter/lib/src/material/dropdown.dart +++ b/packages/flutter/lib/src/material/dropdown.dart @@ -785,7 +785,7 @@ class DropdownButtonHideUnderline extends InheritedWidget { /// * [DropdownMenuItem], the class used to represent the [items]. /// * [DropdownButtonHideUnderline], which prevents its descendant dropdown buttons /// from displaying their underlines. -/// * [RaisedButton], [FlatButton], ordinary buttons that trigger a single action. +/// * [ElevatedButton], [TextButton], ordinary buttons that trigger a single action. /// * class DropdownButton extends StatefulWidget { /// Creates a dropdown button. diff --git a/packages/flutter/lib/src/material/ink_well.dart b/packages/flutter/lib/src/material/ink_well.dart index 4b6b076385c..76cb6295b77 100644 --- a/packages/flutter/lib/src/material/ink_well.dart +++ b/packages/flutter/lib/src/material/ink_well.dart @@ -280,7 +280,7 @@ typedef _CheckContext = bool Function(BuildContext context); /// See also: /// /// * [GestureDetector], for listening for gestures without ink splashes. -/// * [RaisedButton] and [FlatButton], two kinds of buttons in material design. +/// * [ElevatedButton] and [TextButton], two kinds of buttons in material design. /// * [IconButton], which combines [InkResponse] with an [Icon]. class InkResponse extends StatelessWidget { /// Creates an area of a [Material] that responds to touch. @@ -1198,7 +1198,7 @@ class _InkResponseState extends State<_InkResponseStateWidget> /// See also: /// /// * [GestureDetector], for listening for gestures without ink splashes. -/// * [RaisedButton] and [FlatButton], two kinds of buttons in material design. +/// * [ElevatedButton] and [TextButton], two kinds of buttons in material design. /// * [InkResponse], a variant of [InkWell] that doesn't force a rectangular /// shape on the ink reaction. class InkWell extends InkResponse { diff --git a/packages/flutter/lib/src/material/text_theme.dart b/packages/flutter/lib/src/material/text_theme.dart index c024825e21d..723f2c31a69 100644 --- a/packages/flutter/lib/src/material/text_theme.dart +++ b/packages/flutter/lib/src/material/text_theme.dart @@ -231,7 +231,7 @@ class TextTheme with Diagnosticable { /// Used for auxiliary text associated with images. final TextStyle caption; - /// Used for text on [RaisedButton] and [FlatButton]. + /// Used for text on [ElevatedButton], [TextButton] and [OutlinedButton]. final TextStyle button; /// The smallest style. diff --git a/packages/flutter/lib/src/material/theme_data.dart b/packages/flutter/lib/src/material/theme_data.dart index 67b54cb2c4a..229b71ca3f9 100644 --- a/packages/flutter/lib/src/material/theme_data.dart +++ b/packages/flutter/lib/src/material/theme_data.dart @@ -71,6 +71,9 @@ const Color _kDarkThemeSplashColor = Color(0x40CCCCCC); /// /// * [FloatingActionButton], only the mini tap target size is increased. /// * [MaterialButton] +/// * [OutlinedButton] +/// * [TextButton] +/// * [ElevatedButton] /// * [OutlineButton] /// * [FlatButton] /// * [RaisedButton]