calorimeter/lib/app_drawer.dart

41 lines
997 B
Dart
Raw Normal View History

2024-06-09 12:42:17 +00:00
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
2024-06-09 12:42:17 +00:00
class AppDrawer extends StatelessWidget {
const AppDrawer({
super.key,
});
@override
Widget build(BuildContext context) {
return Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: [
DrawerHeader(
decoration: const BoxDecoration(
color: Colors.redAccent,
),
child: ListTile(
leading: IconButton(
icon: const Icon(Icons.close),
onPressed: () {
context.pop();
2024-06-09 12:42:17 +00:00
},
),
title: const Text('Menü')),
),
ListTile(
title: const Text('Einstellungen'),
trailing: const Icon(Icons.settings),
onTap: () {
context.pop();
context.pushNamed('settings');
},
2024-06-09 12:42:17 +00:00
),
],
),
);
}
}