When I press back button after logging out, it however takes me back to home screen, so I made the following changes on the logout button if anyone else experiences the same issue: ListTile( leading: const Icon(Icons.logout), title: const Text('LogOut'), onTap: () async { LocalStorage localStorage = LocalStorage(); await localStorage.clearValue('token'); await localStorage.clearValue('isLogin'); Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => LoginScreen())); }, ),
thanks sir, such a great videos you have provide, i have learned lot of things related to coding
Glad to hear that
if I am not wrong we could have also used getIt package and register singleton pattern right instead of this ? I hope I am right coz I am confused
Singleton pattern provides single point entry, so we don’t need getit
@@thetechbrotherss but i got really confused what is the difference between both. When to use this particularly? Thank you in advance
When I press back button after logging out, it however takes me back to home screen, so I made the following changes on the logout button if anyone else experiences the same issue:
ListTile(
leading: const Icon(Icons.logout),
title: const Text('LogOut'),
onTap: () async {
LocalStorage localStorage = LocalStorage();
await localStorage.clearValue('token');
await localStorage.clearValue('isLogin');
Navigator.pushReplacement(context,
MaterialPageRoute(builder: (context) => LoginScreen()));
},
),
great
🎉🎉🎉
Wao first comment
@@thetechbrotherss thnks