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;
import 'app_bar.dart';
import 'back_button.dart';
import 'button_bar.dart';
import 'card.dart';
import 'constants.dart';
import 'debug.dart';
......@@ -1534,13 +1533,17 @@ class _MasterDetailScaffoldState extends State<_MasterDetailScaffold>
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
ConstrainedBox(
constraints:
BoxConstraints.tightFor(width: masterViewWidth),
constraints: BoxConstraints.tightFor(width: masterViewWidth),
child: IconTheme(
data: Theme.of(context).primaryIconTheme,
child: ButtonBar(
children:
widget.actionBuilder!(context, _ActionLevel.view),
child: Container(
alignment: AlignmentDirectional.centerEnd,
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;
import 'app_bar.dart';
import 'bottom_sheet.dart';
import 'button_bar.dart';
import 'colors.dart';
import 'curves.dart';
import 'debug.dart';
......@@ -1555,7 +1554,7 @@ class Scaffold extends StatefulWidget {
/// Typically this is a list of [TextButton] widgets. These buttons are
/// 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
/// [bottomNavigationBar] but below the [body].
......@@ -3114,11 +3113,19 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
),
child: SafeArea(
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!,
),
),
),
),
),
_ScaffoldSlot.persistentFooter,
removeLeftPadding: false,
removeTopPadding: true,
......
......@@ -492,8 +492,8 @@ void main() {
),
),
);
expect(tester.getBottomLeft(find.byType(ButtonBar)), const Offset(10.0, 560.0));
expect(tester.getBottomRight(find.byType(ButtonBar)), const Offset(770.0, 560.0));
expect(tester.getBottomLeft(_findButtonBar()), const Offset(10.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 {
......@@ -2293,3 +2293,10 @@ class _CustomPageRoute<T> extends PageRoute<T> {
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