first commit
This commit is contained in:
17
lib/Repository/constant_functions.dart
Normal file
17
lib/Repository/constant_functions.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../core/constant_variables/local_data_saving_keys.dart';
|
||||
|
||||
Future<String> getAuthToken() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
print("AUTHToken: Bearer ${prefs.getString(LocalDataBaseSavingKey.tokenKey)}");
|
||||
return "Bearer ${prefs.getString(LocalDataBaseSavingKey.tokenKey) ?? ''}";
|
||||
}
|
||||
|
||||
Future<void> saveUserData({required String token}) async {
|
||||
print(token);
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setString(LocalDataBaseSavingKey.tokenKey, token);
|
||||
await prefs.setBool(LocalDataBaseSavingKey.skipOnBodingKey, true);
|
||||
}
|
||||
Reference in New Issue
Block a user