aboutsummaryrefslogtreecommitdiff
path: root/lib/widgets/custom_drawer_widget.dart
diff options
context:
space:
mode:
Diffstat (limited to 'lib/widgets/custom_drawer_widget.dart')
-rw-r--r--lib/widgets/custom_drawer_widget.dart30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/widgets/custom_drawer_widget.dart b/lib/widgets/custom_drawer_widget.dart
index 3fd8c2e..671ff70 100644
--- a/lib/widgets/custom_drawer_widget.dart
+++ b/lib/widgets/custom_drawer_widget.dart
@@ -14,21 +14,21 @@ import 'package:kulinar_app/widgets/page_route_transitions.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class CustomDrawer extends StatefulWidget {
- CustomDrawer({Key? key, required this.initalIndex}) : super(key: key);
+ const CustomDrawer({Key? key, required this.initialIndex}) : super(key: key);
- final int initalIndex;
+ final int initialIndex;
@override
- _CustomDrawerState createState() => _CustomDrawerState();
+ CustomDrawerState createState() => CustomDrawerState();
}
-class _CustomDrawerState extends State<CustomDrawer> {
+class CustomDrawerState extends State<CustomDrawer> {
int? _index;
@override
void initState() {
super.initState();
- _index = widget.initalIndex;
+ _index = widget.initialIndex;
}
@override
@@ -46,28 +46,28 @@ class _CustomDrawerState extends State<CustomDrawer> {
children: [
_buildDrawerHeader(),
_buildDrawerItem(0, Icons.receipt_rounded, AppLocalizations.of(context)!.category1, () {
- _navigateTo(MainView(), 0);
+ _navigateTo(const MainView(), 0);
}),
_buildDrawerItem(1, Icons.favorite_rounded, AppLocalizations.of(context)!.category4, () {
- _navigateTo(FavoritesView(), 1);
+ _navigateTo(const FavoritesView(), 1);
}),
_buildDrawerItem(2, Icons.calendar_today_rounded, AppLocalizations.of(context)!.category5, () {
- _navigateTo(WeekView(), 2);
+ _navigateTo(const WeekView(), 2);
}),
_buildDrawerItem(3, Icons.how_to_vote_rounded, AppLocalizations.of(context)!.category6, () {
- _navigateTo(VoteView(), 3);
+ _navigateTo(const VoteView(), 3);
}),
_buildDrawerItem(4, Icons.shopping_cart_rounded, AppLocalizations.of(context)!.category7, () {
- _navigateTo(ShoplistView(), 4);
+ _navigateTo(const ShoplistView(), 4);
}),
],
),
),
_buildDrawerItem(5, Icons.settings_rounded, AppLocalizations.of(context)!.category8, () {
- _navigateTo(SettingsView(), 5);
+ _navigateTo(const SettingsView(), 5);
}),
_buildDrawerItem(6, Icons.info_rounded, AppLocalizations.of(context)!.category9, () {
- _navigateTo(InfoView(), 6);
+ _navigateTo(const InfoView(), 6);
}),
],
),
@@ -75,16 +75,17 @@ class _CustomDrawerState extends State<CustomDrawer> {
}
Widget _buildDrawerHeader() {
- return SizedBox(
+ return const SizedBox(
width: double.infinity,
child: DrawerHeader(
margin: EdgeInsets.zero,
+ decoration: BoxDecoration(color: cPrimaryColor),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
- padding: const EdgeInsets.only(bottom: 12.0),
+ padding: EdgeInsets.only(bottom: 12.0),
child: Icon(
Icons.restaurant_menu_rounded,
color: cIconColor,
@@ -93,7 +94,6 @@ class _CustomDrawerState extends State<CustomDrawer> {
),
],
),
- decoration: BoxDecoration(color: cPrimaryColor),
),
);
}