mirror of
https://github.com/flutter/samples.git
synced 2026-07-10 19:12:37 +00:00
Flutter 3.29 beta (#2571)
This commit is contained in:
@@ -15,9 +15,7 @@ class FavoritesPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Favorites'),
|
||||
),
|
||||
appBar: AppBar(title: const Text('Favorites')),
|
||||
body: Consumer<Favorites>(
|
||||
builder: (context, value, child) => value.items.isNotEmpty
|
||||
? ListView.builder(
|
||||
@@ -26,9 +24,7 @@ class FavoritesPage extends StatelessWidget {
|
||||
itemBuilder: (context, index) =>
|
||||
FavoriteItemTile(value.items[index]),
|
||||
)
|
||||
: const Center(
|
||||
child: Text('No favorites added.'),
|
||||
),
|
||||
: const Center(child: Text('No favorites added.')),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -47,10 +43,7 @@ class FavoriteItemTile extends StatelessWidget {
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Colors.primaries[itemNo % Colors.primaries.length],
|
||||
),
|
||||
title: Text(
|
||||
'Item $itemNo',
|
||||
key: Key('favorites_text_$itemNo'),
|
||||
),
|
||||
title: Text('Item $itemNo', key: Key('favorites_text_$itemNo')),
|
||||
trailing: IconButton(
|
||||
key: Key('remove_icon_$itemNo'),
|
||||
icon: const Icon(Icons.close),
|
||||
|
||||
Reference in New Issue
Block a user