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,7 +54,10 @@ class InfiniteProcessPage extends StatelessWidget {
Column( Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
ButtonBar( Padding(
padding: const EdgeInsets.all(8.0),
child: OverflowBar(
spacing: 8.0,
alignment: MainAxisAlignment.center, alignment: MainAxisAlignment.center,
children: [ children: [
ElevatedButton( ElevatedButton(
@ -69,6 +72,7 @@ class InfiniteProcessPage extends StatelessWidget {
), ),
], ],
), ),
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [

@ -440,28 +440,32 @@ 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(
padding: const EdgeInsets.all(8.0),
child: OverflowBar(
alignment: MainAxisAlignment.center, alignment: MainAxisAlignment.center,
spacing: 8.0,
children: [ children: [
ElevatedButton( ElevatedButton(
style: ElevatedButton.styleFrom(foregroundColor: Colors.blue), style: ElevatedButton.styleFrom(
onPressed: onSavePressed, backgroundColor: Colors.blue,
child: const Text( foregroundColor: Colors.white,
'Save',
style: TextStyle(color: Colors.white, fontSize: 16.0),
), ),
onPressed: onSavePressed,
child: const Text('Save'),
), ),
ElevatedButton( ElevatedButton(
style: ElevatedButton.styleFrom(foregroundColor: Colors.red), style: ElevatedButton.styleFrom(
onPressed: onCancelPressed, backgroundColor: Colors.red,
child: const Text( foregroundColor: Colors.white,
'Cancel',
style: TextStyle(color: Colors.white, fontSize: 16.0),
), ),
onPressed: onCancelPressed,
child: const Text('Cancel'),
), ),
], ],
), ),
), ),
),
); );
} }
} }
@ -484,20 +488,23 @@ 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(
padding: const EdgeInsets.all(8.0),
child: OverflowBar(
alignment: MainAxisAlignment.center, alignment: MainAxisAlignment.center,
children: [ spacing: 8.0,
children: <Widget>[
FilledButton( FilledButton(
style: FilledButton.styleFrom( style: FilledButton.styleFrom(
backgroundColor: backgroundColor:
selectedPlaceCategory == PlaceCategory.favorite selectedPlaceCategory == PlaceCategory.favorite
? Colors.green[700] ? Colors.green[700]
: Colors.lightGreen), : Colors.lightGreen),
onPressed: () => onChanged(PlaceCategory.favorite),
child: const Text( child: const Text(
'Favorites', 'Favorites',
style: TextStyle(color: Colors.white, fontSize: 14.0), style: TextStyle(color: Colors.white, fontSize: 14.0),
), ),
onPressed: () => onChanged(PlaceCategory.favorite),
), ),
FilledButton( FilledButton(
style: FilledButton.styleFrom( style: FilledButton.styleFrom(
@ -505,11 +512,11 @@ class _CategoryButtonBar extends StatelessWidget {
selectedPlaceCategory == PlaceCategory.visited selectedPlaceCategory == PlaceCategory.visited
? Colors.green[700] ? Colors.green[700]
: Colors.lightGreen), : Colors.lightGreen),
onPressed: () => onChanged(PlaceCategory.visited),
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( FilledButton(
style: FilledButton.styleFrom( style: FilledButton.styleFrom(
@ -517,15 +524,16 @@ class _CategoryButtonBar extends StatelessWidget {
selectedPlaceCategory == PlaceCategory.wantToGo selectedPlaceCategory == PlaceCategory.wantToGo
? Colors.green[700] ? Colors.green[700]
: Colors.lightGreen), : Colors.lightGreen),
onPressed: () => onChanged(PlaceCategory.wantToGo),
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