Removed ButtonBar from flutter_gallery (#85351)

This commit is contained in:
Hans Muller
2021-06-28 13:01:04 -07:00
committed by GitHub
parent dec122a4d8
commit 93ca2b5ac0
4 changed files with 107 additions and 55 deletions

View File

@@ -127,8 +127,9 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ButtonBar(
mainAxisSize: MainAxisSize.min,
const SizedBox(height: 2),
OverflowBar(
spacing: 8,
children: <Widget>[
ElevatedButton(
style: style,
@@ -143,8 +144,9 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
),
],
),
ButtonBar(
mainAxisSize: MainAxisSize.min,
const SizedBox(height: 16),
OverflowBar(
spacing: 8,
children: <Widget>[
ElevatedButton.icon(
style: style,
@@ -174,8 +176,9 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ButtonBar(
mainAxisSize: MainAxisSize.min,
const SizedBox(height: 2),
OverflowBar(
spacing: 8,
children: <Widget>[
TextButton(
style: style,
@@ -190,8 +193,8 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
),
],
),
ButtonBar(
mainAxisSize: MainAxisSize.min,
OverflowBar(
spacing: 8,
children: <Widget>[
TextButton.icon(
style: style,
@@ -221,8 +224,9 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ButtonBar(
mainAxisSize: MainAxisSize.min,
const SizedBox(height: 2),
OverflowBar(
spacing: 8,
children: <Widget>[
OutlinedButton(
style: style,
@@ -238,8 +242,9 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
),
],
),
ButtonBar(
mainAxisSize: MainAxisSize.min,
const SizedBox(height: 16),
OverflowBar(
spacing: 8,
children: <Widget>[
OutlinedButton.icon(
style: style,

View File

@@ -314,20 +314,24 @@ class TravelDestinationContent extends StatelessWidget {
),
if (destination.type == CardDemoType.standard)
// share, explore buttons
ButtonBar(
alignment: MainAxisAlignment.start,
children: <Widget>[
TextButton(
style: textButtonStyle,
onPressed: () { print('pressed'); },
child: Text('SHARE', semanticsLabel: 'Share ${destination.title}'),
),
TextButton(
style: textButtonStyle,
onPressed: () { print('pressed'); },
child: Text('EXPLORE', semanticsLabel: 'Explore ${destination.title}'),
),
],
Padding(
padding: const EdgeInsetsDirectional.only(start: 8, top: 8),
child: OverflowBar(
alignment: MainAxisAlignment.start,
spacing: 8,
children: <Widget>[
TextButton(
style: textButtonStyle,
onPressed: () { print('pressed'); },
child: Text('SHARE', semanticsLabel: 'Share ${destination.title}'),
),
TextButton(
style: textButtonStyle,
onPressed: () { print('pressed'); },
child: Text('EXPLORE', semanticsLabel: 'Explore ${destination.title}'),
),
],
),
),
],
);

View File

@@ -82,38 +82,37 @@ class _LoginPageState extends State<LoginPage> {
),
),
),
Wrap(
const SizedBox(height: 12.0),
OverflowBar(
spacing: 8,
alignment: MainAxisAlignment.end,
children: <Widget>[
ButtonBar(
children: <Widget>[
TextButton(
style: TextButton.styleFrom(
shape: const BeveledRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(7.0)),
),
),
onPressed: () {
// The login screen is immediately displayed on top of
// the Shrine home screen using onGenerateRoute and so
// rootNavigator must be set to true in order to get out
// of Shrine completely.
Navigator.of(context, rootNavigator: true).pop();
},
child: const Text('CANCEL'),
TextButton(
style: TextButton.styleFrom(
shape: const BeveledRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(7.0)),
),
ElevatedButton(
style: ElevatedButton.styleFrom(
elevation: 8.0,
shape: const BeveledRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(7.0)),
),
),
onPressed: () {
Navigator.pop(context);
},
child: const Text('NEXT'),
),
onPressed: () {
// The login screen is immediately displayed on top of
// the Shrine home screen using onGenerateRoute and so
// rootNavigator must be set to true in order to get out
// of Shrine completely.
Navigator.of(context, rootNavigator: true).pop();
},
child: const Text('CANCEL'),
),
ElevatedButton(
style: ElevatedButton.styleFrom(
elevation: 8.0,
shape: const BeveledRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(7.0)),
),
],
),
onPressed: () {
Navigator.pop(context);
},
child: const Text('NEXT'),
),
],
),