feat: enhance product picker with searchable bottom sheet and improve recipe list item layout
This commit is contained in:
@@ -71,15 +71,42 @@ class RecipesScreen extends ConsumerWidget {
|
||||
itemCount: recipes.length,
|
||||
itemBuilder: (context, index) {
|
||||
final recipe = recipes[index];
|
||||
return ListTile(
|
||||
leading: recipe.imageUrl != null
|
||||
? CircleAvatar(
|
||||
backgroundImage: NetworkImage(recipe.imageUrl!),
|
||||
)
|
||||
: const CircleAvatar(child: Icon(Icons.restaurant)),
|
||||
title: Text(recipe.title),
|
||||
subtitle: Text(recipe.description ?? ''),
|
||||
return InkWell(
|
||||
onTap: () => context.push('/recipes/${recipe.id}'),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12, vertical: 6),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
child: recipe.imageUrl != null
|
||||
? Image.network(
|
||||
recipe.imageUrl!,
|
||||
width: 72,
|
||||
height: 72,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: Container(
|
||||
width: 72,
|
||||
height: 72,
|
||||
color: Colors.grey[200],
|
||||
child: const Icon(Icons.restaurant,
|
||||
size: 32),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
recipe.title,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user