1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00

Migrate to the New Material Buttons (#668)

This commit is contained in:
Brett Morgan
2021-01-27 13:20:50 +11:00
committed by GitHub
parent 6502209a78
commit 622e8d55d3
44 changed files with 122 additions and 107 deletions

View File

@@ -102,7 +102,7 @@ class _CategoryButton extends StatelessWidget {
),
child: ButtonTheme(
height: 50.0,
child: FlatButton(
child: TextButton(
child: Text(
_buttonText,
style: TextStyle(

View File

@@ -479,16 +479,16 @@ class _AddPlaceButtonBar extends StatelessWidget {
child: ButtonBar(
alignment: MainAxisAlignment.center,
children: [
RaisedButton(
color: Colors.blue,
ElevatedButton(
style: ElevatedButton.styleFrom(primary: Colors.blue),
child: const Text(
'Save',
style: TextStyle(color: Colors.white, fontSize: 16.0),
),
onPressed: onSavePressed,
),
RaisedButton(
color: Colors.red,
ElevatedButton(
style: ElevatedButton.styleFrom(primary: Colors.red),
child: const Text(
'Cancel',
style: TextStyle(color: Colors.white, fontSize: 16.0),
@@ -527,30 +527,33 @@ class _CategoryButtonBar extends StatelessWidget {
child: ButtonBar(
alignment: MainAxisAlignment.center,
children: [
RaisedButton(
color: selectedPlaceCategory == PlaceCategory.favorite
? Colors.green[700]
: Colors.lightGreen,
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: selectedPlaceCategory == PlaceCategory.favorite
? Colors.green[700]
: Colors.lightGreen),
child: const Text(
'Favorites',
style: TextStyle(color: Colors.white, fontSize: 14.0),
),
onPressed: () => onChanged(PlaceCategory.favorite),
),
RaisedButton(
color: selectedPlaceCategory == PlaceCategory.visited
? Colors.green[700]
: Colors.lightGreen,
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: selectedPlaceCategory == PlaceCategory.visited
? Colors.green[700]
: Colors.lightGreen),
child: const Text(
'Visited',
style: TextStyle(color: Colors.white, fontSize: 14.0),
),
onPressed: () => onChanged(PlaceCategory.visited),
),
RaisedButton(
color: selectedPlaceCategory == PlaceCategory.wantToGo
? Colors.green[700]
: Colors.lightGreen,
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: selectedPlaceCategory == PlaceCategory.wantToGo
? Colors.green[700]
: Colors.lightGreen),
child: const Text(
'Want To Go',
style: TextStyle(color: Colors.white, fontSize: 14.0),