added new pages

This commit is contained in:
marcoabat
2023-08-05 14:07:21 +02:00
parent c5c00b999e
commit 77e1fa8244
5 changed files with 36 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
import 'package:briessenchecker/pages/edit_checklist_page.dart';
import 'package:briessenchecker/services/dbhelper.dart'; import 'package:briessenchecker/services/dbhelper.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart';
@@ -28,6 +29,7 @@ class MyApp extends StatelessWidget {
LandingPage.routeName: (context) => const LandingPage(), LandingPage.routeName: (context) => const LandingPage(),
LoginPage.routeName: (context) => const LoginPage(), LoginPage.routeName: (context) => const LoginPage(),
DashboardPage.routeName: (context) => const DashboardPage(), DashboardPage.routeName: (context) => const DashboardPage(),
EditChecklistPage.routeName: (context) => const EditChecklistPage(),
}, },
); );
} }

View File

@@ -20,6 +20,10 @@ class _DashboardPageState extends State<DashboardPage> {
future: checklistFuture, future: checklistFuture,
builder: _futureBuilder, builder: _futureBuilder,
), ),
floatingActionButton: FloatingActionButton(
onPressed: _onAddTapped,
child: const Icon(Icons.add),
),
); );
} }
@@ -43,4 +47,8 @@ class _DashboardPageState extends State<DashboardPage> {
subtitle: Text(cl.description), subtitle: Text(cl.description),
); );
} }
void _onAddTapped() {
DbHelper.addChecklist().then((id) {});
}
} }

View File

@@ -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();
}
}

View File

@@ -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();
}
}

View File

@@ -28,6 +28,12 @@ class DbHelper {
return ed.checklists; return ed.checklists;
} }
/// returns id of newly created checklist
static Future<int> addChecklist() async {
//TODO Add checklist
return 0;
}
static Stream<AuthState> get authChangeEventStream => static Stream<AuthState> get authChangeEventStream =>
_client.auth.onAuthStateChange; _client.auth.onAuthStateChange;
} }