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

Replace uses of ButtonBar in doc/samples with Overflowbar (#85358)

parent 93ca2b5a
...@@ -1355,52 +1355,58 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { ...@@ -1355,52 +1355,58 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
/// ], /// ],
/// ), /// ),
/// bottomNavigationBar: BottomAppBar( /// bottomNavigationBar: BottomAppBar(
/// child: ButtonBar( /// child: Padding(
/// alignment: MainAxisAlignment.spaceEvenly, /// padding: const EdgeInsets.all(8),
/// children: <Widget>[ /// child: OverflowBar(
/// Row( /// alignment: MainAxisAlignment.spaceEvenly,
/// children: <Widget>[ /// children: <Widget>[
/// const Text('pinned'), /// Row(
/// Switch( /// mainAxisSize: MainAxisSize.min,
/// onChanged: (bool val) { /// children: <Widget>[
/// setState(() { /// const Text('pinned'),
/// _pinned = val; /// Switch(
/// }); /// onChanged: (bool val) {
/// }, /// setState(() {
/// value: _pinned, /// _pinned = val;
/// ), /// });
/// ], /// },
/// ), /// value: _pinned,
/// Row( /// ),
/// children: <Widget>[ /// ],
/// const Text('snap'), /// ),
/// Switch( /// Row(
/// onChanged: (bool val) { /// mainAxisSize: MainAxisSize.min,
/// setState(() { /// children: <Widget>[
/// _snap = val; /// const Text('snap'),
/// // Snapping only applies when the app bar is floating. /// Switch(
/// _floating = _floating || _snap; /// onChanged: (bool val) {
/// }); /// setState(() {
/// }, /// _snap = val;
/// value: _snap, /// // Snapping only applies when the app bar is floating.
/// ), /// _floating = _floating || _snap;
/// ], /// });
/// ), /// },
/// Row( /// value: _snap,
/// children: <Widget>[ /// ),
/// const Text('floating'), /// ],
/// Switch( /// ),
/// onChanged: (bool val) { /// Row(
/// setState(() { /// mainAxisSize: MainAxisSize.min,
/// _floating = val; /// children: <Widget>[
/// _snap = _snap && _floating; /// const Text('floating'),
/// }); /// Switch(
/// }, /// onChanged: (bool val) {
/// value: _floating, /// setState(() {
/// ), /// _floating = val;
/// ], /// _snap = _snap && _floating;
/// ), /// });
/// ], /// },
/// value: _floating,
/// ),
/// ],
/// ),
/// ],
/// ),
/// ), /// ),
/// ), /// ),
/// ); /// );
......
...@@ -6,7 +6,6 @@ import 'dart:ui'; ...@@ -6,7 +6,6 @@ import 'dart:ui';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'button_bar.dart';
import 'colors.dart'; import 'colors.dart';
import 'debug.dart'; import 'debug.dart';
import 'dialog_theme.dart'; import 'dialog_theme.dart';
...@@ -339,18 +338,15 @@ class AlertDialog extends StatelessWidget { ...@@ -339,18 +338,15 @@ class AlertDialog extends StatelessWidget {
final TextStyle? contentTextStyle; final TextStyle? contentTextStyle;
/// The (optional) set of actions that are displayed at the bottom of the /// The (optional) set of actions that are displayed at the bottom of the
/// dialog. /// dialog with an [OverflowBar].
/// ///
/// Typically this is a list of [TextButton] widgets. It is recommended to /// Typically this is a list of [TextButton] widgets. It is recommended to
/// set the [Text.textAlign] to [TextAlign.end] for the [Text] within the /// set the [Text.textAlign] to [TextAlign.end] for the [Text] within the
/// [TextButton], 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. /// with the overall [OverflowBar]'s alignment within the dialog.
///
/// These widgets will be wrapped in a [ButtonBar], which introduces 8 pixels
/// of padding on each side.
/// ///
/// If the [title] is not null but the [content] _is_ null, then an extra 20 /// If the [title] is not null but the [content] _is_ null, then an extra 20
/// pixels of padding is added above the [ButtonBar] to separate the [title] /// pixels of padding is added above the [OverflowBar] to separate the [title]
/// from the [actions]. /// from the [actions].
final List<Widget>? actions; final List<Widget>? actions;
...@@ -381,7 +377,7 @@ class AlertDialog extends StatelessWidget { ...@@ -381,7 +377,7 @@ class AlertDialog extends StatelessWidget {
/// ///
/// See also: /// See also:
/// ///
/// * [ButtonBar], which [actions] configures to lay itself out. /// * [OverflowBar], which [actions] configures to lay itself out.
final EdgeInsetsGeometry actionsPadding; final EdgeInsetsGeometry actionsPadding;
/// Defines the horizontal layout of the [actions] according to the same /// Defines the horizontal layout of the [actions] according to the same
...@@ -404,16 +400,13 @@ class AlertDialog extends StatelessWidget { ...@@ -404,16 +400,13 @@ class AlertDialog extends StatelessWidget {
/// property is set to [VerticalDirection.up], since it "starts" at the /// property is set to [VerticalDirection.up], since it "starts" at the
/// bottom and "ends" at the top. /// bottom and "ends" at the top.
/// ///
/// If null then it will use the surrounding
/// [ButtonBarThemeData.overflowDirection]. If that is null, it will
/// default to [VerticalDirection.down].
///
/// See also: /// See also:
/// ///
/// * [ButtonBar], which [actions] configures to lay itself out. /// * [OverflowBar], which [actions] configures to lay itself out.
final VerticalDirection? actionsOverflowDirection; final VerticalDirection? actionsOverflowDirection;
/// The spacing between [actions] when the button bar overflows. /// The spacing between [actions] when the [OverflowBar] switches
/// to a column layout because the actions don't fit horizontally.
/// ///
/// If the widgets in [actions] do not fit into a single row, they are /// If the widgets in [actions] do not fit into a single row, they are
/// arranged into a column. This parameter provides additional /// arranged into a column. This parameter provides additional
......
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