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.
81 lines
2.4 KiB
Dart
81 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class MainDrawer extends StatelessWidget {
|
|
final Function(String identifier) onSelectScreen;
|
|
|
|
const MainDrawer({Key? key, required this.onSelectScreen}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Drawer(
|
|
child: Column(
|
|
children: [
|
|
DrawerHeader(
|
|
padding: const EdgeInsets.all(20),
|
|
decoration: BoxDecoration(
|
|
gradient: LinearGradient(
|
|
colors: [
|
|
Theme.of(context).colorScheme.primaryContainer,
|
|
Theme.of(context)
|
|
.colorScheme
|
|
.primaryContainer
|
|
.withOpacity(0.8),
|
|
],
|
|
begin: Alignment.topLeft,
|
|
end: Alignment.bottomRight,
|
|
),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Icon(
|
|
Icons.fastfood,
|
|
color: Theme.of(context).colorScheme.primary,
|
|
),
|
|
const SizedBox(
|
|
width: 18,
|
|
),
|
|
Text(
|
|
'Cooking up!',
|
|
style: Theme.of(context).textTheme.titleLarge!.copyWith(
|
|
color: Theme.of(context).colorScheme.primary,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
ListTile(
|
|
leading: Icon(
|
|
Icons.restaurant,
|
|
size: 26,
|
|
color: Theme.of(context).colorScheme.onBackground,
|
|
),
|
|
title: Text('Meals',
|
|
style: Theme.of(context).textTheme.titleSmall!.copyWith(
|
|
color: Colors.white,
|
|
fontSize: 24,
|
|
)),
|
|
onTap: () {
|
|
onSelectScreen('meals');
|
|
},
|
|
),
|
|
ListTile(
|
|
leading: Icon(
|
|
Icons.settings,
|
|
size: 26,
|
|
color: Theme.of(context).colorScheme.onBackground,
|
|
),
|
|
title: Text('Filters',
|
|
style: Theme.of(context).textTheme.titleSmall!.copyWith(
|
|
color: Colors.white,
|
|
fontSize: 24,
|
|
)),
|
|
onTap: () {
|
|
onSelectScreen('filters');
|
|
},
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|