You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
828 B
Dart
29 lines
828 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:meals/data/dummy_categories.dart';
|
|
import 'package:meals/widgets/CategoryGridItem.dart';
|
|
|
|
class CategoriesScreen extends StatelessWidget {
|
|
const CategoriesScreen({Key? key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Pick your category'),
|
|
),
|
|
body: GridView(
|
|
padding: const EdgeInsets.all(24),
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
crossAxisCount: 2,
|
|
childAspectRatio: 1.5,
|
|
crossAxisSpacing: 20,
|
|
mainAxisSpacing: 20,
|
|
),
|
|
children: [
|
|
for (final category in availableCategories)
|
|
CategoryGridItem(category: category)
|
|
]),
|
|
);
|
|
}
|
|
}
|