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:
@@ -102,7 +102,7 @@ class _CategoryButton extends StatelessWidget {
|
||||
),
|
||||
child: ButtonTheme(
|
||||
height: 50.0,
|
||||
child: FlatButton(
|
||||
child: TextButton(
|
||||
child: Text(
|
||||
_buttonText,
|
||||
style: TextStyle(
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user