From 1a9c9056d4bee73fa8f1cabd1e4d8dd836d1fba9 Mon Sep 17 00:00:00 2001 From: MohammadTaha Basiri Date: Tue, 4 Jan 2022 20:04:44 +0330 Subject: [PATCH] D1APP-49 logout --- lib/pages/home/profile/profile.dart | 6 +++++- lib/utils/actions_sheet.dart | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/pages/home/profile/profile.dart b/lib/pages/home/profile/profile.dart index 212ba77..bbd0665 100644 --- a/lib/pages/home/profile/profile.dart +++ b/lib/pages/home/profile/profile.dart @@ -8,6 +8,7 @@ import 'package:didvan/widgets/didvan/divider.dart'; import 'package:didvan/widgets/didvan/text.dart'; import 'package:didvan/widgets/item_title.dart'; import 'package:flutter/material.dart'; +import 'package:hive/hive.dart'; import 'package:provider/provider.dart'; class Profile extends StatelessWidget { @@ -59,7 +60,10 @@ class Profile extends StatelessWidget { title: 'خروج از حساب کاربری', icon: DidvanIcons.sign_out_regular, color: Theme.of(context).colorScheme.secondary, - onTap: () => {}, + onTap: () async { + await Hive.deleteBoxFromDisk('autherization'); + Navigator.of(context).pushReplacementNamed(Routes.splash); + }, ), ], ), diff --git a/lib/utils/actions_sheet.dart b/lib/utils/actions_sheet.dart index 18fc11c..f3b333b 100644 --- a/lib/utils/actions_sheet.dart +++ b/lib/utils/actions_sheet.dart @@ -12,7 +12,7 @@ import 'package:flutter/services.dart'; import 'package:rive/rive.dart'; class ActionSheetUtils { - static late final BuildContext context; + static late BuildContext context; static Future showLogoLoadingIndicator() async { await showDialog(