2023-11-21 21:52:39 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class Menu extends StatelessWidget {
|
|
|
|
final Function(String) onMenuItemSelected;
|
|
|
|
|
|
|
|
const Menu({Key? key, required this.onMenuItemSelected}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Drawer(
|
|
|
|
child: ListView(
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
children: <Widget>[
|
|
|
|
SizedBox(
|
|
|
|
height: AppBar().preferredSize.height,
|
|
|
|
child: const DrawerHeader(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Colors.greenAccent,
|
|
|
|
),
|
|
|
|
child: Text('Hauptmenü', style: TextStyle(color: Colors.black, fontSize: 20.0)),
|
|
|
|
),
|
|
|
|
),
|
2024-01-10 07:20:15 +01:00
|
|
|
_buildListTile(context, 'Startseite'),
|
2023-11-21 21:52:39 +01:00
|
|
|
_buildListTile(context, 'Meine Rezepte'),
|
2024-01-10 07:20:15 +01:00
|
|
|
//_buildListTile(context, 'Rezept importieren'),
|
|
|
|
//_buildListTile(context, 'Texterkennung Bild'),
|
|
|
|
//_buildListTile(context, '(Beta) Rezepte finden'),
|
2023-11-21 21:52:39 +01:00
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _buildListTile(BuildContext context, String title) {
|
|
|
|
return Container(
|
|
|
|
color: Colors.white54,
|
|
|
|
child: ListTile(
|
|
|
|
title: Text(title),
|
|
|
|
onTap: () {
|
|
|
|
onMenuItemSelected(title);
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|