models updates -> 3.13.6

dev_v3.13.6_voipcall
devamirsaleemahmad 1 year ago
parent 50816d452e
commit 9c2948db29

@ -1,3 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
final Color? secondaryColor = Colors.red[800]; final Color? secondaryColor = Colors.red[800];
final Color? dividerColor = Colors.grey[600];

@ -112,8 +112,8 @@ class Appointment {
} }
// R024.1 // R024.1
book_appointment_time_selection({required String appointment_type, required DateTime dateTime, required DoctorList doctor}) { book_appointment_time_selection({required String appointment_type, required DateTime? dateTime, required DoctorList doctor}) {
final day = DateUtil.getWeekDay(dateTime.weekday); final day = DateUtil.getWeekDay(dateTime!.weekday);
final hour = DateFormat('HH').format(dateTime); final hour = DateFormat('HH').format(dateTime);
logger('book_appointment_time_selection', parameters: { logger('book_appointment_time_selection', parameters: {
'appointment_type': appointment_type, 'appointment_type': appointment_type,

@ -153,7 +153,7 @@ class H2OViewModel extends BaseViewModel {
Future insertUserActivity(InsertUserActivityRequestModel insertUserActivityRequestModel) async { Future insertUserActivity(InsertUserActivityRequestModel insertUserActivityRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
insertUserActivityRequestModel.mobileNumber = user!.mobileNumber.substring(1); insertUserActivityRequestModel.mobileNumber = user!.mobileNumber!.substring(1);
insertUserActivityRequestModel.identificationNo = user!.patientIdentificationNo; insertUserActivityRequestModel.identificationNo = user!.patientIdentificationNo;
await _h2OService.insertUserActivity(insertUserActivityRequestModel); await _h2OService.insertUserActivity(insertUserActivityRequestModel);

@ -47,8 +47,8 @@ class EReferralViewModel extends BaseViewModel {
void getAllProjects() async { void getAllProjects() async {
} }
//Changed By Aamir into Future<void>
void sendActivationCodeForEReferral(SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel) async { Future<void> sendActivationCodeForEReferral(SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _eReferralService.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); await _eReferralService.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
if (_eReferralService.hasError) { if (_eReferralService.hasError) {
@ -69,8 +69,8 @@ class EReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
//Changed by Aamir to Future
void createEReferral( Future<void> createEReferral(
CreateEReferralRequestModel createEReferralRequestModel) async { CreateEReferralRequestModel createEReferralRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _eReferralService.createEReferral(createEReferralRequestModel); await _eReferralService.createEReferral(createEReferralRequestModel);

@ -143,7 +143,7 @@ class MyBalanceViewModel extends BaseViewModel {
} }
Future checkActivationCodeForAdvancePayment( Future checkActivationCodeForAdvancePayment(
{required String activationCode, required String patientMobileNumber}) async { {required String activationCode, String? patientMobileNumber}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _myBalanceService.checkActivationCodeForAdvancePayment( await _myBalanceService.checkActivationCodeForAdvancePayment(
activationCode: activationCode); activationCode: activationCode);

@ -1,9 +1,9 @@
class healthData { class healthData {
int MedCategoryID; int? MedCategoryID;
int MedSubCategoryID; int? MedSubCategoryID;
String MachineDate; String? MachineDate;
double Value; double? Value;
int TransactionsListID; int? TransactionsListID;
healthData({ healthData({
this.MedCategoryID, this.MedCategoryID,

@ -1,8 +1,8 @@
class WeeklyHeartRateResModel { class WeeklyHeartRateResModel {
num valueAvg; num? valueAvg;
String machineDate; String? machineDate;
int medCategoryID; int? medCategoryID;
int patientID; int? patientID;
WeeklyHeartRateResModel( WeeklyHeartRateResModel(
{this.valueAvg, this.machineDate, this.medCategoryID, this.patientID}); {this.valueAvg, this.machineDate, this.medCategoryID, this.patientID});

@ -1,14 +1,14 @@
class WeeklyStepsResModel { class WeeklyStepsResModel {
int iD; int? iD;
int patientID; int? patientID;
int medCategoryID; int? medCategoryID;
int medSubCategoryID; int? medSubCategoryID;
num value; num? value;
String machineDate; String? machineDate;
bool patientOutSA; bool? patientOutSA;
dynamic notes; dynamic notes;
bool isActive; bool? isActive;
String createdOn; String? createdOn;
WeeklyStepsResModel({this.iD, this.patientID, this.medCategoryID, this.medSubCategoryID, this.value, this.machineDate, this.patientOutSA, this.notes, this.isActive, this.createdOn}); WeeklyStepsResModel({this.iD, this.patientID, this.medCategoryID, this.medSubCategoryID, this.value, this.machineDate, this.patientOutSA, this.notes, this.isActive, this.createdOn});
@ -17,7 +17,7 @@ class WeeklyStepsResModel {
patientID = json['PatientID']; patientID = json['PatientID'];
medCategoryID = json['MedCategoryID']; medCategoryID = json['MedCategoryID'];
medSubCategoryID = json['MedSubCategoryID']; medSubCategoryID = json['MedSubCategoryID'];
value = json['Value'] != null ? num.tryParse(json['Value']).toInt() : 0; value = json['Value'] != null ? num.tryParse(json['Value'])!.toInt() : 0;
machineDate = json['MachineDate']; machineDate = json['MachineDate'];
patientOutSA = json['PatientOutSA']; patientOutSA = json['PatientOutSA'];
notes = json['Notes']; notes = json['Notes'];

@ -1,10 +1,10 @@
class YearlyHeartRateResModel { class YearlyHeartRateResModel {
num valueAvg; num? valueAvg;
int medCategoryID; int? medCategoryID;
int month; int? month;
String monthName; String? monthName;
int patientID; int? patientID;
int year; int? year;
YearlyHeartRateResModel( YearlyHeartRateResModel(
{this.valueAvg, {this.valueAvg,

@ -1,10 +1,10 @@
class YearlyStepsResModel { class YearlyStepsResModel {
num valueSum; num? valueSum;
int medCategoryID; int? medCategoryID;
int month; int? month;
String monthName; String? monthName;
int patientID; int? patientID;
int year; int? year;
YearlyStepsResModel( YearlyStepsResModel(
{this.valueSum, {this.valueSum,
@ -21,7 +21,7 @@ class YearlyStepsResModel {
monthName = json['MonthName']; monthName = json['MonthName'];
patientID = json['PatientID']; patientID = json['PatientID'];
year = json['Year']; year = json['Year'];
valueSum = valueSum != null ? valueSum.toInt() : valueSum; valueSum = valueSum != null ? valueSum!.toInt() : valueSum;
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {

@ -1,22 +1,22 @@
class ApplePayRequest { class ApplePayRequest {
String currency; String? currency;
String language; String? language;
String customername; String? customername;
dynamic customerEmail; dynamic customerEmail;
String orderdescription; String? orderdescription;
String liveServiceid; String? liveServiceid;
dynamic longitude; dynamic longitude;
dynamic latitude; dynamic latitude;
String devicetoken; String? devicetoken;
String clientrequestid; String? clientrequestid;
String projectid; String? projectid;
String serviceid; String? serviceid;
String patientid; String? patientid;
String amount; String? amount;
String appleData; String? appleData;
String appleSignature; String? appleSignature;
AppleHeader appleHeader; AppleHeader? appleHeader;
ApplePaymentMethod applePaymentMethod; ApplePaymentMethod? applePaymentMethod;
ApplePayRequest( ApplePayRequest(
{this.currency, {this.currency,
@ -78,20 +78,20 @@ class ApplePayRequest {
data['apple_data'] = this.appleData; data['apple_data'] = this.appleData;
data['apple_signature'] = this.appleSignature; data['apple_signature'] = this.appleSignature;
if (this.appleHeader != null) { if (this.appleHeader != null) {
data['apple_header'] = this.appleHeader.toJson(); data['apple_header'] = this.appleHeader!.toJson();
} }
if (this.applePaymentMethod != null) { if (this.applePaymentMethod != null) {
data['apple_paymentMethod'] = this.applePaymentMethod.toJson(); data['apple_paymentMethod'] = this.applePaymentMethod!.toJson();
} }
return data; return data;
} }
} }
class AppleHeader { class AppleHeader {
String appleApplicationData; String? appleApplicationData;
String appleEphemeralPublicKey; String? appleEphemeralPublicKey;
String applePublicKeyHash; String? applePublicKeyHash;
String appleTransactionId; String? appleTransactionId;
AppleHeader({this.appleApplicationData, this.appleEphemeralPublicKey, this.applePublicKeyHash, this.appleTransactionId}); AppleHeader({this.appleApplicationData, this.appleEphemeralPublicKey, this.applePublicKeyHash, this.appleTransactionId});
@ -113,9 +113,9 @@ class AppleHeader {
} }
class ApplePaymentMethod { class ApplePaymentMethod {
String appleDisplayName; String? appleDisplayName;
String appleNetwork; String? appleNetwork;
String appleType; String? appleType;
ApplePaymentMethod({this.appleDisplayName, this.appleNetwork, this.appleType}); ApplePaymentMethod({this.appleDisplayName, this.appleNetwork, this.appleType});

@ -1,11 +1,11 @@
import 'dart:convert'; import 'dart:convert';
class ApplePayResponse { class ApplePayResponse {
PaymentMethod paymentMethod; PaymentMethod? paymentMethod;
dynamic billingContact; dynamic billingContact;
dynamic shippingMethod; dynamic shippingMethod;
dynamic shippingContact; dynamic shippingContact;
Token token; Token? token;
ApplePayResponse( ApplePayResponse(
{this.paymentMethod, {this.paymentMethod,
@ -27,13 +27,13 @@ class ApplePayResponse {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.paymentMethod != null) { if (this.paymentMethod != null) {
data['paymentMethod'] = this.paymentMethod.toJson(); data['paymentMethod'] = this.paymentMethod!.toJson();
} }
data['billingContact'] = this.billingContact; data['billingContact'] = this.billingContact;
data['shippingMethod'] = this.shippingMethod; data['shippingMethod'] = this.shippingMethod;
data['shippingContact'] = this.shippingContact; data['shippingContact'] = this.shippingContact;
if (this.token != null) { if (this.token != null) {
data['token'] = this.token.toJson(); data['token'] = this.token!.toJson();
} }
return data; return data;
} }
@ -62,10 +62,10 @@ class PaymentMethod {
} }
class Token { class Token {
String version; String? version;
String data; String? data;
String signature; String? signature;
Header header; Header? header;
Token({this.version, this.data, this.signature, this.header}); Token({this.version, this.data, this.signature, this.header});
@ -83,16 +83,16 @@ class Token {
data['data'] = this.data; data['data'] = this.data;
data['signature'] = this.signature; data['signature'] = this.signature;
if (this.header != null) { if (this.header != null) {
data['header'] = this.header.toJson(); data['header'] = this.header!.toJson();
} }
return data; return data;
} }
} }
class Header { class Header {
String ephemeralPublicKey; String? ephemeralPublicKey;
String publicKeyHash; String? publicKeyHash;
String transactionId; String? transactionId;
Header({this.ephemeralPublicKey, this.publicKeyHash, this.transactionId}); Header({this.ephemeralPublicKey, this.publicKeyHash, this.transactionId});

@ -10,26 +10,26 @@ class GradientColor {
List<GradientColor> bannerColor = [ List<GradientColor> bannerColor = [
new GradientColor(Color(0xFFF2B353E), Color(0xFFF71787E)), new GradientColor(Color(0xFFF2B353E), Color(0xFFF71787E)),
new GradientColor(Color(0xFFFD02127), Color(0xFFFEE6161)), new GradientColor(Color(0xFFFD02127), Color(0xFFFEE6161)),
new GradientColor(Colors.blue[700], Colors.blue[400]), new GradientColor(Colors.blue[700]!, Colors.blue[400]!),
new GradientColor(Colors.yellow[700], Colors.yellow), new GradientColor(Colors.yellow[700]!, Colors.yellow),
new GradientColor(Colors.orange[800], Colors.orange), new GradientColor(Colors.orange[800]!, Colors.orange),
new GradientColor(Colors.green[800], Colors.green[500]), new GradientColor(Colors.green[800]!, Colors.green[500]!),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
new GradientColor(Colors.brown[700], Colors.brown), new GradientColor(Colors.brown[700]!, Colors.brown),
]; ];

@ -15,5 +15,5 @@ class HeaderModel {
String email; String email;
HeaderModel(this.doctorName, this.doctorId, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate, HeaderModel(this.doctorName, this.doctorId, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate,
this.actualDoctorRate, this.totalReviews, this.email, {this.decimalDoctorRate = null}); this.actualDoctorRate, this.totalReviews, this.email, {this.decimalDoctorRate = ""});
} }

@ -16,10 +16,10 @@
// } // }
class Countries { class Countries {
String name; String? name;
String nameAr; String? nameAr;
String code; String? code;
String countryCode; String? countryCode;
Countries({this.name, this.nameAr, this.code, this.countryCode}); Countries({this.name, this.nameAr, this.code, this.countryCode});

@ -35,7 +35,7 @@ class Wishlist {
dynamic languageId; dynamic languageId;
dynamic id; dynamic id;
List<dynamic> productAttributes; List<dynamic>? productAttributes;
dynamic customerEnteredPrice; dynamic customerEnteredPrice;
dynamic quantity; dynamic quantity;
dynamic discountAmountInclTax; dynamic discountAmountInclTax;
@ -53,7 +53,7 @@ class Wishlist {
dynamic productId; dynamic productId;
dynamic product; dynamic product;
dynamic customerId; dynamic customerId;
Customer customer; Customer? customer;
factory Wishlist.fromJson(Map<String, dynamic> json) => Wishlist( factory Wishlist.fromJson(Map<String, dynamic> json) => Wishlist(
languageId: json["language_id"], languageId: json["language_id"],
@ -82,7 +82,7 @@ class Wishlist {
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"language_id": languageId, "language_id": languageId,
"id": id, "id": id,
"product_attributes": List<dynamic>.from(productAttributes.map((x) => x)), "product_attributes": List<dynamic>.from(productAttributes!.map((x) => x)),
"customer_entered_price": customerEnteredPrice, "customer_entered_price": customerEnteredPrice,
"quantity": quantity, "quantity": quantity,
"discount_amount_incl_tax": discountAmountInclTax, "discount_amount_incl_tax": discountAmountInclTax,
@ -100,7 +100,7 @@ class Wishlist {
"product_id": productId, "product_id": productId,
"product": product.toJson(), "product": product.toJson(),
"customer_id": customerId, "customer_id": customerId,
"customer": customer.toJson(), "customer": customer!.toJson(),
}; };
} }
@ -130,28 +130,28 @@ class Customer {
this.roleIds, this.roleIds,
}); });
Address billingAddress; Address? billingAddress;
Address shippingAddress; Address? shippingAddress;
List<Address> addresses; List<Address>? addresses;
String id; String? id;
String username; String? username;
String email; String? email;
dynamic firstName; dynamic firstName;
dynamic lastName; dynamic lastName;
dynamic languageId; dynamic languageId;
dynamic adminComment; dynamic adminComment;
bool isTaxExempt; bool? isTaxExempt;
bool hasShoppingCartItems; bool? hasShoppingCartItems;
bool active; bool? active;
bool deleted; bool? deleted;
bool isSystemAccount; bool? isSystemAccount;
dynamic systemName; dynamic systemName;
String lastIpAddress; String? lastIpAddress;
DateTime createdOnUtc; DateTime? createdOnUtc;
DateTime lastLoginDateUtc; DateTime? lastLoginDateUtc;
DateTime lastActivityDateUtc; DateTime? lastActivityDateUtc;
dynamic registeredInStoreId; dynamic registeredInStoreId;
List<dynamic> roleIds; List<dynamic>? roleIds;
factory Customer.fromJson(Map<String, dynamic> json) => Customer( factory Customer.fromJson(Map<String, dynamic> json) => Customer(
billingAddress: Address.fromJson(json["billing_address"]), billingAddress: Address.fromJson(json["billing_address"]),
@ -179,9 +179,9 @@ class Customer {
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"billing_address": billingAddress.toJson(), "billing_address": billingAddress!.toJson(),
"shipping_address": shippingAddress.toJson(), "shipping_address": shippingAddress!.toJson(),
"addresses": List<dynamic>.from(addresses.map((x) => x.toJson())), "addresses": List<dynamic>.from(addresses!.map((x) => x.toJson())),
"id": id, "id": id,
"username": username, "username": username,
"email": email, "email": email,
@ -196,11 +196,11 @@ class Customer {
"is_system_account": isSystemAccount, "is_system_account": isSystemAccount,
"system_name": systemName, "system_name": systemName,
"last_ip_address": lastIpAddress, "last_ip_address": lastIpAddress,
"created_on_utc": createdOnUtc.toIso8601String(), "created_on_utc": createdOnUtc!.toIso8601String(),
"last_login_date_utc": lastLoginDateUtc.toIso8601String(), "last_login_date_utc": lastLoginDateUtc!.toIso8601String(),
"last_activity_date_utc": lastActivityDateUtc.toIso8601String(), "last_activity_date_utc": lastActivityDateUtc!.toIso8601String(),
"registered_in_store_id": registeredInStoreId, "registered_in_store_id": registeredInStoreId,
"role_ids": List<dynamic>.from(roleIds.map((x) => x)), "role_ids": List<dynamic>.from(roleIds!.map((x) => x)),
}; };
} }
@ -226,35 +226,35 @@ class Address {
this.latLong, this.latLong,
}); });
String id; String? id;
FirstName firstName; FirstName? firstName;
LastName lastName; LastName? lastName;
Email email; Email? email;
dynamic company; dynamic company;
dynamic countryId; dynamic countryId;
Country country; Country? country;
dynamic stateProvinceId; dynamic stateProvinceId;
City city; City? city;
String address1; String? address1;
String address2; String? address2;
String zipPostalCode; String? zipPostalCode;
String phoneNumber; String? phoneNumber;
dynamic faxNumber; dynamic faxNumber;
String customerAttributes; String? customerAttributes;
DateTime createdOnUtc; DateTime? createdOnUtc;
dynamic province; dynamic province;
String latLong; String? latLong;
factory Address.fromJson(Map<String, dynamic> json) => Address( factory Address.fromJson(Map<String, dynamic> json) => Address(
id: json["id"], id: json["id"],
firstName: firstNameValues.map[json["first_name"]], firstName: firstNameValues.map![json["first_name"]],
lastName: lastNameValues.map[json["last_name"]], lastName: lastNameValues.map![json["last_name"]],
email: emailValues.map[json["email"]], email: emailValues.map![json["email"]],
company: json["company"], company: json["company"],
countryId: json["country_id"], countryId: json["country_id"],
country: countryValues.map[json["country"]], country: countryValues.map![json["country"]],
stateProvinceId: json["state_province_id"], stateProvinceId: json["state_province_id"],
city: cityValues.map[json["city"]], city: cityValues.map![json["city"]],
address1: json["address1"], address1: json["address1"],
address2: json["address2"], address2: json["address2"],
zipPostalCode: json["zip_postal_code"], zipPostalCode: json["zip_postal_code"],
@ -282,7 +282,7 @@ class Address {
"phone_number": phoneNumber, "phone_number": phoneNumber,
"fax_number": faxNumber, "fax_number": faxNumber,
"customer_attributes": customerAttributes, "customer_attributes": customerAttributes,
"created_on_utc": createdOnUtc.toIso8601String(), "created_on_utc": createdOnUtc!.toIso8601String(),
"province": province, "province": province,
"lat_long": latLong, "lat_long": latLong,
}; };
@ -437,117 +437,117 @@ class Product {
this.seName, this.seName,
}); });
String id; String? id;
bool visibleIndividually; bool? visibleIndividually;
String name; String? name;
String namen; String? namen;
List<LocalizedName> localizedNames; List<LocalizedName>? localizedNames;
String shortDescription; String? shortDescription;
String shortDescriptionn; String? shortDescriptionn;
String fullDescription; String? fullDescription;
String fullDescriptionn; String? fullDescriptionn;
bool markasNew; bool? markasNew;
bool showOnHomePage; bool? showOnHomePage;
// dynamic metaKeywords; // dynamic metaKeywords;
// dynamic metaDescription; // dynamic metaDescription;
// dynamic metaTitle; // dynamic metaTitle;
bool allowCustomerReviews; bool? allowCustomerReviews;
dynamic approvedRatingSum; dynamic approvedRatingSum;
dynamic notApprovedRatingSum; dynamic notApprovedRatingSum;
dynamic approvedTotalReviews; dynamic approvedTotalReviews;
dynamic notApprovedTotalReviews; dynamic notApprovedTotalReviews;
String sku; String? sku;
bool isRx; bool? isRx;
bool prescriptionRequired; bool? prescriptionRequired;
dynamic rxMessage; dynamic rxMessage;
dynamic rxMessagen; dynamic rxMessagen;
// dynamic manufacturerPartNumber; // dynamic manufacturerPartNumber;
// dynamic gtin; // dynamic gtin;
bool isGiftCard; bool? isGiftCard;
bool requireOtherProducts; bool? requireOtherProducts;
bool automaticallyAddRequiredProducts; bool? automaticallyAddRequiredProducts;
bool isDownload; bool? isDownload;
bool unlimitedDownloads; bool? unlimitedDownloads;
dynamic maxNumberOfDownloads; dynamic maxNumberOfDownloads;
// dynamic downloadExpirationDays; // dynamic downloadExpirationDays;
bool hasSampleDownload; bool? hasSampleDownload;
bool hasUserAgreement; bool? hasUserAgreement;
bool isRecurring; bool? isRecurring;
dynamic recurringCycleLength; dynamic recurringCycleLength;
dynamic recurringTotalCycles; dynamic recurringTotalCycles;
bool isRental; bool? isRental;
dynamic rentalPriceLength; dynamic rentalPriceLength;
bool isShipEnabled; bool? isShipEnabled;
bool isFreeShipping; bool? isFreeShipping;
bool shipSeparately; bool? shipSeparately;
dynamic additionalShippingCharge; dynamic additionalShippingCharge;
bool isTaxExempt; bool? isTaxExempt;
bool isTelecommunicationsOrBroadcastingOrElectronicServices; bool? isTelecommunicationsOrBroadcastingOrElectronicServices;
bool useMultipleWarehouses; bool? useMultipleWarehouses;
dynamic manageInventoryMethodId; dynamic manageInventoryMethodId;
dynamic stockQuantity; dynamic stockQuantity;
String stockAvailability; String? stockAvailability;
String stockAvailabilityn; String? stockAvailabilityn;
bool displayStockAvailability; bool? displayStockAvailability;
bool displayStockQuantity; bool? displayStockQuantity;
dynamic minStockQuantity; dynamic minStockQuantity;
dynamic notifyAdminForQuantityBelow; dynamic notifyAdminForQuantityBelow;
bool allowBackInStockSubscriptions; bool? allowBackInStockSubscriptions;
dynamic orderMinimumQuantity; dynamic orderMinimumQuantity;
dynamic orderMaximumQuantity; dynamic orderMaximumQuantity;
// dynamic allowedQuantities; // dynamic allowedQuantities;
bool allowAddingOnlyExistingAttributeCombinations; bool? allowAddingOnlyExistingAttributeCombinations;
bool disableBuyButton; bool? disableBuyButton;
bool disableWishlistButton; bool? disableWishlistButton;
bool availableForPreOrder; bool? availableForPreOrder;
dynamic preOrderAvailabilityStartDateTimeUtc; dynamic preOrderAvailabilityStartDateTimeUtc;
bool callForPrice; bool? callForPrice;
double price; double? price;
dynamic oldPrice; dynamic oldPrice;
double productCost; double? productCost;
dynamic specialPrice; dynamic specialPrice;
dynamic specialPriceStartDateTimeUtc; dynamic specialPriceStartDateTimeUtc;
dynamic specialPriceEndDateTimeUtc; dynamic specialPriceEndDateTimeUtc;
bool customerEntersPrice; bool? customerEntersPrice;
dynamic minimumCustomerEnteredPrice; dynamic minimumCustomerEnteredPrice;
dynamic maximumCustomerEnteredPrice; dynamic maximumCustomerEnteredPrice;
bool basepriceEnabled; bool? basepriceEnabled;
dynamic basepriceAmount; dynamic basepriceAmount;
dynamic basepriceBaseAmount; dynamic basepriceBaseAmount;
bool hasTierPrices; bool? hasTierPrices;
bool hasDiscountsApplied; bool? hasDiscountsApplied;
dynamic discountName; dynamic discountName;
dynamic discountNamen; dynamic discountNamen;
dynamic discountDescription; dynamic discountDescription;
dynamic discountDescriptionn; dynamic discountDescriptionn;
dynamic discountPercentage; dynamic discountPercentage;
String currency; String? currency;
String currencyn; String? currencyn;
double weight; double? weight;
dynamic length; dynamic length;
dynamic width; dynamic width;
dynamic height; dynamic height;
dynamic availableStartDateTimeUtc; dynamic availableStartDateTimeUtc;
dynamic availableEndDateTimeUtc; dynamic availableEndDateTimeUtc;
dynamic displayOrder; dynamic displayOrder;
bool published; bool? published;
bool deleted; bool? deleted;
DateTime createdOnUtc; DateTime? createdOnUtc;
DateTime updatedOnUtc; DateTime? updatedOnUtc;
String productType; String? productType;
dynamic parentGroupedProductId; dynamic parentGroupedProductId;
List<dynamic> roleIds; List<dynamic>? roleIds;
List<dynamic> discountIds; List<dynamic>? discountIds;
List<dynamic> storeIds; List<dynamic>? storeIds;
List<dynamic> manufacturerIds; List<dynamic>? manufacturerIds;
List<dynamic> reviews; List<dynamic>? reviews;
List<Image> images; List<Image>? images;
List<dynamic> attributes; List<dynamic>? attributes;
List<Specification> specifications; List<Specification>? specifications;
List<dynamic> associatedProductIds; List<dynamic>? associatedProductIds;
List<dynamic> tags; List<dynamic>? tags;
dynamic vendorId; dynamic vendorId;
String seName; String? seName;
factory Product.fromJson(Map<String, dynamic> json) => Product( factory Product.fromJson(Map<String, dynamic> json) => Product(
id: json["id"], id: json["id"],
@ -668,7 +668,7 @@ class Product {
"visible_individually": visibleIndividually, "visible_individually": visibleIndividually,
"name": name, "name": name,
"namen": namen, "namen": namen,
"localized_names": List<dynamic>.from(localizedNames.map((x) => x.toJson())), "localized_names": List<dynamic>.from(localizedNames!.map((x) => x.toJson())),
"short_description": shortDescription, "short_description": shortDescription,
"short_descriptionn": shortDescriptionn, "short_descriptionn": shortDescriptionn,
"full_description": fullDescription, "full_description": fullDescription,
@ -759,20 +759,20 @@ class Product {
"display_order": displayOrder, "display_order": displayOrder,
"published": published, "published": published,
"deleted": deleted, "deleted": deleted,
"created_on_utc": createdOnUtc.toIso8601String(), "created_on_utc": createdOnUtc!.toIso8601String(),
"updated_on_utc": updatedOnUtc.toIso8601String(), "updated_on_utc": updatedOnUtc!.toIso8601String(),
"product_type": productType, "product_type": productType,
"parent_grouped_product_id": parentGroupedProductId, "parent_grouped_product_id": parentGroupedProductId,
"role_ids": List<dynamic>.from(roleIds.map((x) => x)), "role_ids": List<dynamic>.from(roleIds!.map((x) => x)),
"discount_ids": List<dynamic>.from(discountIds.map((x) => x)), "discount_ids": List<dynamic>.from(discountIds!.map((x) => x)),
"store_ids": List<dynamic>.from(storeIds.map((x) => x)), "store_ids": List<dynamic>.from(storeIds!.map((x) => x)),
"manufacturer_ids": List<dynamic>.from(manufacturerIds.map((x) => x)), "manufacturer_ids": List<dynamic>.from(manufacturerIds!.map((x) => x)),
"reviews": List<dynamic>.from(reviews.map((x) => x)), "reviews": List<dynamic>.from(reviews!.map((x) => x)),
"images": List<dynamic>.from(images.map((x) => x.toJson())), "images": List<dynamic>.from(images!.map((x) => x.toJson())),
"attributes": List<dynamic>.from(attributes.map((x) => x)), "attributes": List<dynamic>.from(attributes!.map((x) => x)),
"specifications": List<dynamic>.from(specifications.map((x) => x.toJson())), "specifications": List<dynamic>.from(specifications!.map((x) => x.toJson())),
"associated_product_ids": List<dynamic>.from(associatedProductIds.map((x) => x)), "associated_product_ids": List<dynamic>.from(associatedProductIds!.map((x) => x)),
"tags": List<dynamic>.from(tags.map((x) => x)), "tags": List<dynamic>.from(tags!.map((x) => x)),
"vendor_id": vendorId, "vendor_id": vendorId,
"se_name": seName, "se_name": seName,
}; };
@ -789,9 +789,9 @@ class Image {
dynamic id; dynamic id;
dynamic position; dynamic position;
String src; String? src;
String thumb; String? thumb;
String attachment; String? attachment;
factory Image.fromJson(Map<String, dynamic> json) => Image( factory Image.fromJson(Map<String, dynamic> json) => Image(
id: json["id"], id: json["id"],
@ -817,7 +817,7 @@ class LocalizedName {
}); });
dynamic languageId; dynamic languageId;
String localizedName; String? localizedName;
factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName( factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName(
languageId: json["language_id"], languageId: json["language_id"],
@ -842,10 +842,10 @@ class Specification {
dynamic id; dynamic id;
dynamic displayOrder; dynamic displayOrder;
String defaultValue; String? defaultValue;
String defaultValuen; String? defaultValuen;
String name; String? name;
String nameN; String? nameN;
factory Specification.fromJson(Map<String, dynamic> json) => Specification( factory Specification.fromJson(Map<String, dynamic> json) => Specification(
id: json["id"], id: json["id"],
@ -867,15 +867,15 @@ class Specification {
} }
class EnumValues<T> { class EnumValues<T> {
Map<String, T> map; Map<String, T>? map;
Map<T, String> reverseMap; Map<T, String>? reverseMap;
EnumValues(this.map); EnumValues(this.map);
Map<T, String> get reverse { Map<T, String> get reverse {
if (reverseMap == null) { if (reverseMap == null) {
reverseMap = map.map((k, v) => new MapEntry(v, k)); reverseMap = map!.map((k, v) => new MapEntry(v, k));
} }
return reverseMap; return reverseMap!;
} }
} }

@ -44,7 +44,7 @@ class ShoppingCart {
"subtotal_with_vat": subtotalWithVat, "subtotal_with_vat": subtotalWithVat,
"subtotal_vat_amount": subtotalVatAmount, "subtotal_vat_amount": subtotalVatAmount,
"subtotal_vat_rate": subtotalVatRate, "subtotal_vat_rate": subtotalVatRate,
"shopping_carts": List<dynamic>.from(shoppingCarts.map((x) => x.toJson())), "shopping_carts": List<dynamic>.from(shoppingCarts!.map((x) => x.toJson())),
}; };
} }
@ -287,14 +287,14 @@ class Address {
factory Address.fromJson(Map<String, dynamic> json) => Address( factory Address.fromJson(Map<String, dynamic> json) => Address(
id: json["id"], id: json["id"],
firstName: firstNameValues.map[json["first_name"]], firstName: firstNameValues.map![json["first_name"]],
lastName: lastNameValues.map[json["last_name"]], lastName: lastNameValues.map![json["last_name"]],
email: emailValues.map[json["email"]], email: emailValues.map![json["email"]],
company: json["company"], company: json["company"],
countryId: json["country_id"], countryId: json["country_id"],
country: countryValues.map[json["country"]], country: countryValues.map![json["country"]],
stateProvinceId: json["state_province_id"], stateProvinceId: json["state_province_id"],
city: cityValues.map[json["city"]], city: cityValues.map![json["city"]],
address1: json["address1"], address1: json["address1"],
address2: json["address2"], address2: json["address2"],
zipPostalCode: json["zip_postal_code"], zipPostalCode: json["zip_postal_code"],

@ -30,24 +30,24 @@ class Brand {
this.image, this.image,
}); });
String id; String? id;
String name; String? name;
String namen; String? namen;
List<LocalizedName> localizedNames; List<LocalizedName>? localizedNames;
String description; String? description;
int manufacturerTemplateId; int? manufacturerTemplateId;
String metaKeywords; String? metaKeywords;
dynamic metaDescription; dynamic metaDescription;
dynamic metaTitle; dynamic metaTitle;
int pageSize; int? pageSize;
String pageSizeOptions; String? pageSizeOptions;
dynamic priceRanges; dynamic priceRanges;
bool published; bool? published;
bool deleted; bool? deleted;
int displayOrder; int? displayOrder;
DateTime createdOnUtc; DateTime? createdOnUtc;
DateTime updatedOnUtc; DateTime? updatedOnUtc;
Image image; Image? image;
factory Brand.fromJson(Map<String, dynamic> json) => Brand( factory Brand.fromJson(Map<String, dynamic> json) => Brand(
id: json["id"], id: json["id"],
@ -74,7 +74,7 @@ class Brand {
"id": id, "id": id,
"name": name, "name": name,
"namen": namen, "namen": namen,
"localized_names": List<dynamic>.from(localizedNames.map((x) => x.toJson())), "localized_names": List<dynamic>.from(localizedNames!.map((x) => x.toJson())),
"description": description == null ? null : description, "description": description == null ? null : description,
"manufacturer_template_id": manufacturerTemplateId, "manufacturer_template_id": manufacturerTemplateId,
"meta_keywords": metaKeywords, "meta_keywords": metaKeywords,
@ -86,9 +86,9 @@ class Brand {
"published": published, "published": published,
"deleted": deleted, "deleted": deleted,
"display_order": displayOrder, "display_order": displayOrder,
"created_on_utc": createdOnUtc.toIso8601String(), "created_on_utc": createdOnUtc!.toIso8601String(),
"updated_on_utc": updatedOnUtc.toIso8601String(), "updated_on_utc": updatedOnUtc!.toIso8601String(),
"image": image == null ? null : image.toJson(), "image": image == null ? null : image!.toJson(),
}; };
} }
@ -99,7 +99,7 @@ class Image {
this.attachment, this.attachment,
}); });
String src; String? src;
dynamic thumb; dynamic thumb;
dynamic attachment; dynamic attachment;
@ -122,8 +122,8 @@ class LocalizedName {
this.localizedName, this.localizedName,
}); });
int languageId; int? languageId;
String localizedName; String? localizedName;
factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName( factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName(
languageId: json["language_id"], languageId: json["language_id"],

@ -36,33 +36,33 @@ class LocationModel {
this.sortOrder, this.sortOrder,
}); });
ExpiryDate expiryDate; ExpiryDate? expiryDate;
double sellingPrice; double? sellingPrice;
int quantity; int? quantity;
int itemId; int? itemId;
int locationId; int? locationId;
int projectId; int? projectId;
String setupId; String? setupId;
String locationDescription; String? locationDescription;
dynamic locationDescriptionN; dynamic locationDescriptionN;
ItemDescription itemDescription; ItemDescription? itemDescription;
dynamic itemDescriptionN; dynamic itemDescriptionN;
Alias alias; Alias? alias;
int locationTypeId; int? locationTypeId;
int barcode; int? barcode;
dynamic companybarcode; dynamic companybarcode;
int cityId; int? cityId;
String cityName; String? cityName;
int distanceInKilometers; int? distanceInKilometers;
String latitude; String? latitude;
int locationType; int? locationType;
String longitude; String? longitude;
String phoneNumber; String? phoneNumber;
String projectImageUrl; String? projectImageUrl;
int sortOrder; int? sortOrder;
factory LocationModel.fromJson(Map<String, dynamic> json) => LocationModel( factory LocationModel.fromJson(Map<String, dynamic> json) => LocationModel(
expiryDate: expiryDateValues.map[json["ExpiryDate"]], expiryDate: expiryDateValues.map![json["ExpiryDate"]],
sellingPrice: json["SellingPrice"].toDouble(), sellingPrice: json["SellingPrice"].toDouble(),
quantity: json["Quantity"], quantity: json["Quantity"],
itemId: json["ItemID"], itemId: json["ItemID"],
@ -71,9 +71,9 @@ class LocationModel {
setupId: json["SetupID"], setupId: json["SetupID"],
locationDescription: json["LocationDescription"], locationDescription: json["LocationDescription"],
locationDescriptionN: json["LocationDescriptionN"], locationDescriptionN: json["LocationDescriptionN"],
itemDescription: itemDescriptionValues.map[json["ItemDescription"]], itemDescription: itemDescriptionValues.map![json["ItemDescription"]],
itemDescriptionN: json["ItemDescriptionN"], itemDescriptionN: json["ItemDescriptionN"],
alias: aliasValues.map[json["Alias"]], alias: aliasValues.map![json["Alias"]],
locationTypeId: json["LocationTypeID"], locationTypeId: json["LocationTypeID"],
barcode: json["Barcode"], barcode: json["Barcode"],
companybarcode: json["Companybarcode"], companybarcode: json["Companybarcode"],
@ -145,15 +145,15 @@ final itemDescriptionValues = EnumValues({
}); });
class EnumValues<T> { class EnumValues<T> {
Map<String, T> map; Map<String, T>? map;
Map<T, String> reverseMap; Map<T, String>? reverseMap;
EnumValues(this.map); EnumValues(this.map);
Map<T, String> get reverse { Map<T, String> get reverse {
if (reverseMap == null) { if (reverseMap == null) {
reverseMap = map.map((k, v) => new MapEntry(v, k)); reverseMap = map!.map((k, v) => new MapEntry(v, k));
} }
return reverseMap; return reverseMap!;
} }
} }

@ -9,14 +9,14 @@ class ProductDetail {
this.reviews, this.reviews,
}); });
List<Review> reviews; List<Review>? reviews;
factory ProductDetail.fromJson(Map<String, dynamic> json) => ProductDetail( factory ProductDetail.fromJson(Map<String, dynamic> json) => ProductDetail(
reviews: List<Review>.from(json["reviews"].map((x) => Review.fromJson(x))), reviews: List<Review>.from(json["reviews"].map((x) => Review.fromJson(x))),
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"reviews": List<dynamic>.from(reviews.map((x) => x.toJson())), "reviews": List<dynamic>.from(reviews!.map((x) => x.toJson())),
}; };
} }
@ -40,21 +40,21 @@ class Review {
this.product, this.product,
}); });
int id; int? id;
int position; int? position;
int reviewId; int? reviewId;
int customerId; int? customerId;
int productId; int? productId;
int storeId; int? storeId;
bool isApproved; bool? isApproved;
String title; String? title;
String reviewText; String? reviewText;
dynamic replyText; dynamic replyText;
int rating; int? rating;
int helpfulYesTotal; int? helpfulYesTotal;
int helpfulNoTotal; int? helpfulNoTotal;
DateTime createdOnUtc; DateTime? createdOnUtc;
Customer customer; Customer? customer;
dynamic product; dynamic product;
factory Review.fromJson(Map<String, dynamic> json) => Review( factory Review.fromJson(Map<String, dynamic> json) => Review(
@ -90,8 +90,8 @@ class Review {
"rating": rating, "rating": rating,
"helpful_yes_total": helpfulYesTotal, "helpful_yes_total": helpfulYesTotal,
"helpful_no_total": helpfulNoTotal, "helpful_no_total": helpfulNoTotal,
"created_on_utc": createdOnUtc.toIso8601String(), "created_on_utc": createdOnUtc!.toIso8601String(),
"customer": customer.toJson(), "customer": customer!.toJson(),
"product": product, "product": product,
}; };
} }
@ -131,18 +131,18 @@ class Customer {
dynamic fileNumber; dynamic fileNumber;
dynamic iqamaNumber; dynamic iqamaNumber;
int isOutSa; int? isOutSa;
int patientType; int? patientType;
dynamic gender; dynamic gender;
DateTime birthDate; DateTime? birthDate;
dynamic phone; dynamic phone;
dynamic countryCode; dynamic countryCode;
dynamic yahalaAccountno; dynamic yahalaAccountno;
dynamic billingAddress; dynamic billingAddress;
dynamic shippingAddress; dynamic shippingAddress;
String id; String? id;
Email username; Email? username;
Email email; Email? email;
dynamic firstName; dynamic firstName;
dynamic lastName; dynamic lastName;
dynamic languageId; dynamic languageId;
@ -172,8 +172,8 @@ class Customer {
billingAddress: json["billing_address"], billingAddress: json["billing_address"],
shippingAddress: json["shipping_address"], shippingAddress: json["shipping_address"],
id: json["id"], id: json["id"],
username: emailValues.map[json["username"]], username: emailValues.map![json["username"]],
email: emailValues.map[json["email"]], email: emailValues.map![json["email"]],
firstName: json["first_name"], firstName: json["first_name"],
lastName: json["last_name"], lastName: json["last_name"],
languageId: json["language_id"], languageId: json["language_id"],
@ -197,7 +197,7 @@ class Customer {
"is_out_sa": isOutSa, "is_out_sa": isOutSa,
"patient_type": patientType, "patient_type": patientType,
"gender": gender, "gender": gender,
"birth_date": birthDate.toIso8601String(), "birth_date": birthDate!.toIso8601String(),
"phone": phone, "phone": phone,
"country_code": countryCode, "country_code": countryCode,
"yahala_accountno": yahalaAccountno, "yahala_accountno": yahalaAccountno,
@ -229,15 +229,15 @@ enum Email { STEVE_GATES_NOP_COMMERCE_COM }
final emailValues = EnumValues({"steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM}); final emailValues = EnumValues({"steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM});
class EnumValues<T> { class EnumValues<T> {
Map<String, T> map; Map<String, T>? map;
Map<T, String> reverseMap; Map<T, String>? reverseMap;
EnumValues(this.map); EnumValues(this.map);
Map<T, String> get reverse { Map<T, String> get reverse {
if (reverseMap == null) { if (reverseMap == null) {
reverseMap = map.map((k, v) => new MapEntry(v, k)); reverseMap = map!.map((k, v) => new MapEntry(v, k));
} }
return reverseMap; return reverseMap!;
} }
} }

File diff suppressed because it is too large Load Diff

@ -123,117 +123,117 @@ class Product {
this.seName, this.seName,
}); });
String id; String? id;
bool visibleIndividually; bool? visibleIndividually;
String name; String? name;
String namen; String? namen;
List<LocalizedName> localizedNames; List<LocalizedName>? localizedNames;
String shortDescription; String? shortDescription;
String shortDescriptionn; String? shortDescriptionn;
String fullDescription; String? fullDescription;
String fullDescriptionn; String? fullDescriptionn;
bool markasNew; bool? markasNew;
bool showOnHomePage; bool? showOnHomePage;
String metaKeywords; String? metaKeywords;
String metaDescription; String? metaDescription;
String metaTitle; String? metaTitle;
bool allowCustomerReviews; bool? allowCustomerReviews;
dynamic approvedRatingSum; dynamic approvedRatingSum;
dynamic notApprovedRatingSum; dynamic notApprovedRatingSum;
dynamic approvedTotalReviews; dynamic approvedTotalReviews;
dynamic notApprovedTotalReviews; dynamic notApprovedTotalReviews;
String sku; String? sku;
bool isRx; bool? isRx;
bool prescriptionRequired; bool? prescriptionRequired;
dynamic rxMessage; dynamic rxMessage;
dynamic rxMessagen; dynamic rxMessagen;
dynamic manufacturerPartNumber; dynamic manufacturerPartNumber;
dynamic gtin; dynamic gtin;
bool isGiftCard; bool? isGiftCard;
bool requireOtherProducts; bool? requireOtherProducts;
bool automaticallyAddRequiredProducts; bool? automaticallyAddRequiredProducts;
bool isDownload; bool? isDownload;
bool unlimitedDownloads; bool? unlimitedDownloads;
dynamic maxNumberOfDownloads; dynamic maxNumberOfDownloads;
dynamic downloadExpirationDays; dynamic downloadExpirationDays;
bool hasSampleDownload; bool? hasSampleDownload;
bool hasUserAgreement; bool? hasUserAgreement;
bool isRecurring; bool? isRecurring;
dynamic recurringCycleLength; dynamic recurringCycleLength;
dynamic recurringTotalCycles; dynamic recurringTotalCycles;
bool isRental; bool? isRental;
dynamic rentalPriceLength; dynamic rentalPriceLength;
bool isShipEnabled; bool? isShipEnabled;
bool isFreeShipping; bool? isFreeShipping;
bool shipSeparately; bool? shipSeparately;
dynamic additionalShippingCharge; dynamic additionalShippingCharge;
bool isTaxExempt; bool? isTaxExempt;
bool isTelecommunicationsOrBroadcastingOrElectronicServices; bool? isTelecommunicationsOrBroadcastingOrElectronicServices;
bool useMultipleWarehouses; bool? useMultipleWarehouses;
dynamic manageInventoryMethodId; dynamic manageInventoryMethodId;
dynamic stockQuantity; dynamic stockQuantity;
String stockAvailability; String? stockAvailability;
String stockAvailabilityn; String? stockAvailabilityn;
bool displayStockAvailability; bool? displayStockAvailability;
bool displayStockQuantity; bool? displayStockQuantity;
dynamic minStockQuantity; dynamic minStockQuantity;
dynamic notifyAdminForQuantityBelow; dynamic notifyAdminForQuantityBelow;
bool allowBackInStockSubscriptions; bool? allowBackInStockSubscriptions;
dynamic orderMinimumQuantity; dynamic orderMinimumQuantity;
dynamic orderMaximumQuantity; dynamic orderMaximumQuantity;
dynamic allowedQuantities; dynamic allowedQuantities;
bool allowAddingOnlyExistingAttributeCombinations; bool? allowAddingOnlyExistingAttributeCombinations;
bool disableBuyButton; bool? disableBuyButton;
bool disableWishlistButton; bool? disableWishlistButton;
bool availableForPreOrder; bool? availableForPreOrder;
dynamic preOrderAvailabilityStartDateTimeUtc; dynamic preOrderAvailabilityStartDateTimeUtc;
bool callForPrice; bool? callForPrice;
dynamic price; dynamic price;
dynamic oldPrice; dynamic oldPrice;
dynamic productCost; dynamic productCost;
dynamic specialPrice; dynamic specialPrice;
dynamic specialPriceStartDateTimeUtc; dynamic specialPriceStartDateTimeUtc;
dynamic specialPriceEndDateTimeUtc; dynamic specialPriceEndDateTimeUtc;
bool customerEntersPrice; bool? customerEntersPrice;
dynamic minimumCustomerEnteredPrice; dynamic minimumCustomerEnteredPrice;
dynamic maximumCustomerEnteredPrice; dynamic maximumCustomerEnteredPrice;
bool basepriceEnabled; bool? basepriceEnabled;
dynamic basepriceAmount; dynamic basepriceAmount;
dynamic basepriceBaseAmount; dynamic basepriceBaseAmount;
bool hasTierPrices; bool? hasTierPrices;
bool hasDiscountsApplied; bool? hasDiscountsApplied;
dynamic discountName; dynamic discountName;
dynamic discountNamen; dynamic discountNamen;
dynamic discountDescription; dynamic discountDescription;
dynamic discountDescriptionn; dynamic discountDescriptionn;
dynamic discountPercentage; dynamic discountPercentage;
String currency; String? currency;
String currencyn; String? currencyn;
double weight; double? weight;
dynamic length; dynamic length;
dynamic width; dynamic width;
dynamic height; dynamic height;
dynamic availableStartDateTimeUtc; dynamic availableStartDateTimeUtc;
dynamic availableEndDateTimeUtc; dynamic availableEndDateTimeUtc;
dynamic displayOrder; dynamic displayOrder;
bool published; bool? published;
bool deleted; bool? deleted;
DateTime createdOnUtc; DateTime? createdOnUtc;
DateTime updatedOnUtc; DateTime? updatedOnUtc;
String productType; String? productType;
dynamic parentGroupedProductId; dynamic parentGroupedProductId;
List<dynamic> roleIds; List<dynamic>? roleIds;
List<dynamic> discountIds; List<dynamic>? discountIds;
List<dynamic> storeIds; List<dynamic>? storeIds;
List<dynamic> manufacturerIds; List<dynamic>? manufacturerIds;
List<Review> reviews; List<Review>? reviews;
List<Image> images; List<Image>? images;
List<dynamic> attributes; List<dynamic>? attributes;
List<Specification> specifications; List<Specification>? specifications;
List<dynamic> associatedProductIds; List<dynamic>? associatedProductIds;
List<dynamic> tags; List<dynamic>? tags;
dynamic vendorId; dynamic vendorId;
String seName; String? seName;
factory Product.fromJson(Map<String, dynamic> json) => Product( factory Product.fromJson(Map<String, dynamic> json) => Product(
id: json["id"], id: json["id"],
@ -354,7 +354,7 @@ class Product {
"visible_individually": visibleIndividually, "visible_individually": visibleIndividually,
"name": name, "name": name,
"namen": namen, "namen": namen,
"localized_names": List<dynamic>.from(localizedNames.map((x) => x.toJson())), "localized_names": List<dynamic>.from(localizedNames!.map((x) => x.toJson())),
"short_description": shortDescription, "short_description": shortDescription,
"short_descriptionn": shortDescriptionn, "short_descriptionn": shortDescriptionn,
"full_description": fullDescription, "full_description": fullDescription,
@ -445,20 +445,20 @@ class Product {
"display_order": displayOrder, "display_order": displayOrder,
"published": published, "published": published,
"deleted": deleted, "deleted": deleted,
"created_on_utc": createdOnUtc.toIso8601String(), "created_on_utc": createdOnUtc!.toIso8601String(),
"updated_on_utc": updatedOnUtc.toIso8601String(), "updated_on_utc": updatedOnUtc!.toIso8601String(),
"product_type": productType, "product_type": productType,
"parent_grouped_product_id": parentGroupedProductId, "parent_grouped_product_id": parentGroupedProductId,
"role_ids": List<dynamic>.from(roleIds.map((x) => x)), "role_ids": List<dynamic>.from(roleIds!.map((x) => x)),
"discount_ids": List<dynamic>.from(discountIds.map((x) => x)), "discount_ids": List<dynamic>.from(discountIds!.map((x) => x)),
"store_ids": List<dynamic>.from(storeIds.map((x) => x)), "store_ids": List<dynamic>.from(storeIds!.map((x) => x)),
"manufacturer_ids": List<dynamic>.from(manufacturerIds.map((x) => x)), "manufacturer_ids": List<dynamic>.from(manufacturerIds!.map((x) => x)),
"reviews": List<dynamic>.from(reviews.map((x) => x.toJson())), "reviews": List<dynamic>.from(reviews!.map((x) => x.toJson())),
"images": List<dynamic>.from(images.map((x) => x.toJson())), "images": List<dynamic>.from(images!.map((x) => x.toJson())),
"attributes": List<dynamic>.from(attributes.map((x) => x)), "attributes": List<dynamic>.from(attributes!.map((x) => x)),
"specifications": List<dynamic>.from(specifications.map((x) => x.toJson())), "specifications": List<dynamic>.from(specifications!.map((x) => x.toJson())),
"associated_product_ids": List<dynamic>.from(associatedProductIds.map((x) => x)), "associated_product_ids": List<dynamic>.from(associatedProductIds!.map((x) => x)),
"tags": List<dynamic>.from(tags.map((x) => x)), "tags": List<dynamic>.from(tags!.map((x) => x)),
"vendor_id": vendorId, "vendor_id": vendorId,
"se_name": seName, "se_name": seName,
}; };
@ -490,16 +490,16 @@ class Review {
dynamic customerId; dynamic customerId;
dynamic productId; dynamic productId;
dynamic storeId; dynamic storeId;
bool isApproved; bool? isApproved;
String title; String? title;
ReviewText reviewText; ReviewText? reviewText;
dynamic replyText; dynamic replyText;
dynamic rating; dynamic rating;
dynamic helpfulYesTotal; dynamic helpfulYesTotal;
dynamic helpfulNoTotal; dynamic helpfulNoTotal;
DateTime createdOnUtc; DateTime? createdOnUtc;
Customer customer; Customer? customer;
Product product; Product? product;
factory Review.fromJson(Map<String, dynamic> json) => Review( factory Review.fromJson(Map<String, dynamic> json) => Review(
id: json["id"], id: json["id"],
@ -510,7 +510,7 @@ class Review {
storeId: json["store_id"], storeId: json["store_id"],
isApproved: json["is_approved"], isApproved: json["is_approved"],
title: json["title"], title: json["title"],
reviewText: reviewTextValues.map[json["review_text"]], reviewText: reviewTextValues.map![json["review_text"]],
replyText: json["reply_text"], replyText: json["reply_text"],
rating: json["rating"], rating: json["rating"],
helpfulYesTotal: json["helpful_yes_total"], helpfulYesTotal: json["helpful_yes_total"],
@ -534,9 +534,9 @@ class Review {
"rating": rating, "rating": rating,
"helpful_yes_total": helpfulYesTotal, "helpful_yes_total": helpfulYesTotal,
"helpful_no_total": helpfulNoTotal, "helpful_no_total": helpfulNoTotal,
"created_on_utc": createdOnUtc.toIso8601String(), "created_on_utc": createdOnUtc!.toIso8601String(),
"customer": customer.toJson(), "customer": customer!.toJson(),
"product": product == null ? null : product.toJson(), "product": product == null ? null : product!.toJson(),
}; };
} }
@ -551,9 +551,9 @@ class Image {
dynamic id; dynamic id;
dynamic position; dynamic position;
String src; String? src;
String thumb; String? thumb;
String attachment; String? attachment;
factory Image.fromJson(Map<String, dynamic> json) => Image( factory Image.fromJson(Map<String, dynamic> json) => Image(
id: json["id"], id: json["id"],
@ -579,7 +579,7 @@ class LocalizedName {
}); });
dynamic languageId; dynamic languageId;
String localizedName; String? localizedName;
factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName( factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName(
languageId: json["language_id"], languageId: json["language_id"],
@ -604,10 +604,10 @@ class Specification {
dynamic id; dynamic id;
dynamic displayOrder; dynamic displayOrder;
String defaultValue; String? defaultValue;
String defaultValuen; String? defaultValuen;
String name; String? name;
String nameN; String? nameN;
factory Specification.fromJson(Map<String, dynamic> json) => Specification( factory Specification.fromJson(Map<String, dynamic> json) => Specification(
id: json["id"], id: json["id"],
@ -668,16 +668,16 @@ class Customer {
dynamic isOutSa; dynamic isOutSa;
dynamic patientType; dynamic patientType;
dynamic gender; dynamic gender;
DateTime birthDate; DateTime? birthDate;
dynamic phone; dynamic phone;
dynamic countryCode; dynamic countryCode;
dynamic yahalaAccountno; dynamic yahalaAccountno;
dynamic billingAddress; dynamic billingAddress;
dynamic shippingAddress; dynamic shippingAddress;
List<dynamic> addresses; List<dynamic>? addresses;
String id; String? id;
Username username; Username? username;
Email email; Email? email;
dynamic firstName; dynamic firstName;
dynamic lastName; dynamic lastName;
dynamic languageId; dynamic languageId;
@ -693,7 +693,7 @@ class Customer {
dynamic lastLoginDateUtc; dynamic lastLoginDateUtc;
dynamic lastActivityDateUtc; dynamic lastActivityDateUtc;
dynamic registeredInStoreId; dynamic registeredInStoreId;
List<dynamic> roleIds; List<dynamic>? roleIds;
factory Customer.fromJson(Map<String, dynamic> json) => Customer( factory Customer.fromJson(Map<String, dynamic> json) => Customer(
fileNumber: json["file_number"], fileNumber: json["file_number"],
@ -709,8 +709,8 @@ class Customer {
shippingAddress: json["shipping_address"], shippingAddress: json["shipping_address"],
addresses: List<dynamic>.from(json["addresses"].map((x) => x)), addresses: List<dynamic>.from(json["addresses"].map((x) => x)),
id: json["id"], id: json["id"],
username: usernameValues.map[json["username"]], username: usernameValues.map![json["username"]],
email: emailValues.map[json["email"]], email: emailValues.map![json["email"]],
firstName: json["first_name"], firstName: json["first_name"],
lastName: json["last_name"], lastName: json["last_name"],
languageId: json["language_id"], languageId: json["language_id"],
@ -735,13 +735,13 @@ class Customer {
"is_out_sa": isOutSa, "is_out_sa": isOutSa,
"patient_type": patientType, "patient_type": patientType,
"gender": gender, "gender": gender,
"birth_date": birthDate.toIso8601String(), "birth_date": birthDate!.toIso8601String(),
"phone": phone, "phone": phone,
"country_code": countryCode, "country_code": countryCode,
"yahala_accountno": yahalaAccountno, "yahala_accountno": yahalaAccountno,
"billing_address": billingAddress, "billing_address": billingAddress,
"shipping_address": shippingAddress, "shipping_address": shippingAddress,
"addresses": List<dynamic>.from(addresses.map((x) => x)), "addresses": List<dynamic>.from(addresses!.map((x) => x)),
"id": id, "id": id,
"username": usernameValues.reverse[username], "username": usernameValues.reverse[username],
"email": emailValues.reverse[email], "email": emailValues.reverse[email],
@ -760,7 +760,7 @@ class Customer {
"last_login_date_utc": lastLoginDateUtc, "last_login_date_utc": lastLoginDateUtc,
"last_activity_date_utc": lastActivityDateUtc, "last_activity_date_utc": lastActivityDateUtc,
"registered_in_store_id": registeredInStoreId, "registered_in_store_id": registeredInStoreId,
"role_ids": List<dynamic>.from(roleIds.map((x) => x)), "role_ids": List<dynamic>.from(roleIds!.map((x) => x)),
}; };
} }
@ -789,15 +789,15 @@ final reviewTextValues = EnumValues({
}); });
class EnumValues<T> { class EnumValues<T> {
Map<String, T> map; Map<String, T>? map;
Map<T, String> reverseMap; Map<T, String>? reverseMap;
EnumValues(this.map); EnumValues(this.map);
Map<T, String> get reverse { Map<T, String> get reverse {
if (reverseMap == null) { if (reverseMap == null) {
reverseMap = map.map((k, v) => new MapEntry(v, k)); reverseMap = map!.map((k, v) => new MapEntry(v, k));
} }
return reverseMap; return reverseMap!;
} }
} }

@ -13,14 +13,14 @@ class SpecificationModel {
this.specification, this.specification,
}); });
List<Specification> specification; List<Specification>? specification;
factory SpecificationModel.fromJson(Map<String, dynamic> json) => SpecificationModel( factory SpecificationModel.fromJson(Map<String, dynamic> json) => SpecificationModel(
specification: List<Specification>.from(json["specification"].map((x) => Specification.fromJson(x))), specification: List<Specification>.from(json["specification"].map((x) => Specification.fromJson(x))),
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"specification": List<dynamic>.from(specification.map((x) => x.toJson())), "specification": List<dynamic>.from(specification!.map((x) => x.toJson())),
}; };
} }
@ -34,12 +34,12 @@ class Specification {
this.nameN, this.nameN,
}); });
int id; int? id;
int displayOrder; int? displayOrder;
String defaultValue; String? defaultValue;
String defaultValuen; String? defaultValuen;
String name; String? name;
String nameN; String? nameN;
factory Specification.fromJson(Map<String, dynamic> json) => Specification( factory Specification.fromJson(Map<String, dynamic> json) => Specification(
id: json["id"], id: json["id"],

@ -30,24 +30,24 @@ class TopBrand {
this.image, this.image,
}); });
String id; String? id;
String name; String? name;
String namen; String? namen;
List<LocalizedName> localizedNames; List<LocalizedName>? localizedNames;
String description; String? description;
int manufacturerTemplateId; int? manufacturerTemplateId;
String metaKeywords; String? metaKeywords;
dynamic metaDescription; dynamic metaDescription;
dynamic metaTitle; dynamic metaTitle;
int pageSize; int? pageSize;
String pageSizeOptions; String? pageSizeOptions;
dynamic priceRanges; dynamic priceRanges;
bool published; bool? published;
bool deleted; bool? deleted;
int displayOrder; int? displayOrder;
DateTime createdOnUtc; DateTime? createdOnUtc;
DateTime updatedOnUtc; DateTime? updatedOnUtc;
Image image; Image? image;
factory TopBrand.fromJson(Map<String, dynamic> json) => TopBrand( factory TopBrand.fromJson(Map<String, dynamic> json) => TopBrand(
id: json["id"], id: json["id"],
@ -74,7 +74,7 @@ class TopBrand {
"id": id, "id": id,
"name": name, "name": name,
"namen": namen, "namen": namen,
"localized_names": List<dynamic>.from(localizedNames.map((x) => x.toJson())), "localized_names": List<dynamic>.from(localizedNames!.map((x) => x.toJson())),
"description": description == null ? null : description, "description": description == null ? null : description,
"manufacturer_template_id": manufacturerTemplateId, "manufacturer_template_id": manufacturerTemplateId,
"meta_keywords": metaKeywords, "meta_keywords": metaKeywords,
@ -86,9 +86,9 @@ class TopBrand {
"published": published, "published": published,
"deleted": deleted, "deleted": deleted,
"display_order": displayOrder, "display_order": displayOrder,
"created_on_utc": createdOnUtc.toIso8601String(), "created_on_utc": createdOnUtc!.toIso8601String(),
"updated_on_utc": updatedOnUtc.toIso8601String(), "updated_on_utc": updatedOnUtc!.toIso8601String(),
"image": image == null ? null : image.toJson(), "image": image == null ? null : image!.toJson(),
}; };
} }
@ -99,7 +99,7 @@ class Image {
this.attachment, this.attachment,
}); });
String src; String? src;
dynamic thumb; dynamic thumb;
dynamic attachment; dynamic attachment;
@ -122,8 +122,8 @@ class LocalizedName {
this.localizedName, this.localizedName,
}); });
int languageId; int? languageId;
String localizedName; String? localizedName;
factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName( factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName(
languageId: json["language_id"], languageId: json["language_id"],

@ -1,5 +1,5 @@
class RRTProcedureList { class RRTProcedureList {
List<VidaProcedureList> vidaProcedureList; List<VidaProcedureList>? vidaProcedureList;
RRTProcedureList({this.vidaProcedureList}); RRTProcedureList({this.vidaProcedureList});
@ -7,7 +7,7 @@ class RRTProcedureList {
if (json['Vida_ProcedureList'] != null) { if (json['Vida_ProcedureList'] != null) {
vidaProcedureList = <VidaProcedureList>[]; vidaProcedureList = <VidaProcedureList>[];
json['Vida_ProcedureList'].forEach((v) { json['Vida_ProcedureList'].forEach((v) {
vidaProcedureList.add(new VidaProcedureList.fromJson(v)); vidaProcedureList!.add(new VidaProcedureList.fromJson(v));
}); });
} }
} }
@ -15,26 +15,20 @@ class RRTProcedureList {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.vidaProcedureList != null) { if (this.vidaProcedureList != null) {
data['Vida_ProcedureList'] = data['Vida_ProcedureList'] = this.vidaProcedureList!.map((v) => v.toJson()).toList();
this.vidaProcedureList.map((v) => v.toJson()).toList();
} }
return data; return data;
} }
} }
class VidaProcedureList { class VidaProcedureList {
num patientShare; num? patientShare;
num patientShareWithTax; num? patientShareWithTax;
num patientTaxAmount; num? patientTaxAmount;
String procedureID; String? procedureID;
String procedureName; String? procedureName;
VidaProcedureList( VidaProcedureList({this.patientShare, this.patientShareWithTax, this.patientTaxAmount, this.procedureID, this.procedureName});
{this.patientShare,
this.patientShareWithTax,
this.patientTaxAmount,
this.procedureID,
this.procedureName});
VidaProcedureList.fromJson(Map<String, dynamic> json) { VidaProcedureList.fromJson(Map<String, dynamic> json) {
patientShare = json['PatientShare']; patientShare = json['PatientShare'];

@ -1,14 +1,14 @@
class RRTRequestModel { class RRTRequestModel {
num patientId; num? patientId;
int patientOutSa; int? patientOutSa;
bool isOutPatient; bool? isOutPatient;
int nearestProjectId; int? nearestProjectId;
num longitude; num? longitude;
num latitude; num? latitude;
String additionalDetails; String? additionalDetails;
String nationality; String? nationality;
num paymentAmount; num? paymentAmount;
List<Procedures> procedures; List<Procedures>? procedures;
RRTRequestModel( RRTRequestModel(
{this.patientId, {this.patientId,
@ -35,7 +35,7 @@ class RRTRequestModel {
if (json['procedures'] != null) { if (json['procedures'] != null) {
procedures = <Procedures>[]; procedures = <Procedures>[];
json['procedures'].forEach((v) { json['procedures'].forEach((v) {
procedures.add(new Procedures.fromJson(v)); procedures!.add(new Procedures.fromJson(v));
}); });
} }
} }
@ -52,14 +52,14 @@ class RRTRequestModel {
data['nationality'] = this.nationality; data['nationality'] = this.nationality;
data['paymentAmount'] = this.paymentAmount; data['paymentAmount'] = this.paymentAmount;
if (this.procedures != null) { if (this.procedures != null) {
data['procedures'] = this.procedures.map((v) => v.toJson()).toList(); data['procedures'] = this.procedures!.map((v) => v.toJson()).toList();
} }
return data; return data;
} }
} }
class Procedures { class Procedures {
String serviceID; String? serviceID;
Procedures({this.serviceID}); Procedures({this.serviceID});

@ -1,5 +1,5 @@
class ServicePrice { class ServicePrice {
String currency; String? currency;
dynamic maxPrice; dynamic maxPrice;
dynamic maxTotalPrice; dynamic maxTotalPrice;
dynamic maxVAT; dynamic maxVAT;

@ -1,31 +1,31 @@
class TamaraRequestModel { class TamaraRequestModel {
String merchantReference; String? merchantReference;
String merchantIdentifier; String? merchantIdentifier;
String clientRequestID; String? clientRequestID;
num amount; num? amount;
String currency; String? currency;
String language; String? language;
String commandType; String? commandType;
String signature; String? signature;
String customerEmail; String? customerEmail;
String orderDescription; String? orderDescription;
bool isInstallment; bool? isInstallment;
num projectID; num? projectID;
String accessCode; String? accessCode;
String sHARequestPhase; String? sHARequestPhase;
String sHAResponsePhase; String? sHAResponsePhase;
String customerName; String? customerName;
String fileNumber; String? fileNumber;
bool patientOutSA; bool? patientOutSA;
String deviceToken; String? deviceToken;
String longitude; String? longitude;
String latitude; String? latitude;
String appointmentNo; String? appointmentNo;
var serviceID; var serviceID;
var liveServiceID; var liveServiceID;
String doctorID; String? doctorID;
var appointmentDate; var appointmentDate;
bool isSchedule; bool? isSchedule;
TamaraRequestModel( TamaraRequestModel(
{this.merchantReference, {this.merchantReference,

@ -5,10 +5,10 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class ConfirmCancelOrderDialog extends StatefulWidget { class ConfirmCancelOrderDialog extends StatefulWidget {
final CMCViewModel model; final CMCViewModel model;
final Function onTap; final Function onTap;
ConfirmCancelOrderDialog({Key key, this.model, this.onTap}); ConfirmCancelOrderDialog({Key? key, required this.model, required this.onTap});
@override @override
_ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState(); _ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState();

@ -4,7 +4,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
Future<void> showCMCConfirmDialog(BuildContext context, String requestId, {Function onClick}) async { Future<void> showCMCConfirmDialog(BuildContext context, String requestId, {required Function onClick}) async {
return showDialog<void>( return showDialog<void>(
context: context, context: context,
barrierDismissible: false, // user must tap button! barrierDismissible: false, // user must tap button!
@ -28,7 +28,7 @@ class ConfirmDialog extends StatelessWidget {
String requestId; String requestId;
Function onClick; Function onClick;
ConfirmDialog(this.requestId, {this.onClick}); ConfirmDialog(this.requestId, {required this.onClick});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -24,7 +24,7 @@ import 'package:flutter/material.dart';
// import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart';
import 'package:geocoding/geocoding.dart'; import 'package:geocoding/geocoding.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart' as gmaps;
import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -35,7 +35,7 @@ class CMCLocationPage extends StatefulWidget {
final double longitude; final double longitude;
final dynamic model; final dynamic model;
const CMCLocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model}) : super(key: key); const CMCLocationPage({ Key? key, required this.onPick, required this.latitude, required this.longitude, this.model}) : super(key: key);
@override @override
_CMCLocationPageState createState() => _CMCLocationPageState(); _CMCLocationPageState createState() => _CMCLocationPageState();
@ -45,17 +45,17 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
bool showCurrentLocation = false; bool showCurrentLocation = false;
Function onPick; late Function onPick;
bool isHuawei = false; bool isHuawei = false;
Placemark selectedPlace; late Placemark selectedPlace;
AppMap appMap; late AppMap appMap;
static CameraPosition _kGooglePlex = CameraPosition( static gmaps.CameraPosition _kGooglePlex = gmaps.CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962), target: gmaps.LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746, zoom: 14.4746,
); );
LatLng currentPostion; late gmaps.LatLng currentPostion;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
HmsApiAvailability hmsApiAvailability; late HmsApiAvailability hmsApiAvailability;
@override @override
void initState() { void initState() {
@ -63,12 +63,14 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
checkIsHuawei(); checkIsHuawei();
appMap = AppMap( appMap = AppMap(
_kGooglePlex.toMap(), _kGooglePlex.toMap() as Map<dynamic, dynamic>,
onCameraMove: (camera) { // changed by Aamir
_updatePosition(camera); onCameraMove: (cam) {
_updatePosition(cam as gmaps.CameraPosition);
// changed by Aamir Huawei & Google Issue may Be
}, },
onMapCreated: () { onMapCreated: () {
currentPostion = LatLng(widget.latitude, widget.longitude); currentPostion = gmaps.LatLng(widget.latitude, widget.longitude);
latitude = widget.latitude; latitude = widget.latitude;
longitude = widget.longitude; longitude = widget.longitude;
_getUserLocation(); _getUserLocation();
@ -91,7 +93,7 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
} }
checkIsHuawei() async { checkIsHuawei() async {
await hmsApiAvailability.isHMSAvailable().then((value) { await hmsApiAvailability!.isHMSAvailable().then((value) {
isHuawei = value == 0 ? true : false; isHuawei = value == 0 ? true : false;
}); });
print(isHuawei); print(isHuawei);
@ -148,13 +150,13 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
createdOnUtc: "", createdOnUtc: "",
id: "0", id: "0",
faxNumber: "", faxNumber: "",
phoneNumber: projectViewModel.user.mobileNumber, phoneNumber: projectViewModel.user!.mobileNumber,
province: selectedPlace.administrativeArea, province: selectedPlace.administrativeArea,
countryId: 69, countryId: 69,
latLong: latitude.toStringAsFixed(6) + "," + longitude.toStringAsFixed(6), latLong: latitude.toStringAsFixed(6) + "," + longitude.toStringAsFixed(6),
country: selectedPlace.country, country: selectedPlace.country,
zipPostalCode: selectedPlace.postalCode, zipPostalCode: selectedPlace.postalCode,
email: projectViewModel.user.emailAddress) email: projectViewModel.user!.emailAddress)
]), ]),
); );
await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
@ -206,28 +208,28 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
customer: Customer( customer: Customer(
addresses: [ addresses: [
Addresses( Addresses(
address1: selectedPlace.formattedAddress, address1: selectedPlace!.formattedAddress,
address2: selectedPlace.formattedAddress, address2: selectedPlace.formattedAddress,
customerAttributes: "", customerAttributes: "",
city: "", city: "",
createdOnUtc: "", createdOnUtc: "",
id: "0", id: "0",
latLong: selectedPlace.geometry.location.lat.toString() + "," + selectedPlace.geometry.location.lng.toString(), latLong: selectedPlace.geometry!.location.lat.toString() + "," + selectedPlace.geometry!.location.lng.toString(),
email: "", email: "",
) )
], ],
), ),
); );
selectedPlace.addressComponents.forEach((e) { selectedPlace.addressComponents!.forEach((e) {
if (e.types.contains("country")) { if (e.types.contains("country")) {
addNewAddressRequestModel.customer.addresses[0].country = e.longName; addNewAddressRequestModel.customer!.addresses![0].country = e.longName;
} }
if (e.types.contains("postal_code")) { if (e.types.contains("postal_code")) {
addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName; addNewAddressRequestModel.customer!.addresses![0].zipPostalCode = e.longName;
} }
if (e.types.contains("locality")) { if (e.types.contains("locality")) {
addNewAddressRequestModel.customer.addresses[0].city = e.longName; addNewAddressRequestModel.customer!.addresses![0].city = e.longName;
} }
}); });
@ -247,7 +249,7 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
), ),
); );
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: gmaps.LatLng(latitude, longitude),
useCurrentLocation: showCurrentLocation, useCurrentLocation: showCurrentLocation,
), ),
), ),
@ -260,29 +262,29 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
var long = await this.sharedPref.getDouble(USER_LONG); var long = await this.sharedPref.getDouble(USER_LONG);
latitude = lat; latitude = lat;
longitude = long; longitude = long;
currentPostion = LatLng(lat, long); currentPostion = gmaps.LatLng(lat, long);
setMap(); setMap();
} else { } else {
if (await PermissionService.isLocationEnabled()) { if (await PermissionService.isLocationEnabled()) {
Geolocator.getLastKnownPosition().then((value) { Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude; latitude = value!.latitude;
longitude = value.longitude; longitude = value.longitude;
currentPostion = LatLng(latitude, longitude); currentPostion = gmaps.LatLng(latitude, longitude);
setMap(); setMap();
}); });
} else { } else {
if (Platform.isAndroid) { if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) { Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude; latitude = value!.latitude;
longitude = value.longitude; longitude = value.longitude;
currentPostion = LatLng(latitude, longitude); currentPostion = gmaps.LatLng(latitude, longitude);
setMap(); setMap();
}); });
}); });
} else { } else {
Geolocator.getLastKnownPosition().then((value) { Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude; latitude = value!.latitude;
longitude = value.longitude; longitude = value.longitude;
setMap(); setMap();
}); });
@ -293,7 +295,7 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
setMap() { setMap() {
setState(() { setState(() {
_kGooglePlex = CameraPosition( _kGooglePlex = gmaps.CameraPosition(
target: currentPostion, target: currentPostion,
zoom: 14.4746, zoom: 14.4746,
); );
@ -301,7 +303,7 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
}); });
} }
void _updatePosition(CameraPosition _position) { void _updatePosition(gmaps.CameraPosition _position) {
print(_position); print(_position);
latitude = _position.target.latitude; latitude = _position.target.latitude;
longitude = _position.target.longitude; longitude = _position.target.longitude;

@ -18,7 +18,7 @@ import 'package:provider/provider.dart';
import 'new_cmc_step_one_page.dart'; import 'new_cmc_step_one_page.dart';
class NewCMCPage extends StatefulWidget { class NewCMCPage extends StatefulWidget {
NewCMCPage({this.model}); NewCMCPage({required this.model});
final CMCViewModel model; final CMCViewModel model;
@ -27,15 +27,15 @@ class NewCMCPage extends StatefulWidget {
} }
class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin { class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
PageController _controller; late PageController _controller;
int _currentIndex = 1; int _currentIndex = 1;
double _latitude; late double _latitude;
double _longitude; late double _longitude;
CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel; late CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel;
BuildContext _context; late BuildContext _context;
@override @override
void initState() { void initState() {
@ -51,10 +51,11 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
totalPrice: widget.model.cmcAllServicesList[0].priceTotal, totalPrice: widget.model.cmcAllServicesList[0].priceTotal,
vAT: widget.model.cmcAllServicesList[0].priceVAT); vAT: widget.model.cmcAllServicesList[0].priceVAT);
cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: [patientERCMCInsertServicesList]); cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: [patientERCMCInsertServicesList]);
} else {
cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: []);
//changed By Aamir
} }
cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: patientERCMCInsertServicesList != null ? [patientERCMCInsertServicesList] : []);
_controller = new PageController(); _controller = new PageController();
// _getCurrentLocation(); // _getCurrentLocation();
@ -62,7 +63,7 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
_getCurrentLocation() async { _getCurrentLocation() async {
await Geolocator.getLastKnownPosition().then((value) { await Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude; _latitude = value!.latitude;
_longitude = value.longitude; _longitude = value.longitude;
}).catchError((e) { }).catchError((e) {
_longitude = 0; _longitude = 0;
@ -107,9 +108,9 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
)); ));
} }
int status = widget.model.pendingOrder != null ? widget.model.pendingOrder.statusId : 0; int status = widget.model.pendingOrder != null ? widget.model.pendingOrder!.statusId! : 0;
String _statusDisp = widget.model.pendingOrder != null ? widget.model.pendingOrder.statusText : ""; String _statusDisp = widget.model.pendingOrder != null ? widget.model.pendingOrder!.statusText! : "";
Color _color; late Color _color;
if (status == 1) { if (status == 1) {
//pending //pending
_color = Color(0xffCC9B14); _color = Color(0xffCC9B14);
@ -165,7 +166,7 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
), ),
SizedBox(height: 6), SizedBox(height: 6),
Text( Text(
'${TranslationBase.of(context).requestID}: ${widget.model.pendingOrder.iD}', '${TranslationBase.of(context).requestID}: ${widget.model.pendingOrder!.iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
Row( Row(
@ -177,7 +178,7 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
), ),
Expanded( Expanded(
child: Text( child: Text(
widget.model.pendingOrder.projectName != null ? widget.model.pendingOrder.projectName.trim().toString() : "", widget.model.pendingOrder!.projectName != null ? widget.model.pendingOrder!.projectName!.trim().toString() : "",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), ),
), ),
@ -192,7 +193,7 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
), ),
Expanded( Expanded(
child: Text( child: Text(
widget.model.pendingOrder.serviceText.trim().toString(), widget.model.pendingOrder!.serviceText!.trim().toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), ),
), ),
@ -206,14 +207,14 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder.created)), DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder!.created!)!),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
SizedBox(height: 12), SizedBox(height: 12),
if (widget.model.pendingOrder.statusId == 1 || widget.model.pendingOrder.statusId == 2) if (widget.model.pendingOrder!.statusId == 1 || widget.model.pendingOrder!.statusId == 2)
InkWell( InkWell(
onTap: () { onTap: () {
showConfirmMessage(widget.model, widget.model.pendingOrder); showConfirmMessage(widget.model, widget.model.pendingOrder!);
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),

@ -25,7 +25,8 @@ class NewCMCStepOnePage extends StatefulWidget {
final double latitude; final double latitude;
final double longitude; final double longitude;
const NewCMCStepOnePage({Key key, this.cMCInsertPresOrderRequestModel, this.model, this.changePageViewIndex, this.latitude, this.longitude}) : super(key: key); const NewCMCStepOnePage({Key? key, required this.cMCInsertPresOrderRequestModel, required this.model, required this.changePageViewIndex, required this.latitude, required this.longitude})
: super(key: key);
@override @override
_NewCMCStepOnePageState createState() => _NewCMCStepOnePageState(); _NewCMCStepOnePageState createState() => _NewCMCStepOnePageState();
@ -61,7 +62,7 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
return Row( return Row(
children: [ children: [
Radio( Radio(
value: num.tryParse(widget.model.cmcAllServicesList[index].serviceID), value: num.tryParse(widget.model.cmcAllServicesList[index].serviceID!),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (newValue) async { onChanged: (newValue) async {
selectedItem = index; selectedItem = index;
@ -79,8 +80,8 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
// CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: newValue); // CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: newValue);
// await widget.model.getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel); // await widget.model.getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel);
}, },
groupValue: widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length > 0 groupValue: widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList!.length > 0
? int.parse(widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList[0].serviceID) ? int.parse(widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList![0].serviceID!)
: 1), : 1),
Expanded( Expanded(
child: Padding( child: Padding(
@ -91,7 +92,7 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
bottom: 20, bottom: 20,
), ),
child: Text( child: Text(
projectViewModel.isArabic ? widget.model.cmcAllServicesList[index].textN : widget.model.cmcAllServicesList[index].text, projectViewModel.isArabic ? widget.model.cmcAllServicesList[index].textN! : widget.model.cmcAllServicesList[index].text!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -146,7 +147,7 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).next, TranslationBase.of(context).next,
() async { () async {
if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length != 0 || widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList == null) { if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList!.length != 0 || widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList == null) {
// int index = widget.model.cmcAllServicesList.length; // int index = widget.model.cmcAllServicesList.length;
PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList(
price: widget.model.cmcAllServicesList[selectedItem].price, price: widget.model.cmcAllServicesList[selectedItem].price,
@ -158,8 +159,8 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
vAT: widget.model.cmcAllServicesList[selectedItem].priceVAT, vAT: widget.model.cmcAllServicesList[selectedItem].priceVAT,
); );
widget.cMCInsertPresOrderRequestModel.patientID = projectViewModel.user.patientID; widget.cMCInsertPresOrderRequestModel.patientID = projectViewModel.user!.patientID;
widget.cMCInsertPresOrderRequestModel.patientOutSA = projectViewModel.user.outSA; widget.cMCInsertPresOrderRequestModel.patientOutSA = projectViewModel.user!.outSA;
widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList];
navigateTo( navigateTo(

@ -27,7 +27,7 @@ class NewCMCStepThreePage extends StatefulWidget {
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
final CMCViewModel model; final CMCViewModel model;
NewCMCStepThreePage({Key key, this.model, this.cmcInsertPresOrderRequestModel}); NewCMCStepThreePage({Key? key, required this.model, required this.cmcInsertPresOrderRequestModel});
@override @override
_NewCMCStepThreePageState createState() => _NewCMCStepThreePageState(); _NewCMCStepThreePageState createState() => _NewCMCStepThreePageState();
@ -36,9 +36,9 @@ class NewCMCStepThreePage extends StatefulWidget {
class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> { class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
Completer<GoogleMapController> _controller = Completer(); Completer<GoogleMapController> _controller = Completer();
String projectDropdownValue; String? projectDropdownValue;
List<HospitalsModel> projectsList = []; late List<HospitalsModel> projectsList = [];
HospitalsModel selectedHospital; late HospitalsModel selectedHospital;
final GlobalKey projectDropdownKey = GlobalKey(); final GlobalKey projectDropdownKey = GlobalKey();
bool isLocationSelected = false; bool isLocationSelected = false;
@ -57,10 +57,10 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
markerId: MarkerId( markerId: MarkerId(
widget.cmcInsertPresOrderRequestModel.latitude.hashCode.toString(), widget.cmcInsertPresOrderRequestModel.latitude.hashCode.toString(),
), ),
position: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, widget.cmcInsertPresOrderRequestModel.longitude)), position: LatLng(widget.cmcInsertPresOrderRequestModel.latitude!, widget.cmcInsertPresOrderRequestModel.longitude!)),
); );
_kGooglePlex = CameraPosition( _kGooglePlex = CameraPosition(
target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, widget.cmcInsertPresOrderRequestModel.longitude), target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude!, widget.cmcInsertPresOrderRequestModel.longitude!),
zoom: 14.4746, zoom: 14.4746,
); );
} }
@ -148,12 +148,12 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
items: projectsList.map((item) { items: projectsList.map((item) {
return new DropdownMenuItem<HospitalsModel>( return new DropdownMenuItem<HospitalsModel>(
value: item, value: item,
child: new Text(item.name), child: new Text(item.name!),
); );
}).toList(), }).toList(),
onChanged: (newValue) async { onChanged: (newValue) async {
setState(() { setState(() {
selectedHospital = newValue; selectedHospital = newValue!;
projectDropdownValue = newValue.mainProjectID.toString(); projectDropdownValue = newValue.mainProjectID.toString();
isLocationSelected = true; isLocationSelected = true;
widget.cmcInsertPresOrderRequestModel.projectID = newValue.mainProjectID; widget.cmcInsertPresOrderRequestModel.projectID = newValue.mainProjectID;
@ -259,15 +259,15 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
), ),
), ),
...List.generate( ...List.generate(
widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length, widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList!.length,
(index) => Container( (index) => Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
projectViewModel.isArabic projectViewModel.isArabic
? widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index].selectedServiceNameAR ? widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList![index].selectedServiceNameAR!
: widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index].selectedServiceName, : widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList![index].selectedServiceName!,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -353,7 +353,7 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
getDirections() { getDirections() {
if (isLocationSelected) { if (isLocationSelected) {
MapsLauncher.launchCoordinates(double.parse(selectedHospital.latitude), double.parse(selectedHospital.longitude), selectedHospital.name); MapsLauncher.launchCoordinates(double.parse(selectedHospital.latitude!), double.parse(selectedHospital.longitude!), selectedHospital.name);
} else { } else {
Utils.showErrorToast("Please select address from the dropdown menu to get directions"); Utils.showErrorToast("Please select address from the dropdown menu to get directions");
} }

@ -19,7 +19,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart' as gmaps;
import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
@ -33,7 +33,7 @@ class NewCMCStepTowPage extends StatefulWidget {
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
final CMCViewModel model; final CMCViewModel model;
const NewCMCStepTowPage({Key key, this.onPick, this.latitude, this.longitude, this.cmcInsertPresOrderRequestModel, this.model}) : super(key: key); const NewCMCStepTowPage({Key? key, required this.onPick, required this.latitude, required this.longitude, required this.cmcInsertPresOrderRequestModel, required this.model}) : super(key: key);
@override @override
_NewCMCStepTowPageState createState() => _NewCMCStepTowPageState(); _NewCMCStepTowPageState createState() => _NewCMCStepTowPageState();
@ -42,16 +42,16 @@ class NewCMCStepTowPage extends StatefulWidget {
class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> { class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AddressInfo _selectedAddress; late AddressInfo _selectedAddress;
bool showCurrentLocation = false; bool showCurrentLocation = false;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
static CameraPosition cameraPosition = CameraPosition( static gmaps.CameraPosition cameraPosition = gmaps.CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962), target: gmaps.LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746, zoom: 14.4746,
); );
LatLng currentPostion; late gmaps.LatLng currentPostion;
void _getUserLocation() async { void _getUserLocation() async {
if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) {
@ -59,31 +59,31 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
var long = await this.sharedPref.getDouble(USER_LONG); var long = await this.sharedPref.getDouble(USER_LONG);
latitude = lat; latitude = lat;
longitude = long; longitude = long;
currentPostion = LatLng(lat, long); currentPostion = gmaps.LatLng(lat, long);
setMap(); setMap();
} else { } else {
if (await PermissionService.isLocationEnabled()) { if (await PermissionService.isLocationEnabled()) {
Geolocator.getLastKnownPosition().then((value) { Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude; latitude = value!.latitude;
longitude = value.longitude; longitude = value.longitude;
currentPostion = LatLng(latitude, longitude); currentPostion = gmaps.LatLng(latitude, longitude);
setMap(); setMap();
}); });
} else { } else {
if (Platform.isAndroid) { if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) { Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude; latitude = value!.latitude;
longitude = value.longitude; longitude = value.longitude;
currentPostion = LatLng(latitude, longitude); currentPostion = gmaps.LatLng(latitude, longitude);
setMap(); setMap();
}); });
}); });
} else { } else {
Geolocator.getLastKnownPosition().then((value) { Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude; latitude = value!.latitude;
longitude = value.longitude; longitude = value.longitude;
currentPostion = LatLng(latitude, longitude); currentPostion = gmaps.LatLng(latitude, longitude);
setMap(); setMap();
}); });
} }
@ -95,10 +95,12 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
void initState() { void initState() {
super.initState(); super.initState();
appMap = AppMap( appMap = AppMap(
cameraPosition.toMap(), cameraPosition.toMap() as Map<dynamic, dynamic>,
// Changed by Aamir
onCameraMove: (camera) { onCameraMove: (camera) {
setState(() {}); setState(() {});
_updatePosition(camera); // Changed by Aamir
_updatePosition(camera as gmaps.CameraPosition);
}, },
onMapCreated: () { onMapCreated: () {
print("_getUserLocation"); print("_getUserLocation");
@ -109,7 +111,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
setMap() { setMap() {
setState(() { setState(() {
cameraPosition = CameraPosition( cameraPosition = gmaps.CameraPosition(
target: currentPostion, target: currentPostion,
zoom: 14.4746, zoom: 14.4746,
); );
@ -126,7 +128,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
return permissionResults; return permissionResults;
} }
setLatitudeAndLongitude({bool isSetState = false, String latLong}) async { setLatitudeAndLongitude({bool isSetState = false, String? latLong}) async {
print("latLong " + latLong.toString()); print("latLong " + latLong.toString());
if (latLong == null) { if (latLong == null) {
if (widget.model.addressesList.isEmpty) { if (widget.model.addressesList.isEmpty) {
@ -139,18 +141,18 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
} }
if (!showCurrentLocation) { if (!showCurrentLocation) {
List latLongArr = latLong.split(','); List latLongArr = latLong!.split(',');
latitude = double.parse(latLongArr[0]); latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]); longitude = double.parse(latLongArr[1]);
print("sssss1 " + latitude.toString()); print("sssss1 " + latitude.toString());
print("sssss2 " + longitude.toString()); print("sssss2 " + longitude.toString());
currentPostion = LatLng(latitude, longitude); currentPostion = gmaps.LatLng(latitude, longitude);
setMap(); setMap();
} }
} }
AppMap appMap; late AppMap appMap;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -283,7 +285,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
); );
} }
void _updatePosition(CameraPosition _position) { void _updatePosition(gmaps.CameraPosition _position) {
latitude = _position.target.latitude; latitude = _position.target.latitude;
longitude = _position.target.longitude; longitude = _position.target.longitude;
} }
@ -308,7 +310,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
String getAddressName() { String getAddressName() {
if (_selectedAddress != null) if (_selectedAddress != null)
return _selectedAddress.address1; return _selectedAddress.address1!;
else else
return TranslationBase.of(context).selectAddress; return TranslationBase.of(context).selectAddress;
} }

@ -20,7 +20,7 @@ class CMCPage extends StatefulWidget {
} }
class _CMCPageState extends State<CMCPage> with SingleTickerProviderStateMixin { class _CMCPageState extends State<CMCPage> with SingleTickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
@override @override
void initState() { void initState() {

@ -23,7 +23,7 @@ import 'Dialog/confirm_cancel_order_dialog.dart';
class OrdersLogDetailsPage extends StatelessWidget { class OrdersLogDetailsPage extends StatelessWidget {
final CMCViewModel model; final CMCViewModel model;
const OrdersLogDetailsPage({Key key, this.model}) : super(key: key); const OrdersLogDetailsPage({Key ?key, required this.model}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -62,9 +62,9 @@ class OrdersLogDetailsPage extends StatelessWidget {
itemBuilder: (context, index) { itemBuilder: (context, index) {
GetCMCAllOrdersResponseModel order = model.cmcAllPresOrders.reversed.toList()[index]; GetCMCAllOrdersResponseModel order = model.cmcAllPresOrders.reversed.toList()[index];
int status = order.statusId; int status = order.statusId!;
String _statusDisp = order.statusText; String _statusDisp = order.statusText!;
Color _color; late Color _color;
if (status == 1) { if (status == 1) {
//pending //pending
_color = Color(0xffCC9B14); _color = Color(0xffCC9B14);
@ -133,7 +133,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
Expanded( Expanded(
child: Text( child: Text(
// !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(), // !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(),
order.projectName != null ? order.projectName.trim().toString() : "", order.projectName != null ? order.projectName!.trim().toString() : "",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), ),
), ),
@ -147,7 +147,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created)), DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created!)!),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
SizedBox(height: 12), SizedBox(height: 12),

@ -16,7 +16,7 @@ class StartIndexForNewEReferral extends StatefulWidget {
} }
class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral> with TickerProviderStateMixin { class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral> with TickerProviderStateMixin {
PageController _controller; late PageController _controller;
int _currentIndex = 0; int _currentIndex = 0;
int pageSelected = 2; int pageSelected = 2;
@ -120,7 +120,7 @@ class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral> w
); );
} }
Widget showProgress({String title, String status, Color color, bool isNeedBorder = true}) { Widget showProgress({required String title, required String status, required Color color, bool isNeedBorder = true}) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

@ -28,7 +28,7 @@ class NewEReferralStepOnePage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel; final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex; final Function changePageViewIndex;
const NewEReferralStepOnePage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key); const NewEReferralStepOnePage({Key? key, required this.createEReferralRequestModel, required this.changePageViewIndex}) : super(key: key);
@override @override
_NewEReferralStepOnePageState createState() => _NewEReferralStepOnePageState(); _NewEReferralStepOnePageState createState() => _NewEReferralStepOnePageState();
@ -38,19 +38,19 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
TextEditingController _nameTextController = TextEditingController(); TextEditingController _nameTextController = TextEditingController();
TextEditingController _requesterRelationTextController = TextEditingController(); TextEditingController _requesterRelationTextController = TextEditingController();
GetAllRelationshipTypeResponseModel _selectedRelation; late GetAllRelationshipTypeResponseModel _selectedRelation;
String email; String? email;
AuthenticatedUser authenticatedUser; late AuthenticatedUser authenticatedUser;
GetAllSharedRecordsByStatusList selectedPatientFamily; late GetAllSharedRecordsByStatusList selectedPatientFamily;
AdvanceModel advanceModel = AdvanceModel(); AdvanceModel advanceModel = AdvanceModel();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
String mobileNo = ""; String mobileNo = "";
// todo create a model for Country // todo create a model for Country
// todo use country from the json // todo use country from the json
dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9}; dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9};
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; late AuthenticatedUser authUser;
@override @override
void initState() { void initState() {
@ -251,7 +251,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { {VoidCallback? suffixTap, bool isEnable = true, bool hasSelection = false, int? lines, bool isInputTypeNum = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
@ -340,9 +340,9 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
String getRelationName() { String getRelationName() {
if (_selectedRelation != null) { if (_selectedRelation != null) {
if (projectViewModel.isArabic) { if (projectViewModel.isArabic) {
return _selectedRelation.textAr; return _selectedRelation.textAr!;
} }
return _selectedRelation.textEn; return _selectedRelation.textEn!;
} else } else
return ""; return "";
} }
@ -359,7 +359,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
} }
class MobileNumberTextFiled extends StatelessWidget { class MobileNumberTextFiled extends StatelessWidget {
const MobileNumberTextFiled({Key key, this.controller, this.code, this.onChange}) : super(key: key); const MobileNumberTextFiled({Key? key, required this.controller, required this.code, required this.onChange}) : super(key: key);
final TextEditingController controller; final TextEditingController controller;
final String code; final String code;
@ -389,7 +389,7 @@ class MobileNumberTextFiled extends StatelessWidget {
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: TextField( child: TextField(
controller: controller, controller: controller,
onChanged: onChange, onChanged: onChange(),
keyboardType: TextInputType.phone, keyboardType: TextInputType.phone,
decoration: InputDecoration(border: InputBorder.none, hintText: '5xxxxxxxx'), decoration: InputDecoration(border: InputBorder.none, hintText: '5xxxxxxxx'),
), ),

@ -29,7 +29,7 @@ class NewEReferralStepThreePage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel; final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex; final Function changePageViewIndex;
const NewEReferralStepThreePage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key); const NewEReferralStepThreePage({Key? key, required this.createEReferralRequestModel, required this.changePageViewIndex}) : super(key: key);
@override @override
_NewEReferralStepThreePageState createState() => _NewEReferralStepThreePageState(); _NewEReferralStepThreePageState createState() => _NewEReferralStepThreePageState();
@ -38,9 +38,9 @@ class NewEReferralStepThreePage extends StatefulWidget {
class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> { class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
TextEditingController _nameTextController = TextEditingController(); TextEditingController _nameTextController = TextEditingController();
TextEditingController _mobileTextController = TextEditingController(); TextEditingController _mobileTextController = TextEditingController();
GetAllCitiesResponseModel _selectedCity; late GetAllCitiesResponseModel _selectedCity;
GetAllSharedRecordsByStatusList selectedPatientFamily; late GetAllSharedRecordsByStatusList selectedPatientFamily;
List<EReferralAttachment> medicalReportImages = []; List<EReferralAttachment> medicalReportImages = [];
List<EReferralAttachment> insuredPatientImages = []; List<EReferralAttachment> insuredPatientImages = [];
@ -48,10 +48,10 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
bool isPatientInsured = false; bool isPatientInsured = false;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; late AuthenticatedUser authUser;
final GlobalKey projectDropdownKey = GlobalKey(); final GlobalKey projectDropdownKey = GlobalKey();
String projectDropdownValue; String? projectDropdownValue;
@override @override
void initState() { void initState() {
@ -211,12 +211,12 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
items: projectsList.map((item) { items: projectsList.map((item) {
return new DropdownMenuItem<String>( return new DropdownMenuItem<String>(
value: item.mainProjectID.toString() + "," + item.name.toString(), value: item.mainProjectID.toString() + "," + item.name.toString(),
child: new Text(item.name), child: new Text(item.name!),
); );
}).toList(), }).toList(),
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
projectDropdownValue = newValue; projectDropdownValue = newValue!;
print(projectDropdownValue); print(projectDropdownValue);
}); });
}, },
@ -247,9 +247,9 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
Checkbox( Checkbox(
value: isPatientInsured, value: isPatientInsured,
activeColor: CustomColors.accentColor, activeColor: CustomColors.accentColor,
onChanged: (bool newValue) { onChanged: (bool? newValue) {
setState(() { setState(() {
isPatientInsured = newValue; isPatientInsured = newValue!;
}); });
}), }),
Padding( Padding(
@ -372,8 +372,8 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length != 0 ? insuredPatientImages[0] : null; this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length != 0 ? insuredPatientImages[0] : null;
this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured; this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured;
// ToDo make the preferred Branch info dynamic // ToDo make the preferred Branch info dynamic
this.widget.createEReferralRequestModel.preferredBranchCode = projectDropdownValue != null && projectDropdownValue.isNotEmpty ? num.tryParse(projectDropdownValue.split(",")[0]) : 0; this.widget.createEReferralRequestModel.preferredBranchCode = projectDropdownValue != null && projectDropdownValue!.isNotEmpty ? int.tryParse(projectDropdownValue!.split(",")[0]) : 0;
this.widget.createEReferralRequestModel.preferredBranchName = projectDropdownValue != null && projectDropdownValue.isNotEmpty ? projectDropdownValue.split(",")[1] : ""; this.widget.createEReferralRequestModel.preferredBranchName = projectDropdownValue != null && projectDropdownValue!.isNotEmpty ? projectDropdownValue!.split(",")[1] : "";
// this.widget.createEReferralRequestModel.otherRelationship = ""; // this.widget.createEReferralRequestModel.otherRelationship = "";
await model.createEReferral(this.widget.createEReferralRequestModel); await model.createEReferral(this.widget.createEReferralRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
@ -472,7 +472,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
String getRelationName() { String getRelationName() {
if (_selectedCity != null) if (_selectedCity != null)
return _selectedCity.description; return _selectedCity.description!;
else else
return "Select Relationship" /*TranslationBase.of(context).selectHospital*/; return "Select Relationship" /*TranslationBase.of(context).selectHospital*/;
} }

@ -25,7 +25,7 @@ class NewEReferralStepTowPage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel; final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex; final Function changePageViewIndex;
const NewEReferralStepTowPage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key); const NewEReferralStepTowPage({Key? key, required this.createEReferralRequestModel, required this.changePageViewIndex}) : super(key: key);
@override @override
_NewEReferralStepTowPageState createState() => _NewEReferralStepTowPageState(); _NewEReferralStepTowPageState createState() => _NewEReferralStepTowPageState();
@ -35,15 +35,15 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
TextEditingController _patientNameTextController = TextEditingController(); TextEditingController _patientNameTextController = TextEditingController();
TextEditingController _patientIdentificationTextController = TextEditingController(); TextEditingController _patientIdentificationTextController = TextEditingController();
String mobileNo = ""; String mobileNo = "";
GetAllCitiesResponseModel _selectedCity; late GetAllCitiesResponseModel _selectedCity;
GetAllSharedRecordsByStatusList selectedPatientFamily; late GetAllSharedRecordsByStatusList selectedPatientFamily;
// todo create a model for Country // todo create a model for Country
// todo use country from the json // todo use country from the json
dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9}; dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9};
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; late AuthenticatedUser authUser;
@override @override
void initState() { void initState() {
@ -195,7 +195,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { {VoidCallback? suffixTap, bool isEnable = true, bool hasSelection = false, int? lines, bool isInputTypeNum = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
@ -298,7 +298,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
String getRelationName() { String getRelationName() {
if (_selectedCity != null) if (_selectedCity != null)
return _selectedCity.description; return _selectedCity.description!;
else else
return TranslationBase.of(context).selectCity /*TranslationBase.of(context).selectHospital*/; return TranslationBase.of(context).selectCity /*TranslationBase.of(context).selectHospital*/;
} }
@ -312,7 +312,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
} }
class MobileNumberTextFiled extends StatelessWidget { class MobileNumberTextFiled extends StatelessWidget {
const MobileNumberTextFiled({Key key, this.controller, this.code}) : super(key: key); const MobileNumberTextFiled({Key? key, required this.controller, required this.code}) : super(key: key);
final TextEditingController controller; final TextEditingController controller;
final String code; final String code;

@ -10,7 +10,7 @@ class SelectCityDialog extends StatefulWidget {
final Function(GetAllCitiesResponseModel) onValueSelected; final Function(GetAllCitiesResponseModel) onValueSelected;
GetAllCitiesResponseModel selectedCity; GetAllCitiesResponseModel selectedCity;
SelectCityDialog({Key key, this.cities, this.onValueSelected, this.selectedCity}); SelectCityDialog({Key? key, required this.cities, required this.onValueSelected, required this.selectedCity});
@override @override
_SelectCityDialogState createState() => _SelectCityDialogState(); _SelectCityDialogState createState() => _SelectCityDialogState();
@ -51,14 +51,14 @@ class _SelectCityDialogState extends State<SelectCityDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text(widget.cities[index].description), title: Text(widget.cities[index].description!),
leading: Radio( leading: Radio(
value: widget.cities[index], value: widget.cities[index],
groupValue: widget.selectedCity, groupValue: widget.selectedCity,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
widget.selectedCity = value; widget.selectedCity = value!;
}); });
}, },
), ),

@ -11,7 +11,7 @@ class SelectCountryDialog extends StatefulWidget {
dynamic selectedCountry; dynamic selectedCountry;
SelectCountryDialog( SelectCountryDialog(
{Key key, /*this.relationTypes,*/ this.onValueSelected, this.selectedCountry}); {Key? key, /*this.relationTypes,*/ required this.onValueSelected, this.selectedCountry});
@override @override
_SelectCountryDialogState createState() => _SelectCountryDialogState(); _SelectCountryDialogState createState() => _SelectCountryDialogState();

@ -11,7 +11,7 @@ class SelectRelationTypeDialog extends StatefulWidget {
GetAllRelationshipTypeResponseModel selectedRelation; GetAllRelationshipTypeResponseModel selectedRelation;
SelectRelationTypeDialog( SelectRelationTypeDialog(
{Key key, this.relationTypes, this.onValueSelected, this.selectedRelation}); {Key? key, required this.relationTypes, required this.onValueSelected, required this.selectedRelation});
@override @override
_SelectRelationTypeDialogState createState() => _SelectRelationTypeDialogState(); _SelectRelationTypeDialogState createState() => _SelectRelationTypeDialogState();
@ -50,14 +50,14 @@ class _SelectRelationTypeDialogState extends State<SelectRelationTypeDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text(widget.relationTypes[index].text), title: Text(widget.relationTypes[index].text!),
leading: Radio( leading: Radio(
value: widget.relationTypes[index], value: widget.relationTypes[index],
groupValue: widget.selectedRelation, groupValue: widget.selectedRelation,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
widget.selectedRelation = value; widget.selectedRelation = value!;
}); });
}, },
), ),

@ -20,9 +20,9 @@ class EReferralConfirmSMSDialog extends StatefulWidget {
// final String selectedPaymentMethod; // final String selectedPaymentMethod;
const EReferralConfirmSMSDialog( const EReferralConfirmSMSDialog(
{Key key, {Key? key,
this.phoneNumber, required this.phoneNumber,
this.onSucces required this.onSucces
// this.advanceModel, // this.advanceModel,
// this.selectedPaymentMethod, // this.selectedPaymentMethod,
// this.patientInfoAndMobileNumber // this.patientInfoAndMobileNumber
@ -50,7 +50,7 @@ class _EReferralConfirmSMSDialogState extends State<EReferralConfirmSMSDialog> {
String timerText = (TIMER_MIN - 1).toString() + ':59'; String timerText = (TIMER_MIN - 1).toString() + ':59';
int min = TIMER_MIN - 1; int min = TIMER_MIN - 1;
int sec = 59; int sec = 59;
Timer _timer; late Timer _timer;
resendCode() { resendCode() {
min = TIMER_MIN - 1; min = TIMER_MIN - 1;
@ -75,10 +75,10 @@ class _EReferralConfirmSMSDialogState extends State<EReferralConfirmSMSDialog> {
}); });
} }
FocusNode focusD1; late FocusNode focusD1;
FocusNode focusD2; late FocusNode focusD2;
FocusNode focusD3; late FocusNode focusD3;
FocusNode focusD4; late FocusNode focusD4;
@override @override
void initState() { void initState() {
@ -158,7 +158,7 @@ class _EReferralConfirmSMSDialogState extends State<EReferralConfirmSMSDialog> {
Form( Form(
key: verifyAccountForm, key: verifyAccountForm,
child: Container( child: Container(
width: SizeConfig.realScreenWidth * 0.90, width: SizeConfig.realScreenWidth! * 0.90,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -173,7 +173,7 @@ class _EReferralConfirmSMSDialogState extends State<EReferralConfirmSMSDialog> {
child: TextFormField( child: TextFormField(
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
), ),
focusNode: focusD1, focusNode: focusD1,
maxLength: 1, maxLength: 1,
@ -204,7 +204,7 @@ class _EReferralConfirmSMSDialogState extends State<EReferralConfirmSMSDialog> {
maxLength: 1, maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
), ),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: buildInputDecoration(context), decoration: buildInputDecoration(context),
@ -231,7 +231,7 @@ class _EReferralConfirmSMSDialogState extends State<EReferralConfirmSMSDialog> {
maxLength: 1, maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
), ),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: buildInputDecoration(context), decoration: buildInputDecoration(context),
@ -257,7 +257,7 @@ class _EReferralConfirmSMSDialogState extends State<EReferralConfirmSMSDialog> {
maxLength: 1, maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
), ),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: buildInputDecoration(context), decoration: buildInputDecoration(context),
@ -330,7 +330,7 @@ class _EReferralConfirmSMSDialogState extends State<EReferralConfirmSMSDialog> {
} }
void submit(EReferralViewModel model) async { void submit(EReferralViewModel model) async {
if (verifyAccountForm.currentState.validate()) { if (verifyAccountForm.currentState!.validate()) {
final activationCode = final activationCode =
digit1.text + digit2.text + digit3.text + digit4.text; digit1.text + digit2.text + digit3.text + digit4.text;
// ToDo call service // ToDo call service
@ -346,7 +346,7 @@ class _EReferralConfirmSMSDialogState extends State<EReferralConfirmSMSDialog> {
} }
} }
String validateCodeDigit(value) { String? validateCodeDigit(value) {
if (value.isEmpty) { if (value.isEmpty) {
return ''; return '';
} }

@ -20,7 +20,7 @@ class EReferralPage extends StatefulWidget {
class _EReferralPageState extends State<EReferralPage> class _EReferralPageState extends State<EReferralPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
@override @override
void initState() { void initState() {

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/Constants.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -10,7 +11,7 @@ import 'package:provider/provider.dart';
class ReferralDetails extends StatefulWidget { class ReferralDetails extends StatefulWidget {
final SearchEReferralResponseModel referral; final SearchEReferralResponseModel referral;
const ReferralDetails({Key key, @required this.referral}) : super(key: key); const ReferralDetails({Key? key, required this.referral}) : super(key: key);
@override @override
_ReferralDetailsState createState() => _ReferralDetailsState(); _ReferralDetailsState createState() => _ReferralDetailsState();
@ -55,7 +56,7 @@ class _ReferralDetailsState extends State<ReferralDetails> {
], ],
), ),
), ),
mDivider(Colors.grey[600]), mDivider(dividerColor!),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 10, bottom: 5), padding: EdgeInsets.only(top: 10, bottom: 5),
@ -70,7 +71,7 @@ class _ReferralDetailsState extends State<ReferralDetails> {
], ],
), ),
), ),
mDivider(Colors.grey[600]), mDivider(dividerColor!),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 10, bottom: 5), padding: EdgeInsets.only(top: 10, bottom: 5),
@ -85,7 +86,7 @@ class _ReferralDetailsState extends State<ReferralDetails> {
], ],
), ),
), ),
mDivider(Colors.grey[600]), mDivider(dividerColor!),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 10, bottom: 5), padding: EdgeInsets.only(top: 10, bottom: 5),
@ -95,12 +96,12 @@ class _ReferralDetailsState extends State<ReferralDetails> {
child: _getNormalText(TranslationBase.of(context).referralDate), child: _getNormalText(TranslationBase.of(context).referralDate),
), ),
Expanded( Expanded(
child: _getNormalText(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateNoTimeZone(widget.referral.referralDate)), isBold: true), child: _getNormalText(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateNoTimeZone(widget.referral.referralDate!)), isBold: true),
) )
], ],
), ),
), ),
mDivider(Colors.grey[600]), mDivider(dividerColor!),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 10, bottom: 5), padding: EdgeInsets.only(top: 10, bottom: 5),

@ -25,7 +25,7 @@ import 'package:provider/provider.dart';
import 'dialogs/select_country_ingo_Dialog.dart'; import 'dialogs/select_country_ingo_Dialog.dart';
class SearchForReferralsPage extends StatefulWidget { class SearchForReferralsPage extends StatefulWidget {
SearchForReferralsPage({Key key}); SearchForReferralsPage({Key? key});
@override @override
_SearchForReferralsPageState createState() => _SearchForReferralsPageState(); _SearchForReferralsPageState createState() => _SearchForReferralsPageState();
@ -50,14 +50,14 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
Future.delayed(new Duration(milliseconds: 300)).then((value) async { Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel( SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel(
patientMobileNumber: (projectViewModel.user.outSA == 0 ? "966" : "971") + projectViewModel.user.mobileNumber.substring(1, projectViewModel.user.mobileNumber.length), patientMobileNumber: (projectViewModel.user!.outSA == 0 ? "966" : "971") + projectViewModel.user!.mobileNumber!.substring(1, projectViewModel.user!.mobileNumber!.length),
); );
if (selectedCriteria.value == 1) { if (selectedCriteria.value == 1) {
searchEReferralRequestModel.identificationNo = _searchTextController.text; searchEReferralRequestModel.identificationNo = _searchTextController.text;
searchEReferralRequestModel.referralNumber = 0; searchEReferralRequestModel.referralNumber = 0;
} else { } else {
searchEReferralRequestModel.referralNumber = int.parse(_searchTextController.text); searchEReferralRequestModel.referralNumber = int.parse(_searchTextController.text);
searchEReferralRequestModel.identificationNo = projectViewModel.user.patientIdentificationNo; searchEReferralRequestModel.identificationNo = projectViewModel.user!.patientIdentificationNo;
} }
await model.getEReferrals(searchEReferralRequestModel); await model.getEReferrals(searchEReferralRequestModel);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -85,7 +85,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
]; ];
List<RadioSelectionDialogModel> list = <RadioSelectionDialogModel>[]; List<RadioSelectionDialogModel> list = <RadioSelectionDialogModel>[];
for (int i = 0; i < searchCriteria.length; i++) { for (int i = 0; i < searchCriteria.length; i++) {
list.add(RadioSelectionDialogModel(projectViewModel.isArabic ? searchCriteria[i].nameAr : searchCriteria[i].name, searchCriteria[i].value)); list.add(RadioSelectionDialogModel(projectViewModel.isArabic ? searchCriteria[i].nameAr! : searchCriteria[i].name!, searchCriteria[i].value!));
} }
showDialog( showDialog(
context: context, context: context,
@ -168,14 +168,14 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(projectViewModel.isArabic ? model.allReferral[index].statusAr : model.allReferral[index].status, Text(projectViewModel.isArabic ? model.allReferral[index].statusAr! : model.allReferral[index].status!,
style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)), style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)),
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),
child: MyRichText(TranslationBase.of(context).patientName + ": ", model.allReferral[index].patientName, projectViewModel.isArabic)), child: MyRichText(TranslationBase.of(context).patientName + ": ", model.allReferral[index].patientName!, projectViewModel.isArabic)),
MyRichText(TranslationBase.of(context).hospital + ": ", model.allReferral[index].preferredBranchName, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).hospital + ": ", model.allReferral[index].preferredBranchName!, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).referralDate + ": ", MyRichText(TranslationBase.of(context).referralDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateNoTimeZone(model.allReferral[index].referralDate)), projectViewModel.isArabic), DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateNoTimeZone(model.allReferral[index].referralDate!)), projectViewModel.isArabic),
], ],
), ),
Icon(projectViewModel.isArabic ? Icons.arrow_back_ios_outlined : Icons.arrow_forward_outlined), Icon(projectViewModel.isArabic ? Icons.arrow_back_ios_outlined : Icons.arrow_forward_outlined),
@ -248,7 +248,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { {VoidCallback? suffixTap, bool isEnable = true, bool hasSelection = false, int? lines, bool isInputTypeNum = false}) {
return InkWell( return InkWell(
onTap: hasSelection ? () {} : null, onTap: hasSelection ? () {} : null,
child: Row( child: Row(
@ -309,6 +309,6 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
} }
String getSearchCriteriaName(ProjectViewModel projectViewModel) { String getSearchCriteriaName(ProjectViewModel projectViewModel) {
return projectViewModel.isArabic ? selectedCriteria.nameAr : selectedCriteria.name; return projectViewModel.isArabic ? selectedCriteria.nameAr! : selectedCriteria.name!;
} }
} }

@ -50,7 +50,7 @@ class AllHabibMedicalService extends StatefulWidget {
//TODO //TODO
final Function goToMyProfile; final Function goToMyProfile;
AllHabibMedicalService({Key key, this.goToMyProfile}); AllHabibMedicalService({Key? key, required this.goToMyProfile});
@override @override
_AllHabibMedicalServiceState createState() => _AllHabibMedicalServiceState(); _AllHabibMedicalServiceState createState() => _AllHabibMedicalServiceState();
@ -61,7 +61,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>(); PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
LocationUtils locationUtils; late LocationUtils locationUtils;
var weather = '--'; var weather = '--';
WeatherService _weatherService = WeatherService(); WeatherService _weatherService = WeatherService();
List<HmgServices> hmgServices = []; List<HmgServices> hmgServices = [];
@ -70,7 +70,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => {Geolocator.getLastKnownPosition().then((value) => setLocation(value))}); WidgetsBinding.instance.addPostFrameCallback((_) => {Geolocator.getLastKnownPosition().then((value) => setLocation(value!))});
}); });
super.initState(); super.initState();
} }

