2023-11-21 20:23:14 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
|
|
|
import 'package:prasule/pw/platformroute.dart';
|
|
|
|
import 'package:prasule/views/graph_view.dart';
|
|
|
|
import 'package:prasule/views/home.dart';
|
2024-01-08 21:19:15 +01:00
|
|
|
import 'package:prasule/views/recurring_view.dart';
|
2023-11-21 20:23:14 +01:00
|
|
|
|
|
|
|
/// Makes the drawer because I won't enter the same code in every view
|
|
|
|
Drawer makeDrawer(BuildContext context, int page) => Drawer(
|
|
|
|
child: ListView(
|
|
|
|
children: [
|
|
|
|
const DrawerHeader(child: Text("Prašule")),
|
|
|
|
ListTile(
|
|
|
|
leading: const Icon(Icons.home),
|
|
|
|
title: Text(
|
2023-12-25 19:03:52 +01:00
|
|
|
AppLocalizations.of(context).home,
|
2023-11-21 20:23:14 +01:00
|
|
|
),
|
|
|
|
selected: page == 1,
|
|
|
|
onTap: () {
|
|
|
|
if (page == 1) {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Navigator.of(context)
|
|
|
|
.pushReplacement(platformRoute((p0) => const HomeView()));
|
|
|
|
},
|
|
|
|
),
|
|
|
|
ListTile(
|
|
|
|
leading: const Icon(Icons.bar_chart),
|
|
|
|
title: Text(
|
2023-12-25 19:03:52 +01:00
|
|
|
AppLocalizations.of(context).graphs,
|
2023-11-21 20:23:14 +01:00
|
|
|
),
|
|
|
|
selected: page == 2,
|
|
|
|
onTap: () {
|
|
|
|
if (page == 2) {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Navigator.of(context)
|
|
|
|
.pushReplacement(platformRoute((p0) => const GraphView()));
|
|
|
|
},
|
|
|
|
),
|
2024-01-08 21:19:15 +01:00
|
|
|
ListTile(
|
|
|
|
leading: const Icon(Icons.repeat),
|
|
|
|
title: Text(
|
|
|
|
AppLocalizations.of(context).recurringPayments,
|
|
|
|
),
|
|
|
|
selected: page == 3,
|
|
|
|
onTap: () {
|
|
|
|
if (page == 3) {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Navigator.of(context).pushReplacement(
|
|
|
|
platformRoute((p0) => const RecurringEntriesView()),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
2023-11-21 20:23:14 +01:00
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|