added location overview screen
This commit is contained in:
@@ -6,6 +6,7 @@ import '../model/task.dart';
|
||||
import '../service/controllers/task_controller.dart';
|
||||
import '../service/tools.dart';
|
||||
import '../widgets/task_dismissible.dart';
|
||||
import 'locations_overview_page.dart';
|
||||
import 'task_edit_page.dart';
|
||||
|
||||
class TaskOverviewPage extends StatefulWidget {
|
||||
@@ -22,7 +23,20 @@ class _TaskOverviewPageState extends State<TaskOverviewPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text('Hallo Yannick')),
|
||||
appBar: AppBar(
|
||||
title: Text('Hallo Yannick'),
|
||||
actions: [
|
||||
PopupMenuButton(
|
||||
itemBuilder: (_) => [
|
||||
PopupMenuItem(
|
||||
onTap: onLocationsButtonTapped,
|
||||
child: Text('Locations'),
|
||||
),
|
||||
],
|
||||
icon: Icon(Icons.more_vert),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Padding(
|
||||
padding: EdgeInsetsGeometry.symmetric(
|
||||
horizontal: MediaQuery.of(context).size.width * 0.05,
|
||||
@@ -84,10 +98,13 @@ class _TaskOverviewPageState extends State<TaskOverviewPage> {
|
||||
await Navigator.of(context).pushNamed(TaskEditPage.routeName)
|
||||
as CreateTaskRequest?;
|
||||
|
||||
if (result != null && context.mounted) {
|
||||
if (result != null && mounted) {
|
||||
context.controller<TaskController>().saveTask(
|
||||
result.toTask(id: generateId()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void onLocationsButtonTapped() =>
|
||||
Navigator.of(context).pushNamed(LocationsOverviewPage.routeName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user