Arquivo "food_menu.dart" -
import 'package:flutter/widgets.dart';
import 'package:panucci_ristorante/components/food_item.dart';
import 'package:panucci_ristorante/cardapio.dart';
class Menu extends StatelessWidget {
const Menu({super.key});
final List items = comidas;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 0),
child: CustomScrollView(
slivers: [
const SliverToBoxAdapter(
child: Padding(
padding: EdgeInsets.only(bottom: 16.0),
child: Text(
textAlign: TextAlign.center,
'Menu',
style: TextStyle(
fontFamily: "Caveat",
fontSize: 32,
),
),
),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) {
return FoodItem(
itemTitle: items[index]['name'],
itemPrice: items[index]['price'],
imageURI: items[index]['image']);
},
childCount: items.length,
),
)
],
),
);
}
}
No arquivo "food_item.dart" só adicionei width: 80 e height: 80