@ -30,7 +30,7 @@ class AllHabibMedicalSevicePage2 extends StatefulWidget {
class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2> { class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2> {
List<HmgServices> hmgServices = []; List<HmgServices> hmgServices = [];
LocationUtils locationUtils; late LocationUtils locationUtils;
var weather = '--'; var weather = '--';
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
@ -46,17 +46,17 @@ class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2>
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) async => { WidgetsBinding.instance.addPostFrameCallback((_) async => {
if (await PermissionService.isLocationEnabled()) if (await PermissionService.isLocationEnabled())
{Geolocator.getLastKnownPosition().then((value) => setLocation(value))} {Geolocator.getLastKnownPosition().then((value) => setLocation(value!))}
else else
{ {
if (Platform.isAndroid) if (Platform.isAndroid)
{ {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) => setLocation(value)); Geolocator.getLastKnownPosition().then((value) => setLocation(value!));
}) })
} }
else else
{Geolocator.getLastKnownPosition().then((value) => setLocation(value))} {Geolocator.getLastKnownPosition().then((value) => setLocation(value!))}
} }
}); });
}); });

@ -18,8 +18,8 @@ class AnicllaryOrders extends StatefulWidget {
} }
class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProviderStateMixin { class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProviderStateMixin {
TabController _tabController; TabController? _tabController;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
void initState() { void initState() {
super.initState(); super.initState();
@ -28,7 +28,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProv
void dispose() { void dispose() {
super.dispose(); super.dispose();
_tabController.dispose(); _tabController!.dispose();
} }
@override @override
@ -73,7 +73,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProv
), ),
mWidth(3), mWidth(3),
Text( Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
@ -95,7 +95,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProv
), ),
mWidth(3), mWidth(3),
Text( Text(
projectViewModel.user.patientID.toString(), projectViewModel!.user!.patientID.toString(),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
@ -117,7 +117,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProv
), ),
mWidth(3), mWidth(3),
Text( Text(
projectViewModel.user.patientIdentificationNo, projectViewModel!.user!.patientIdentificationNo!,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
@ -146,18 +146,18 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProv
reverse: true, reverse: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return DoctorCard( return DoctorCard(
onTap: () => ancillaryOrdersDetails(model.ancillaryLists[0].ancillaryOrderList[index], model.ancillaryLists[0].projectID), onTap: () => ancillaryOrdersDetails(model.ancillaryLists[0].ancillaryOrderList![index], model.ancillaryLists[0].projectID),
isInOutPatient: true, isInOutPatient: true,
name: TranslationBase.of(context).dr.toString() + " " + (model.ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""), name: TranslationBase.of(context).dr.toString() + " " + (model.ancillaryLists[0].ancillaryOrderList![index].doctorName ?? ""),
billNo: model.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(), billNo: model.ancillaryLists[0].ancillaryOrderList![index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: model.ancillaryLists[0].projectName, subName: model.ancillaryLists[0].projectName,
isLiveCareAppointment: false, isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(model.ancillaryLists[0].ancillaryOrderList[index].orderDate), date: DateUtil.convertStringToDate(model.ancillaryLists[0].ancillaryOrderList![index].orderDate!),
isSortByClinic: true, isSortByClinic: true,
); );
}, },
itemCount: model.ancillaryLists[0].ancillaryOrderList.length, itemCount: model.ancillaryLists[0].ancillaryOrderList!.length,
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
), ),
]); ]);

