25-6-23/1
This commit is contained in:
@@ -40,7 +40,6 @@ class AppInitializer {
|
||||
|
||||
Future<void> initializeApp() async {
|
||||
if (box.read(BoxName.jwt) == null) {
|
||||
Log.print('box.read(BoxName.jwt): ${box.read(BoxName.jwt)}');
|
||||
await LoginDriverController().getJWT();
|
||||
} else {
|
||||
bool isTokenExpired = JwtDecoder.isExpired(X
|
||||
@@ -55,15 +54,18 @@ class AppInitializer {
|
||||
// await getKey();
|
||||
}
|
||||
|
||||
getAIKey(String key1) async {
|
||||
if (box.read(BoxName.firstTimeLoadKey) == null) {
|
||||
var res =
|
||||
await CRUD().get(link: AppLink.getapiKey, payload: {"keyName": key1});
|
||||
if (res != 'failure') {
|
||||
var d = jsonDecode(res)['message'];
|
||||
await storage.write(key: key1, value: d[key1].toString());
|
||||
await Future.delayed(Duration.zero);
|
||||
} else {}
|
||||
Future<void> getAIKey(String key1) async {
|
||||
var res =
|
||||
await CRUD().get(link: AppLink.getapiKey, payload: {"keyName": key1});
|
||||
|
||||
if (res != 'failure') {
|
||||
var d = jsonDecode(res)['message'];
|
||||
final rawValue = d[key1].toString();
|
||||
|
||||
// ✅ اكتبها في storage
|
||||
await storage.write(key: key1, value: rawValue);
|
||||
|
||||
await Future.delayed(Duration.zero);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user