Added Provider and DetailPage

This commit is contained in:
marcoabat
2023-08-05 14:35:19 +02:00
parent 77e1fa8244
commit 64e680ec6f
7 changed files with 104 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
import 'package:flutter/material.dart';
class ChecklistProvider extends ChangeNotifier {
int? _selectedChecklistId;
updateSelectedChecklist(int? checklistId, {bool silent = false}) {
_selectedChecklistId = checklistId;
if (!silent) notifyListeners();
}
int? get selectedChecklistId => _selectedChecklistId;
}

View File

@@ -34,6 +34,10 @@ class DbHelper {
return 0;
}
static Future<Checklist> getChecklistById(int id) async {
return ed.checklists.first;
}
static Stream<AuthState> get authChangeEventStream =>
_client.auth.onAuthStateChange;
}