mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
Upgrading samples to flutter_lints, part 1 of n (#804)
This commit is contained in:
@@ -14,15 +14,15 @@ class HomePage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Testing Sample'),
|
||||
title: const Text('Testing Sample'),
|
||||
actions: <Widget>[
|
||||
TextButton.icon(
|
||||
style: TextButton.styleFrom(primary: Colors.white),
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(context, FavoritesPage.routeName);
|
||||
},
|
||||
icon: Icon(Icons.favorite_border),
|
||||
label: Text('Favorites'),
|
||||
icon: const Icon(Icons.favorite_border),
|
||||
label: const Text('Favorites'),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -61,8 +61,8 @@ class ItemTile extends StatelessWidget {
|
||||
trailing: IconButton(
|
||||
key: Key('icon_$itemNo'),
|
||||
icon: favoritesList.items.contains(itemNo)
|
||||
? Icon(Icons.favorite)
|
||||
: Icon(Icons.favorite_border),
|
||||
? const Icon(Icons.favorite)
|
||||
: const Icon(Icons.favorite_border),
|
||||
onPressed: () {
|
||||
!favoritesList.items.contains(itemNo)
|
||||
? favoritesList.add(itemNo)
|
||||
@@ -72,7 +72,7 @@ class ItemTile extends StatelessWidget {
|
||||
content: Text(favoritesList.items.contains(itemNo)
|
||||
? 'Added to favorites.'
|
||||
: 'Removed from favorites.'),
|
||||
duration: Duration(seconds: 1),
|
||||
duration: const Duration(seconds: 1),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user