Mitgliederladen/Frontend-user/lib/shopping.dart

42 lines
1.3 KiB
Dart
Raw Normal View History

2023-06-25 19:10:29 +02:00
import 'package:flutter/material.dart';
import 'package:mitgliederladen/sample_data.dart';
2023-06-25 19:10:29 +02:00
class Shopping extends StatelessWidget {
const Shopping({super.key});
2023-06-25 19:10:29 +02:00
@override
Widget build(BuildContext context) {
return Scaffold(
floatingActionButton: FloatingActionButton(
child: const Icon(Icons.shopping_cart),
onPressed: () {},
),
body: GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2),
itemCount: SampleData.categories.length,
2023-06-25 19:10:29 +02:00
itemBuilder: ((context, index) {
return Card(
child: Column(children: [
Expanded(
2023-06-25 19:10:29 +02:00
child: FittedBox(
fit: BoxFit.scaleDown,
child: Text(
SampleData.categories[index].icon,
style: const TextStyle(fontSize: 400),
2023-06-25 19:10:29 +02:00
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
SampleData.categories[index].name,
2023-06-25 19:10:29 +02:00
style: Theme.of(context).textTheme.labelLarge,
),
),
]),
);
})));
}
}