code updated in-progress

merge-update-with-lab-changes
Sultan khan 2 years ago
parent 6a6ac76973
commit c63a1fadf5

@ -28,7 +28,7 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'https://webservices.hmg.com/'; // var BASE_URL = 'https://webservices.hmg.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLsProductDetailService
// var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -81,7 +81,7 @@ class _MyApp extends State<MyApp> {
PlatformBridge.init(context); PlatformBridge.init(context);
LocalNotification.init(onNotificationClick: (payload) { LocalNotification.init(onNotificationClick: (payload) {
LocalNotification.getInstance().showNow(title: "Payload", subtitle: payload, payload: payload); LocalNotification.getInstance()?.showNow(title: "Payload", subtitle: payload, payload: payload);
}); });
// SystemChrome.setPreferredOrientations([ // SystemChrome.setPreferredOrientations([

@ -1,6 +1,4 @@
import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
@ -28,10 +26,10 @@ class DoctorsListService extends BaseService {
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
double lat; late double lat;
double long; late double long;
String deviceToken; late String deviceToken;
String tokenID; late String tokenID;
List<LaserBodyPart> selectedBodyPartList = []; List<LaserBodyPart> selectedBodyPartList = [];
Future<Map> getDoctorsList(int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async { Future<Map> getDoctorsList(int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async {
@ -92,8 +90,8 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorsListByName(String docName, BuildContext context) async { Future<Map> getDoctorsListByName(String docName, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
double lat; late double lat;
double long; late double long;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -257,7 +255,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context, [ProjectViewModel projectViewModel]) async { Future<Map> getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context, [ProjectViewModel? projectViewModel]) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
@ -281,7 +279,7 @@ class DoctorsListService extends BaseService {
}; };
if (clinicID == 253) { if (clinicID == 253) {
List<String> procedureID = projectViewModel.selectedBodyPartList.map((element) => element.id.toString()).toList(); List<String> procedureID = projectViewModel!.selectedBodyPartList.map((element) => element.id.toString()).toList();
request["GeneralProcedureList"] = procedureID; request["GeneralProcedureList"] = procedureID;
if (procedureID.length == 1 && procedureID[0] == "1") { if (procedureID.length == 1 && procedureID[0] == "1") {
request["ProcedureSlotDuration"] = 90; request["ProcedureSlotDuration"] = 90;
@ -799,7 +797,7 @@ class DoctorsListService extends BaseService {
"IsForLiveCare": appo.isLiveCareAppointment, "IsForLiveCare": appo.isLiveCareAppointment,
"OriginalClinicID": appo.originalClinicID, "OriginalClinicID": appo.originalClinicID,
"OriginalProjectID": appo.originalProjectID, "OriginalProjectID": appo.originalProjectID,
"StrAppointmentDate": DateUtil.getDateFormatted(appo.appointmentDate), "StrAppointmentDate": DateUtil.getDateFormatted(appo.appointmentDate!),
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2, "LanguageID": languageID == 'ar' ? 1 : 2,
@ -1306,7 +1304,7 @@ class DoctorsListService extends BaseService {
"ListPrescriptions": prescriptionReportEnhList, "ListPrescriptions": prescriptionReportEnhList,
"PatientIditificationNum": authUser.patientIdentificationNo, "PatientIditificationNum": authUser.patientIdentificationNo,
"PatientMobileNumber": authUser.mobileNumber, "PatientMobileNumber": authUser.mobileNumber,
"PatientName": authUser.firstName + " " + authUser.lastName, "PatientName": authUser.firstName! + " " + authUser.lastName!,
"To": authUser.emailAddress, "To": authUser.emailAddress,
"SetupID": setupId, "SetupID": setupId,
"VersionID": req.VersionID, "VersionID": req.VersionID,
@ -1395,7 +1393,7 @@ class DoctorsListService extends BaseService {
"AccountID": patientID, "AccountID": patientID,
"PaymentAmount": payedAmount, "PaymentAmount": payedAmount,
"NationalityID": null, "NationalityID": null,
"DepositorName": authUser.firstName + " " + authUser.lastName, "DepositorName": authUser.firstName! + " " + authUser.lastName!,
"CreatedBy": 3, "CreatedBy": 3,
"PaymentMethodName": paymentMethodName, "PaymentMethodName": paymentMethodName,
"PaymentReference": paymentReference, "PaymentReference": paymentReference,
@ -1443,7 +1441,7 @@ class DoctorsListService extends BaseService {
"ProjectId": projectID, "ProjectId": projectID,
"PatientId": authUser.patientID, "PatientId": authUser.patientID,
"ClinicId": 10, "ClinicId": 10,
"DepositorName": authUser.firstName + " " + authUser.lastName, "DepositorName": authUser.firstName! + " " + authUser.lastName!,
"MemberId": authUser.patientID, "MemberId": authUser.patientID,
"NationalityID": authUser.nationalityID, "NationalityID": authUser.nationalityID,
"PaymentAmount": payedAmount, "PaymentAmount": payedAmount,
@ -1487,7 +1485,7 @@ class DoctorsListService extends BaseService {
"PatientId": authUser.patientID, "PatientId": authUser.patientID,
"ClinicId": 10, "ClinicId": 10,
"FormId": 15, "FormId": 15,
"DepositorName": authUser.firstName + " " + authUser.lastName, "DepositorName": authUser.firstName! + " " + authUser.lastName!,
"MemberId": authUser.patientID, "MemberId": authUser.patientID,
"NationalityID": authUser.nationalityID, "NationalityID": authUser.nationalityID,
"PaymentAmount": payedAmount, "PaymentAmount": payedAmount,
@ -1604,14 +1602,14 @@ class DoctorsListService extends BaseService {
"apple_signature": applePayRequest.appleSignature, "apple_signature": applePayRequest.appleSignature,
"apple_header": { "apple_header": {
"apple_applicationData": "76a9a9cb2d9811e8de56d8e7713601bfa6acda3d488b1cf03b9b115bc3ff12b4", "apple_applicationData": "76a9a9cb2d9811e8de56d8e7713601bfa6acda3d488b1cf03b9b115bc3ff12b4",
"apple_ephemeralPublicKey": applePayRequest.appleHeader.appleEphemeralPublicKey, "apple_ephemeralPublicKey": applePayRequest.appleHeader!.appleEphemeralPublicKey!,
"apple_publicKeyHash": applePayRequest.appleHeader.applePublicKeyHash, "apple_publicKeyHash": applePayRequest.appleHeader!.applePublicKeyHash!,
"apple_transactionId": applePayRequest.appleHeader.appleTransactionId "apple_transactionId": applePayRequest.appleHeader!.appleTransactionId
}, },
"apple_paymentMethod": { "apple_paymentMethod": {
"apple_displayName": applePayRequest.applePaymentMethod.appleDisplayName, "apple_displayName": applePayRequest.applePaymentMethod!.appleDisplayName,
"apple_network": applePayRequest.applePaymentMethod.appleNetwork, "apple_network": applePayRequest.applePaymentMethod!.appleNetwork,
"apple_type": applePayRequest.applePaymentMethod.appleType "apple_type": applePayRequest.applePaymentMethod!.appleType
} }
}; };
dynamic localRes; dynamic localRes;
@ -1808,7 +1806,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> logDoctorFreeSlots(int docID, int clinicID, int projectID, List<dynamic> selectedfreeSlots, dynamic appoNumber, BuildContext context, [ProjectViewModel projectViewModel]) async { Future<Map> logDoctorFreeSlots(int docID, int clinicID, int projectID, List<dynamic> selectedfreeSlots, dynamic appoNumber, BuildContext context, [ProjectViewModel? projectViewModel]) async {
Map<String, dynamic> requestFreeSlots; Map<String, dynamic> requestFreeSlots;
Map<String, dynamic> request; Map<String, dynamic> request;

@ -122,12 +122,12 @@ class AuthProvider with ChangeNotifier {
var imei = await sharedPref.getString(PUSH_TOKEN); var imei = await sharedPref.getString(PUSH_TOKEN);
// if (!request.) { // if (!request.) {
newRequest.iMEI = imei; //imei!=null ? imei : ''; newRequest.iMEI = imei; //imei!=null ? imei : '';
newRequest.firstName = request.firstName ?? "" + " " + request.lastName ?? ""; newRequest.firstName = request.firstName ?? "" + " " + request.lastName! ?? "";
newRequest.firstNameN = request.firstNameN ?? "" + " " + request.lastNameN ?? ""; newRequest.firstNameN = request.firstNameN ?? "" + " " + request.lastNameN! ?? "";
newRequest.lastNameN = request.lastNameN ?? ""; newRequest.lastNameN = request.lastNameN ?? "";
newRequest.outSA = request.outSA == 1 ? true : false; newRequest.outSA = request.outSA == 1 ? true : false;
newRequest.biometricEnabled = false; newRequest.biometricEnabled = false;
newRequest.preferredLanguage = int.parse(request.preferredLanguage) ?? 1; newRequest.preferredLanguage = int.parse(request.preferredLanguage!) ?? 1;
newRequest.logInTypeID = lastLogin ?? 1; newRequest.logInTypeID = lastLogin ?? 1;
newRequest.patientID = request.patientID; newRequest.patientID = request.patientID;
newRequest.mobileNo = request.mobileNumber; newRequest.mobileNo = request.mobileNumber;
@ -373,14 +373,14 @@ class AuthProvider with ChangeNotifier {
request['LogInTokenID'] = await sharedPref.getString(LOGIN_TOKEN_ID); request['LogInTokenID'] = await sharedPref.getString(LOGIN_TOKEN_ID);
var nhic = await sharedPref.getObject(NHIC_DATA); var nhic = await sharedPref.getObject(NHIC_DATA);
var requestN = RegisterUserRequest.fromJson(request); var requestN = RegisterUserRequest.fromJson(request);
requestN.patientOutSA = requestN.patientobject.patientOutSA; requestN.patientOutSA = requestN.patientobject!.patientOutSA!;
final DateFormat dateFormat = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat = DateFormat('MM/dd/yyyy');
final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy');
if(nhic !=null) { if(nhic !=null) {
requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format( requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(
dateFormat.parse(nhic['DateOfBirth'])); dateFormat.parse(nhic['DateOfBirth']));
requestN.isHijri = nhic['IsHijri'] ? 1 : 0; requestN.isHijri = nhic['IsHijri'] ? 1 : 0;
requestN.healthId = requestN.patientobject.eHealthIDField; requestN.healthId = requestN.patientobject!.eHealthIDField!;
} }
requestN.zipCode = requestN.patientOutSA == 1 ? '971' : '966'; requestN.zipCode = requestN.patientOutSA == 1 ? '971' : '966';
@ -407,7 +407,7 @@ class AuthProvider with ChangeNotifier {
request.deviceToken = deviceToken; request.deviceToken = deviceToken;
request.voipToken = ""; //this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false); request.voipToken = ""; //this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false);
request.deviceType = Platform.isIOS ? "1" : "2"; request.deviceType = Platform.isIOS ? "1" : "2";
request.patientMobileNumber = user.mobileNumber[0] == '0' ? user.mobileNumber : '0' + user.mobileNumber; request.patientMobileNumber = user.mobileNumber![0] == '0' ? user.mobileNumber : '0' + user.mobileNumber!;
request.nationalID = user.patientIdentificationNo; request.nationalID = user.patientIdentificationNo;
request.gender = user.gender; request.gender = user.gender;
request.patientID = user.patientID; request.patientID = user.patientID;
@ -416,7 +416,7 @@ class AuthProvider with ChangeNotifier {
request.mACAddress = '00:00:00:00:00:00'; request.mACAddress = '00:00:00:00:00:00';
request.latitude = lat; request.latitude = lat;
request.longitude = long; request.longitude = long;
request.languageID = int.parse(user.preferredLanguage); request.languageID = int.parse(user.preferredLanguage!);
request.patientTypeID = user.patientType; request.patientTypeID = user.patientType;
request.patientType = user.patientType; request.patientType = user.patientType;
dynamic localRes; dynamic localRes;
@ -566,7 +566,7 @@ class AuthProvider with ChangeNotifier {
await authenticatedUserObject.getUser(); await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false; Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false;
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false); var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
model.setState(0, false, null); model.setState(0, false, "");
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
} }
} }

@ -14,8 +14,8 @@ class ClinicListService extends BaseService {
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
double lat; late double lat;
double long; late double long;
Future<Map> getClinicsList(context) async { Future<Map> getClinicsList(context) async {
Map<String, dynamic> request; Map<String, dynamic> request;

@ -34,7 +34,7 @@ class FamilyFilesProvider with ChangeNotifier {
bool isLogin = false; bool isLogin = false;
bool isLoading = true; bool isLoading = true;
dynamic authenticatedUser; dynamic authenticatedUser;
GetAllSharedRecordsByStatusResponse allSharedRecordsByStatusResponse; GetAllSharedRecordsByStatusResponse? allSharedRecordsByStatusResponse;
Future<GetAllSharedRecordsByStatusResponse> getSharedRecordByStatus() async { Future<GetAllSharedRecordsByStatusResponse> getSharedRecordByStatus() async {
dynamic localRes; dynamic localRes;
@ -241,7 +241,7 @@ class FamilyFilesProvider with ChangeNotifier {
request['PatientOutSA'] = currentUser.outSA; //currentUser.outSA; //? 1 : 0; request['PatientOutSA'] = currentUser.outSA; //currentUser.outSA; //? 1 : 0;
request['LoginType'] = await sharedPref.getInt(LAST_LOGIN) ?? 1; request['LoginType'] = await sharedPref.getInt(LAST_LOGIN) ?? 1;
request['MobileNo'] = currentUser.mobileNumber[0].toString() == "0" ? currentUser.mobileNumber.toString() : '0' + currentUser.mobileNumber.toString(); request['MobileNo'] = currentUser.mobileNumber![0].toString() == "0" ? currentUser.mobileNumber.toString() : '0' + currentUser.mobileNumber.toString();
request['PatientMobileNumber'] = currentUser.mobileNumber; //['MobileNumber']; request['PatientMobileNumber'] = currentUser.mobileNumber; //['MobileNumber'];
request['SearchType'] = 2; request['SearchType'] = 2;
// request['SuperUser'] = currentUser.patientID; //currentUser.PatientID; // request['SuperUser'] = currentUser.patientID; //currentUser.PatientID;

@ -203,7 +203,7 @@ class LiveCareService extends BaseService {
Future<Map> addNewCallForPatientER(int serviceID, String clientRequestID, bool isPharma, BuildContext context) async { Future<Map> addNewCallForPatientER(int serviceID, String clientRequestID, bool isPharma, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
String deviceToken; String? deviceToken;
String voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN); String voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
getDeviceToken().then((value) { getDeviceToken().then((value) {
print(value); print(value);
@ -219,7 +219,7 @@ class LiveCareService extends BaseService {
"IsPharmacy": isPharma, "IsPharmacy": isPharma,
"ErServiceID": serviceID, "ErServiceID": serviceID,
"ClientRequestID": clientRequestID, "ClientRequestID": clientRequestID,
"DeviceToken": deviceToken, "DeviceToken": deviceToken!,
"VoipToken": voipToken, "VoipToken": voipToken,
"IsFlutter": true, "IsFlutter": true,
"Latitude": await this.sharedPref.getDouble(USER_LAT), "Latitude": await this.sharedPref.getDouble(USER_LAT),

@ -100,7 +100,7 @@ class MyInvoicesService extends BaseService {
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"License": true, "License": true,
"AppointmentNo": appoNo, "AppointmentNo": appoNo,
"To": authProvider.authenticatedUserObject.user.emailAddress, "To": authProvider.authenticatedUserObject.user!.emailAddress,
"IsRegistered": true, "IsRegistered": true,
"ProjectID": projectID, "ProjectID": projectID,
"PatientTypeID": authUser.patientIdentificationType, "PatientTypeID": authUser.patientIdentificationType,

@ -8,7 +8,7 @@ import 'package:geolocator/geolocator.dart' as geo;
class PermissionService extends BaseService { class PermissionService extends BaseService {
final LocalStorage storage = new LocalStorage("permission"); final LocalStorage storage = new LocalStorage("permission");
geo.LocationPermission locationPermission; geo.LocationPermission? locationPermission;
AppGlobal appGlobal = new AppGlobal(); AppGlobal appGlobal = new AppGlobal();
setVibrationPermission(flag) async { setVibrationPermission(flag) async {
@ -25,7 +25,7 @@ class PermissionService extends BaseService {
vibrate(callback, context) async { vibrate(callback, context) async {
if (callback == null) return null; if (callback == null) return null;
if (isVibrationEnabled() == true) { if (isVibrationEnabled() == true) {
if (await Vibration.hasVibrator()) { if (await Vibration.hasVibrator() !=null) {
Vibration.vibrate(duration: 100); Vibration.vibrate(duration: 100);
callback(); callback();
} }

@ -49,8 +49,8 @@ class BrandsService extends BaseService {
}); });
} }
Future searchProducts({String productName}) async { Future searchProducts({String? productName}) async {
RegExp exp = new RegExp(productName.toUpperCase()); RegExp exp = new RegExp(productName!.toUpperCase());
hasError = false; hasError = false;
_searchList.clear(); _searchList.clear();
await baseAppClient.getPharmacy( await baseAppClient.getPharmacy(

@ -10,7 +10,7 @@ import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'
class PharmacyAddressService extends BaseService { class PharmacyAddressService extends BaseService {
List<AddressInfo> addresses =[]; List<AddressInfo> addresses =[];
CountryData country; CountryData? country;
int selectedAddressIndex = 0; int selectedAddressIndex = 0;
Future<List<AddressInfo>> getAddresses() async { Future<List<AddressInfo>> getAddresses() async {
@ -18,7 +18,7 @@ class PharmacyAddressService extends BaseService {
var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID); var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
Map<String, String> queryParams = {'fields': 'addresses'}; Map<String, String> queryParams = {'fields': 'addresses'};
hasError = false; hasError = false;
Addresses selectedAddress; Addresses? selectedAddress;
try { try {
var completer = Completer(); var completer = Completer();
@ -31,7 +31,7 @@ class PharmacyAddressService extends BaseService {
int index = 0; int index = 0;
response['customers'][0]['addresses'].forEach((item) { response['customers'][0]['addresses'].forEach((item) {
AddressInfo address = AddressInfo.fromJson(item); AddressInfo address = AddressInfo.fromJson(item);
if (selectedAddress != null && selectedAddress.id == item["id"]) { if (selectedAddress! != null && selectedAddress!.id == item["id"]) {
selectedAddressIndex = index; selectedAddressIndex = index;
} }
addresses.add(address); addresses.add(address);

@ -12,19 +12,19 @@ import 'package:diplomaticquarterapp/uitl/utils.dart';
class ProductDetailService extends BaseService { class ProductDetailService extends BaseService {
bool isLogin = false; bool isLogin = false;
num _stockQuantity; num? _stockQuantity;
num get stockQuantity => _stockQuantity; num? get stockQuantity => _stockQuantity;
String _stockAvailability; String? _stockAvailability;
String _stockAvailabilityn; String? _stockAvailabilityn;
String get stockAvailability => _stockAvailability; String? get stockAvailability => _stockAvailability;
String get stockAvailabilityn => _stockAvailabilityn; String? get stockAvailabilityn => _stockAvailabilityn;
bool _isStockAvailable; bool? _isStockAvailable;
bool get isStockAvailable => _isStockAvailable; bool? get isStockAvailable => _isStockAvailable;
List<ProductDetail> _productDetailList =[]; List<ProductDetail> _productDetailList =[];

@ -30,7 +30,7 @@ defaultTheme({fontName}) {
scaffoldBackgroundColor: Color(0xffF8F8F8), scaffoldBackgroundColor: Color(0xffF8F8F8),
canvasColor: Colors.white, canvasColor: Colors.white,
backgroundColor: Color.fromRGBO(255, 255, 255, 1), backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100]!.withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Color(0xff515A5D), primaryColor: Color(0xff515A5D),
toggleableActiveColor: secondaryColor, toggleableActiveColor: secondaryColor,
@ -76,7 +76,7 @@ invertThemes({fontName}) {
scaffoldBackgroundColor: Color(0xff000000), scaffoldBackgroundColor: Color(0xff000000),
canvasColor: Colors.black, canvasColor: Colors.black,
backgroundColor: Color.fromRGBO(255, 255, 255, 1), backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100]!.withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Color(0xff515A5D), primaryColor: Color(0xff515A5D),
toggleableActiveColor: secondaryColor, toggleableActiveColor: secondaryColor,
@ -126,7 +126,7 @@ bwThemes({fontName}) {
scaffoldBackgroundColor: Color(0xffffffe4), scaffoldBackgroundColor: Color(0xffffffe4),
canvasColor: Colors.black, canvasColor: Colors.black,
backgroundColor: Color(0xffffffe4), backgroundColor: Color(0xffffffe4),
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100]!.withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Color(0xfffffff4), primaryColor: Color(0xfffffff4),
toggleableActiveColor: secondaryColor, toggleableActiveColor: secondaryColor,
@ -163,7 +163,7 @@ dimTheme({fontName}) {
scaffoldBackgroundColor: Color(0xffEEEEEE), scaffoldBackgroundColor: Color(0xffEEEEEE),
canvasColor: Colors.white, canvasColor: Colors.white,
backgroundColor: Color.fromRGBO(255, 255, 255, 1), backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100]!.withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Color(0xff40ACC9), primaryColor: Color(0xff40ACC9),
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),

@ -19,7 +19,7 @@ class CalendarUtils {
_completer = Completer<CalendarUtils>(); _completer = Completer<CalendarUtils>();
try { try {
final calendarsResult = await deviceCalendarPlugin.retrieveCalendars(); final calendarsResult = await deviceCalendarPlugin.retrieveCalendars();
_completer?.complete(CalendarUtils._(calendarsResult?.data!)); _completer?.complete(CalendarUtils._(calendarsResult?.data! as List<Calendar>));
} on Exception catch (e) { } on Exception catch (e) {
_completer!.completeError(e); _completer!.completeError(e);
final Future<CalendarUtils> sharedPrefsFuture = _completer!.future; final Future<CalendarUtils> sharedPrefsFuture = _completer!.future;
@ -30,15 +30,15 @@ class CalendarUtils {
return _completer!.future; return _completer!.future;
} }
Future createOrUpdateEvents({List<DateTime> scheduleList, String title, String description, List<DateTime> scheduleDateTime, List<DayOfWeek> daysOfWeek}) async { Future createOrUpdateEvents({List<DateTime>? scheduleList, String? title, String? description, List<DateTime>? scheduleDateTime, List<DayOfWeek>? daysOfWeek}) async {
List<Event> events =[]; List<Event> events =[];
scheduleDateTime.forEach((element) { scheduleDateTime!.forEach((element) {
RecurrenceRule recurrenceRule = RecurrenceRule( RecurrenceRule recurrenceRule = RecurrenceRule(
RecurrenceFrequency.Daily, RecurrenceFrequency.Daily,
daysOfWeek: daysOfWeek, daysOfWeek: daysOfWeek,
endDate: element, endDate: element,
); );
Event event = Event(writableCalendars.id, recurrenceRule: recurrenceRule, start: element, end: element.add(Duration(minutes: 30)), title: title, description: description); Event event = Event(writableCalendars!.id, recurrenceRule: recurrenceRule, start: element, end: element.add(Duration(minutes: 30)), title: title, description: description);
events.add(event); events.add(event);
}); });
@ -47,7 +47,7 @@ class CalendarUtils {
}); });
} }
Future createOrUpdateEvent({String title, String description, DateTime scheduleDateTime, String eventId}) async { Future createOrUpdateEvent({String? title, String? description, DateTime? scheduleDateTime, String? eventId}) async {
RecurrenceRule recurrenceRule = RecurrenceRule( RecurrenceRule recurrenceRule = RecurrenceRule(
RecurrenceFrequency.Daily, RecurrenceFrequency.Daily,
// daysOfWeek: daysOfWeek, // daysOfWeek: daysOfWeek,
@ -60,17 +60,17 @@ class CalendarUtils {
else else
_currentLocation = getLocation('Asia/Riyadh'); _currentLocation = getLocation('Asia/Riyadh');
TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime, _currentLocation); TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime!, _currentLocation);
// print("eventId: " + eventId); // print("eventId: " + eventId);
// print("writableCalendars-name: " + writableCalendars.name); // print("writableCalendars-name: " + writableCalendars.name);
// print("writableCalendars-Id: " + writableCalendars.id); // print("writableCalendars-Id: " + writableCalendars.id);
// print("writableCalendarsToString: " + writableCalendars.toString()); // print("writableCalendarsToString: " + writableCalendars.toString());
Event event = Event(writableCalendars.id, start: scheduleDateTimeUTZ, end: scheduleDateTimeUTZ.add(Duration(minutes: 30)), title: title, description: description); Event event = Event(writableCalendars!.id, start: scheduleDateTimeUTZ, end: scheduleDateTimeUTZ.add(Duration(minutes: 30)), title: title, description: description);
deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e) { deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e) {
print("catchError " + e.toString()); print("catchError " + e.toString());
}).whenComplete(() { }).whenComplete(() {
print("whenComplete " + eventId); print("whenComplete " + eventId!);
}); });
} }
@ -87,8 +87,8 @@ class CalendarUtils {
Future createCalendar( Future createCalendar(
String calendarName, { String calendarName, {
Color calendarColor, Color? calendarColor,
String localAccountName, String? localAccountName,
}) async { }) async {
return await deviceCalendarPlugin.createCalendar(calendarName, calendarColor: calendarColor, localAccountName: localAccountName); return await deviceCalendarPlugin.createCalendar(calendarName, calendarColor: calendarColor, localAccountName: localAccountName);
} }

@ -4,7 +4,7 @@ import 'package:shared_preferences/shared_preferences.dart';
class AppSharedPreferences { class AppSharedPreferences {
Future<SharedPreferences> _prefs = SharedPreferences.getInstance(); Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
Map<String, dynamic> _allData; late Map<String, dynamic> _allData;
// To Test Saved Data // To Test Saved Data
Future<Map<String, dynamic>> getAll() async{ Future<Map<String, dynamic>> getAll() async{
@ -75,7 +75,7 @@ class AppSharedPreferences {
getStringWithDefaultValue(String key, String defaultVal) async { getStringWithDefaultValue(String key, String defaultVal) async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;
await prefs.reload(); await prefs.reload();
String value = prefs.getString(key); String? value = prefs.getString(key);
return value == null ? defaultVal : value; return value == null ? defaultVal : value;
} }

@ -5,44 +5,44 @@ import 'package:fluttertoast/fluttertoast.dart';
class AppToast { class AppToast {
static void showToast({ static void showToast({
@required String message, required String message,
Toast toastLength, Toast? toastLength,
int timeInSeconds, int? timeInSeconds,
double fontSize, double? fontSize,
ToastGravity toastGravity, ToastGravity? toastGravity,
Color backgroundColor, Color? backgroundColor,
Color textColor, Color? textColor,
int radius, int? radius,
int elevation, int? elevation,
int imageSize, int? imageSize,
}) { }) {
Fluttertoast.showToast( Fluttertoast.showToast(
msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: backgroundColor, textColor: textColor, fontSize: fontSize); msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds!, backgroundColor: backgroundColor, textColor: textColor, fontSize: fontSize);
} }
static void showSuccessToast({ static void showSuccessToast({
@required String message, required String message,
Toast toastLength = Toast.LENGTH_LONG, Toast toastLength = Toast.LENGTH_LONG,
int timeInSeconds, int? timeInSeconds,
double fontSize = 16, double fontSize = 16,
ToastGravity toastGravity = ToastGravity.TOP, ToastGravity toastGravity = ToastGravity.TOP,
Color textColor = Colors.white, Color textColor = Colors.white,
int radius, int? radius,
int elevation, int? elevation,
int imageSize = 32, int imageSize = 32,
}) { }) {
Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.green, textColor: textColor, fontSize: fontSize); Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds!, backgroundColor: Colors.green, textColor: textColor, fontSize: fontSize);
} }
static void showErrorToast({ static void showErrorToast({
@required String message, required String message,
Toast toastLength = Toast.LENGTH_LONG, Toast toastLength = Toast.LENGTH_LONG,
int timeInSeconds = 2, int timeInSeconds = 2,
double fontSize = 16, double fontSize = 16,
ToastGravity toastGravity = ToastGravity.TOP, ToastGravity toastGravity = ToastGravity.TOP,
Color textColor = Colors.white, Color textColor = Colors.white,
int radius = 15, int radius = 15,
int elevation, int? elevation,
int imageSize = 32, int imageSize = 32,
}) { }) {
Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.red, textColor: textColor, fontSize: fontSize); Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.red, textColor: textColor, fontSize: fontSize);

@ -387,7 +387,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(22) ? Navigator.push(context, FadePage(page: InsuranceCard())) : null, onTap: () => projectViewModel.havePrivilege(22) ? Navigator.push(context, FadePage(page: InsuranceCard(appointmentNo: 0,))) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insurance, title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card.svg', imagePath: 'insurance_card.svg',
@ -408,7 +408,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null, onTap: () => projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval(appointmentNo: 0,))) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insuranceApproval, title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approval.svg', imagePath: 'insurance_approval.svg',

@ -349,7 +349,7 @@ class _SearchBot extends State<BottomBarSearch> {
break; break;
case '12': case '12':
{ {
Navigator.push(context, FadePage(page: InsuranceApproval())); Navigator.push(context, FadePage(page: InsuranceApproval(appointmentNo: 0,)));
} }
break; break;
case '13': case '13':

@ -460,7 +460,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
break; break;
case '12': case '12':
{ {
Navigator.push(context, FadePage(page: InsuranceApproval())); Navigator.push(context, FadePage(page: InsuranceApproval(appointmentNo: 0,)));
} }
break; break;
case '13': case '13':

Loading…
Cancel
Save