Unverified Commit abc9af52 authored by Hans Muller's avatar Hans Muller Committed by GitHub

Updated API doc references to obsolete Material button classes (#65665)

parent 41880855
...@@ -22,13 +22,25 @@ import 'theme_data.dart'; ...@@ -22,13 +22,25 @@ import 'theme_data.dart';
/// Creates a button based on [Semantics], [Material], and [InkWell] /// Creates a button based on [Semantics], [Material], and [InkWell]
/// widgets. /// widgets.
/// ///
/// ### This class is obsolete.
///
/// Custom button classes can be created by configuring the
/// [ButtonStyle] of a [TextButton], [ElevatedButton] or an
/// [OutlinedButton].
///
/// FlatButton, RaisedButton, and OutlineButton have been replaced by
/// TextButton, ElevatedButton, and OutlinedButton respectively.
/// ButtonTheme has been replaced by TextButtonTheme,
/// ElevatedButtonTheme, and OutlinedButtonTheme. The original classes
/// will be deprecated soon, please migrate code that uses them.
/// There's a detailed migration guide for the new button and button
/// theme classes in
/// [flutter.dev/go/material-button-migration-guide](https://flutter.dev/go/material-button-migration-guide).
///
/// This class does not use the current [Theme] or [ButtonTheme] to /// This class does not use the current [Theme] or [ButtonTheme] to
/// compute default values for unspecified parameters. It's intended to /// compute default values for unspecified parameters. It's intended to
/// be used for custom Material buttons that optionally incorporate defaults /// be used for custom Material buttons that optionally incorporate defaults
/// from the themes or from app-specific sources. /// from the themes or from app-specific sources.
///
/// [RaisedButton] and [FlatButton] configure a [RawMaterialButton] based
/// on the current [Theme] and [ButtonTheme].
@Category(<String>['Material', 'Button']) @Category(<String>['Material', 'Button'])
class RawMaterialButton extends StatefulWidget { class RawMaterialButton extends StatefulWidget {
/// Create a button based on [Semantics], [Material], and [InkWell] widgets. /// Create a button based on [Semantics], [Material], and [InkWell] widgets.
......
...@@ -10,8 +10,6 @@ import 'package:flutter/rendering.dart'; ...@@ -10,8 +10,6 @@ import 'package:flutter/rendering.dart';
import 'button_bar_theme.dart'; import 'button_bar_theme.dart';
import 'button_theme.dart'; import 'button_theme.dart';
import 'dialog.dart'; import 'dialog.dart';
import 'flat_button.dart';
import 'raised_button.dart';
/// An end-aligned row of buttons, laying out into a column if there is not /// An end-aligned row of buttons, laying out into a column if there is not
/// enough horizontal space. /// enough horizontal space.
...@@ -46,8 +44,9 @@ import 'raised_button.dart'; ...@@ -46,8 +44,9 @@ import 'raised_button.dart';
/// ///
/// See also: /// See also:
/// ///
/// * [RaisedButton], a kind of button. /// * [TextButton], a simple flat button without a shadow.
/// * [FlatButton], another kind of button. /// * [ElevatedButton], a filled button whose material elevates when pressed.
/// * [OutlinedButton], a [TextButton] with a border outline.
/// * [Card], at the bottom of which it is common to place a [ButtonBar]. /// * [Card], at the bottom of which it is common to place a [ButtonBar].
/// * [Dialog], which uses a [ButtonBar] for its actions. /// * [Dialog], which uses a [ButtonBar] for its actions.
/// * [ButtonBarTheme], which configures the [ButtonBar]. /// * [ButtonBarTheme], which configures the [ButtonBar].
...@@ -166,7 +165,7 @@ class ButtonBar extends StatelessWidget { ...@@ -166,7 +165,7 @@ class ButtonBar extends StatelessWidget {
/// The buttons to arrange horizontally. /// The buttons to arrange horizontally.
/// ///
/// Typically [RaisedButton] or [FlatButton] widgets. /// Typically [ElevatedButton] or [TextButton] widgets.
final List<Widget> children; final List<Widget> children;
@override @override
......
...@@ -119,8 +119,7 @@ class _DefaultHeroTag { ...@@ -119,8 +119,7 @@ class _DefaultHeroTag {
/// See also: /// See also:
/// ///
/// * [Scaffold], in which floating action buttons typically live. /// * [Scaffold], in which floating action buttons typically live.
/// * [RaisedButton], another kind of button that appears to float above the /// * [ElevatedButton], a filled button whose material elevates when pressed.
/// content.
/// * <https://material.io/design/components/buttons-floating-action-button.html> /// * <https://material.io/design/components/buttons-floating-action-button.html>
class FloatingActionButton extends StatelessWidget { class FloatingActionButton extends StatelessWidget {
/// Creates a circular floating action button. /// Creates a circular floating action button.
...@@ -358,7 +357,7 @@ class FloatingActionButton extends StatelessWidget { ...@@ -358,7 +357,7 @@ class FloatingActionButton extends StatelessWidget {
/// This controls the size of the shadow below the floating action button. /// This controls the size of the shadow below the floating action button.
/// ///
/// Defaults to the same value as [elevation]. Setting this to zero makes the /// Defaults to the same value as [elevation]. Setting this to zero makes the
/// floating action button work similar to a [RaisedButton] but the titular /// floating action button work similar to an [ElevatedButton] but the titular
/// "floating" effect is lost. The value is always non-negative. /// "floating" effect is lost. The value is always non-negative.
/// ///
/// See also: /// See also:
......
...@@ -108,7 +108,7 @@ class PaginatedDataTable extends StatefulWidget { ...@@ -108,7 +108,7 @@ class PaginatedDataTable extends StatefulWidget {
/// The table card's header. /// The table card's header.
/// ///
/// This is typically a [Text] widget, but can also be a [ButtonBar] with /// This is typically a [Text] widget, but can also be a [ButtonBar] with
/// [FlatButton]s. Suitable defaults are automatically provided for the font, /// [TextButton]s. Suitable defaults are automatically provided for the font,
/// button color, button padding, and so forth. /// button color, button padding, and so forth.
/// ///
/// If items in the table are selectable, then, when the selection is not /// If items in the table are selectable, then, when the selection is not
......
...@@ -231,7 +231,7 @@ class _TextFieldSelectionGestureDetectorBuilder extends TextSelectionGestureDete ...@@ -231,7 +231,7 @@ class _TextFieldSelectionGestureDetectorBuilder extends TextSelectionGestureDete
/// title: const Text('Thanks!'), /// title: const Text('Thanks!'),
/// content: Text ('You typed "$value".'), /// content: Text ('You typed "$value".'),
/// actions: <Widget>[ /// actions: <Widget>[
/// FlatButton( /// TextButton(
/// onPressed: () { Navigator.pop(context); }, /// onPressed: () { Navigator.pop(context); },
/// child: const Text('OK'), /// child: const Text('OK'),
/// ), /// ),
......
...@@ -1278,9 +1278,8 @@ class _OrderedFocusInfo { ...@@ -1278,9 +1278,8 @@ class _OrderedFocusInfo {
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// return FocusTraversalOrder( /// return FocusTraversalOrder(
/// order: NumericFocusOrder(order), /// order: NumericFocusOrder(order),
/// child: FlatButton( /// child: TextButton(
/// autofocus: autofocus, /// autofocus: autofocus,
/// focusColor: Colors.red,
/// onPressed: () => _handleOnPressed(), /// onPressed: () => _handleOnPressed(),
/// child: Text(name), /// child: Text(name),
/// ), /// ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment