Unverified Commit 4d78435a authored by Hans Muller's avatar Hans Muller Committed by GitHub

Removed ButtonBar from the Scaffold and About widgets (#76246)

parent 23e41734
...@@ -11,7 +11,6 @@ import 'package:flutter/widgets.dart' hide Flow; ...@@ -11,7 +11,6 @@ import 'package:flutter/widgets.dart' hide Flow;
import 'app_bar.dart'; import 'app_bar.dart';
import 'back_button.dart'; import 'back_button.dart';
import 'button_bar.dart';
import 'card.dart'; import 'card.dart';
import 'constants.dart'; import 'constants.dart';
import 'debug.dart'; import 'debug.dart';
...@@ -1534,13 +1533,17 @@ class _MasterDetailScaffoldState extends State<_MasterDetailScaffold> ...@@ -1534,13 +1533,17 @@ class _MasterDetailScaffoldState extends State<_MasterDetailScaffold>
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
ConstrainedBox( ConstrainedBox(
constraints: constraints: BoxConstraints.tightFor(width: masterViewWidth),
BoxConstraints.tightFor(width: masterViewWidth),
child: IconTheme( child: IconTheme(
data: Theme.of(context).primaryIconTheme, data: Theme.of(context).primaryIconTheme,
child: ButtonBar( child: Container(
children: alignment: AlignmentDirectional.centerEnd,
widget.actionBuilder!(context, _ActionLevel.view), padding: const EdgeInsets.all(8),
child: OverflowBar(
spacing: 8,
overflowAlignment: OverflowBarAlignment.end,
children: widget.actionBuilder!(context, _ActionLevel.view),
),
), ),
), ),
) )
......
...@@ -13,7 +13,6 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; ...@@ -13,7 +13,6 @@ import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'app_bar.dart'; import 'app_bar.dart';
import 'bottom_sheet.dart'; import 'bottom_sheet.dart';
import 'button_bar.dart';
import 'colors.dart'; import 'colors.dart';
import 'curves.dart'; import 'curves.dart';
import 'debug.dart'; import 'debug.dart';
...@@ -1555,7 +1554,7 @@ class Scaffold extends StatefulWidget { ...@@ -1555,7 +1554,7 @@ class Scaffold extends StatefulWidget {
/// Typically this is a list of [TextButton] widgets. These buttons are /// Typically this is a list of [TextButton] widgets. These buttons are
/// persistently visible, even if the [body] of the scaffold scrolls. /// persistently visible, even if the [body] of the scaffold scrolls.
/// ///
/// These widgets will be wrapped in a [ButtonBar]. /// These widgets will be wrapped in an [OverflowBar].
/// ///
/// The [persistentFooterButtons] are rendered above the /// The [persistentFooterButtons] are rendered above the
/// [bottomNavigationBar] but below the [body]. /// [bottomNavigationBar] but below the [body].
...@@ -3114,11 +3113,19 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto ...@@ -3114,11 +3113,19 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
), ),
child: SafeArea( child: SafeArea(
top: false, top: false,
child: ButtonBar( child: IntrinsicHeight(
child: Container(
alignment: AlignmentDirectional.centerEnd,
padding: const EdgeInsets.all(8),
child: OverflowBar(
spacing: 8,
overflowAlignment: OverflowBarAlignment.end,
children: widget.persistentFooterButtons!, children: widget.persistentFooterButtons!,
), ),
), ),
), ),
),
),
_ScaffoldSlot.persistentFooter, _ScaffoldSlot.persistentFooter,
removeLeftPadding: false, removeLeftPadding: false,
removeTopPadding: true, removeTopPadding: true,
......
...@@ -492,8 +492,8 @@ void main() { ...@@ -492,8 +492,8 @@ void main() {
), ),
), ),
); );
expect(tester.getBottomLeft(find.byType(ButtonBar)), const Offset(10.0, 560.0)); expect(tester.getBottomLeft(_findButtonBar()), const Offset(10.0, 560.0));
expect(tester.getBottomRight(find.byType(ButtonBar)), const Offset(770.0, 560.0)); expect(tester.getBottomRight(_findButtonBar()), const Offset(770.0, 560.0));
}); });
testWidgets('Persistent bottom buttons bottom padding is not consumed by viewInsets', (WidgetTester tester) async { testWidgets('Persistent bottom buttons bottom padding is not consumed by viewInsets', (WidgetTester tester) async {
...@@ -2293,3 +2293,10 @@ class _CustomPageRoute<T> extends PageRoute<T> { ...@@ -2293,3 +2293,10 @@ class _CustomPageRoute<T> extends PageRoute<T> {
return child; return child;
} }
} }
// What was the Scaffold's ButtonBar when many of these tests were written,
// is now a Container with an OverflowBar child. The Container's size and location
// match the original ButtonBar's size and location.
Finder _findButtonBar() {
return find.ancestor(of: find.byType(OverflowBar), matching: find.byType(Container)).first;
}
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