Replace `ButtonBar` with `OverflowBar` (#2072)

This PR replaces `ButtonBar` with `OverflowBar` in preparation of
`ButtonBar` deprecation

related to https://github.com/flutter/flutter/issues/127955


## Pre-launch Checklist

- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I read the [Contributors Guide].
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-devrel
channel on [Discord].

<!-- Links -->
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[CLA]: https://cla.developers.google.com/
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Contributors Guide]:
https://github.com/flutter/samples/blob/main/CONTRIBUTING.md

---------

Co-authored-by: Brett Morgan <brett.morgan@gmail.com>
pull/2073/head
Taha Tesser 1 year ago committed by GitHub
parent 92943da0cd
commit 1a26473a50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -54,20 +54,24 @@ class InfiniteProcessPage extends StatelessWidget {
Column( Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
ButtonBar( Padding(
alignment: MainAxisAlignment.center, padding: const EdgeInsets.all(8.0),
children: [ child: OverflowBar(
ElevatedButton( spacing: 8.0,
style: ElevatedButton.styleFrom(elevation: 8.0), alignment: MainAxisAlignment.center,
onPressed: () => controller.start(), children: [
child: const Text('Start'), ElevatedButton(
), style: ElevatedButton.styleFrom(elevation: 8.0),
ElevatedButton( onPressed: () => controller.start(),
style: ElevatedButton.styleFrom(elevation: 8.0), child: const Text('Start'),
onPressed: () => controller.terminate(), ),
child: const Text('Terminate'), ElevatedButton(
), style: ElevatedButton.styleFrom(elevation: 8.0),
], onPressed: () => controller.terminate(),
child: const Text('Terminate'),
),
],
),
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

@ -440,26 +440,30 @@ class _AddPlaceButtonBar extends StatelessWidget {
child: Container( child: Container(
padding: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 14.0), padding: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 14.0),
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: ButtonBar( child: Padding(
alignment: MainAxisAlignment.center, padding: const EdgeInsets.all(8.0),
children: [ child: OverflowBar(
ElevatedButton( alignment: MainAxisAlignment.center,
style: ElevatedButton.styleFrom(foregroundColor: Colors.blue), spacing: 8.0,
onPressed: onSavePressed, children: [
child: const Text( ElevatedButton(
'Save', style: ElevatedButton.styleFrom(
style: TextStyle(color: Colors.white, fontSize: 16.0), backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
onPressed: onSavePressed,
child: const Text('Save'),
), ),
), ElevatedButton(
ElevatedButton( style: ElevatedButton.styleFrom(
style: ElevatedButton.styleFrom(foregroundColor: Colors.red), backgroundColor: Colors.red,
onPressed: onCancelPressed, foregroundColor: Colors.white,
child: const Text( ),
'Cancel', onPressed: onCancelPressed,
style: TextStyle(color: Colors.white, fontSize: 16.0), child: const Text('Cancel'),
), ),
), ],
], ),
), ),
), ),
); );
@ -484,46 +488,50 @@ class _CategoryButtonBar extends StatelessWidget {
child: Container( child: Container(
padding: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 14.0), padding: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 14.0),
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: ButtonBar( child: Padding(
alignment: MainAxisAlignment.center, padding: const EdgeInsets.all(8.0),
children: [ child: OverflowBar(
FilledButton( alignment: MainAxisAlignment.center,
style: FilledButton.styleFrom( spacing: 8.0,
backgroundColor: children: <Widget>[
selectedPlaceCategory == PlaceCategory.favorite FilledButton(
? Colors.green[700] style: FilledButton.styleFrom(
: Colors.lightGreen), backgroundColor:
child: const Text( selectedPlaceCategory == PlaceCategory.favorite
'Favorites', ? Colors.green[700]
style: TextStyle(color: Colors.white, fontSize: 14.0), : Colors.lightGreen),
onPressed: () => onChanged(PlaceCategory.favorite),
child: const Text(
'Favorites',
style: TextStyle(color: Colors.white, fontSize: 14.0),
),
), ),
onPressed: () => onChanged(PlaceCategory.favorite), FilledButton(
), style: FilledButton.styleFrom(
FilledButton( backgroundColor:
style: FilledButton.styleFrom( selectedPlaceCategory == PlaceCategory.visited
backgroundColor: ? Colors.green[700]
selectedPlaceCategory == PlaceCategory.visited : Colors.lightGreen),
? Colors.green[700] onPressed: () => onChanged(PlaceCategory.visited),
: Colors.lightGreen), child: const Text(
child: const Text( 'Visited',
'Visited', style: TextStyle(color: Colors.white, fontSize: 14.0),
style: TextStyle(color: Colors.white, fontSize: 14.0), ),
), ),
onPressed: () => onChanged(PlaceCategory.visited), FilledButton(
), style: FilledButton.styleFrom(
FilledButton( backgroundColor:
style: FilledButton.styleFrom( selectedPlaceCategory == PlaceCategory.wantToGo
backgroundColor: ? Colors.green[700]
selectedPlaceCategory == PlaceCategory.wantToGo : Colors.lightGreen),
? Colors.green[700] onPressed: () => onChanged(PlaceCategory.wantToGo),
: Colors.lightGreen), child: const Text(
child: const Text( 'Want To Go',
'Want To Go', style: TextStyle(color: Colors.white, fontSize: 14.0),
style: TextStyle(color: Colors.white, fontSize: 14.0), ),
), ),
onPressed: () => onChanged(PlaceCategory.wantToGo), ],
), ),
],
), ),
), ),
); );

@ -38,8 +38,10 @@ declare -ar PROJECT_NAMES=(
# TODO(DomesticMouse): Dart formatting required # TODO(DomesticMouse): Dart formatting required
# "experimental/pedometer" # "experimental/pedometer"
# "experimental/pedometer/example" # "experimental/pedometer/example"
"experimental/varfont_shader_puzzle" # TODO(DomesticMouse): Dart formatting required
"experimental/web_dashboard" # "experimental/varfont_shader_puzzle"
# TODO(DomesticMouse): Because every version of flutter_test from sdk depends on intl 0.18.1 and web_dashboard depends on intl ^0.17.0, flutter_test from sdk is forbidden.
# "experimental/web_dashboard"
"flutter_maps_firestore" "flutter_maps_firestore"
"form_app" "form_app"
"game_template" "game_template"

Loading…
Cancel
Save