25-10-6/1
This commit is contained in:
@@ -2,6 +2,7 @@ import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'package:Intaleq/constant/api_key.dart';
|
||||
import 'package:Intaleq/controller/firebase/firbase_messge.dart';
|
||||
import 'package:Intaleq/views/auth/otp_page.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
@@ -47,33 +48,34 @@ class LoginController extends GetxController {
|
||||
var dev = '';
|
||||
@override
|
||||
void onInit() async {
|
||||
await getAppTester();
|
||||
Log.print('box.read(BoxName.isTest): ${box.read(BoxName.isTest)}');
|
||||
// await getAppTester();
|
||||
// Log.print('box.read(BoxName.isTest): ${box.read(BoxName.isTest)}');
|
||||
box.write(BoxName.countryCode, 'Syria');
|
||||
FirebaseMessagesController().getToken();
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
getAppTester() async {
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getTesterApp,
|
||||
payload: {'appPlatform': AppInformation.appName});
|
||||
if (res != 'failure') {
|
||||
var d = jsonDecode(res);
|
||||
// getAppTester() async {
|
||||
// var res = await CRUD().get(
|
||||
// link: AppLink.getTesterApp,
|
||||
// payload: {'appPlatform': AppInformation.appName});
|
||||
// if (res != 'failure') {
|
||||
// var d = jsonDecode(res);
|
||||
|
||||
isTest = int.parse(d['message'][0]['isTest'].toString());
|
||||
box.write(BoxName.isTest, isTest);
|
||||
update();
|
||||
} else {
|
||||
box.write(BoxName.isTest, '1');
|
||||
update();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// isTest = int.parse(d['message'][0]['isTest'].toString());
|
||||
// box.write(BoxName.isTest, isTest);
|
||||
// update();
|
||||
// } else {
|
||||
// box.write(BoxName.isTest, '1');
|
||||
// update();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
updateAppTester(String appPlatform) async {
|
||||
await CRUD().post(
|
||||
link: AppLink.updateTesterApp, payload: {'appPlatform': appPlatform});
|
||||
}
|
||||
// updateAppTester(String appPlatform) async {
|
||||
// await CRUD().post(
|
||||
// link: AppLink.updateTesterApp, payload: {'appPlatform': appPlatform});
|
||||
// }
|
||||
|
||||
void saveAgreementTerms() {
|
||||
box.write(BoxName.agreeTerms, 'agreed');
|
||||
@@ -362,7 +364,7 @@ class LoginController extends GetxController {
|
||||
// var token = await CRUD().get(link: AppLink.getTokens, payload: {
|
||||
// 'passengerID': box.read(BoxName.passengerID).toString()
|
||||
// });
|
||||
await updateAppTester(AppInformation.appName);
|
||||
// await updateAppTester(AppInformation.appName);
|
||||
|
||||
Get.offAll(() => const MapPagePassenger());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user