mirror of
https://github.com/flutter/samples.git
synced 2026-06-02 04:19:15 +00:00
Upgrading samples to flutter_lints, part 1 of n (#804)
This commit is contained in:
@@ -13,7 +13,7 @@ class FavoritesPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Favorites'),
|
||||
title: const Text('Favorites'),
|
||||
),
|
||||
body: Consumer<Favorites>(
|
||||
builder: (context, value, child) => value.items.isNotEmpty
|
||||
@@ -23,7 +23,7 @@ class FavoritesPage extends StatelessWidget {
|
||||
itemBuilder: (context, index) =>
|
||||
FavoriteItemTile(value.items[index]),
|
||||
)
|
||||
: Center(
|
||||
: const Center(
|
||||
child: Text('No favorites added.'),
|
||||
),
|
||||
),
|
||||
@@ -52,11 +52,11 @@ class FavoriteItemTile extends StatelessWidget {
|
||||
),
|
||||
trailing: IconButton(
|
||||
key: Key('remove_icon_$itemNo'),
|
||||
icon: Icon(Icons.close),
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () {
|
||||
Provider.of<Favorites>(context, listen: false).remove(itemNo);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Removed from favorites.'),
|
||||
duration: Duration(seconds: 1),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user