This commit is contained in:
Hamza-Ayed
2023-12-26 16:31:14 +03:00
parent 027d248e56
commit b96275ac8b
4 changed files with 24 additions and 13 deletions

View File

@@ -41,11 +41,17 @@ class LoginController extends GetxController {
void adminDashboardOpen() async { void adminDashboardOpen() async {
if (formKeyAdmin.currentState!.validate()) { if (formKeyAdmin.currentState!.validate()) {
await DeviceInfoPlus.getDeviceInfo(); await DeviceInfoPlus.getDeviceInfo();
print(DeviceInfoPlus.deviceData); print(DeviceInfoPlus.deviceData['serialNumber']);
if (DeviceInfoPlus.deviceData['model'] == 'Nokia 6.1 Plus') { var res = await CRUD().get(link: AppLink.getAdminUser, payload: {
'device_number': DeviceInfoPlus.deviceData['serialNumber'].toString(),
});
var d = jsonDecode(res);
// print(d);
// if (DeviceInfoPlus.deviceData['serialNumber'] ==
// d['message']['device_number']) {
Get.back(); Get.back();
Get.to(() => AdminHomePage()); Get.to(() => AdminHomePage());
} // }
} }
} }

View File

@@ -1070,8 +1070,9 @@ class MapPassengerController extends GetxController {
newTime = currentTime.add(durationToAdd); newTime = currentTime.add(durationToAdd);
averageDuration = duration / distance; averageDuration = duration / distance;
costDuration = duration * averageDuration * 0.016; costDuration = duration * averageDuration * 0.016;
totalDriver = cost + costDuration; var totalDriver1 = cost + costDuration;
totalPassenger = totalDriver + (totalDriver * .16); totalPassenger = totalDriver1 + (totalDriver1 * .16);
totalDriver = totalDriver1 + (totalDriver1 * .16);
tax = totalPassenger * .04; tax = totalPassenger * .04;
totalME = totalPassenger - totalDriver - tax; totalME = totalPassenger - totalDriver - tax;
update(); update();
@@ -1123,12 +1124,12 @@ class MapPassengerController extends GetxController {
totalPassenger = 1; totalPassenger = 1;
update(); update();
if (totalDriver < .5) { if (totalDriver < .5) {
totalDriver = .85; totalDriver = .80;
totalME = .11; totalME = .16;
update(); update();
} else { } else {
totalDriver = .95; totalDriver = .90;
totalME = .05; totalME = .06;
update(); update();
} }
} }

View File

@@ -34,7 +34,8 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await GetStorage.init(); await GetStorage.init();
await AC().gAK(); await AC().gAK();
print(
'local is ${WidgetsBinding.instance.platformDispatcher.locale.countryCode}');
Stripe.publishableKey = AK.publishableKey; Stripe.publishableKey = AK.publishableKey;
//StripeKey.publishableKey; //StripeKey.publishableKey;

View File

@@ -66,7 +66,10 @@ class LoginPage extends StatelessWidget {
), ),
); );
}, },
child: const Icon(Icons.dashboard)), child: const Icon(
Icons.dashboard,
color: AppColor.redColor,
)),
body: [ body: [
if (box.read(BoxName.agreeTerms) != 'agreed') if (box.read(BoxName.agreeTerms) != 'agreed')
agreedPage() agreedPage()