added title and future bugfix

This commit is contained in:
marcoabat
2023-08-05 17:31:09 +02:00
parent 6f8ee1a6ab
commit 1ee2d08e65

View File

@@ -26,12 +26,15 @@ class _DashboardPageState extends State<DashboardPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
checklistProvider = Provider.of<ChecklistProvider>(context, listen: true); checklistProvider = Provider.of<ChecklistProvider>(context, listen: true);
return Scaffold( return Scaffold(
appBar: AppBar(actions: [ appBar: AppBar(
title: const Text('Brießenchecker9000'),
actions: [
IconButton( IconButton(
onPressed: () => DbHelper.logout(), onPressed: () => DbHelper.logout(),
icon: const Icon(Icons.logout), icon: const Icon(Icons.logout),
) )
]), ],
),
body: FutureBuilder( body: FutureBuilder(
future: checklistFuture, future: checklistFuture,
builder: _futureBuilder, builder: _futureBuilder,
@@ -70,8 +73,8 @@ class _DashboardPageState extends State<DashboardPage> {
void _onAddTapped() { void _onAddTapped() {
DbHelper.addOrUpdateChecklist(null).then((id) { DbHelper.addOrUpdateChecklist(null).then((id) {
checklistProvider.updateSelectedChecklist(id, silent: true); checklistProvider.updateSelectedChecklist(id, silent: true);
}); }).whenComplete(
Navigator.of(context).pushNamed(DetailChecklistPage.routeName); () => Navigator.of(context).pushNamed(DetailChecklistPage.routeName));
} }
void _onListEntryTapped(Checklist cl) { void _onListEntryTapped(Checklist cl) {