@ -37,18 +37,18 @@ class AnicllaryOrdersDetails extends StatefulWidget {
} }
class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTickerProviderStateMixin { class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTickerProviderStateMixin {
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
bool _agreeTerms = false; bool _agreeTerms = false;
String selectedPaymentMethod; String selectedPaymentMethod = "";
MyInAppBrowser browser; late MyInAppBrowser browser;
String transID = ""; String transID = "";
BuildContext localContext; late BuildContext localContext;
String selectedInstallmentPlan; String? selectedInstallmentPlan;
List<AncillaryOrderProcDetailsList> selectedProcList = []; List<AncillaryOrderProcDetailsList> selectedProcList = [];
String tamaraPaymentStatus; String? tamaraPaymentStatus;
String tamaraOrderID; String? tamaraOrderID;
void initState() { void initState() {
super.initState(); super.initState();
@ -207,7 +207,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
), ),
mWidth(3), mWidth(3),
Text( Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
@ -229,7 +229,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
), ),
mWidth(3), mWidth(3),
Text( Text(
projectViewModel.user.patientID.toString(), projectViewModel.user!.patientID.toString(),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
@ -251,7 +251,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
), ),
mWidth(3), mWidth(3),
Text( Text(
projectViewModel.user.patientIdentificationNo, projectViewModel.user!.patientIdentificationNo!,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
@ -296,7 +296,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
), ),
mWidth(3), mWidth(3),
Text( Text(
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList[0].orderNo.toString(), model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList![0].orderNo.toString(),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
@ -366,8 +366,8 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
); );
} }
Widget getAncillaryDetails(model) { Widget getAncillaryDetails(AnciallryOrdersViewModel model) {
Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList, (obj) => obj.procedureCategoryName); Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList!, (obj) => obj.procedureCategoryName);
return Padding(padding: EdgeInsets.only(top: 0, bottom: 200), child: getHeaderDetails(newMap)); return Padding(padding: EdgeInsets.only(top: 0, bottom: 200), child: getHeaderDetails(newMap));
} }
@ -406,7 +406,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: isProcedureDisabled(value[index]) ? Colors.grey[300] : Colors.white, color: isProcedureDisabled(value[index]) ? Colors.grey[300] : Colors.white,
border: Border.all(color: isProcedureDisabled(value[index]) ? Colors.grey[300] : Colors.white, width: 1), border: Border.all(color: isProcedureDisabled(value[index]) ? Colors.grey[300]! : Colors.white, width: 1),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
@ -493,31 +493,31 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
showDraggableDialog( showDraggableDialog(
context, context,
PaymentMethod( PaymentMethod(
onSelectedMethod: (String method, [String selectedInstallmentPlan]) { onSelectedMethod: (String method, [String? selectedInstallmentPlan]) {
selectedPaymentMethod = method; selectedPaymentMethod = method;
this.selectedInstallmentPlan = selectedInstallmentPlan; this.selectedInstallmentPlan = selectedInstallmentPlan!;
openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, model, selectedInstallmentPlan); openPayment(selectedPaymentMethod, projectViewModel.user!, double.parse(getTotalValue()), AppoitmentAllHistoryResultList(), model, selectedInstallmentPlan);
}, },
patientShare: double.parse(getTotalValue()), patientShare: double.parse(getTotalValue()),
isFromAdvancePayment: !projectViewModel.havePrivilege(94), isFromAdvancePayment: !projectViewModel.havePrivilege(94),
)); ));
} }
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo, AnciallryOrdersViewModel model, [String selectedInstallmentPlan]) { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo, AnciallryOrdersViewModel model, [String? selectedInstallmentPlan]) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID); transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user!.patientID!);
browser.openPaymentBrowser( browser.openPaymentBrowser(
amount, amount,
"Ancillary Orders Payment", "Ancillary Orders Payment",
transID, transID,
widget.projectID.toString(), widget.projectID.toString(),
projectViewModel.user.emailAddress, projectViewModel.user!.emailAddress!,
paymentMethod, paymentMethod,
projectViewModel.user.patientType, projectViewModel.user!.patientType,
projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!,
projectViewModel.user.patientID, projectViewModel.user!.patientID,
authenticatedUser, authenticatedUser,
browser, browser,
false, false,
@ -580,10 +580,10 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
service.getTamaraPaymentStatus(orderID).then((res) { service.getTamaraPaymentStatus(orderID).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res["status"].toString().toLowerCase() == "success") { if (res["status"].toString().toLowerCase() == "success") {
updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(this.selectedInstallmentPlan), appo); updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID!, int.parse(this.selectedInstallmentPlan!), appo);
} else { } else {
updateTamaraRequestStatus( updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID! : "",
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(this.selectedInstallmentPlan), appo); int.parse(this.selectedInstallmentPlan!), appo);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -598,7 +598,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) { service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (tamaraPaymentStatus.toLowerCase() == "approved") { if (tamaraPaymentStatus!.toLowerCase() == "approved") {
createAdvancePayment(res, appo); createAdvancePayment(res, appo);
// addAdvancedNumberRequestTamara("Tamara-Advance-0000", tamaraOrderID, appo.appointmentNo.toString(), appo); // addAdvancedNumberRequestTamara("Tamara-Advance-0000", tamaraOrderID, appo.appointmentNo.toString(), appo);
} }
@ -637,8 +637,8 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
// selectedProcList.forEach((element) { // selectedProcList.forEach((element) {
// ancillaryOrdersProcedureList.add(new AncillaryOrdersProcedureList(procedureID: num.parse(element.procedureID), procedureDescription: element.procedureName)); // ancillaryOrdersProcedureList.add(new AncillaryOrdersProcedureList(procedureID: num.parse(element.procedureID), procedureDescription: element.procedureName));
// }); // });
service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType, service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user!.patientType,
projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext, projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!, projectViewModel.user!.patientID!, localContext,
isAncillaryOrder: true) isAncillaryOrder: true)
.then((res) { .then((res) {
addAdvancedNumberRequest( addAdvancedNumberRequest(
@ -714,7 +714,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
addToSelectedProcedures(AnciallryOrdersViewModel model) { addToSelectedProcedures(AnciallryOrdersViewModel model) {
if (model.ancillaryListsDetails.isNotEmpty) { if (model.ancillaryListsDetails.isNotEmpty) {
selectedProcList.clear(); selectedProcList.clear();
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList.forEach((element) { model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList!.forEach((element) {
if (!isProcedureDisabled(element)) { if (!isProcedureDisabled(element)) {
selectedProcList.add(element); selectedProcList.add(element);
} }
@ -756,9 +756,9 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
} }
bool isProcedureDisabled(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) { bool isProcedureDisabled(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) {
if ((ancillaryOrderProcDetailsList.isApprovalRequired && !ancillaryOrderProcDetailsList.isApprovalCreated) || if ((ancillaryOrderProcDetailsList.isApprovalRequired! && !ancillaryOrderProcDetailsList.isApprovalCreated!) ||
(ancillaryOrderProcDetailsList.isApprovalCreated && ancillaryOrderProcDetailsList.approvalNo == 0) || (ancillaryOrderProcDetailsList.isApprovalCreated! && ancillaryOrderProcDetailsList.approvalNo == 0) ||
(ancillaryOrderProcDetailsList.isApprovalRequired && ancillaryOrderProcDetailsList.isApprovalCreated && ancillaryOrderProcDetailsList.approvalNo == 0)) { (ancillaryOrderProcDetailsList.isApprovalRequired! && ancillaryOrderProcDetailsList.isApprovalCreated! && ancillaryOrderProcDetailsList.approvalNo == 0)) {
return true; return true;
} else { } else {
return false; return false;

@ -6,7 +6,7 @@ class CommonRadioButtonDialog extends StatefulWidget {
final String title; final String title;
final int selectedIndex; final int selectedIndex;
final Function(int) onSelect; final Function(int) onSelect;
CommonRadioButtonDialog({Key key, this.title = "", this.selectedIndex = 0, this.list, this.onSelect}) : super(key: key); CommonRadioButtonDialog({Key? key, this.title = "", this.selectedIndex = 0, required this.list, required this.onSelect}) : super(key: key);
@override @override
_CommonRadioButtonDialogState createState() { _CommonRadioButtonDialogState createState() {
@ -58,7 +58,7 @@ class _CommonRadioButtonDialogState extends State<CommonRadioButtonDialog> {
dense: true, dense: true,
activeColor: Colors.black54, activeColor: Colors.black54,
groupValue: _selectedIndex, groupValue: _selectedIndex,
onChanged: (_index) => setState(() => _selectedIndex = _index), onChanged: (_index) => setState(() => _selectedIndex = _index!),
title: Text( title: Text(
widget.list[index], widget.list[index],
style: TextStyle(fontWeight: FontWeight.w500), style: TextStyle(fontWeight: FontWeight.w500),

@ -22,7 +22,7 @@ class H2oSetting extends StatefulWidget {
final UserDetailModel userDetailModel; final UserDetailModel userDetailModel;
final H2OViewModel viewModel; final H2OViewModel viewModel;
H2oSetting({Key key, this.userDetailModel, this.viewModel}) : super(key: key); H2oSetting({Key? key, required this.userDetailModel, required this.viewModel}) : super(key: key);
@override @override
_H2oSettingState createState() { _H2oSettingState createState() {
@ -51,7 +51,7 @@ class _H2oSettingState extends State<H2oSetting> {
DateTime _dobDate = DateTime.now(); DateTime _dobDate = DateTime.now();
DateTime _tempDate = DateTime.now(); DateTime _tempDate = DateTime.now();
UserDetailModel _userDetailModel; late UserDetailModel _userDetailModel;
@override @override
void initState() { void initState() {
@ -61,16 +61,16 @@ class _H2oSettingState extends State<H2oSetting> {
_weightValue = _userDetailModel?.weight ?? 50; _weightValue = _userDetailModel?.weight ?? 50;
_heightController.text = _heightValue.toStringAsFixed(0); _heightController.text = _heightValue.toStringAsFixed(0);
_weightController.text = _weightValue.toStringAsFixed(0); _weightController.text = _weightValue.toStringAsFixed(0);
_nameController.text = _userDetailModel.firstName; _nameController.text = _userDetailModel.firstName!;
_isWeightKG = _userDetailModel?.isWeightInKG ?? true; _isWeightKG = _userDetailModel?.isWeightInKG ?? true;
_isHeightCM = _userDetailModel?.isHeightInCM ?? true; _isHeightCM = _userDetailModel?.isHeightInCM ?? true;
_isGenderMale = (_userDetailModel?.gender ?? "M") == "M" ? true : false; _isGenderMale = (_userDetailModel?.gender ?? "M") == "M" ? true : false;
_dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB); _dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB!);
_selectedActiveLevel = _userDetailModel.activityID ?? 1; _selectedActiveLevel = _userDetailModel.activityID ?? 1;
readPrefs(); readPrefs();
} }
SharedPreferences prefs; late SharedPreferences prefs;
void readPrefs() async { void readPrefs() async {
prefs = await SharedPreferences.getInstance(); prefs = await SharedPreferences.getInstance();
@ -81,11 +81,8 @@ class _H2oSettingState extends State<H2oSetting> {
@override @override
void didChangeDependencies() { void didChangeDependencies() {
// TODO: implement didChangeDependencies
super.didChangeDependencies(); super.didChangeDependencies();
_activityLevelListEng = [TranslationBase.of(context).notActive, TranslationBase.of(context).lightActive, TranslationBase.of(context).modActive, TranslationBase.of(context).active]; _activityLevelListEng = [TranslationBase.of(context).notActive, TranslationBase.of(context).lightActive, TranslationBase.of(context).modActive, TranslationBase.of(context).active];
_remindedTimeListEng = ["1 ${TranslationBase.of(context).time}", "2 ${TranslationBase.of(context).times}", "3 ${TranslationBase.of(context).times}", "4 ${TranslationBase.of(context).times}"]; _remindedTimeListEng = ["1 ${TranslationBase.of(context).time}", "2 ${TranslationBase.of(context).times}", "3 ${TranslationBase.of(context).times}", "4 ${TranslationBase.of(context).times}"];
} }
@ -142,7 +139,7 @@ class _H2oSettingState extends State<H2oSetting> {
_commonRadioButtonsRow(TranslationBase.of(context).mililitre, TranslationBase.of(context).litre, _isUnitML, (value) { _commonRadioButtonsRow(TranslationBase.of(context).mililitre, TranslationBase.of(context).litre, _isUnitML, (value) {
if (_isUnitML != value) { if (_isUnitML != value) {
setState(() { setState(() {
_isUnitML = value; _isUnitML = value!;
}); });
} }
}), }),
@ -161,7 +158,7 @@ class _H2oSettingState extends State<H2oSetting> {
_commonRadioButtonsRow(TranslationBase.of(context).male, TranslationBase.of(context).female, _isGenderMale, (value) { _commonRadioButtonsRow(TranslationBase.of(context).male, TranslationBase.of(context).female, _isGenderMale, (value) {
if (_isGenderMale != value) { if (_isGenderMale != value) {
setState(() { setState(() {
_isGenderMale = value; _isGenderMale = value!;
}); });
} }
}), }),
@ -328,7 +325,7 @@ class _H2oSettingState extends State<H2oSetting> {
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return InkWell( return InkWell(
onTap: hasSelection ? () {} : null, onTap: hasSelection ? () {} : null,
child: Row( child: Row(
@ -400,7 +397,7 @@ class _H2oSettingState extends State<H2oSetting> {
); );
} }
Widget _commonRadioButtonsRow(String rightText, String leftText, bool checkParam, Function(bool) callBack) { Widget _commonRadioButtonsRow(String rightText, String leftText, bool checkParam, Function(bool?) callBack) {
return Row( return Row(
children: [ children: [
Row( Row(
@ -509,7 +506,7 @@ class _H2oSettingState extends State<H2oSetting> {
Expanded( Expanded(
flex: 1, flex: 1,
child: PopupMenuButton( child: PopupMenuButton(
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, null), child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, (){}),
onSelected: (value) { onSelected: (value) {
onUnitTap(value); onUnitTap(value);
}, },
@ -554,13 +551,13 @@ class _H2oSettingState extends State<H2oSetting> {
final CalendarPlugin _myPlugin = CalendarPlugin(); final CalendarPlugin _myPlugin = CalendarPlugin();
void _addReminderToCalender(int _selectedRemindedTime) async { void _addReminderToCalender(int _selectedRemindedTime) async {
bool _calendarPermission = await _myPlugin.hasPermissions(); bool? _calendarPermission = await _myPlugin.hasPermissions();
if (_calendarPermission) { if (_calendarPermission!) {
} else { } else {
await _myPlugin.requestPermissions(); await _myPlugin.requestPermissions();
} }
_myPlugin.hasPermissions().then((value) { _myPlugin.hasPermissions().then((value) {
if (!value) { if (!value!) {
_myPlugin.requestPermissions(); _myPlugin.requestPermissions();
} else { } else {
_myPlugin.getCalendars().then((value) => {}); _myPlugin.getCalendars().then((value) => {});
@ -574,8 +571,8 @@ class CommonDropDownView extends StatelessWidget {
final String title; final String title;
final String value; final String value;
final VoidCallback callback; final VoidCallback callback;
final IconData iconData; final IconData? iconData;
CommonDropDownView(this.title, this.value, this.callback, {Key key, this.iconData}) : super(key: key); CommonDropDownView(this.title, this.value, this.callback, {Key? key, this.iconData}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -27,7 +27,7 @@ class H2OPage extends StatefulWidget {
} }
class _H2OPageState extends State<H2OPage> with SingleTickerProviderStateMixin { class _H2OPageState extends State<H2OPage> with SingleTickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
@override @override
void initState() { void initState() {

@ -49,7 +49,7 @@ class MonthPage extends StatelessWidget {
style: TextStyle(fontSize: 16.0, color: Color(0xff2E303A), fontWeight: FontWeight.w600, letterSpacing: -0.64), style: TextStyle(fontSize: 16.0, color: Color(0xff2E303A), fontWeight: FontWeight.w600, letterSpacing: -0.64),
), ),
SizedBox(height: 24), SizedBox(height: 24),
CustomLineChart(model.userProgressForMonthDataSeries, projectViewModel.isArabic), CustomLineChart(model.userProgressForMonthDataSeries!, projectViewModel.isArabic),
], ],
), ),
), ),

@ -16,7 +16,7 @@ import 'package:wave/config.dart';
import 'package:wave/wave.dart'; import 'package:wave/wave.dart';
class TodayPage extends StatefulWidget { class TodayPage extends StatefulWidget {
TodayPage({Key key}) : super(key: key); TodayPage({Key? key}) : super(key: key);
@override @override
_TodayPageState createState() { _TodayPageState createState() {
@ -60,7 +60,7 @@ class _TodayPageState extends State<TodayPage> {
builder: (context, data) { builder: (context, data) {
String unit; String unit;
if (data.connectionState == ConnectionState.done) { if (data.connectionState == ConnectionState.done) {
isUnitML = data.data; isUnitML = data.data!;
} }
if (isUnitML) { if (isUnitML) {
unit = TranslationBase.of(context).ml; unit = TranslationBase.of(context).ml;
@ -348,7 +348,7 @@ class _TodayPageState extends State<TodayPage> {
InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: amount); InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: amount);
await model.insertUserActivity(insertUserActivityRequestModel); await model.insertUserActivity(insertUserActivityRequestModel);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
FocusManager.instance.primaryFocus.unfocus(); FocusManager.instance.primaryFocus!.unfocus();
}, },
), ),
); );

@ -48,7 +48,7 @@ class WeekPage extends StatelessWidget {
style: TextStyle(fontSize: 16.0, color: Color(0xff2E303A), fontWeight: FontWeight.w600, letterSpacing: -0.64), style: TextStyle(fontSize: 16.0, color: Color(0xff2E303A), fontWeight: FontWeight.w600, letterSpacing: -0.64),
), ),
SizedBox(height: 24), SizedBox(height: 24),
CustomLineChart(model.userProgressForWeekDataSeries, projectViewModel.isArabic), CustomLineChart(model.userProgressForWeekDataSeries!, projectViewModel.isArabic),
], ],
), ),
), ),

@ -9,7 +9,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class H20BottomNavigationBar extends StatelessWidget { class H20BottomNavigationBar extends StatelessWidget {
H20BottomNavigationBar({Key key}) : super(key: key); H20BottomNavigationBar({Key? key}) : super(key: key);
PageController pageController = PageController(keepPage: true); PageController pageController = PageController(keepPage: true);
int currentTab = 0; int currentTab = 0;

@ -24,10 +24,10 @@ class HealthWeatherIndicator extends StatefulWidget {
class _HospitalsPageState extends State<HealthWeatherIndicator> { class _HospitalsPageState extends State<HealthWeatherIndicator> {
var data; var data;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
LocationUtils locationUtils; late LocationUtils locationUtils;
var weather = '--'; var weather = '--';
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -125,7 +125,7 @@ class _HospitalsPageState extends State<HealthWeatherIndicator> {
Padding( Padding(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
child: AppText( child: AppText(
projectViewModel.isArabic ? mode.weatherIndicatorData[0].cityNameN : mode.weatherIndicatorData[0].cityName, projectViewModel.isArabic ? mode.weatherIndicatorData[0].cityNameN! : mode.weatherIndicatorData[0].cityName!,
fontSize: 24, fontSize: 24,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
)), )),

@ -66,8 +66,8 @@ class _BariatricsPageState extends State<BariatricsPage> {
title: Texts("${item.diseases}"), title: Texts("${item.diseases}"),
activeColor: Colors.blue.shade700, activeColor: Colors.blue.shade700,
value: item.diseasesID, value: item.diseasesID,
groupValue: _selectedDisease != null ? _selectedDisease.diseasesID : -1, groupValue: _selectedDisease != null ? _selectedDisease!.diseasesID : -1,
selected: _selectedDisease != null ? item.diseasesID == _selectedDisease.diseasesID : false, selected: _selectedDisease != null ? item.diseasesID == _selectedDisease!.diseasesID : false,
onChanged: (val) { onChanged: (val) {
setState(() { setState(() {
_selectedDisease = item; _selectedDisease = item;
@ -91,7 +91,7 @@ class _BariatricsPageState extends State<BariatricsPage> {
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: BorderedButton( child: BorderedButton(
TranslationBase.of(context).continues, TranslationBase.of(context).continues,
fontSize: SizeConfig.textMultiplier * 2.1, fontSize: SizeConfig.textMultiplier! * 2.1,
textColor: Colors.white, textColor: Colors.white,
vPadding: 8, vPadding: 8,
hPadding: 8, hPadding: 8,
@ -114,7 +114,7 @@ class _BariatricsPageState extends State<BariatricsPage> {
margin: EdgeInsets.only(bottom: 16.0, left: 16, right: 16), margin: EdgeInsets.only(bottom: 16.0, left: 16, right: 16),
child: BorderedButton( child: BorderedButton(
TranslationBase.of(context).skip, TranslationBase.of(context).skip,
fontSize: SizeConfig.textMultiplier * 2.1, fontSize: SizeConfig.textMultiplier! * 2.1,
textColor: Colors.blue, textColor: Colors.blue,
vPadding: 8, vPadding: 8,
hPadding: 8, hPadding: 8,
@ -165,7 +165,7 @@ class _BariatricsPageState extends State<BariatricsPage> {
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital _patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));

@ -21,9 +21,9 @@ class BMICalculator extends StatefulWidget {
class _BMICalculatorState extends State<BMICalculator> { class _BMICalculatorState extends State<BMICalculator> {
TextEditingController textController = new TextEditingController(); TextEditingController textController = new TextEditingController();
String textResult; String? textResult;
String msg; String? msg;
double bmiResult; double? bmiResult;
TextEditingController _heightController = TextEditingController(); TextEditingController _heightController = TextEditingController();
TextEditingController _weightController = TextEditingController(); TextEditingController _weightController = TextEditingController();
@ -51,29 +51,29 @@ class _BMICalculatorState extends State<BMICalculator> {
bmiResult = _weightValue / pow(_heightValue / 100, 2); bmiResult = _weightValue / pow(_heightValue / 100, 2);
return bmiResult; return bmiResult!;
} }
void showTextResult(BuildContext context) { void showTextResult(BuildContext context) {
if (bmiResult >= 30) { if (bmiResult! >= 30) {
textResult = TranslationBase.of(context).obese; textResult = TranslationBase.of(context).obese;
} else if (bmiResult < 30 && bmiResult >= 25) { } else if (bmiResult! < 30 && bmiResult! >= 25) {
textResult = TranslationBase.of(context).overWeight; textResult = TranslationBase.of(context).overWeight;
} else if (bmiResult < 25 && bmiResult >= 18.5) { } else if (bmiResult! < 25 && bmiResult! >= 18.5) {
textResult = TranslationBase.of(context).healthy; textResult = TranslationBase.of(context).healthy;
} else if (bmiResult < 18.5) { } else if (bmiResult! < 18.5) {
textResult = TranslationBase.of(context).underWeight; textResult = TranslationBase.of(context).underWeight;
} }
} }
void showMsg(BuildContext context) { void showMsg(BuildContext context) {
if (bmiResult >= 30) { if (bmiResult! >= 30) {
msg = TranslationBase.of(context).bmiCalcMsgObese; msg = TranslationBase.of(context).bmiCalcMsgObese;
} else if (bmiResult < 30 && bmiResult >= 25) { } else if (bmiResult! < 30 && bmiResult! >= 25) {
msg = TranslationBase.of(context).bmiCalcMsgOverweight; msg = TranslationBase.of(context).bmiCalcMsgOverweight;
} else if (bmiResult < 25 && bmiResult >= 18.5) { } else if (bmiResult! < 25 && bmiResult! >= 18.5) {
msg = TranslationBase.of(context).bmiCalcMsgHealthy; msg = TranslationBase.of(context).bmiCalcMsgHealthy;
} else if (bmiResult < 18.5) { } else if (bmiResult! < 18.5) {
msg = TranslationBase.of(context).bmiCalcMsgUnderWeight; msg = TranslationBase.of(context).bmiCalcMsgUnderWeight;
} }
} }
@ -184,9 +184,9 @@ class _BMICalculatorState extends State<BMICalculator> {
context, context,
FadePage( FadePage(
page: ResultPage( page: ResultPage(
finalResult: bmiResult, finalResult: bmiResult!,
textResult: textResult, textResult: textResult!,
msg: msg, msg: msg!,
), ),
), ),
); );
@ -267,7 +267,7 @@ class _BMICalculatorState extends State<BMICalculator> {
Expanded( Expanded(
flex: 1, flex: 1,
child: PopupMenuButton( child: PopupMenuButton(
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, null), child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, (){}),
onSelected: (value) { onSelected: (value) {
onUnitTap(value); onUnitTap(value);
}, },
@ -283,9 +283,9 @@ class CommonDropDownView extends StatelessWidget {
final String title; final String title;
final String value; final String value;
final VoidCallback callback; final VoidCallback callback;
final IconData iconData; final IconData? iconData;
CommonDropDownView(this.title, this.value, this.callback, {Key key, this.iconData}) : super(key: key); CommonDropDownView(this.title, this.value, this.callback, {Key? key, this.iconData}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -21,16 +21,16 @@ class ResultPage extends StatefulWidget {
final String textResult; final String textResult;
final String msg; final String msg;
ResultPage({this.finalResult, this.textResult, this.msg}); ResultPage({required this.finalResult, required this.textResult, required this.msg});
@override @override
_ResultPageState createState() => _ResultPageState(); _ResultPageState createState() => _ResultPageState();
} }
class _ResultPageState extends State<ResultPage> { class _ResultPageState extends State<ResultPage> {
Color inductorColor; Color? inductorColor;
double percent; double? percent;
Color colorInductor() { Color colorInductor() {
if (widget.finalResult >= 30) { if (widget.finalResult >= 30) {
@ -42,7 +42,7 @@ class _ResultPageState extends State<ResultPage> {
} else if (widget.finalResult < 18.5) { } else if (widget.finalResult < 18.5) {
inductorColor = Color(0xff1BE0EE); inductorColor = Color(0xff1BE0EE);
} }
return inductorColor; return inductorColor!;
} }
double percentInductor() { double percentInductor() {
@ -55,7 +55,7 @@ class _ResultPageState extends State<ResultPage> {
} else if (widget.finalResult < 18.5) { } else if (widget.finalResult < 18.5) {
percent = 0.25; percent = 0.25;
} }
return percent; return percent!;
} }
@override @override
@ -163,7 +163,7 @@ class _ResultPageState extends State<ResultPage> {
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital _patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));

@ -42,14 +42,14 @@ class _BmrCalculatorState extends State<BmrCalculator> {
double _heightValue = 150; double _heightValue = 150;
double _weightValue = 40; double _weightValue = 40;
List<PopupMenuItem> _heightPopupList =[]; List<PopupMenuItem> _heightPopupList = [];
List<PopupMenuItem> _weightPopupList =[]; List<PopupMenuItem> _weightPopupList = [];
// int age = 0; // int age = 0;
// int height = 0; // int height = 0;
// int weight = 0; // int weight = 0;
double bmrResult = 0; double bmrResult = 0;
String dropdownValue = null; String dropdownValue = '';
double calories = 0; double calories = 0;
void updateColor(int type) { void updateColor(int type) {
@ -357,7 +357,8 @@ class _BmrCalculatorState extends State<BmrCalculator> {
height: 18, height: 18,
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
value: dropdownValue, key: clinicDropdownKey, value: dropdownValue,
key: clinicDropdownKey,
icon: Icon(Icons.arrow_downward), icon: Icon(Icons.arrow_downward),
iconSize: 0, iconSize: 0,
elevation: 16, elevation: 16,
@ -367,9 +368,9 @@ class _BmrCalculatorState extends State<BmrCalculator> {
height: 2, height: 2,
color: Colors.black54, color: Colors.black54,
), ),
onChanged: (String newValue) { onChanged: (String? newValue) {
setState(() { setState(() {
dropdownValue = newValue; dropdownValue = newValue!;
}); });
}, },
items: <String>[ items: <String>[
@ -436,27 +437,28 @@ class _BmrCalculatorState extends State<BmrCalculator> {
} }
void openDropdown(GlobalKey key) { void openDropdown(GlobalKey key) {
GestureDetector detector; GestureDetector? detector;
void searchForGestureDetector(BuildContext element) { void searchForGestureDetector(BuildContext element) {
element.visitChildElements((element) { element.visitChildElements((element) {
if (element.widget != null && element.widget is GestureDetector) { if (element.widget != null && element.widget is GestureDetector) {
detector = element.widget; detector = element.widget as GestureDetector?;
return false; //return false;
} else { } else {
searchForGestureDetector(element); searchForGestureDetector(element);
} }
return true; //return true;
}); });
} }
searchForGestureDetector(key.currentContext); searchForGestureDetector(key.currentContext!);
assert(detector != null); assert(detector != null);
detector.onTap(); detector!.onTap!();
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
@ -605,7 +607,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
Expanded( Expanded(
flex: 1, flex: 1,
child: PopupMenuButton( child: PopupMenuButton(
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, null), child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, (){}),
onSelected: (value) { onSelected: (value) {
onUnitTap(value); onUnitTap(value);
}, },
@ -621,9 +623,9 @@ class CommonDropDownView extends StatelessWidget {
final String title; final String title;
final String value; final String value;
final VoidCallback callback; final VoidCallback callback;
final IconData iconData; final IconData? iconData;
CommonDropDownView(this.title, this.value, this.callback, {Key key, this.iconData}) : super(key: key); CommonDropDownView(this.title, this.value, this.callback, {Key? key, this.iconData}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -17,7 +17,7 @@ class BmrResultPage extends StatelessWidget {
final double bmrResult; final double bmrResult;
final double calories; final double calories;
BmrResultPage({this.bmrResult, this.calories}); BmrResultPage({required this.bmrResult, required this.calories});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -148,7 +148,7 @@ class BmrResultPage extends StatelessWidget {
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element)); _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
} }

@ -61,15 +61,15 @@ class _BodyFatState extends State<BodyFat> {
// int heightCm = 0; // int heightCm = 0;
// int heightFt = 0; // int heightFt = 0;
// int hip = 5; // int hip = 5;
double heightInches; double? heightInches;
double minRange; double? minRange;
double maxRange; double? maxRange;
double overWeightBy; double? overWeightBy;
// int waist = 5; // int waist = 5;
double bodyFat = 0; double bodyFat = 0;
double fat = 0; double fat = 0;
String dropdownValue; String? dropdownValue;
double calories = 0; double calories = 0;
String textResult = ''; String textResult = '';
@ -479,7 +479,7 @@ class _BodyFatState extends State<BodyFat> {
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
@ -628,7 +628,7 @@ class _BodyFatState extends State<BodyFat> {
Expanded( Expanded(
flex: 1, flex: 1,
child: PopupMenuButton( child: PopupMenuButton(
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, null), child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, (){}),
onSelected: (value) { onSelected: (value) {
onUnitTap(value); onUnitTap(value);
}, },
@ -644,9 +644,9 @@ class CommonDropDownView extends StatelessWidget {
final String title; final String title;
final String value; final String value;
final VoidCallback callback; final VoidCallback callback;
final IconData iconData; final IconData? iconData;
CommonDropDownView(this.title, this.value, this.callback, {Key key, this.iconData}) : super(key: key); CommonDropDownView(this.title, this.value, this.callback, {Key? key, this.iconData}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -18,9 +18,9 @@ class FatResult extends StatelessWidget {
final double fat; final double fat;
final String textResult; final String textResult;
FatResult({this.bodyFat, this.fat, this.textResult = ''}); FatResult({required this.bodyFat, required this.fat, this.textResult = ''});
Color inductorColor; Color? inductorColor;
Color colorInductor() { Color colorInductor() {
if (bodyFat >= 17) { if (bodyFat >= 17) {
@ -32,7 +32,7 @@ class FatResult extends StatelessWidget {
} else if (bodyFat > 45) { } else if (bodyFat > 45) {
inductorColor = Color(0xff1BE0EE); inductorColor = Color(0xff1BE0EE);
} }
return inductorColor; return inductorColor!;
} }
@override @override
@ -84,18 +84,13 @@ class FatResult extends StatelessWidget {
), ),
mHeight(20), mHeight(20),
Text( Text(
textResult, style: TextStyle( textResult,
fontSize: 14, style: TextStyle(fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600, color: CustomColors.textColor),
letterSpacing: -0.56,
fontWeight: FontWeight.w600,
color: CustomColors.textColor
),
), ),
], ],
).withBorderedContainer, ).withBorderedContainer,
), ),
mFlex(1), mFlex(1),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white, color: Colors.white,
@ -107,7 +102,6 @@ class FatResult extends StatelessWidget {
}, },
), ),
), ),
], ],
), ),
); );
@ -118,7 +112,7 @@ class FatResult extends StatelessWidget {
BariatricsService service = new BariatricsService(); BariatricsService service = new BariatricsService();
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =[]; List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
service.getCalculationDoctors(calculationID: 5).then((res) { service.getCalculationDoctors(calculationID: 5).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -150,7 +144,7 @@ class FatResult extends StatelessWidget {
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element)); _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
} }
@ -165,18 +159,19 @@ class FatResult extends StatelessWidget {
}); });
} }
} }
extension BorderedContainer on Widget { extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container( Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
color: Colors.white, color: Colors.white,
border: Border.all( border: Border.all(
color: Color(0xffefefef), color: Color(0xffefefef),
width: 1, width: 1,
), ),
), ),
child: this, child: this,
); );
} }

@ -37,14 +37,14 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
TextEditingController _heightController = new TextEditingController(); TextEditingController _heightController = new TextEditingController();
TextEditingController _weightController = TextEditingController(); TextEditingController _weightController = TextEditingController();
List<PopupMenuItem> _heightPopupList =[]; List<PopupMenuItem> _heightPopupList = [];
List<PopupMenuItem> _weightPopupList =[]; List<PopupMenuItem> _weightPopupList = [];
// int age = 0; // int age = 0;
// int height = 0; // int height = 0;
// int weight = 0; // int weight = 0;
double calories; double? calories;
String dropdownValue; String dropdownValue = '';
void updateColor(int type) { void updateColor(int type) {
//MG/DLT card //MG/DLT card
@ -261,7 +261,6 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
InkWell( InkWell(
onTap: () { onTap: () {
// dropdownKey.currentState; // dropdownKey.currentState;
@ -300,16 +299,16 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
height: 2, height: 2,
color: Colors.black54, color: Colors.black54,
), ),
onChanged: (String newValue) { onChanged: (String? newValue) {
setState(() { setState(() {
dropdownValue = newValue; dropdownValue = newValue!;
}); });
}, },
items: <String>[ items: <String>[
TranslationBase.of(context).almostInactive, TranslationBase.of(context).almostInactive,
TranslationBase.of(context).lightActive, TranslationBase.of(context).lightActive,
TranslationBase.of(context).lightActive1, TranslationBase.of(context).lightActive1,
TranslationBase.of(context).superActive, TranslationBase.of(context).superActive,
].map<DropdownMenuItem<String>>((String value) { ].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
@ -350,7 +349,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
context, context,
FadePage( FadePage(
page: CalorieResultPage( page: CalorieResultPage(
calorie: calories, calorie: calories!,
)), )),
); );
} }
@ -363,28 +362,51 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
); );
} }
// void openDropdown(GlobalKey key) {
// GestureDetector detector;
// void searchForGestureDetector(BuildContext element) {
// element.visitChildElements((element) {
// if (element.widget != null && element.widget is GestureDetector) {
// detector = element.widget;
// return false;
// } else {
// searchForGestureDetector(element);
// }
//
// return true;
// });
// }
//
// searchForGestureDetector(key.currentContext);
// assert(detector != null);
//
// detector.onTap();
// }
//
void openDropdown(GlobalKey key) { void openDropdown(GlobalKey key) {
GestureDetector detector; GestureDetector? detector;
void searchForGestureDetector(BuildContext element) { void searchForGestureDetector(BuildContext element) {
element.visitChildElements((element) { element.visitChildElements((element) {
if (element.widget != null && element.widget is GestureDetector) { if (element.widget != null && element.widget is GestureDetector) {
detector = element.widget; detector = element.widget as GestureDetector?;
return false; //return false;
} else { } else {
searchForGestureDetector(element); searchForGestureDetector(element);
} }
return true; //return true;
}); });
} }
searchForGestureDetector(key.currentContext); searchForGestureDetector(key.currentContext!);
assert(detector != null); assert(detector != null);
detector.onTap(); detector!.onTap!();
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
@ -533,7 +555,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
Expanded( Expanded(
flex: 1, flex: 1,
child: PopupMenuButton( child: PopupMenuButton(
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, null), child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, (){}),
onSelected: (value) { onSelected: (value) {
onUnitTap(value); onUnitTap(value);
}, },
@ -549,9 +571,9 @@ class CommonDropDownView extends StatelessWidget {
final String title; final String title;
final String value; final String value;
final VoidCallback callback; final VoidCallback callback;
final IconData iconData; final IconData? iconData;
CommonDropDownView(this.title, this.value, this.callback, {Key key, this.iconData}) : super(key: key); CommonDropDownView(this.title, this.value, this.callback, {Key? key, this.iconData}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -16,7 +16,7 @@ import 'package:percent_indicator/circular_percent_indicator.dart';
class CalorieResultPage extends StatelessWidget { class CalorieResultPage extends StatelessWidget {
final double calorie; final double calorie;
CalorieResultPage({this.calorie}); CalorieResultPage({required this.calorie});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -147,7 +147,7 @@ class CalorieResultPage extends StatelessWidget {
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element)); _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
} }

@ -19,23 +19,23 @@ class Carbs extends StatefulWidget {
class _CarbsState extends State<Carbs> { class _CarbsState extends State<Carbs> {
TextEditingController textController = new TextEditingController(); TextEditingController textController = new TextEditingController();
final GlobalKey clinicDropdownKey = GlobalKey(); final GlobalKey clinicDropdownKey = GlobalKey();
int calories; int? calories;
String dropdownValue; late String dropdownValue;
bool _visible = false; bool _visible = false;
int meals; int? meals;
int protein; int? protein;
int carbs; int? carbs;
int fat; int? fat;
double pCal; double? pCal;
double cCal; double? cCal;
double fCal; double? fCal;
double pCalGram; double? pCalGram;
double cCalGram; double? cCalGram;
double fCalGram; double? fCalGram;
double pCalMeal; double? pCalMeal;
double cCalMeal; double? cCalMeal;
double fCalMeal; double? fCalMeal;
void calculateDietRatios() { void calculateDietRatios() {
if (dropdownValue == TranslationBase.of(context).dietVeryLow) { if (dropdownValue == TranslationBase.of(context).dietVeryLow) {
@ -67,17 +67,17 @@ class _CarbsState extends State<Carbs> {
} }
void calculate() { void calculate() {
pCal = (protein / 100.0) * int.parse(textController.text).ceil(); pCal = (protein! / 100.0) * int.parse(textController.text).ceil();
cCal = (carbs / 100.0) * int.parse(textController.text); cCal = (carbs! / 100.0) * int.parse(textController.text);
fCal = (fat / 100) * int.parse(textController.text); fCal = (fat! / 100) * int.parse(textController.text);
pCalGram = pCal / 4.0; pCalGram = pCal! / 4.0;
cCalGram = cCal / 4.0; cCalGram = cCal! / 4.0;
fCalGram = fCal / 9.0; fCalGram = fCal! / 9.0;
pCalMeal = pCalGram / meals.ceil(); pCalMeal = pCalGram! / meals!.ceil();
cCalMeal = cCalGram / meals.ceil(); cCalMeal = cCalGram! / meals!.ceil();
fCalMeal = fCalGram / meals.ceil(); fCalMeal = fCalGram! / meals!.ceil();
} }
@override @override
@ -171,7 +171,8 @@ class _CarbsState extends State<Carbs> {
height: 18, height: 18,
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
value: dropdownValue, key: clinicDropdownKey, value: dropdownValue,
key: clinicDropdownKey,
icon: Icon(Icons.arrow_downward), icon: Icon(Icons.arrow_downward),
iconSize: 0, iconSize: 0,
elevation: 16, elevation: 16,
@ -181,9 +182,9 @@ class _CarbsState extends State<Carbs> {
height: 2, height: 2,
color: Colors.black54, color: Colors.black54,
), ),
onChanged: (String newValue) { onChanged: (String? newValue) {
setState(() { setState(() {
dropdownValue = newValue; dropdownValue = newValue!;
calculateDietRatios(); calculateDietRatios();
}); });
}, },
@ -196,7 +197,8 @@ class _CarbsState extends State<Carbs> {
].map<DropdownMenuItem<String>>((String value) { ].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontSize: 11, letterSpacing: -0.44, fontWeight: FontWeight.w600)), child: Text(value,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontSize: 11, letterSpacing: -0.44, fontWeight: FontWeight.w600)),
); );
}).toList(), }).toList(),
), ),
@ -235,15 +237,15 @@ class _CarbsState extends State<Carbs> {
context, context,
FadePage( FadePage(
page: CarbsResult( page: CarbsResult(
cCal: cCal, cCal: cCal!,
pCal: pCal, pCal: pCal!,
fCal: fCal, fCal: fCal!,
pCalGram: pCalGram, pCalGram: pCalGram!,
pCalMeal: pCalMeal, pCalMeal: pCalMeal!,
fCalGram: fCalGram, fCalGram: fCalGram!,
fCalMeal: fCalMeal, fCalMeal: fCalMeal!,
cCalGram: cCalGram, cCalGram: cCalGram!,
cCalMeal: cCalMeal, cCalMeal: cCalMeal!,
)), )),
); );
} }
@ -256,29 +258,52 @@ class _CarbsState extends State<Carbs> {
); );
} }
void openDropdown(GlobalKey key) { void openDropdown(GlobalKey key) {
GestureDetector detector; GestureDetector? detector;
void searchForGestureDetector(BuildContext element) { void searchForGestureDetector(BuildContext element) {
element.visitChildElements((element) { element.visitChildElements((element) {
if (element.widget != null && element.widget is GestureDetector) { if (element.widget != null && element.widget is GestureDetector) {
detector = element.widget; detector = element.widget as GestureDetector?;
return false; //return false;
} else { } else {
searchForGestureDetector(element); searchForGestureDetector(element);
} }
return true; //return true;
}); });
} }
searchForGestureDetector(key.currentContext); searchForGestureDetector(key.currentContext!);
assert(detector != null); assert(detector != null);
detector.onTap(); detector!.onTap!();
} }
// void openDropdown(GlobalKey key) {
// GestureDetector detector;
// void searchForGestureDetector(BuildContext element) {
// element.visitChildElements((element) {
// if (element.widget != null && element.widget is GestureDetector) {
// detector = element.widget;
// return false;
// } else {
// searchForGestureDetector(element);
// }
//
// return true;
// });
// }
//
// searchForGestureDetector(key.currentContext);
// assert(detector != null);
//
// detector.onTap();
// }
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,

@ -27,7 +27,7 @@ class CarbsResult extends StatelessWidget {
double cCalMeal; double cCalMeal;
double fCalMeal; double fCalMeal;
CarbsResult({this.pCal, this.cCal, this.fCal, this.pCalGram, this.cCalGram, this.fCalGram, this.fCalMeal, this.cCalMeal, this.pCalMeal}); CarbsResult({required this.pCal, required this.cCal, required this.fCal, required this.pCalGram, required this.cCalGram, required this.fCalGram, required this.fCalMeal, required this.cCalMeal, required this.pCalMeal});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -170,7 +170,7 @@ class CarbsResult extends StatelessWidget {
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element)); _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
} }

@ -103,7 +103,7 @@ class DeliveryDueResult extends StatelessWidget {
); );
} }
Widget showItem(String title, String value, {Color titleColor}) { Widget showItem(String title, String value, {Color? titleColor}) {
return Container( return Container(
width: double.infinity, width: double.infinity,
child: Column( child: Column(
@ -170,7 +170,7 @@ class DeliveryDueResult extends StatelessWidget {
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element)); _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
} }

@ -6,11 +6,12 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart';
class DoctorList extends StatelessWidget { class DoctorList extends StatelessWidget {
DiseasesByClinic diseaseByClinic; DiseasesByClinic diseaseByClinic;
DoctorList({Key key, this.diseaseByClinic}) : super(key: key);
DoctorList({Key? key, required this.diseaseByClinic}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -56,8 +57,7 @@ class DoctorList extends StatelessWidget {
flex: 1, flex: 1,
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(100.0), borderRadius: BorderRadius.circular(100.0),
child: Image.network(doctor.doctorImageURL, child: Image.network(doctor.doctorImageURL!, fit: BoxFit.fill, height: 60.0, width: 60.0),
fit: BoxFit.fill, height: 60.0, width: 60.0),
), ),
), ),
Expanded( Expanded(
@ -69,32 +69,51 @@ class DoctorList extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
if (doctor.doctorTitle != null) if (doctor.doctorTitle != null)
Text(doctor.doctorTitle + " " + doctor.name, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0)), Text(doctor.doctorTitle! + " " + doctor.name!, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0)),
Container( Container(
margin: EdgeInsets.only(top: 3.0), margin: EdgeInsets.only(top: 3.0),
child: Text(doctor.clinicName != null ? doctor.clinicName : "", style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: 1.0)), child: Text(doctor.clinicName != null ? doctor.clinicName! : "", style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: 1.0)),
), ),
Container( Container(
margin: EdgeInsets.only(top: 3.0), margin: EdgeInsets.only(top: 3.0),
child: Text(doctor.projectName, style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: 1.0)), child: Text(doctor.projectName!, style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: 1.0)),
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
RatingBar.readOnly( // RatingBar.readOnly(
initialRating: doctor.actualDoctorRate.toDouble(), // initialRating: doctor.actualDoctorRate.toDouble(),
size: 20.0, // size: 20.0,
filledColor: Colors.yellow[700], // filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500], // emptyColor: Colors.grey[500],
isHalfAllowed: true, // isHalfAllowed: true,
halfFilledIcon: Icons.star_half, // halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, // filledIcon: Icons.star,
emptyIcon: Icons.star, // emptyIcon: Icons.star,
// ),
// Changed By Aamir
RatingBar(
initialRating: 3,
direction: Axis.horizontal,
allowHalfRating: true,
itemCount: 5,
itemSize: 20,
ignoreGestures: true,
ratingWidget: RatingWidget(
full: Icon(Icons.star),
half: Icon(Icons.star_half),
empty: Icon(Icons.star),
),
tapOnlyMode: true,
itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
onRatingUpdate: (rating) {
print(rating);
},
), ),
Container( Container(
child: Image.network(doctor.nationalityFlagURL, child: Image.network(doctor.nationalityFlagURL!, width: 25.0, height: 25.0),
width: 25.0, height: 25.0),
), ),
], ],
), ),

@ -27,17 +27,17 @@ class _IdealBodyState extends State<IdealBody> {
// int age = 0; // int age = 0;
// int height = 0; // int height = 0;
double heightInches; double? heightInches;
double minRange; double? minRange;
double maxRange; double? maxRange;
double overWeightBy; double? overWeightBy;
int weight = 0; int weight = 0;
double idealWeight = 0; double idealWeight = 0;
String dropdownValue = null; late String dropdownValue;
double calories = 0; double calories = 0;
String textResult = ''; String textResult = '';
double maxIdealWeight; double? maxIdealWeight;
double heightFeet; double? heightFeet;
final GlobalKey clinicDropdownKey = GlobalKey(); final GlobalKey clinicDropdownKey = GlobalKey();
bool _isHeightCM = true; bool _isHeightCM = true;
@ -48,8 +48,8 @@ class _IdealBodyState extends State<IdealBody> {
TextEditingController _heightController = new TextEditingController(); TextEditingController _heightController = new TextEditingController();
TextEditingController _weightController = TextEditingController(); TextEditingController _weightController = TextEditingController();
List<PopupMenuItem> _heightPopupList =[]; List<PopupMenuItem> _heightPopupList = [];
List<PopupMenuItem> _weightPopupList =[]; List<PopupMenuItem> _weightPopupList = [];
void calculateIdealWeight() { void calculateIdealWeight() {
var height = int.parse(_heightController.text); var height = int.parse(_heightController.text);
@ -219,9 +219,9 @@ class _IdealBodyState extends State<IdealBody> {
height: 2, height: 2,
color: Colors.black54, color: Colors.black54,
), ),
onChanged: (String newValue) { onChanged: (String? newValue) {
setState(() { setState(() {
dropdownValue = newValue; dropdownValue = newValue!;
}); });
}, },
items: <String>[ items: <String>[
@ -267,9 +267,9 @@ class _IdealBodyState extends State<IdealBody> {
FadePage( FadePage(
page: IdealBodyResult( page: IdealBodyResult(
idealBodyWeight: idealWeight, idealBodyWeight: idealWeight,
minRange: minRange, minRange: minRange!,
mixRange: maxRange, mixRange: maxRange!,
overWeightBy: overWeightBy, overWeightBy: overWeightBy!,
textResult: textResult, textResult: textResult,
)), )),
); );
@ -283,28 +283,51 @@ class _IdealBodyState extends State<IdealBody> {
); );
} }
void openDropdown(GlobalKey key) { void openDropdown(GlobalKey key) {
GestureDetector detector; GestureDetector? detector;
void searchForGestureDetector(BuildContext element) { void searchForGestureDetector(BuildContext element) {
element.visitChildElements((element) { element.visitChildElements((element) {
if (element.widget != null && element.widget is GestureDetector) { if (element.widget != null && element.widget is GestureDetector) {
detector = element.widget; detector = element.widget as GestureDetector?;
return false; //return false;
} else { } else {
searchForGestureDetector(element); searchForGestureDetector(element);
} }
return true; //return true;
}); });
} }
searchForGestureDetector(key.currentContext); searchForGestureDetector(key.currentContext!);
assert(detector != null); assert(detector != null);
detector.onTap(); detector!.onTap!();
} }
// void openDropdown(GlobalKey key) {
// GestureDetector detector;
// void searchForGestureDetector(BuildContext element) {
// element.visitChildElements((element) {
// if (element.widget != null && element.widget is GestureDetector) {
// detector = element.widget;
// return false;
// } else {
// searchForGestureDetector(element);
// }
//
// return true;
// });
// }
//
// searchForGestureDetector(key.currentContext);
// assert(detector != null);
//
// detector.onTap();
// }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
@ -453,7 +476,7 @@ class _IdealBodyState extends State<IdealBody> {
Expanded( Expanded(
flex: 1, flex: 1,
child: PopupMenuButton( child: PopupMenuButton(
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, null), child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, (){}),
onSelected: (value) { onSelected: (value) {
onUnitTap(value); onUnitTap(value);
}, },
@ -469,9 +492,9 @@ class CommonDropDownView extends StatelessWidget {
final String title; final String title;
final String value; final String value;
final VoidCallback callback; final VoidCallback callback;
final IconData iconData; final IconData? iconData;
CommonDropDownView(this.title, this.value, this.callback, {Key key, this.iconData}) : super(key: key); CommonDropDownView(this.title, this.value, this.callback, {Key? key, this.iconData}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -18,7 +18,7 @@ class IdealBodyResult extends StatelessWidget {
final double overWeightBy; final double overWeightBy;
final String textResult; final String textResult;
IdealBodyResult({this.idealBodyWeight, this.minRange, this.mixRange, this.overWeightBy, this.textResult}); IdealBodyResult({required this.idealBodyWeight, required this.minRange, required this.mixRange, required this.overWeightBy, required this.textResult});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -247,7 +247,7 @@ class IdealBodyResult extends StatelessWidget {
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element)); _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
} }

@ -1,7 +1,6 @@
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -25,7 +24,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
// int cycleLength = 0; // int cycleLength = 0;
// int lutealPhaseLength = 0; // int lutealPhaseLength = 0;
String selectedDate; late String selectedDate;
var dateFrom = DateTime.now(); var dateFrom = DateTime.now();
var babyAgeWeeks; var babyAgeWeeks;
var babyAgeDays; var babyAgeDays;
@ -34,7 +33,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
var deliveryDue = DateTime.now(); var deliveryDue = DateTime.now();
var dt = DateTime.now(); var dt = DateTime.now();
var newFormat = DateFormat("yy-MM-dd"); var newFormat = DateFormat("yy-MM-dd");
String updatedDt; String? updatedDt;
TextEditingController cycleLengthController = new TextEditingController(); TextEditingController cycleLengthController = new TextEditingController();
TextEditingController lutelLengthController = new TextEditingController(); TextEditingController lutelLengthController = new TextEditingController();
@ -57,8 +56,11 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
deliveryDue = selectedDateTime.add(Duration(days: 280)); deliveryDue = selectedDateTime.add(Duration(days: 280));
// babyAge = Jiffy([DateTime.now()]).diff(Jiffy([date]), Units.WEEK); // babyAge = Jiffy([DateTime.now()]).diff(Jiffy([date]), Units.WEEK);
babyAgeWeeks = Jiffy([DateTime.now().year, DateTime.now().month, DateTime.now().day]).diff(Jiffy([selectedDateTime.year, selectedDateTime.month, dateTo.day]), Units.WEEK);
babyAgeDays = Jiffy([DateTime.now().year, DateTime.now().month, DateTime.now().day]).diff(Jiffy([selectedDateTime.year, selectedDateTime.month, dateTo.day]), Units.DAY); babyAgeWeeks =
Jiffy.parseFromList([DateTime.now().year, DateTime.now().month, DateTime.now().day]).diff(Jiffy.parseFromList([selectedDateTime.year, selectedDateTime.month, dateTo.day]), unit: Unit.week);
babyAgeDays =
Jiffy.parseFromList([DateTime.now().year, DateTime.now().month, DateTime.now().day]).diff(Jiffy.parseFromList([selectedDateTime.year, selectedDateTime.month, dateTo.day]), unit: Unit.day);
}); });
} }
@ -163,7 +165,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,

@ -88,10 +88,10 @@ class OvulationResult extends StatelessWidget {
mDivider(CustomColors.devider), mDivider(CustomColors.devider),
mHeight(12), mHeight(12),
showItem(TranslationBase.of(context).babyAge, babyAge <= 0 ? TranslationBase.of(context).babyAgeAvail : babyAge.toString() + TranslationBase.of(context).week), showItem(TranslationBase.of(context).babyAge, babyAge <= 0 ? TranslationBase.of(context).babyAgeAvail : babyAge.toString() + TranslationBase.of(context).week),
mHeight(12), mHeight(12),
mDivider(CustomColors.devider), mDivider(CustomColors.devider),
mHeight(12), showItem(TranslationBase.of(context).deliveryDue, DateFormat.yMMMEd().format(deliveryDue)), mHeight(12),
showItem(TranslationBase.of(context).deliveryDue, DateFormat.yMMMEd().format(deliveryDue)),
], ],
).withBorderedContainer, ).withBorderedContainer,
), ),
@ -113,7 +113,7 @@ class OvulationResult extends StatelessWidget {
); );
} }
Widget showItem(String title, String value, {Color titleColor}) { Widget showItem(String title, String value, {Color? titleColor}) {
return Container( return Container(
width: double.infinity, width: double.infinity,
child: Column( child: Column(
@ -147,7 +147,7 @@ class OvulationResult extends StatelessWidget {
BariatricsService service = new BariatricsService(); BariatricsService service = new BariatricsService();
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =[]; List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
service.getCalculationDoctors(calculationID: 6).then((res) { service.getCalculationDoctors(calculationID: 6).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -180,7 +180,7 @@ class OvulationResult extends StatelessWidget {
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element)); _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
} }

@ -52,10 +52,10 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
bool _visible = false; bool _visible = false;
TextEditingController textController = new TextEditingController(); TextEditingController textController = new TextEditingController();
TextEditingController resultTextController = new TextEditingController(); TextEditingController resultTextController = new TextEditingController();
String finalValue; late String finalValue;
double inputValue = 0.0; double inputValue = 0.0;
String unit; late String unit;
double conversionConst = 38.67; double conversionConst = 38.67;
@override @override
@ -213,7 +213,7 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,

@ -16,7 +16,7 @@ class BloodSugar extends StatefulWidget {
_BloodSugarState createState() => _BloodSugarState(); _BloodSugarState createState() => _BloodSugarState();
} }
Color color; Color? color;
class _BloodSugarState extends State<BloodSugar> { class _BloodSugarState extends State<BloodSugar> {
Color cardMGColor = inactiveCardColor; Color cardMGColor = inactiveCardColor;
@ -64,10 +64,10 @@ class _BloodSugarState extends State<BloodSugar> {
bool _visible = false; bool _visible = false;
TextEditingController textController = new TextEditingController(); TextEditingController textController = new TextEditingController();
TextEditingController resultTextController = new TextEditingController(); TextEditingController resultTextController = new TextEditingController();
String finalValue; late String finalValue;
double inputValue = 0; double inputValue = 0;
String unit; late String unit;
@override @override
void initState() { void initState() {
@ -230,7 +230,7 @@ class _BloodSugarState extends State<BloodSugar> {
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,

@ -17,7 +17,7 @@ class Triglycerides extends StatefulWidget {
class _TriglyceridesState extends State<Triglycerides> { class _TriglyceridesState extends State<Triglycerides> {
Color cardMGColor = inactiveCardColor; Color cardMGColor = inactiveCardColor;
Color cardMMOLColor = inactiveCardColor; Color cardMMOLColor = inactiveCardColor;
int type; late int type;
void updateColor(type) { void updateColor(type) {
//MG/DLT card //MG/DLT card
@ -54,10 +54,10 @@ class _TriglyceridesState extends State<Triglycerides> {
bool _visible = false; bool _visible = false;
TextEditingController textController = new TextEditingController(); TextEditingController textController = new TextEditingController();
TextEditingController resultTextController = new TextEditingController(); TextEditingController resultTextController = new TextEditingController();
String finalValue; late String finalValue;
double inputValue = 0.0; double inputValue = 0.0;
String unit; late String unit;
double conversionConst = 88.57; double conversionConst = 88.57;
@override @override
@ -219,7 +219,7 @@ class _TriglyceridesState extends State<Triglycerides> {
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,

@ -12,8 +12,8 @@ class MyWebView extends StatelessWidget {
Completer<WebViewController>(); Completer<WebViewController>();
MyWebView({ MyWebView({
@required this.title, required this.title,
@required this.selectedUrl, required this.selectedUrl,
}); });
@override @override

@ -66,11 +66,11 @@ class ParkingPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Texts(model.qrParkingModel.parkingDescriptionN), Texts(model.qrParkingModel!.parkingDescriptionN),
Divider( Divider(
height: 3, height: 3,
), ),
Texts(model.qrParkingModel.rowDescriptionN) Texts(model.qrParkingModel!.rowDescriptionN)
], ],
), ),
), ),
@ -89,7 +89,7 @@ class ParkingPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts(TranslationBase.of(context).showMyPark), Texts(TranslationBase.of(context).showMyPark),
Texts(projectViewModel.isArabic ? model.qrParkingModel.floorDescriptionN : model.qrParkingModel.floorDescription), Texts(projectViewModel.isArabic ? model.qrParkingModel!.floorDescriptionN : model.qrParkingModel!.floorDescription),
], ],
), ),
), ),
@ -105,7 +105,7 @@ class ParkingPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts(TranslationBase.of(context).gate), Texts(TranslationBase.of(context).gate),
Texts(projectViewModel.isArabic ? model.qrParkingModel.gateDescriptionN : model.qrParkingModel.gateDescription), Texts(projectViewModel.isArabic ? model.qrParkingModel!.gateDescriptionN : model.qrParkingModel!.gateDescription),
], ],
), ),
), ),
@ -121,7 +121,7 @@ class ParkingPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts(TranslationBase.of(context).building), Texts(TranslationBase.of(context).building),
Texts(projectViewModel.isArabic ? model.qrParkingModel.buildingDescriptionN : model.qrParkingModel.buildingDescription), Texts(projectViewModel.isArabic ? model.qrParkingModel!.buildingDescriptionN : model.qrParkingModel!.buildingDescription),
], ],
), ),
), ),
@ -137,7 +137,7 @@ class ParkingPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts(TranslationBase.of(context).branch), Texts(TranslationBase.of(context).branch),
Texts(projectViewModel.isArabic ? model.qrParkingModel.branchDescriptionN : model.qrParkingModel.branchDescription), Texts(projectViewModel.isArabic ? model.qrParkingModel!.branchDescriptionN : model.qrParkingModel!.branchDescription),
], ],
), ),
), ),
@ -173,8 +173,8 @@ class ParkingPage extends StatelessWidget {
TranslationBase.of(context).showMyPark, TranslationBase.of(context).showMyPark,
() => { () => {
MapsLauncher.launchCoordinates( MapsLauncher.launchCoordinates(
model.qrParkingModel.latitude, model.qrParkingModel!.latitude!,
model.qrParkingModel.longitude, model.qrParkingModel!.longitude!,
), ),
}), }),
), ),

@ -21,7 +21,7 @@ class HealthCalculators extends StatefulWidget {
} }
class _HealthCalculatorsState extends State<HealthCalculators> with SingleTickerProviderStateMixin { class _HealthCalculatorsState extends State<HealthCalculators> with SingleTickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
void initState() { void initState() {
super.initState(); super.initState();

@ -21,7 +21,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
enum Gender { Male, Female, NON } enum Gender { Male, Female, NON }
enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON } enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON }
class BloodDonationPage extends StatefulWidget { class BloodDonationPage extends StatefulWidget {
@ -32,7 +34,7 @@ class BloodDonationPage extends StatefulWidget {
class _BloodDonationPageState extends State<BloodDonationPage> { class _BloodDonationPageState extends State<BloodDonationPage> {
BeneficiaryType beneficiaryType = BeneficiaryType.NON; BeneficiaryType beneficiaryType = BeneficiaryType.NON;
CitiesModel _selectedHospital; late CitiesModel _selectedHospital;
int _selectedHospitalIndex = 0; int _selectedHospitalIndex = 0;
int _selectedGenderIndex = 1; int _selectedGenderIndex = 1;
@ -40,14 +42,14 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
String _selectedBloodType = "O+"; String _selectedBloodType = "O+";
String amount = ""; String amount = "";
String email; String? email;
List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-"); List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-");
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
var checkedValue = false; var checkedValue = false;
List<ImagesInfo> imagesInfo =[]; List<ImagesInfo> imagesInfo = [];
ProjectViewModel projectProvider; late ProjectViewModel projectProvider;
@override @override
void initState() { void initState() {
@ -62,7 +64,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
int cityID = 1; int cityID = 1;
model.CitiesModelList.forEach((element) { model.CitiesModelList.forEach((element) {
if (element.description == model.bloodModelList[0].city) { if (element.description == model.bloodModelList[0].city) {
cityID = element.iD; cityID = element.iD!;
} }
}); });
return cityID; return cityID;
@ -78,11 +80,11 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
if (model.bloodModelList.length > 0) { if (model.bloodModelList.length > 0) {
CitiesModel citiesModel = new CitiesModel(); CitiesModel citiesModel = new CitiesModel();
citiesModel.iD = getSelectedCityID(model); citiesModel.iD = getSelectedCityID(model);
_selectedHospitalIndex = (citiesModel.iD - 1); _selectedHospitalIndex = (citiesModel.iD! - 1);
citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description; citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description;
citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN; citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN;
_selectedHospital = citiesModel; _selectedHospital = citiesModel;
_selectedBloodType = model.bloodModelList[0].bloodGroup; _selectedBloodType = model.bloodModelList[0].bloodGroup!;
_selectedBloodTypeIndex = getBloodIndex(_selectedBloodType); _selectedBloodTypeIndex = getBloodIndex(_selectedBloodType);
} else { } else {
_selectedHospital = model.CitiesModelList[0]; _selectedHospital = model.CitiesModelList[0];
@ -134,33 +136,32 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
), ),
SizedBox(height: 12), SizedBox(height: 12),
if (projectProvider.isLogin && model.state != ViewState.Busy) if (projectProvider.isLogin && model.state != ViewState.Busy)
CommonDropDownView( CommonDropDownView(
TranslationBase.of(context).city, TranslationBase.of(context).city,
model.CitiesModelList.isNotEmpty model.CitiesModelList.isNotEmpty
? projectProvider.isArabic ? projectProvider.isArabic
? model.CitiesModelList[_selectedHospitalIndex].descriptionN ? model.CitiesModelList[_selectedHospitalIndex].descriptionN!
: model.CitiesModelList[_selectedHospitalIndex].description : model.CitiesModelList[_selectedHospitalIndex].description!
: "", () { : "", () {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < model.CitiesModelList.length; i++) for (int i = 0; i < model.CitiesModelList.length; i++)
RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i), RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN! : model.CitiesModelList[i].description!, i),
]; ];
showDialog( showDialog(
context: context, context: context,
builder: (cxt) => RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedHospitalIndex, selectedIndex: _selectedHospitalIndex,
isScrollable: true, isScrollable: true,
onValueSelected: (index) { onValueSelected: (index) {
_selectedHospitalIndex = index; _selectedHospitalIndex = index;
_selectedHospital = model.CitiesModelList[index]; _selectedHospital = model.CitiesModelList[index];
setState(() {}); setState(() {});
}, },
), ),
); );
}).withBorderedContainer, }).withBorderedContainer,
SizedBox(height: 12), SizedBox(height: 12),
CommonDropDownView(TranslationBase.of(context).gender, _selectedGenderIndex == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female, () { CommonDropDownView(TranslationBase.of(context).gender, _selectedGenderIndex == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female, () {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
@ -230,9 +231,9 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
Row( Row(
children: [ children: [
Checkbox( Checkbox(
onChanged: (bool value) { onChanged: (bool? value) {
setState(() { setState(() {
checkedValue = value; checkedValue = value!;
}); });
}, },
value: checkedValue, value: checkedValue,
@ -372,7 +373,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
String getHospitalName(ProjectViewModel projectProvider, BuildContext context) { String getHospitalName(ProjectViewModel projectProvider, BuildContext context) {
if (_selectedHospital != null) if (_selectedHospital != null)
return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; return projectProvider.isArabic ? _selectedHospital.descriptionN! : _selectedHospital.description!;
else else
return TranslationBase.of(context).selectCity; return TranslationBase.of(context).selectCity;
} }

@ -1,3 +1,5 @@
import 'dart:js';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
@ -27,15 +29,15 @@ import 'dialogs/ConfirmSMSDialog.dart';
import 'new_text_Field.dart'; import 'new_text_Field.dart';
class ConfirmPaymentPage extends StatelessWidget { class ConfirmPaymentPage extends StatelessWidget {
final AdvanceModel advanceModel; late AdvanceModel advanceModel;
final PatientInfoAndMobileNumber patientInfoAndMobileNumber; final PatientInfoAndMobileNumber patientInfoAndMobileNumber;
final String selectedPaymentMethod; final String selectedPaymentMethod;
MyInAppBrowser browser; late MyInAppBrowser browser;
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser}); ConfirmPaymentPage({required this.advanceModel, required this.patientInfoAndMobileNumber, required this.selectedPaymentMethod, required this.authenticatedUser});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -45,7 +47,7 @@ class ConfirmPaymentPage extends StatelessWidget {
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (cxt) => ConfirmSMSDialog( builder: (cxt) => ConfirmSMSDialog(
phoneNumber: patientInfoAndMobileNumber.mobileNumber, phoneNumber: patientInfoAndMobileNumber.mobileNumber!,
), ),
).then((value) { ).then((value) {
print("dialog dismissed"); print("dialog dismissed");
@ -53,7 +55,7 @@ class ConfirmPaymentPage extends StatelessWidget {
if (value != null && value) { if (value != null && value) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = patientInfoAndMobileNumber.projectID; appo.projectID = patientInfoAndMobileNumber.projectID;
openPayment(selectedPaymentMethod, authenticatedUser, double.parse(advanceModel.amount), appo); openPayment(selectedPaymentMethod, authenticatedUser, double.parse(advanceModel.amount!), appo, context);
} }
}); });
} }
@ -88,7 +90,7 @@ class ConfirmPaymentPage extends StatelessWidget {
child: selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(selectedPaymentMethod)) : Image.asset(getImagePath(selectedPaymentMethod)), child: selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(selectedPaymentMethod)) : Image.asset(getImagePath(selectedPaymentMethod)),
), ),
Texts( Texts(
advanceModel.hospitalsModel.projectOutSA ? '${advanceModel.amount} AED' : '${advanceModel.amount} SAR', advanceModel.hospitalsModel!.projectOutSA! ? '${advanceModel.amount} AED' : '${advanceModel.amount} SAR',
fontSize: 26, fontSize: 26,
bold: true, bold: true,
) )
@ -104,7 +106,7 @@ class ConfirmPaymentPage extends StatelessWidget {
margin: EdgeInsets.all(3), margin: EdgeInsets.all(3),
child: NewTextFields( child: NewTextFields(
hintText: TranslationBase.of(context).fileNumber, hintText: TranslationBase.of(context).fileNumber,
initialValue: advanceModel.fileNumber, initialValue: advanceModel.fileNumber!,
isEnabled: false, isEnabled: false,
), ),
), ),
@ -114,7 +116,7 @@ class ConfirmPaymentPage extends StatelessWidget {
margin: EdgeInsets.all(3), margin: EdgeInsets.all(3),
child: NewTextFields( child: NewTextFields(
hintText: TranslationBase.of(context).name, hintText: TranslationBase.of(context).name,
initialValue: patientInfoAndMobileNumber.firstName, initialValue: patientInfoAndMobileNumber.firstName!,
isEnabled: false, isEnabled: false,
), ),
), ),
@ -126,7 +128,7 @@ class ConfirmPaymentPage extends StatelessWidget {
), ),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).mobileNumber, hintText: TranslationBase.of(context).mobileNumber,
initialValue: patientInfoAndMobileNumber.mobileNumber, initialValue: patientInfoAndMobileNumber.mobileNumber!,
isEnabled: false, isEnabled: false,
), ),
SizedBox( SizedBox(
@ -134,7 +136,7 @@ class ConfirmPaymentPage extends StatelessWidget {
), ),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).depositorName, hintText: TranslationBase.of(context).depositorName,
initialValue: advanceModel.depositorName, initialValue: advanceModel.depositorName!,
isEnabled: false, isEnabled: false,
), ),
SizedBox( SizedBox(
@ -142,7 +144,7 @@ class ConfirmPaymentPage extends StatelessWidget {
), ),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).notes, hintText: TranslationBase.of(context).notes,
initialValue: advanceModel.note, initialValue: advanceModel.note!,
isEnabled: false, isEnabled: false,
), ),
], ],
@ -159,7 +161,7 @@ class ConfirmPaymentPage extends StatelessWidget {
disabled: model.state == ViewState.Busy, disabled: model.state == ViewState.Busy,
onTap: () { onTap: () {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.sendActivationCodeForAdvancePayment(patientID: int.parse(advanceModel.fileNumber), projectID: advanceModel.hospitalsModel.iD).then((value) { model.sendActivationCodeForAdvancePayment(patientID: int.parse(advanceModel.fileNumber!), projectID: advanceModel.hospitalsModel!.iD).then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(); if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog();
}); });
@ -195,11 +197,26 @@ class ConfirmPaymentPage extends StatelessWidget {
return 'assets/images/new-design/mada.png'; return 'assets/images/new-design/mada.png';
} }
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo) { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo, BuildContext context) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
browser.openPaymentBrowser(amount, "Advance Payment", Utils.getAdvancePaymentTransID(authenticatedUser.projectID, authenticatedUser.patientID), appo.projectID.toString(), browser.openPaymentBrowser(
authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "", null); amount,
"Advance Payment",
Utils.getAdvancePaymentTransID(authenticatedUser.projectID!, authenticatedUser.patientID!),
appo.projectID.toString(),
authenticatedUser.emailAddress!,
paymentMethod,
authenticatedUser.patientType,
authenticatedUser.firstName!,
authenticatedUser.patientID,
authenticatedUser,
browser,
false,
"3",
"",
context,
);
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {
@ -231,7 +248,7 @@ class ConfirmPaymentPage extends StatelessWidget {
checkPaymentStatus(AppoitmentAllHistoryResultList appo) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, AppGlobal.context).then((res) { service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), false, AppGlobal.context).then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print("Printing Payment Status Reponse!!!!"); print("Printing Payment Status Reponse!!!!");
print(res); print(res);
@ -255,7 +272,7 @@ class ConfirmPaymentPage extends StatelessWidget {
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) { service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
addAdvancedNumberRequest( addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, appo.projectID) Utils.isVidaPlusProject(projectViewModel, appo.projectID!)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference, paymentReference,

@ -18,17 +18,11 @@ import 'package:provider/provider.dart';
class ConfirmSMSDialog extends StatefulWidget { class ConfirmSMSDialog extends StatefulWidget {
final String phoneNumber; final String phoneNumber;
final AdvanceModel advanceModel; final AdvanceModel? advanceModel;
final PatientInfoAndMobileNumber patientInfoAndMobileNumber; final PatientInfoAndMobileNumber? patientInfoAndMobileNumber;
final String selectedPaymentMethod; final String? selectedPaymentMethod;
const ConfirmSMSDialog( const ConfirmSMSDialog({Key? key, required this.phoneNumber, this.advanceModel, this.selectedPaymentMethod, this.patientInfoAndMobileNumber}) : super(key: key);
{Key key,
this.phoneNumber,
this.advanceModel,
this.selectedPaymentMethod,
this.patientInfoAndMobileNumber})
: super(key: key);
@override @override
_ConfirmSMSDialogState createState() => _ConfirmSMSDialogState(); _ConfirmSMSDialogState createState() => _ConfirmSMSDialogState();
@ -51,7 +45,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
String timerText = (TIMER_MIN - 1).toString() + ':59'; String timerText = (TIMER_MIN - 1).toString() + ':59';
int min = TIMER_MIN - 1; int min = TIMER_MIN - 1;
int sec = 59; int sec = 59;
Timer _timer; late Timer _timer;
resendCode() { resendCode() {
min = TIMER_MIN - 1; min = TIMER_MIN - 1;
@ -76,10 +70,10 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
}); });
} }
FocusNode focusD1; late FocusNode focusD1;
FocusNode focusD2; late FocusNode focusD2;
FocusNode focusD3; late FocusNode focusD3;
FocusNode focusD4; late FocusNode focusD4;
@override @override
void initState() { void initState() {
@ -125,8 +119,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
child: InkWell( child: InkWell(
onTap: () => Navigator.pop(context), onTap: () => Navigator.pop(context),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(shape: BoxShape.circle, color: Colors.white),
shape: BoxShape.circle, color: Colors.white),
child: Icon( child: Icon(
Icons.clear, Icons.clear,
color: Colors.grey[900], color: Colors.grey[900],
@ -150,8 +143,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
TranslationBase.of(context).pleaseEnterTheVerificationCode + TranslationBase.of(context).pleaseEnterTheVerificationCode + '[${widget.phoneNumber}]',
'[${widget.phoneNumber}]',
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
@ -161,7 +153,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
Form( Form(
key: verifyAccountForm, key: verifyAccountForm,
child: Container( child: Container(
width: SizeConfig.realScreenWidth * 0.90, width: SizeConfig.realScreenWidth! * 0.90,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -176,7 +168,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
child: TextFormField( child: TextFormField(
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
), ),
focusNode: focusD1, focusNode: focusD1,
maxLength: 1, maxLength: 1,
@ -207,7 +199,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
maxLength: 1, maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
), ),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: buildInputDecoration(context), decoration: buildInputDecoration(context),
@ -234,7 +226,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
maxLength: 1, maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
), ),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: buildInputDecoration(context), decoration: buildInputDecoration(context),
@ -247,8 +239,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
}, },
onChanged: (val) { onChanged: (val) {
if (val.length == 1) { if (val.length == 1) {
FocusScope.of(context) FocusScope.of(context).requestFocus(focusD4);
.requestFocus(focusD4);
} }
}, },
)), )),
@ -260,7 +251,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
maxLength: 1, maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
), ),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: buildInputDecoration(context), decoration: buildInputDecoration(context),
@ -274,8 +265,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
}, },
onChanged: (val) { onChanged: (val) {
if (val.length == 1) { if (val.length == 1) {
FocusScope.of(context) FocusScope.of(context).requestFocus(focusD4);
.requestFocus(focusD4);
submit(model); submit(model);
} }
}), }),
@ -285,8 +275,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
SizedBox( SizedBox(
height: 8, height: 8,
), ),
if (model.state == ViewState.ErrorLocal || if (model.state == ViewState.ErrorLocal || model.state == ViewState.Error)
model.state == ViewState.Error)
Container( Container(
margin: EdgeInsets.only(left: 8, right: 8), margin: EdgeInsets.only(left: 8, right: 8),
width: double.maxFinite, width: double.maxFinite,
@ -301,9 +290,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
TranslationBase.of(context) TranslationBase.of(context).theVerificationCodeExpiresIn + ' $timerText',
.theVerificationCodeExpiresIn +
' $timerText',
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
@ -314,8 +301,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
label: label: TranslationBase.of(context).submit.toUpperCase(),
TranslationBase.of(context).submit.toUpperCase(),
onTap: () { onTap: () {
submit(model); submit(model);
}, },
@ -333,13 +319,10 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
} }
void submit(MyBalanceViewModel model) { void submit(MyBalanceViewModel model) {
if (verifyAccountForm.currentState.validate()) { if (verifyAccountForm.currentState!.validate()) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
final activationCode = final activationCode = digit1.text + digit2.text + digit3.text + digit4.text;
digit1.text + digit2.text + digit3.text + digit4.text; model.checkActivationCodeForAdvancePayment(activationCode: activationCode).then((value) {
model
.checkActivationCodeForAdvancePayment(activationCode: activationCode)
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.pop(context, true); Navigator.pop(context, true);
}); });
@ -350,7 +333,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
if (value.isEmpty) { if (value.isEmpty) {
return ''; return '';
} }
return null; return 'null';
} }
InputDecoration buildInputDecoration(BuildContext context) { InputDecoration buildInputDecoration(BuildContext context) {

@ -7,15 +7,15 @@ import 'package:flutter/material.dart';
//import '../advance_payment_page.dart'; //import '../advance_payment_page.dart';
class SelectBeneficiaryDialog extends StatefulWidget { class SelectBeneficiaryDialog extends StatefulWidget {
final BeneficiaryType beneficiaryType; final BeneficiaryType? beneficiaryType;
final Function(BeneficiaryType) onValueSelected; final Function(BeneficiaryType)? onValueSelected;
SelectBeneficiaryDialog( SelectBeneficiaryDialog(
{Key key, this.beneficiaryType, this.onValueSelected}); {Key? key, this.beneficiaryType, this.onValueSelected});
@override @override
_SelectBeneficiaryDialogState createState() => _SelectBeneficiaryDialogState createState() =>
_SelectBeneficiaryDialogState(this.beneficiaryType); _SelectBeneficiaryDialogState(this.beneficiaryType!);
} }
class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> { class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
@ -47,9 +47,9 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
value: BeneficiaryType.MyAccount, value: BeneficiaryType.MyAccount,
groupValue: beneficiaryType, groupValue: beneficiaryType,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (BeneficiaryType value) { onChanged: (BeneficiaryType? value) {
setState(() { setState(() {
beneficiaryType = value; beneficiaryType = value!;
}); });
}, },
), ),
@ -77,9 +77,9 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
value: BeneficiaryType.MyFamilyFiles, value: BeneficiaryType.MyFamilyFiles,
groupValue: beneficiaryType, groupValue: beneficiaryType,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (BeneficiaryType value) { onChanged: (BeneficiaryType? value) {
setState(() { setState(() {
beneficiaryType = value; beneficiaryType = value!;
}); });
}, },
), ),
@ -107,9 +107,9 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
value: BeneficiaryType.OtherAccount, value: BeneficiaryType.OtherAccount,
groupValue: beneficiaryType, groupValue: beneficiaryType,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (BeneficiaryType value) { onChanged: (BeneficiaryType? value) {
setState(() { setState(() {
beneficiaryType = value; beneficiaryType = value!;
}); });
}, },
), ),
@ -152,7 +152,7 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
widget.onValueSelected(beneficiaryType); widget.onValueSelected!(beneficiaryType);
Navigator.pop(context); Navigator.pop(context);
}, },
child: Padding( child: Padding(

@ -8,7 +8,7 @@ class SelectGenderDialog extends StatefulWidget {
final Gender beneficiaryType; final Gender beneficiaryType;
final Function(Gender) onValueSelected; final Function(Gender) onValueSelected;
SelectGenderDialog({Key key, this.beneficiaryType, this.onValueSelected}); SelectGenderDialog({Key? key, required this.beneficiaryType, required this.onValueSelected});
@override @override
_SelectGenderDialogState createState() => _SelectGenderDialogState createState() =>
@ -43,9 +43,9 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
value: Gender.Male, value: Gender.Male,
groupValue: beneficiaryType, groupValue: beneficiaryType,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (Gender value) { onChanged: (Gender? value) {
setState(() { setState(() {
beneficiaryType = value; beneficiaryType = value!;
}); });
}, },
), ),
@ -73,9 +73,9 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
value: Gender.Female, value: Gender.Female,
groupValue: beneficiaryType, groupValue: beneficiaryType,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (Gender value) { onChanged: (Gender? value) {
setState(() { setState(() {
beneficiaryType = value; beneficiaryType = value!;
}); });
}, },
), ),

