12/24/1
This commit is contained in:
109
lib/controller/admin/captain_admin_controller.dart
Normal file
109
lib/controller/admin/captain_admin_controller.dart
Normal file
@@ -0,0 +1,109 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:local_auth/local_auth.dart';
|
||||
|
||||
import '../../constant/colors.dart';
|
||||
import '../../constant/links.dart';
|
||||
import '../functions/crud.dart';
|
||||
|
||||
class CaptainAdminController extends GetxController {
|
||||
bool isLoading = false;
|
||||
Map captainData = {};
|
||||
Map captain = {};
|
||||
final captainController = TextEditingController();
|
||||
final captainPrizeController = TextEditingController();
|
||||
final titleNotify = TextEditingController();
|
||||
final bodyNotify = TextEditingController();
|
||||
final formCaptainKey = GlobalKey<FormState>();
|
||||
final formCaptainPrizeKey = GlobalKey<FormState>();
|
||||
|
||||
Future getCaptainCount() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().get(link: AppLink.getCaptainDetails, payload: {});
|
||||
var d = jsonDecode(res);
|
||||
if (d['status'] == 'success') {
|
||||
captainData = d;
|
||||
print(captainData);
|
||||
}
|
||||
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
Future addCaptainPrizeToWallet() async {
|
||||
String? paymentId;
|
||||
//todo link to add wallet to captain
|
||||
for (var i = 0; i < captainData['message'].length; i++) {
|
||||
await CRUD().post(link: AppLink.addDriverPaymentPoints, payload: {
|
||||
'driverID': captainData['message'][i]['id'],
|
||||
'amount': captainPrizeController.text,
|
||||
'paymentMethod': 'Prize',
|
||||
}).then((value) {
|
||||
paymentId = value['message'].toString();
|
||||
});
|
||||
await CRUD().post(link: AppLink.addPassengersWallet, payload: {
|
||||
'driverID': captainData['message'][i]['id'],
|
||||
'amount': captainPrizeController.text,
|
||||
'paymentMethod': 'Prize',
|
||||
'paymentID': paymentId.toString(),
|
||||
});
|
||||
}
|
||||
|
||||
Get.back();
|
||||
}
|
||||
|
||||
void addCaptainsPrizeToWalletSecure() async {
|
||||
try {
|
||||
// Check if local authentication is available
|
||||
bool isAvailable = await LocalAuthentication().isDeviceSupported();
|
||||
if (isAvailable) {
|
||||
// Authenticate the user
|
||||
bool didAuthenticate = await LocalAuthentication().authenticate(
|
||||
localizedReason: 'Use Touch ID or Face ID to confirm payment',
|
||||
);
|
||||
if (didAuthenticate) {
|
||||
// User authenticated successfully, proceed with payment
|
||||
await addCaptainPrizeToWallet();
|
||||
Get.snackbar('Prize Added', '', backgroundColor: AppColor.greenColor);
|
||||
} else {
|
||||
// Authentication failed, handle accordingly
|
||||
Get.snackbar('Authentication failed', '',
|
||||
backgroundColor: AppColor.redColor);
|
||||
// print(
|
||||
// 'Authentication failed');
|
||||
}
|
||||
} else {
|
||||
// Local authentication not available, proceed with payment without authentication
|
||||
await addCaptainPrizeToWallet();
|
||||
Get.snackbar('Prize Added', '', backgroundColor: AppColor.greenColor);
|
||||
}
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
Future getCaptains() async {
|
||||
var res = await CRUD()
|
||||
.get(link: AppLink.getCaptainDetailsByEmailOrIDOrPhone, payload: {
|
||||
'driver_id': captainController.text,
|
||||
'driverEmail': captainController.text,
|
||||
'driverPhone': captainController.text,
|
||||
});
|
||||
var d = jsonDecode(res);
|
||||
// print(d['message']);
|
||||
if (d['status'] == 'success') {
|
||||
captain = d;
|
||||
}
|
||||
// print(passengers);
|
||||
update();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
getCaptainCount();
|
||||
super.onInit();
|
||||
}
|
||||
}
|
||||
110
lib/controller/admin/passenger_admin_controller.dart
Normal file
110
lib/controller/admin/passenger_admin_controller.dart
Normal file
@@ -0,0 +1,110 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:local_auth/local_auth.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/links.dart';
|
||||
import 'package:ride/controller/functions/crud.dart';
|
||||
|
||||
class PassengerAdminController extends GetxController {
|
||||
bool isLoading = false;
|
||||
Map passengersData = {};
|
||||
Map passengers = {};
|
||||
double height = 150;
|
||||
final formPassKey = GlobalKey<FormState>();
|
||||
final formPrizeKey = GlobalKey<FormState>();
|
||||
final titleNotify = TextEditingController();
|
||||
final bodyNotify = TextEditingController();
|
||||
final passengerController = TextEditingController();
|
||||
final passengerPrizeController = TextEditingController();
|
||||
|
||||
Future getPassengerCount() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().get(link: AppLink.getPassengerDetails, payload: {});
|
||||
var d = jsonDecode(res);
|
||||
if (d['status'] == 'success') {
|
||||
passengersData = d;
|
||||
}
|
||||
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
Future addPassengerPrizeToWallet() async {
|
||||
for (var i = 0; i < passengersData['message'].length; i++) {
|
||||
await CRUD().post(link: AppLink.addPassengersWallet, payload: {
|
||||
'passenger_id': passengersData['message'][i]['id'],
|
||||
'balance': passengerPrizeController.text,
|
||||
});
|
||||
}
|
||||
|
||||
Get.back();
|
||||
}
|
||||
|
||||
void addPassengerPrizeToWalletSecure() async {
|
||||
try {
|
||||
// Check if local authentication is available
|
||||
bool isAvailable = await LocalAuthentication().isDeviceSupported();
|
||||
if (isAvailable) {
|
||||
// Authenticate the user
|
||||
bool didAuthenticate = await LocalAuthentication().authenticate(
|
||||
localizedReason: 'Use Touch ID or Face ID to confirm payment',
|
||||
);
|
||||
if (didAuthenticate) {
|
||||
// User authenticated successfully, proceed with payment
|
||||
await addPassengerPrizeToWallet();
|
||||
Get.snackbar('Prize Added', '', backgroundColor: AppColor.greenColor);
|
||||
} else {
|
||||
// Authentication failed, handle accordingly
|
||||
Get.snackbar('Authentication failed', '',
|
||||
backgroundColor: AppColor.redColor);
|
||||
// print(
|
||||
// 'Authentication failed');
|
||||
}
|
||||
} else {
|
||||
// Local authentication not available, proceed with payment without authentication
|
||||
await addPassengerPrizeToWallet();
|
||||
Get.snackbar('Prize Added', '', backgroundColor: AppColor.greenColor);
|
||||
}
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
Future getPassengers() async {
|
||||
var res = await CRUD().get(link: AppLink.getPassengerbyEmail, payload: {
|
||||
'passengerEmail': passengerController.text,
|
||||
'passengerId': passengerController.text,
|
||||
'passengerphone': passengerController.text,
|
||||
});
|
||||
var d = jsonDecode(res);
|
||||
// print(d['message']);
|
||||
if (d['status'] == 'success') {
|
||||
passengers = d;
|
||||
}
|
||||
// print(passengers);
|
||||
update();
|
||||
}
|
||||
|
||||
changeHeight() {
|
||||
if (passengers.isEmpty) {
|
||||
height = 0;
|
||||
update();
|
||||
}
|
||||
height = 150;
|
||||
update();
|
||||
}
|
||||
|
||||
void clearPlaces() {
|
||||
passengers = {};
|
||||
update();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
getPassengerCount();
|
||||
super.onInit();
|
||||
}
|
||||
}
|
||||
50
lib/controller/admin/ride_admin_controller.dart
Normal file
50
lib/controller/admin/ride_admin_controller.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/links.dart';
|
||||
import 'package:ride/controller/functions/crud.dart';
|
||||
|
||||
import '../../models/model/admin/monthly_ride.dart';
|
||||
|
||||
class RideAdminController extends GetxController {
|
||||
bool isLoading = false;
|
||||
late List<RideData> rideData;
|
||||
late Map<String, dynamic> jsonResponse;
|
||||
List<dynamic> ridesDetails = [];
|
||||
var chartData;
|
||||
Future getRidesAdminDash() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().get(link: AppLink.getRidesPerMonth, payload: {});
|
||||
jsonResponse = jsonDecode(res);
|
||||
rideData = (jsonResponse['message'] as List)
|
||||
.map((item) => RideData.fromJson(item))
|
||||
.toList();
|
||||
|
||||
chartData = rideData
|
||||
.map((data) => FlSpot(data.day.toDouble(), data.ridesCount.toDouble()))
|
||||
.toList();
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
Future<void> getRidesDetails() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().get(link: AppLink.getRidesDetails, payload: {});
|
||||
|
||||
var d = jsonDecode(res);
|
||||
ridesDetails = d['message'];
|
||||
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
getRidesAdminDash();
|
||||
getRidesDetails();
|
||||
super.onInit();
|
||||
}
|
||||
}
|
||||
@@ -52,13 +52,13 @@ class CarRegistrationRecognizerController extends GetxController {
|
||||
],
|
||||
uiSettings: [
|
||||
AndroidUiSettings(
|
||||
toolbarTitle: 'Cropper',
|
||||
toolbarTitle: 'Cropper'.tr,
|
||||
toolbarColor: AppColor.blueColor,
|
||||
toolbarWidgetColor: AppColor.yellowColor,
|
||||
initAspectRatio: CropAspectRatioPreset.original,
|
||||
lockAspectRatio: false),
|
||||
IOSUiSettings(
|
||||
title: 'Cropper',
|
||||
title: 'Cropper'.tr,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -12,11 +12,17 @@ import 'package:ride/main.dart';
|
||||
import 'package:ride/views/auth/verify_email_page.dart';
|
||||
import 'package:ride/views/home/map_page_passenger.dart';
|
||||
|
||||
import '../../views/admin/admin_home_page.dart';
|
||||
import '../functions/device_info.dart';
|
||||
|
||||
class LoginController extends GetxController {
|
||||
final formKey = GlobalKey<FormState>();
|
||||
final formKeyAdmin = GlobalKey<FormState>();
|
||||
TextEditingController emailController = TextEditingController();
|
||||
TextEditingController phoneController = TextEditingController();
|
||||
TextEditingController passwordController = TextEditingController();
|
||||
TextEditingController adminPasswordController = TextEditingController();
|
||||
TextEditingController adminNameController = TextEditingController();
|
||||
bool isAgreeTerms = false;
|
||||
bool isloading = false;
|
||||
final FlutterSecureStorage _storage = const FlutterSecureStorage();
|
||||
@@ -32,6 +38,17 @@ class LoginController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
void adminDashboardOpen() async {
|
||||
if (formKeyAdmin.currentState!.validate()) {
|
||||
await DeviceInfoPlus.getDeviceInfo();
|
||||
print(DeviceInfoPlus.deviceData);
|
||||
if (DeviceInfoPlus.deviceData['model'] == 'Nokia 6.1 Plus') {
|
||||
Get.back();
|
||||
Get.to(() => AdminHomePage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void login() async {
|
||||
isloading = true;
|
||||
update();
|
||||
|
||||
@@ -96,7 +96,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
} else {
|
||||
box.write(BoxName.tokenFCM, token);
|
||||
}
|
||||
// print(token);
|
||||
print(token);
|
||||
});
|
||||
|
||||
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
||||
|
||||
@@ -28,11 +28,11 @@ class CRUD {
|
||||
);
|
||||
print("-----request----" + response.request.toString());
|
||||
// print("-----headers-----" + response.headers.toString());
|
||||
print("-----payload-----" + payload.toString());
|
||||
// print("-----payload-----" + payload.toString());
|
||||
if (response.statusCode == 200) {
|
||||
var jsonData = jsonDecode(response.body);
|
||||
if (jsonData['status'] == 'success') {
|
||||
print(jsonData);
|
||||
// print(jsonData);
|
||||
|
||||
return response.body;
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ import 'dart:io';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
|
||||
class DeviceInfoPlus {
|
||||
static Map<String, dynamic> deviceData = {};
|
||||
static Future<Map<String, dynamic>> getDeviceInfo() async {
|
||||
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
|
||||
Map<String, dynamic> deviceData = {};
|
||||
|
||||
try {
|
||||
if (Platform.isAndroid) {
|
||||
|
||||
247
lib/controller/functions/gemeni.dart
Normal file
247
lib/controller/functions/gemeni.dart
Normal file
@@ -0,0 +1,247 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:image_cropper/image_cropper.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:image/image.dart' as img;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
import '../../constant/api_key.dart';
|
||||
import '../../constant/colors.dart';
|
||||
|
||||
class ContentController extends GetxController {
|
||||
final picker = ImagePicker();
|
||||
bool isloading = false;
|
||||
var image;
|
||||
CroppedFile? croppedFile;
|
||||
|
||||
Future<void> pickImage() async {
|
||||
final pickedImage = await picker.pickImage(source: ImageSource.gallery);
|
||||
|
||||
if (pickedImage != null) {
|
||||
image = File(pickedImage.path);
|
||||
// Crop the image
|
||||
croppedFile = await ImageCropper().cropImage(
|
||||
sourcePath: image!.path,
|
||||
aspectRatioPresets: [
|
||||
CropAspectRatioPreset.square,
|
||||
CropAspectRatioPreset.ratio3x2,
|
||||
CropAspectRatioPreset.original,
|
||||
CropAspectRatioPreset.ratio4x3,
|
||||
CropAspectRatioPreset.ratio16x9
|
||||
],
|
||||
uiSettings: [
|
||||
AndroidUiSettings(
|
||||
toolbarTitle: 'Cropper'.tr,
|
||||
toolbarColor: AppColor.blueColor,
|
||||
toolbarWidgetColor: AppColor.yellowColor,
|
||||
initAspectRatio: CropAspectRatioPreset.original,
|
||||
lockAspectRatio: false),
|
||||
IOSUiSettings(
|
||||
title: 'Cropper'.tr,
|
||||
),
|
||||
],
|
||||
);
|
||||
// image = croppedFile;
|
||||
|
||||
// Resize the image
|
||||
final rawImage =
|
||||
img.decodeImage(File(croppedFile!.path).readAsBytesSync());
|
||||
final resizedImage =
|
||||
img.copyResize(rawImage!, width: 800); // Adjust the width as needed
|
||||
|
||||
final appDir = await getTemporaryDirectory();
|
||||
final resizedImagePath = '${appDir.path}/resized_image.jpg';
|
||||
|
||||
final resizedImageFile = File(resizedImagePath);
|
||||
resizedImageFile.writeAsBytesSync(
|
||||
img.encodeJpg(resizedImage)); // Save the resized image as JPEG
|
||||
|
||||
image = resizedImageFile;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> generateContent() async {
|
||||
await pickImage();
|
||||
if (image != null) {
|
||||
final imageBytes = await image.readAsBytes();
|
||||
final imageData = base64Encode(imageBytes);
|
||||
|
||||
var requestBody = jsonEncode({
|
||||
'contents': [
|
||||
{
|
||||
'parts': [
|
||||
{
|
||||
'inlineData': {
|
||||
'mimeType': 'image/jpeg',
|
||||
'data': imageData,
|
||||
},
|
||||
},
|
||||
{
|
||||
'text':
|
||||
'write json for all data as first name ,last name,dob,licenseID,expiration date,issued date asdress class type ,output json type',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
'generationConfig': {
|
||||
'temperature': 0.4,
|
||||
'topK': 32,
|
||||
'topP': 1,
|
||||
'maxOutputTokens': 4096,
|
||||
'stopSequences': [],
|
||||
},
|
||||
'safetySettings': [
|
||||
{
|
||||
'category': 'HARM_CATEGORY_HARASSMENT',
|
||||
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||
},
|
||||
{
|
||||
'category': 'HARM_CATEGORY_HATE_SPEECH',
|
||||
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||
},
|
||||
{
|
||||
'category': 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
|
||||
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||
},
|
||||
{
|
||||
'category': 'HARM_CATEGORY_DANGEROUS_CONTENT',
|
||||
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||
},
|
||||
],
|
||||
});
|
||||
print(requestBody);
|
||||
|
||||
final response = await http.post(
|
||||
Uri.parse(
|
||||
'https://generativelanguage.googleapis.com/v1beta/models/gemini-pro-vision:generateContent?key=${AK.geminiApi}'),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: requestBody,
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
var responseData = jsonDecode(response.body);
|
||||
// Process the responseData as needed
|
||||
// print(responseData);
|
||||
|
||||
var result =
|
||||
responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||
// print(jsonEncode(result));
|
||||
// print((result));
|
||||
// print(result['dob']);
|
||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||
String? jsonString =
|
||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||
|
||||
if (jsonString != null) {
|
||||
// Convert the JSON object to a String
|
||||
jsonString = jsonEncode(json.decode(jsonString));
|
||||
print(jsonString);
|
||||
} else {
|
||||
print("JSON string not found");
|
||||
}
|
||||
|
||||
// Rest of your code...
|
||||
} else {
|
||||
print('Request failed with status: ${response.statusCode}');
|
||||
print('Request failed with status: ${response.body}');
|
||||
}
|
||||
} else {
|
||||
print('No image selected');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> getFromCarRegistration() async {
|
||||
await pickImage();
|
||||
if (image != null) {
|
||||
final imageBytes = await image.readAsBytes();
|
||||
final imageData = base64Encode(imageBytes);
|
||||
|
||||
var requestBody = jsonEncode({
|
||||
'contents': [
|
||||
{
|
||||
'parts': [
|
||||
{
|
||||
'inlineData': {
|
||||
'mimeType': 'image/jpeg',
|
||||
'data': imageData,
|
||||
},
|
||||
},
|
||||
{
|
||||
'text':
|
||||
'write output json from image for[ vin, make, model, year, expiration_date, color, owner, registration_date ],output json type ',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
'generationConfig': {
|
||||
'temperature': 0.4,
|
||||
'topK': 32,
|
||||
'topP': 1,
|
||||
'maxOutputTokens': 4096,
|
||||
'stopSequences': [],
|
||||
},
|
||||
'safetySettings': [
|
||||
{
|
||||
'category': 'HARM_CATEGORY_HARASSMENT',
|
||||
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||
},
|
||||
{
|
||||
'category': 'HARM_CATEGORY_HATE_SPEECH',
|
||||
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||
},
|
||||
{
|
||||
'category': 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
|
||||
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||
},
|
||||
{
|
||||
'category': 'HARM_CATEGORY_DANGEROUS_CONTENT',
|
||||
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||
},
|
||||
],
|
||||
});
|
||||
print(requestBody);
|
||||
|
||||
final response = await http.post(
|
||||
Uri.parse(
|
||||
'https://generativelanguage.googleapis.com/v1beta/models/gemini-pro-vision:generateContent?key=${AK.geminiApi}'),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: requestBody,
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
var responseData = jsonDecode(response.body);
|
||||
// Process the responseData as needed
|
||||
var result =
|
||||
responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||
print(result);
|
||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||
String? jsonString =
|
||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||
|
||||
if (jsonString != null) {
|
||||
// Convert the JSON object to a String
|
||||
jsonString = jsonEncode(json.decode(jsonString));
|
||||
print(jsonString);
|
||||
} else {
|
||||
print("JSON string not found");
|
||||
}
|
||||
|
||||
// Rest of your code...
|
||||
} else {
|
||||
print('Request failed with status: ${response.statusCode}');
|
||||
print('Request failed with status: ${response.body}');
|
||||
}
|
||||
} else {
|
||||
print('No image selected');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// generateContent();
|
||||
super.onInit();
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ class LlamaAi {
|
||||
print(true);
|
||||
Map exrtatDataFinal = {};
|
||||
String oneLine = input.replaceAll('\n', ' ');
|
||||
// var res = await CRUD().getLlama(link: AppLink.gemini, payload: oneLine);
|
||||
var res = await CRUD().getLlama(link: AppLink.llama, payload: oneLine);
|
||||
var decod = jsonDecode(res);
|
||||
// print(decod);
|
||||
|
||||
@@ -1215,12 +1215,20 @@ class MapPassengerController extends GetxController {
|
||||
// );
|
||||
}
|
||||
|
||||
addToken() async {
|
||||
await CRUD().post(link: AppLink.addTokens, payload: {
|
||||
'token': box.read(BoxName.tokenFCM),
|
||||
'passengerID': box.read(BoxName.passengerID).toString()
|
||||
}).then((value) => print('cccc'));
|
||||
}
|
||||
|
||||
List<LatLng> polylineCoordinate = [];
|
||||
String? cardNumber;
|
||||
@override
|
||||
void onInit() async {
|
||||
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
||||
await getLocation();
|
||||
await addToken();
|
||||
await getCarsLocationByPassenger();
|
||||
getNearestDriverByPassengerLocation();
|
||||
addCustomPicker();
|
||||
|
||||
Reference in New Issue
Block a user