calorimeter/lib/utils/app_drawer.dart

46 lines
1.3 KiB
Dart
Raw Normal View History

2024-12-07 12:29:34 +00:00
/* SPDX-License-Identifier: GPL-3.0-or-later */
2024-12-07 12:39:11 +00:00
/* Copyright (C) 2024 Marco Groß <mgross@sw-gross.de> */
import 'package:calorimeter/utils/settings.dart';
2024-06-09 12:42:17 +00:00
import 'package:flutter/material.dart';
2024-12-10 21:37:13 +00:00
import 'package:flutter_gen/gen_l10n/app_localizations.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(
2024-12-10 21:37:13 +00:00
leading: IconButton(
icon: const Icon(Icons.close),
onPressed: () {
Navigator.of(context).pop();
},
),
title: Text(AppLocalizations.of(context)!.menu),
),
2024-06-09 12:42:17 +00:00
),
ListTile(
2024-12-10 21:37:13 +00:00
title: Text(AppLocalizations.of(context)!.settings),
2024-06-09 12:42:17 +00:00
trailing: const Icon(Icons.settings),
onTap: () {
Navigator.of(context).pop();
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const SettingsWidget()));
},
2024-06-09 12:42:17 +00:00
),
],
),
);
}
}