@ -7,10 +7,10 @@ import 'package:flutter/material.dart';
class SelectHospitalDialog extends StatefulWidget { class SelectHospitalDialog extends StatefulWidget {
final List<HospitalsModel> hospitals; final List<HospitalsModel> hospitals;
final Function(HospitalsModel) onValueSelected; final Function(HospitalsModel) onValueSelected;
HospitalsModel selectedHospital; HospitalsModel? selectedHospital;
SelectHospitalDialog( SelectHospitalDialog(
{Key key, this.hospitals, this.onValueSelected, this.selectedHospital}); {Key? key, required this.hospitals, required this.onValueSelected, this.selectedHospital});
@override @override
_SelectHospitalDialogState createState() => _SelectHospitalDialogState(); _SelectHospitalDialogState createState() => _SelectHospitalDialogState();
@ -49,7 +49,7 @@ class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text(widget.hospitals[index].name), title: Text(widget.hospitals[index].name!),
leading: Radio( leading: Radio(
value: widget.hospitals[index], value: widget.hospitals[index],
groupValue: widget.selectedHospital, groupValue: widget.selectedHospital,
@ -105,7 +105,7 @@ class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
widget.onValueSelected(widget.selectedHospital); widget.onValueSelected(widget.selectedHospital!);
Navigator.pop(context); Navigator.pop(context);
}, },
child: Padding( child: Padding(

@ -7,9 +7,9 @@ import 'package:flutter/material.dart';
class SelectPatientFamilyDialog extends StatefulWidget { class SelectPatientFamilyDialog extends StatefulWidget {
final List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList; final List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList;
final Function(GetAllSharedRecordsByStatusList) onValueSelected; final Function(GetAllSharedRecordsByStatusList) onValueSelected;
GetAllSharedRecordsByStatusList selectedPatientFamily; GetAllSharedRecordsByStatusList? selectedPatientFamily;
SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected,this.selectedPatientFamily}); SelectPatientFamilyDialog({Key? key, required this.getAllSharedRecordsByStatusList, required this.onValueSelected,this.selectedPatientFamily});
@override @override
_SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState(); _SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState();
@ -49,7 +49,7 @@ class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text(widget.getAllSharedRecordsByStatusList[index].patientName), title: Text(widget.getAllSharedRecordsByStatusList[index].patientName!),
leading: Radio( leading: Radio(
value: widget.getAllSharedRecordsByStatusList[index], value: widget.getAllSharedRecordsByStatusList[index],
groupValue: widget.selectedPatientFamily, groupValue: widget.selectedPatientFamily,
@ -105,7 +105,7 @@ class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
widget.onValueSelected(widget.selectedPatientFamily); widget.onValueSelected(widget.selectedPatientFamily!);
Navigator.pop(context); Navigator.pop(context);
}, },
child: Padding( child: Padding(

@ -9,7 +9,7 @@ class SelectPatientInfoDialog extends StatefulWidget {
final Function(PatientInfo) onValueSelected; final Function(PatientInfo) onValueSelected;
PatientInfo selectedPatientInfo; PatientInfo selectedPatientInfo;
SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected,this.selectedPatientInfo}); SelectPatientInfoDialog({Key? key, required this.patientInfoList, required this.onValueSelected,required this.selectedPatientInfo});
@override @override
_SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState(); _SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState();
@ -49,14 +49,14 @@ class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text(widget.patientInfoList[index].fullName), title: Text(widget.patientInfoList[index].fullName!),
leading: Radio( leading: Radio(
value: widget.patientInfoList[index], value: widget.patientInfoList[index],
groupValue: widget.selectedPatientInfo, groupValue: widget.selectedPatientInfo,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
widget.selectedPatientInfo = value; widget.selectedPatientInfo = value!;
}); });
}, },
), ),

