logout button
This commit is contained in:
@@ -26,6 +26,12 @@ 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: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () => DbHelper.logout(),
|
||||||
|
icon: const Icon(Icons.logout),
|
||||||
|
)
|
||||||
|
]),
|
||||||
body: FutureBuilder(
|
body: FutureBuilder(
|
||||||
future: checklistFuture,
|
future: checklistFuture,
|
||||||
builder: _futureBuilder,
|
builder: _futureBuilder,
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ class DbHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<void> logout() async {
|
||||||
|
await _client.auth.signOut();
|
||||||
|
}
|
||||||
|
|
||||||
static Future<List<Checklist>> get fetchChecklist async {
|
static Future<List<Checklist>> get fetchChecklist async {
|
||||||
//TODO replace example data
|
//TODO replace example data
|
||||||
await Future.delayed(const Duration(seconds: 2));
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
|
|||||||
Reference in New Issue
Block a user