Removed ButtonBar from the Scaffold and About widgets (#76246)
This commit is contained in:
parent
23e41734e5
commit
4d78435a18
@ -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>
|
|||||||
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;
|
|||||||
|
|
||||||
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 {
|
|||||||
/// 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,8 +3113,16 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
|
|||||||
),
|
),
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
top: false,
|
top: false,
|
||||||
child: ButtonBar(
|
child: IntrinsicHeight(
|
||||||
children: widget.persistentFooterButtons!,
|
child: Container(
|
||||||
|
alignment: AlignmentDirectional.centerEnd,
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
child: OverflowBar(
|
||||||
|
spacing: 8,
|
||||||
|
overflowAlignment: OverflowBarAlignment.end,
|
||||||
|
children: widget.persistentFooterButtons!,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -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> {
|
|||||||
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;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user