@ -4,8 +4,7 @@ import 'package:flutter/services.dart';
class NumberTextInputFormatter extends TextInputFormatter { class NumberTextInputFormatter extends TextInputFormatter {
@override @override
TextEditingValue formatEditUpdate( TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
TextEditingValue oldValue, TextEditingValue newValue) {
final int newTextLength = newValue.text.length; final int newTextLength = newValue.text.length;
int selectionIndex = newValue.selection.end; int selectionIndex = newValue.selection.end;
int usedSubstringIndex = 0; int usedSubstringIndex = 0;
@ -27,8 +26,7 @@ class NumberTextInputFormatter extends TextInputFormatter {
if (newValue.selection.end >= 10) selectionIndex++; if (newValue.selection.end >= 10) selectionIndex++;
} }
// Dump the rest. // Dump the rest.
if (newTextLength >= usedSubstringIndex) if (newTextLength >= usedSubstringIndex) newText.write(newValue.text.substring(usedSubstringIndex));
newText.write(newValue.text.substring(usedSubstringIndex));
return TextEditingValue( return TextEditingValue(
text: newText.toString(), text: newText.toString(),
selection: TextSelection.collapsed(offset: selectionIndex), selection: TextSelection.collapsed(offset: selectionIndex),
@ -40,74 +38,76 @@ final _mobileFormatter = NumberTextInputFormatter();
class NewTextFields extends StatefulWidget { class NewTextFields extends StatefulWidget {
NewTextFields( NewTextFields(
{Key key, {Key? key,
this.type, this.type,
this.hintText, this.hintText,
this.suffixIcon, this.suffixIcon,
this.autoFocus, this.autoFocus,
this.onChanged, this.onChanged,
this.initialValue, this.initialValue,
this.minLines, this.minLines,
this.maxLines, this.maxLines,
this.inputFormatters, this.inputFormatters,
this.padding, this.padding,
this.focus = false, this.focus = false,
this.maxLengthEnforced = true, this.maxLengthEnforced = true,
this.suffixIconColor, this.suffixIconColor,
this.inputAction, this.inputAction,
this.onSubmit, this.onSubmit,
this.keepPadding = true, this.keepPadding = true,
this.textCapitalization = TextCapitalization.none, this.textCapitalization = TextCapitalization.none,
this.controller, this.controller,
this.keyboardType, this.keyboardType,
this.validator, this.validator,
this.borderOnlyError = false, this.borderOnlyError = false,
this.onSaved, this.onSaved,
this.onSuffixTap, this.onSuffixTap,
this.readOnly: false, this.readOnly = false,
this.maxLength, this.maxLength,
this.prefixIcon, this.prefixIcon,
this.bare = false, this.bare = false,
this.onTap, this.onTap,
this.fontSize = 16.0, this.fontSize = 16.0,
this.fontWeight = FontWeight.w700, this.fontWeight = FontWeight.w700,
this.hintColor,this.isEnabled=true}) this.hintColor,
this.isEnabled = true})
: super(key: key); : super(key: key);
final String hintText; final String? hintText;
// final String initialValue; // final String initialValue;
final String type; final String? type;
final bool autoFocus; final bool? autoFocus;
final IconData suffixIcon; final IconData? suffixIcon;
final Color suffixIconColor; final Color? suffixIconColor;
final Icon prefixIcon; final Icon? prefixIcon;
final VoidCallback onTap; final VoidCallback? onTap;
final TextEditingController controller; final TextEditingController? controller;
final TextInputType keyboardType; final TextInputType? keyboardType;
final FormFieldValidator validator; final FormFieldValidator? validator;
final Function onSaved; final Function(String?)? onSaved;
final Function onSuffixTap; final Function? onSuffixTap;
final Function onChanged; final Function(String)? onChanged;
final Function onSubmit; final Function(String)? onSubmit;
final bool readOnly; final bool? readOnly;
final int maxLength; final int? maxLength;
final int minLines; final int? minLines;
final int maxLines; final int? maxLines;
final bool maxLengthEnforced; final bool? maxLengthEnforced;
final bool bare; final bool? bare;
final bool isEnabled; final bool? isEnabled;
final TextInputAction inputAction; final TextInputAction? inputAction;
final double fontSize; final double? fontSize;
final FontWeight fontWeight; final FontWeight? fontWeight;
final bool keepPadding; final bool? keepPadding;
final TextCapitalization textCapitalization; final TextCapitalization textCapitalization;
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter>? inputFormatters;
final EdgeInsets padding; final EdgeInsets? padding;
final bool focus; final bool? focus;
final bool borderOnlyError; final bool? borderOnlyError;
final Color hintColor; final Color? hintColor;
final String initialValue; final String? initialValue;
@override @override
_NewTextFieldsState createState() => _NewTextFieldsState(); _NewTextFieldsState createState() => _NewTextFieldsState();
} }
@ -129,7 +129,7 @@ class _NewTextFieldsState extends State<NewTextFields> {
@override @override
void didUpdateWidget(NewTextFields oldWidget) { void didUpdateWidget(NewTextFields oldWidget) {
if (widget.focus) _focusNode.requestFocus(); if (widget.focus!) _focusNode.requestFocus();
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
} }
@ -139,9 +139,8 @@ class _NewTextFieldsState extends State<NewTextFields> {
super.dispose(); super.dispose();
} }
bool _determineReadOnly() { bool _determineReadOnly() {
if (widget.readOnly != null && widget.readOnly) { if (widget.readOnly != null && widget.readOnly!) {
_focusNode.unfocus(); _focusNode.unfocus();
return true; return true;
} else { } else {
@ -153,12 +152,9 @@ class _NewTextFieldsState extends State<NewTextFields> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AnimatedContainer( return AnimatedContainer(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
decoration:BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Container( child: Container(
margin: EdgeInsets.only(top: 8), margin: EdgeInsets.only(top: 8),
child: TextFormField( child: TextFormField(
enabled: widget.isEnabled, enabled: widget.isEnabled,
initialValue: widget.initialValue, initialValue: widget.initialValue,
@ -167,10 +163,10 @@ class _NewTextFieldsState extends State<NewTextFields> {
textCapitalization: widget.textCapitalization, textCapitalization: widget.textCapitalization,
onFieldSubmitted: widget.inputAction == TextInputAction.next onFieldSubmitted: widget.inputAction == TextInputAction.next
? (widget.onSubmit != null ? (widget.onSubmit != null
? widget.onSubmit ? widget.onSubmit
: (val) { : (val) {
_focusNode.nextFocus(); _focusNode.nextFocus();
}) })
: widget.onSubmit, : widget.onSubmit,
textInputAction: widget.inputAction, textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1, minLines: widget.minLines ?? 1,
@ -187,44 +183,22 @@ class _NewTextFieldsState extends State<NewTextFields> {
validator: widget.validator, validator: widget.validator,
onSaved: widget.onSaved, onSaved: widget.onSaved,
style: Theme.of(context) style: Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
.textTheme
.bodyText2
.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[
FilteringTextInputFormatter.digitsOnly, FilteringTextInputFormatter.digitsOnly,
_mobileFormatter, _mobileFormatter,
] ]
: widget.inputFormatters, : widget.inputFormatters,
decoration: InputDecoration( decoration: InputDecoration(
labelText: widget.hintText, labelText: widget.hintText,
labelStyle: TextStyle(color: Colors.black), labelStyle: TextStyle(color: Colors.black),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(12.0)),
borderSide: BorderSide( focusedErrorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(8.0)),
color: Theme.of(context) focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)),
.errorColor disabledBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)),
.withOpacity(0.5),
width: 1.0),
borderRadius: BorderRadius.circular(12.0)),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context)
.errorColor
.withOpacity(0.5),
width: 1.0),
borderRadius: BorderRadius.circular(8.0)),
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.white, width: 1.0),
borderRadius: BorderRadius.circular(12)),
disabledBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.white, width: 1.0),
borderRadius: BorderRadius.circular(12)),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: borderSide: BorderSide(color: Colors.white, width: 1.0),
BorderSide(color: Colors.white, width: 1.0),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
), ),

@ -23,23 +23,23 @@ class DocAvailableAppointments extends StatefulWidget {
DoctorList doctor; DoctorList doctor;
static bool areSlotsAvailable = false; static bool areSlotsAvailable = false;
static bool areAppointmentsAvailable = false; static bool areAppointmentsAvailable = false;
static DateTime selectedAppoDateTime; static DateTime? selectedAppoDateTime;
static String selectedDate; static String? selectedDate;
static String selectedTime; static String? selectedTime;
bool isLiveCareAppointment; bool isLiveCareAppointment;
final dynamic doctorSchedule; final dynamic doctorSchedule;
static int initialSlotDuration; static int? initialSlotDuration;
DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment}); DocAvailableAppointments({required this.doctor, this.doctorSchedule, required this.isLiveCareAppointment});
@override @override
_DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState(); _DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState();
} }
class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> with TickerProviderStateMixin { class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> with TickerProviderStateMixin {
Map<DateTime, List> _events; late Map<DateTime, List> _events;
AnimationController _animationController; late AnimationController _animationController;
CalendarController _calendarController; late CalendarController _calendarController;
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
@ -54,10 +54,11 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
dynamic freeSlotsResponse; dynamic freeSlotsResponse;
ScrollController _scrollController; late ScrollController _scrollController;
var language; var language;
bool isLiveCareSchedule; bool isLiveCareSchedule = false;
// String selectedLogSlots =''; // String selectedLogSlots ='';
@override @override
@ -118,7 +119,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
}); });
} }
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -183,7 +184,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1), monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1),
onTap: (CalendarTapDetails details) { onTap: (CalendarTapDetails details) {
_calendarController.selectedDate = details.date; _calendarController.selectedDate = details.date;
_onDaySelected(details.date); _onDaySelected(details.date!);
}, },
), ),
), ),
@ -214,19 +215,12 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
DocAvailableAppointments.areSlotsAvailable = true; DocAvailableAppointments.areSlotsAvailable = true;
selectedButtonIndex = 0; selectedButtonIndex = 0;
// selectedLogSlots = dayEvents[selectedButtonIndex].toString(); // selectedLogSlots = dayEvents[selectedButtonIndex].toString();
List<Map<String,dynamic>> timeList =[]; List<Map<String, dynamic>> timeList = [];
for(var i =0; i<dayEvents.length;i++){ for (var i = 0; i < dayEvents.length; i++) {
Map<String,dynamic> timeSlot={ Map<String, dynamic> timeSlot = {"isoTime": dayEvents[i].isoTime, "start": dayEvents[i].start.toString(), "end": dayEvents[i].end.toString(), "vidaDate": dayEvents[i].vidaDate};
"isoTime":dayEvents[i].isoTime, timeList.add(timeSlot);
"start":dayEvents[i].start.toString(),
"end":dayEvents[i].end.toString(),
"vidaDate":dayEvents[i].vidaDate
};
timeList.add(timeSlot);
} }
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
sharedPref.setString('selectedLogSlots', json.encode(timeList)); sharedPref.setString('selectedLogSlots', json.encode(timeList));
DocAvailableAppointments.selectedTime = dayEvents[selectedButtonIndex].isoTime; DocAvailableAppointments.selectedTime = dayEvents[selectedButtonIndex].isoTime;
@ -244,30 +238,60 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
for (var i = 0; i < freeSlotsResponse.length; i++) { for (var i = 0; i < freeSlotsResponse.length; i++) {
date = (isLiveCareSchedule != null && isLiveCareSchedule) date = (isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(freeSlotsResponse[i]) ? DateUtil.convertStringToDate(freeSlotsResponse[i])
: DateUtil.convertStringToDateSaudiTimezone(freeSlotsResponse[i], widget.doctor.projectID); : DateUtil.convertStringToDateSaudiTimezone(freeSlotsResponse[i], int.parse(widget.doctor.projectID.toString()));
slotsList.add(FreeSlot(date, ['slot'])); slotsList.add(FreeSlot(date, ['slot']));
docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date, vidaDate: freeSlotsResponse[i])); docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date, vidaDate: freeSlotsResponse[i]));
} }
_eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event); _eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() { setState(() {
DocAvailableAppointments.selectedDate = dateFormatter.format((isLiveCareSchedule != null && isLiveCareSchedule) DocAvailableAppointments.selectedDate = dateFormatter.format(
? DateUtil.convertStringToDate(freeSlotsResponse[0]) (isLiveCareSchedule != null && isLiveCareSchedule)
: DateUtil.convertStringToDateSaudiTimezone(freeSlotsResponse[0], widget.doctor.projectID)); ? DateUtil.convertStringToDate(freeSlotsResponse[0])
: DateUtil.convertStringToDateSaudiTimezone(
freeSlotsResponse[0],
int.parse(
widget.doctor.projectID.toString(),
),
),
);
DocAvailableAppointments.selectedAppoDateTime = (isLiveCareSchedule != null && isLiveCareSchedule) DocAvailableAppointments.selectedAppoDateTime = (isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(freeSlotsResponse[0]) ? DateUtil.convertStringToDate(freeSlotsResponse[0])
: DateUtil.convertStringToDateSaudiTimezone(freeSlotsResponse[0], widget.doctor.projectID); : DateUtil.convertStringToDateSaudiTimezone(
freeSlotsResponse[0],
int.parse(
widget.doctor.projectID.toString(),
),
);
selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted( selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(
(isLiveCareSchedule != null && isLiveCareSchedule) (isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(freeSlotsResponse[0]) ? DateUtil.convertStringToDate(freeSlotsResponse[0])
: DateUtil.convertStringToDateSaudiTimezone(freeSlotsResponse[0], widget.doctor.projectID), : DateUtil.convertStringToDateSaudiTimezone(
freeSlotsResponse[0],
int.parse(
widget.doctor.projectID.toString(),
),
),
language); language);
selectedDateJSON = freeSlotsResponse[0]; selectedDateJSON = freeSlotsResponse[0];
}); });
openTimeSlotsPickerForDate( openTimeSlotsPickerForDate(
(isLiveCareSchedule != null && isLiveCareSchedule) ? DateUtil.convertStringToDate(selectedDateJSON) : DateUtil.convertStringToDateSaudiTimezone(selectedDateJSON, widget.doctor.projectID), (isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(selectedDateJSON)
: DateUtil.convertStringToDateSaudiTimezone(
selectedDateJSON,
int.parse(
widget.doctor.projectID.toString(),
),
),
docFreeSlots); docFreeSlots);
_calendarController.selectedDate = _calendarController.selectedDate = (isLiveCareSchedule != null && isLiveCareSchedule)
(isLiveCareSchedule != null && isLiveCareSchedule) ? DateUtil.convertStringToDate(selectedDateJSON) : DateUtil.convertStringToDateSaudiTimezone(selectedDateJSON, widget.doctor.projectID); ? DateUtil.convertStringToDate(selectedDateJSON)
: DateUtil.convertStringToDateSaudiTimezone(
selectedDateJSON,
int.parse(
widget.doctor.projectID.toString(),
),
);
_calendarController.displayDate = _calendarController.selectedDate; _calendarController.displayDate = _calendarController.selectedDate;
return _eventsParsed; return _eventsParsed;
} }
@ -292,7 +316,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
}); });
projectViewModel.analytics.appointment.book_appointment_time_selection(appointment_type: 'regular', dateTime: timeslot.end, doctor: widget.doctor); projectViewModel.analytics.appointment.book_appointment_time_selection(appointment_type: 'regular', dateTime: timeslot.end, doctor: widget.doctor);
}, },
child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, color: Color(0xFF60686b))), child: Text(dayEvents[index].isoTime!, style: TextStyle(fontSize: 12.0, color: Color(0xFF60686b))),
); );
} }
@ -312,7 +336,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
print(DocAvailableAppointments.selectedTime); print(DocAvailableAppointments.selectedTime);
}); });
}, },
child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, color: Colors.white)), child: Text(dayEvents[index].isoTime!, style: TextStyle(fontSize: 12.0, color: Colors.white)),
); );
} }
@ -320,7 +344,20 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
print(DocAvailableAppointments.initialSlotDuration); print(DocAvailableAppointments.initialSlotDuration);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, context, projectViewModel).then((res) { service
.getDoctorFreeSlots(
int.parse(
docObject.doctorID.toString(),
),
int.parse(
docObject.clinicID.toString(),
),
int.parse(
docObject.projectID.toString(),
),
context,
projectViewModel)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) { if (res['FreeTimeSlots'].length != 0) {
@ -332,7 +369,12 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
_events.clear(), _events.clear(),
_events = value, _events = value,
if (widget.doctorSchedule != null) if (widget.doctorSchedule != null)
{_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date'])), _calendarController.selectedDate = DateUtil.convertStringToDate(widget.doctorSchedule['Date'])} {
_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date'])),
_calendarController.selectedDate = DateUtil.convertStringToDate(
widget.doctorSchedule['Date'],
)
}
}); });
}); });
} else { } else {
@ -353,7 +395,15 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
getDoctorScheduledFreeSlots(context, DoctorList docObject) { getDoctorScheduledFreeSlots(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorScheduledFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, context).then((res) { service
.getDoctorScheduledFreeSlots(
int.parse(docObject.doctorID.toString()),
int.parse(docObject.clinicID.toString()),
int.parse(docObject.projectID.toString()),
docObject.serviceID,
context,
)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['PatientER_DoctorFreeSlots'].length != 0) { if (res['PatientER_DoctorFreeSlots'].length != 0) {
@ -390,37 +440,38 @@ class MeetingDataSource extends CalendarDataSource {
@override @override
DateTime getStartTime(int index) { DateTime getStartTime(int index) {
return _getMeetingData(index).from; return _getMeetingData(index)!.from;
} }
@override @override
DateTime getEndTime(int index) { DateTime getEndTime(int index) {
return _getMeetingData(index).to; return _getMeetingData(index)!.to;
} }
@override @override
String getSubject(int index) { String getSubject(int index) {
return _getMeetingData(index).eventName; return _getMeetingData(index)!.eventName;
} }
@override @override
Color getColor(int index) { Color getColor(int index) {
return _getMeetingData(index).background; return _getMeetingData(index)!.background;
} }
@override @override
bool isAllDay(int index) { bool isAllDay(int index) {
return _getMeetingData(index).isAllDay; return _getMeetingData(index)!.isAllDay;
} }
Meeting _getMeetingData(int index) { Meeting? _getMeetingData(int index) {
final dynamic meeting = appointments[index]; final dynamic meeting = appointments?[index];
Meeting meetingData; Meeting? meetingData;
if (meeting is Meeting) { if (meeting is Meeting) {
meetingData = meeting; meetingData = meeting;
} }
return meetingData; return meetingData;
} }
} }
class Meeting { class Meeting {

@ -1,12 +1,13 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class DoctorInformation extends StatelessWidget { class DoctorInformation extends StatelessWidget {
DoctorProfileList docProfileList; DoctorProfileList docProfileList;
DoctorInformation({@required this.docProfileList}); DoctorInformation({required this.docProfileList});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -46,7 +47,7 @@ class DoctorInformation extends StatelessWidget {
), ),
mWidth(2), mWidth(2),
Text( Text(
docProfileList.genderDescription, docProfileList.genderDescription!,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -69,7 +70,7 @@ class DoctorInformation extends StatelessWidget {
), ),
mWidth(2), mWidth(2),
Text( Text(
docProfileList.nationalityName, docProfileList.nationalityName!,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -104,7 +105,7 @@ class DoctorInformation extends StatelessWidget {
), ),
mHeight(10), mHeight(10),
Text( Text(
docProfileList.doctorProfileInfo != null ? docProfileList.doctorProfileInfo : "", docProfileList.doctorProfileInfo != null ? docProfileList.doctorProfileInfo! : "",
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -121,4 +122,9 @@ class DoctorInformation extends StatelessWidget {
), ),
); );
} }
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(DiagnosticsProperty<DoctorProfileList>('docProfileList', docProfileList));
}
} }

@ -20,7 +20,7 @@ import 'package:provider/provider.dart';
class LaserClinic extends StatefulWidget { class LaserClinic extends StatefulWidget {
HospitalsModel selectedHospital; HospitalsModel selectedHospital;
LaserClinic({this.selectedHospital}); LaserClinic({required this.selectedHospital});
@override @override
_LaserClinicState createState() { _LaserClinicState createState() {
@ -32,11 +32,11 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
List<int> _laserCategoryList = [1, 2, 11]; List<int> _laserCategoryList = [1, 2, 11];
List<LaserBodyPart> _selectedBodyPartList = []; List<LaserBodyPart> _selectedBodyPartList = [];
bool _isFullBody = false; bool _isFullBody = false;
LaserBodyPart fullBody; late LaserBodyPart fullBody;
int _selectedCategoryIndex = 0; int _selectedCategoryIndex = 0;
List<LaserBodyPart> laserBodyPartsList = []; List<LaserBodyPart> laserBodyPartsList = [];
TabController _tabController; late TabController _tabController;
int _duration = 0; int _duration = 0;
List<LaserCategoryType> maleLaserCategory = []; List<LaserCategoryType> maleLaserCategory = [];
@ -49,8 +49,8 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
_tabController.addListener(() { _tabController.addListener(() {
if (_tabController.indexIsChanging) { if (_tabController.indexIsChanging) {
} else { } else {
_selectedBodyPartList = List<LaserBodyPart>(); _selectedBodyPartList = [];
laserBodyPartsList = List<LaserBodyPart>(); laserBodyPartsList = [];
_selectedCategoryIndex = 0; _selectedCategoryIndex = 0;
setState(() {}); setState(() {});
if (_tabController.index == 0) { if (_tabController.index == 0) {
@ -73,7 +73,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['Laser_GetBodyPartsByCategoryList'].length != 0) { if (res['Laser_GetBodyPartsByCategoryList'].length != 0) {
List<LaserBodyPart> _tempList = List<LaserBodyPart>(); List<LaserBodyPart> _tempList = [];
res['Laser_GetBodyPartsByCategoryList'].forEach((v) { res['Laser_GetBodyPartsByCategoryList'].forEach((v) {
_tempList.add(LaserBodyPart.fromJson(v)); _tempList.add(LaserBodyPart.fromJson(v));
}); });
@ -96,7 +96,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
bool lastIndexIsFirst = false; bool lastIndexIsFirst = false;
bool isLastIndexIsBack = false; bool isLastIndexIsBack = false;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
bool get isMale => _tabController.index == 0; bool get isMale => _tabController.index == 0;
@ -231,7 +231,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital _patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
@ -267,7 +267,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
int getDuration() { int getDuration() {
int duration = 0; int duration = 0;
if (_isFullBody) { if (_isFullBody) {
_duration = int.parse(fullBody.timeDuration); _duration = int.parse(fullBody.timeDuration!);
projectViewModel.laserSelectionDuration = duration; projectViewModel.laserSelectionDuration = duration;
return _duration; return _duration;
} }
@ -276,7 +276,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
var upperLowerArmsList = _selectedBodyPartList.where((element) => element.mappingCode == "40" || element.mappingCode == "41")?.toList() ?? []; var upperLowerArmsList = _selectedBodyPartList.where((element) => element.mappingCode == "40" || element.mappingCode == "41")?.toList() ?? [];
if (_selectedBodyPartList.length > 0) { if (_selectedBodyPartList.length > 0) {
duration = _selectedBodyPartList.fold(0, (previousValue, element) => previousValue + int.parse(element.timeDuration)); duration = _selectedBodyPartList.fold(0, (previousValue, element) => previousValue + int.parse(element.timeDuration!));
} }
if (lowerUpperLegsList.length == 2) { if (lowerUpperLegsList.length == 2) {
duration -= 30; duration -= 30;
@ -365,7 +365,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
value: _isFullBody, value: _isFullBody,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
if (value) { if (value!) {
_selectedBodyPartList.clear(); _selectedBodyPartList.clear();
_selectedBodyPartList.add(fullBody); _selectedBodyPartList.add(fullBody);
} else { } else {
@ -380,7 +380,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
), ),
SizedBox(width: 12), SizedBox(width: 12),
Text( Text(
projectViewModel.isArabic ? fullBody.bodyPartN : fullBody.bodyPart, projectViewModel.isArabic ? fullBody.bodyPartN! : fullBody.bodyPart!,
style: TextStyle(fontSize: 15, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.6, height: 21 / 14), style: TextStyle(fontSize: 15, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.6, height: 21 / 14),
), ),
], ],
@ -412,7 +412,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
_selectedBodyPartList.removeWhere((element) => element.id == laserBodyPartsList[index].id); _selectedBodyPartList.removeWhere((element) => element.id == laserBodyPartsList[index].id);
// _selectedBodyPartList.remove(laserBodyPartsList[index]); // _selectedBodyPartList.remove(laserBodyPartsList[index]);
} else { } else {
if (_duration + int.parse(laserBodyPartsList[index].timeDuration) > 90) { if (_duration + int.parse(laserBodyPartsList[index].timeDuration!) > 90) {
AppToast.showToast(message: TranslationBase.of(context).laserMaxLimitReach); AppToast.showToast(message: TranslationBase.of(context).laserMaxLimitReach);
return; return;
} }
@ -440,7 +440,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
border: Border.all(color: _isSelected ? Color(0xffD02127) : Color(0xffEAEAEA), width: 2), border: Border.all(color: _isSelected ? Color(0xffD02127) : Color(0xffEAEAEA), width: 2),
), ),
child: LaserBodyParts() child: LaserBodyParts()
.getCategoryImage(isMale, (isMale ? maleLaserCategory : femaleLaserCategory)[_selectedCategoryIndex].laserCategoryID, laserBodyPartsList[index].mappingCode), .getCategoryImage(isMale, (isMale ? maleLaserCategory : femaleLaserCategory)[_selectedCategoryIndex].laserCategoryID, laserBodyPartsList[index].mappingCode!),
), ),
if (_isSelected) if (_isSelected)
Container( Container(
@ -459,7 +459,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
SizedBox(height: 6), SizedBox(height: 6),
Expanded( Expanded(
child: Text( child: Text(
projectViewModel.isArabic ? laserBodyPartsList[index].bodyPartN : laserBodyPartsList[index].bodyPart, projectViewModel.isArabic ? laserBodyPartsList[index].bodyPartN! : laserBodyPartsList[index].bodyPart!,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -32,7 +32,7 @@ import 'LiveCareBookAppointment.dart';
class SearchByClinic extends StatefulWidget { class SearchByClinic extends StatefulWidget {
final List clnicIds; final List clnicIds;
SearchByClinic({this.clnicIds}); SearchByClinic({required this.clnicIds});
@override @override
_SearchByClinicState createState() => _SearchByClinicState(); _SearchByClinicState createState() => _SearchByClinicState();
@ -40,9 +40,10 @@ class SearchByClinic extends StatefulWidget {
class _SearchByClinicState extends State<SearchByClinic> { class _SearchByClinicState extends State<SearchByClinic> {
bool nearestAppo = false; bool nearestAppo = false;
String dropdownValue; late String dropdownValue;
String dropdownTitle = ""; String dropdownTitle = "";
String projectDropdownValue; late String projectDropdownValue;
// var event = RobotProvider(); // var event = RobotProvider();
List<ListClinicCentralized> clinicsList = []; List<ListClinicCentralized> clinicsList = [];
@ -51,8 +52,8 @@ class _SearchByClinicState extends State<SearchByClinic> {
bool isLoaded = false; bool isLoaded = false;
bool isProjectLoaded = false; bool isProjectLoaded = false;
ListClinicCentralized selectedClinic; late ListClinicCentralized selectedClinic;
HospitalsModel selectedHospital; late HospitalsModel selectedHospital;
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
@ -60,11 +61,11 @@ class _SearchByClinicState extends State<SearchByClinic> {
final GlobalKey clinicDropdownKey = GlobalKey(); final GlobalKey clinicDropdownKey = GlobalKey();
final GlobalKey projectDropdownKey = GlobalKey(); final GlobalKey projectDropdownKey = GlobalKey();
TextEditingController ageController = new TextEditingController(); TextEditingController ageController = new TextEditingController();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
String radioValue = null; late String radioValue;
LocationUtils locationUtils; late LocationUtils locationUtils;
@override @override
void initState() { void initState() {
@ -78,7 +79,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
if (projectViewModel.isLogin) { if (projectViewModel.isLogin) {
if (radioValue == null) { if (radioValue == null) {
if (projectViewModel.user.gender == 1) { if (projectViewModel.user!.gender == 1) {
radioValue = TranslationBase.of(context).male; radioValue = TranslationBase.of(context).male;
} else { } else {
radioValue = TranslationBase.of(context).female; radioValue = TranslationBase.of(context).female;
@ -88,7 +89,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
radioValue = TranslationBase.of(context).female; radioValue = TranslationBase.of(context).female;
} }
if (ageController.text.isEmpty) { if (ageController.text.isEmpty) {
ageController.text = projectViewModel.isLogin ? projectViewModel.user.age.toString() : ""; ageController.text = projectViewModel.isLogin ? projectViewModel.user!.age.toString() : "";
ageController.selection = TextSelection.fromPosition(TextPosition(offset: ageController.text.length)); ageController.selection = TextSelection.fromPosition(TextPosition(offset: ageController.text.length));
} }
@ -143,7 +144,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
groupValue: radioValue, groupValue: radioValue,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
radioValue = v; radioValue = v!;
}); });
}, },
), ),
@ -165,7 +166,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
groupValue: radioValue, groupValue: radioValue,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
radioValue = v; radioValue = v!;
}); });
}, },
), ),
@ -197,9 +198,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
Checkbox( Checkbox(
activeColor: CustomColors.accentColor, activeColor: CustomColors.accentColor,
value: nearestAppo, value: nearestAppo,
onChanged: (bool value) { onChanged: (bool? value) {
setState(() { setState(() {
nearestAppo = value; nearestAppo = value!;
if (nearestAppo) if (nearestAppo)
getProjectsList(); getProjectsList();
else else
@ -228,7 +229,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
} else {} } else {}
}); });
}, },
title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0)))); title: Text(result.clinicDescription!, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0))));
}).toList()) }).toList())
: InkWell( : InkWell(
onTap: () { onTap: () {
@ -236,7 +237,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
selectedClinic = clincs; selectedClinic = clincs;
Navigator.pop(context); Navigator.pop(context);
setState(() { setState(() {
dropdownTitle = clincs.clinicDescription; dropdownTitle = clincs.clinicDescription!;
dropdownValue = dropdownValue =
clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString(); clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString();
if (dropdownValue == "253-false-0-0") { if (dropdownValue == "253-false-0-0") {
@ -325,12 +326,12 @@ class _SearchByClinicState extends State<SearchByClinic> {
items: projectsList.map((item) { items: projectsList.map((item) {
return new DropdownMenuItem<HospitalsModel>( return new DropdownMenuItem<HospitalsModel>(
value: item, value: item,
child: new Text(item.name), child: new Text(item.name!),
); );
}).toList(), }).toList(),
onChanged: (newValue) async { onChanged: (newValue) async {
setState(() { setState(() {
selectedHospital = newValue; selectedHospital = newValue!;
projectDropdownValue = newValue.mainProjectID.toString(); projectDropdownValue = newValue.mainProjectID.toString();
if (dropdownValue.split("-")[0] == "253") { if (dropdownValue.split("-")[0] == "253") {
Navigator.push(context, FadePage(page: LaserClinic(selectedHospital: selectedHospital))); Navigator.push(context, FadePage(page: LaserClinic(selectedHospital: selectedHospital)));
@ -356,7 +357,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
@ -438,27 +439,50 @@ class _SearchByClinicState extends State<SearchByClinic> {
); );
} }
//Changed By Aamir
void openDropdown(GlobalKey key) { void openDropdown(GlobalKey key) {
GestureDetector detector; GestureDetector? detector;
void searchForGestureDetector(BuildContext element) { void searchForGestureDetector(BuildContext element) {
element.visitChildElements((element) { element.visitChildElements((element) {
if (element.widget != null && element.widget is GestureDetector) { if (element.widget != null && element.widget is GestureDetector) {
detector = element.widget; detector = element.widget as GestureDetector?;
return false; //return false;
} else { } else {
searchForGestureDetector(element); searchForGestureDetector(element);
} }
return true; //return true;
}); });
} }
searchForGestureDetector(key.currentContext); searchForGestureDetector(key.currentContext!);
assert(detector != null); assert(detector != null);
detector.onTap(); detector!.onTap!();
} }
// void openDropdown(GlobalKey key) {
// GestureDetector detector;
// void searchForGestureDetector(BuildContext element) {
// element.visitChildElements((element) {
// if (element.widget != null && element.widget is GestureDetector) {
// detector = element.widget;
// return false;
// } else {
// searchForGestureDetector(element);
// }
//
// return true;
// });
// }
//
// searchForGestureDetector(key.currentContext);
// assert(detector != null);
//
// detector.onTap();
// }
bool isDentalSelectedAndSupported() { bool isDentalSelectedAndSupported() {
if (dropdownValue != null) if (dropdownValue != null)
return dropdownValue != "" && (dropdownValue.split("-")[0] == "17" || dropdownValue.split("-")[0] == "253") && isMobileAppDentalAllow; return dropdownValue != "" && (dropdownValue.split("-")[0] == "17" || dropdownValue.split("-")[0] == "253") && isMobileAppDentalAllow;
@ -535,7 +559,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
searchInfo.date = DateTime.now(); searchInfo.date = DateTime.now();
if (projectViewModel.isLogin) { if (projectViewModel.isLogin) {
if (projectViewModel.user.age > 12) { if (projectViewModel.user!.age! > 12) {
navigateToDentalComplaints(context, searchInfo); navigateToDentalComplaints(context, searchInfo);
} else { } else {
callDoctorsSearchAPI(17); callDoctorsSearchAPI(17);
@ -557,7 +581,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
), ),
).then((value) { ).then((value) {
setState(() { setState(() {
if (value == "false") dropdownValue = null; if (value == "false") dropdownValue = "null";
}); });
if (value == "livecare") { if (value == "livecare") {
Navigator.push(context, FadePage(page: LiveCareHome())); Navigator.push(context, FadePage(page: LiveCareHome()));
@ -578,7 +602,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
List<String> arrDistance = []; List<String> arrDistance = [];
List<String> result; List<String> result;
int numAll; int numAll;
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =[]; List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, nearestAppo, context).then((res) { service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, nearestAppo, context).then((res) {
@ -598,7 +622,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital _patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
@ -630,7 +654,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
), ),
).then((value) { ).then((value) {
setState(() { setState(() {
dropdownValue = null; dropdownValue = "null";
}); });
}); });
} }
@ -643,7 +667,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
), ),
).then((value) { ).then((value) {
setState(() { setState(() {
dropdownValue = null; dropdownValue = "null";
}); });
}); });
} }
@ -653,7 +677,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital))) Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)))
.then((value) { .then((value) {
setState(() { setState(() {
dropdownValue = null; dropdownValue = "null";
dropdownTitle = ""; dropdownTitle = "";
}); });
getProjectsList(); getProjectsList();

@ -19,8 +19,8 @@ class SearchByDoctor extends StatefulWidget {
class _SearchByDoctorState extends State<SearchByDoctor> { class _SearchByDoctorState extends State<SearchByDoctor> {
TextEditingController doctorNameController = new TextEditingController(); TextEditingController doctorNameController = new TextEditingController();
bool _isButtonDisabled; late bool _isButtonDisabled;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -109,7 +109,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList(); List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital _patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
@ -156,7 +156,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, isDoctorNameSearch: true, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital))); Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, isDoctorNameSearch: true, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)));
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,

@ -3,9 +3,8 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:progress_hud_v2/generated/i18n.dart';
showClickListDialog(BuildContext context, List<ListClinicCentralized> clinicsList, {Function(ListClinicCentralized) onSelection}) { showClickListDialog(BuildContext context, List<ListClinicCentralized> clinicsList, {Function(ListClinicCentralized)? onSelection}) {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
@ -19,7 +18,7 @@ showClickListDialog(BuildContext context, List<ListClinicCentralized> clinicsLis
height: MediaQuery.of(context).size.height - 80, height: MediaQuery.of(context).size.height - 80,
child: ClickListDialog( child: ClickListDialog(
clinicsList: clinicsList, clinicsList: clinicsList,
onSelection: onSelection, onSelection: onSelection!,
), ),
), ),
); );
@ -28,8 +27,8 @@ showClickListDialog(BuildContext context, List<ListClinicCentralized> clinicsLis
} }
class ClickListDialog extends StatefulWidget { class ClickListDialog extends StatefulWidget {
List<ListClinicCentralized> clinicsList; List<ListClinicCentralized>? clinicsList;
Function(ListClinicCentralized) onSelection; Function(ListClinicCentralized)? onSelection;
ClickListDialog({this.clinicsList, this.onSelection}); ClickListDialog({this.clinicsList, this.onSelection});
@ -50,8 +49,8 @@ class _ClickListDialogState extends State<ClickListDialog> {
addAllData() { addAllData() {
tempClinicsList.clear(); tempClinicsList.clear();
for (int i = 0; i < widget.clinicsList.length; i++) { for (int i = 0; i < widget.clinicsList!.length; i++) {
tempClinicsList.add(widget.clinicsList[i]); tempClinicsList.add(widget.clinicsList![i]);
} }
setState(() {}); setState(() {});
} }
@ -68,9 +67,9 @@ class _ClickListDialogState extends State<ClickListDialog> {
onChanged: (v) { onChanged: (v) {
if (v.length > 0) { if (v.length > 0) {
tempClinicsList.clear(); tempClinicsList.clear();
for (int i = 0; i < widget.clinicsList.length; i++) { for (int i = 0; i < widget.clinicsList!.length; i++) {
if (widget.clinicsList[i].clinicDescription.toLowerCase().contains(v.toLowerCase())) { if (widget.clinicsList![i].clinicDescription!.toLowerCase().contains(v.toLowerCase())) {
tempClinicsList.add(widget.clinicsList[i]); tempClinicsList.add(widget.clinicsList![i]);
} }
} }
} else { } else {
@ -93,15 +92,15 @@ class _ClickListDialogState extends State<ClickListDialog> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
widget.onSelection(tempClinicsList[index]); widget.onSelection!(tempClinicsList[index]);
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded(child: Text(tempClinicsList[index].clinicDescription.trim())), Expanded(child: Text(tempClinicsList[index].clinicDescription!.trim())),
tempClinicsList[index].isLiveCareClinicAndOnline tempClinicsList[index].isLiveCareClinicAndOnline!
? SvgPicture.asset( ? SvgPicture.asset(
'assets/images/new-design/video_icon_green_right.svg', 'assets/images/new-design/video_icon_green_right.svg',
height: 12, height: 12,

@ -11,7 +11,7 @@ import 'package:url_launcher/url_launcher.dart';
class AppUpdatePage extends StatefulWidget { class AppUpdatePage extends StatefulWidget {
final String appUpdateText; final String appUpdateText;
AppUpdatePage({@required this.appUpdateText}); AppUpdatePage({required this.appUpdateText});
@override @override
_AppUpdatePageState createState() => _AppUpdatePageState(); _AppUpdatePageState createState() => _AppUpdatePageState();
@ -58,7 +58,7 @@ class _AppUpdatePageState extends State<AppUpdatePage> {
minWidth: MediaQuery.of(context).size.width, minWidth: MediaQuery.of(context).size.width,
height: 45.0, height: 45.0,
child: CustomTextButton( child: CustomTextButton(
backgroundColor: Colors.red[800], backgroundColor: Colors.red[800]!,
disabledForegroundColor: Color(0xFFbcc2c4).withOpacity(0.38), disabledForegroundColor: Color(0xFFbcc2c4).withOpacity(0.38),
disabledBackgroundColor: Color(0xFFbcc2c4).withOpacity(0.12), disabledBackgroundColor: Color(0xFFbcc2c4).withOpacity(0.12),
elevation: 0, elevation: 0,

@ -11,13 +11,13 @@ import '../../locator.dart';
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
class BaseView<T extends BaseViewModel> extends StatefulWidget { class BaseView<T extends BaseViewModel> extends StatefulWidget {
final Widget Function(BuildContext context, T model, Widget child) builder; final Widget Function(BuildContext context, T model, Widget? child) builder;
final Function(T) onModelReady; final Function(T)? onModelReady;
final bool allowAny; final bool allowAny;
BaseView({ BaseView({
this.builder, required this.builder,
this.onModelReady, this.onModelReady,
this.allowAny = false, this.allowAny = false,
}); });
@ -27,17 +27,15 @@ class BaseView<T extends BaseViewModel> extends StatefulWidget {
class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> { class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> {
T model = locator<T>(); T model = locator<T>();
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
bool isLogin = false; bool isLogin = false;
@override @override
void initState() { void initState() {
if (widget.allowAny && widget.onModelReady != null) { if (widget.allowAny && widget.onModelReady != null) {
widget.onModelReady(model); widget.onModelReady!(model);
} else if (widget.onModelReady != null && } else if (widget.onModelReady != null && Provider.of<ProjectViewModel>(context, listen: false).isLogin) {
Provider.of<ProjectViewModel>(context, listen: false).isLogin) { widget.onModelReady!(model);
widget.onModelReady(model);
} }
super.initState(); super.initState();
} }
@ -57,8 +55,11 @@ class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> {
@override @override
void dispose() { void dispose() {
if (model != null) { if (model != null) {
model = null; //changed by Aamir
//May be cause a problem after update
model = locator<T>();
} }
super.dispose(); super.dispose();
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save