add getSession

This commit is contained in:
Moe Poi ~ 2022-05-12 21:44:58 +07:00
parent 7208594bc2
commit 40e82a6d4b

View file

@ -29,6 +29,16 @@ Future<bool> checkSessionExist() async {
return false;
}
Future<String> getSession() async {
final prefs = await SharedPreferences.getInstance();
if (prefs.containsKey('session')) {
return prefs.getString('session') ?? 'null';
}
return 'null';
}
Future<void> removeSession() async {
final prefs = await SharedPreferences.getInstance();