language setup on logout

merge-requests/139/head
hussam al-habibeh 6 years ago
parent 420cc0622c
commit 0e471aaa63

@ -340,15 +340,13 @@ class Helpers {
} }
static clearSharedPref() async { static clearSharedPref() async {
String lang = await sharedPref.getString(APP_Language);
await sharedPref.clear(); await sharedPref.clear();
sharedPref.setString(APP_Language, lang);
} }
logout() async { logout() async {
String lang = await sharedPref.getString(APP_Language);
await clearSharedPref(); await clearSharedPref();
sharedPref.setString(APP_Language, lang);
Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN); Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN);
} }
} }

@ -106,11 +106,8 @@ class _AppDrawerState extends State<AppDrawer> {
color: Colors.white, color: Colors.white,
), ),
onPressed: () async { onPressed: () async {
// await Helpers.clearSharedPref();
Navigator.pop(context); Navigator.pop(context);
await helpers.logout(); await helpers.logout();
// Navigator.of(context).pushNamed(LOGIN);
}, },
), ),
], ],

Loading…
Cancel
Save