25-1/25/1-secure and links
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:sefer_driver/controller/functions/encrypt_decrypt.dart';
|
||||
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/links.dart';
|
||||
@@ -44,7 +45,19 @@ class AppInitializer {
|
||||
if (res != 'failure') {
|
||||
links = List<Map<String, dynamic>>.from(jsonDecode(res)['message']);
|
||||
await box.remove(BoxName.locationName);
|
||||
await box.remove(BoxName.basicLink);
|
||||
await box.remove(links[4]['name']);
|
||||
await box.remove(links[1]['name']);
|
||||
await box.remove(links[2]['name']);
|
||||
await box.write(BoxName.locationName, links);
|
||||
await box.write(BoxName.basicLink,
|
||||
encryptionHelper.decryptData(links[0]['server_link']));
|
||||
await box.write(links[2]['name'],
|
||||
encryptionHelper.decryptData(links[2]['server_link']));
|
||||
await box.write(links[1]['name'],
|
||||
encryptionHelper.decryptData(links[1]['server_link']));
|
||||
await box.write(BoxName.paymentLink,
|
||||
encryptionHelper.decryptData(links[4]['server_link']));
|
||||
}
|
||||
} catch (e) {
|
||||
print('Error fetching or decoding location data: $e');
|
||||
|
||||
Reference in New Issue
Block a user