mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
[testing_app] added basic placeholder for favorites list (#581)
This commit is contained in:
@@ -16,11 +16,16 @@ class FavoritesPage extends StatelessWidget {
|
||||
title: Text('Favorites'),
|
||||
),
|
||||
body: Consumer<Favorites>(
|
||||
builder: (context, value, child) => ListView.builder(
|
||||
itemCount: value.items.length,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
itemBuilder: (context, index) => FavoriteItemTile(value.items[index]),
|
||||
),
|
||||
builder: (context, value, child) => value.items.isNotEmpty
|
||||
? ListView.builder(
|
||||
itemCount: value.items.length,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
itemBuilder: (context, index) =>
|
||||
FavoriteItemTile(value.items[index]),
|
||||
)
|
||||
: Center(
|
||||
child: Text('No favorites added.'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user