diff --git a/lib/main.dart b/lib/main.dart index 0108dad..309b5d6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,4 @@ +import 'package:briessenchecker/pages/edit_checklist_page.dart'; import 'package:briessenchecker/services/dbhelper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; @@ -28,6 +29,7 @@ class MyApp extends StatelessWidget { LandingPage.routeName: (context) => const LandingPage(), LoginPage.routeName: (context) => const LoginPage(), DashboardPage.routeName: (context) => const DashboardPage(), + EditChecklistPage.routeName: (context) => const EditChecklistPage(), }, ); } diff --git a/lib/pages/dashboard_page.dart b/lib/pages/dashboard_page.dart index 9ac4ed4..980579e 100644 --- a/lib/pages/dashboard_page.dart +++ b/lib/pages/dashboard_page.dart @@ -20,6 +20,10 @@ class _DashboardPageState extends State { future: checklistFuture, builder: _futureBuilder, ), + floatingActionButton: FloatingActionButton( + onPressed: _onAddTapped, + child: const Icon(Icons.add), + ), ); } @@ -43,4 +47,8 @@ class _DashboardPageState extends State { subtitle: Text(cl.description), ); } + + void _onAddTapped() { + DbHelper.addChecklist().then((id) {}); + } } diff --git a/lib/pages/detail_checklist_page.dart b/lib/pages/detail_checklist_page.dart new file mode 100644 index 0000000..d9751bf --- /dev/null +++ b/lib/pages/detail_checklist_page.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class DetailChecklistPage extends StatelessWidget { + const DetailChecklistPage({super.key}); + static const routeName = '/detail'; + @override + Widget build(BuildContext context) { + return const Placeholder(); + } +} diff --git a/lib/pages/edit_checklist_page.dart b/lib/pages/edit_checklist_page.dart new file mode 100644 index 0000000..24a3142 --- /dev/null +++ b/lib/pages/edit_checklist_page.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class EditChecklistPage extends StatelessWidget { + const EditChecklistPage({super.key}); + static const routeName = '/edit'; + @override + Widget build(BuildContext context) { + return const Placeholder(); + } +} diff --git a/lib/services/dbhelper.dart b/lib/services/dbhelper.dart index 4ae4028..2073030 100644 --- a/lib/services/dbhelper.dart +++ b/lib/services/dbhelper.dart @@ -28,6 +28,12 @@ class DbHelper { return ed.checklists; } + /// returns id of newly created checklist + static Future addChecklist() async { + //TODO Add checklist + return 0; + } + static Stream get authChangeEventStream => _client.auth.onAuthStateChange; }