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';
final Color? secondaryColor = Colors.red[800];
final Color? dividerColor = Colors.grey[600];

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

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

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

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

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

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

@ -1,14 +1,14 @@
class WeeklyStepsResModel {
int iD;
int patientID;
int medCategoryID;
int medSubCategoryID;
num value;
String machineDate;
bool patientOutSA;
int? iD;
int? patientID;
int? medCategoryID;
int? medSubCategoryID;
num? value;
String? machineDate;
bool? patientOutSA;
dynamic notes;
bool isActive;
String createdOn;
bool? isActive;
String? 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'];
medCategoryID = json['MedCategoryID'];
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'];
patientOutSA = json['PatientOutSA'];
notes = json['Notes'];

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

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

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

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

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

@ -15,5 +15,5 @@ class HeaderModel {
String email;
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 {
String name;
String nameAr;
String code;
String countryCode;
String? name;
String? nameAr;
String? code;
String? countryCode;
Countries({this.name, this.nameAr, this.code, this.countryCode});

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

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

@ -36,33 +36,33 @@ class LocationModel {
this.sortOrder,
});
ExpiryDate expiryDate;
double sellingPrice;
int quantity;
int itemId;
int locationId;
int projectId;
String setupId;
String locationDescription;
ExpiryDate? expiryDate;
double? sellingPrice;
int? quantity;
int? itemId;
int? locationId;
int? projectId;
String? setupId;
String? locationDescription;
dynamic locationDescriptionN;
ItemDescription itemDescription;
ItemDescription? itemDescription;
dynamic itemDescriptionN;
Alias alias;
int locationTypeId;
int barcode;
Alias? alias;
int? locationTypeId;
int? barcode;
dynamic companybarcode;
int cityId;
String cityName;
int distanceInKilometers;
String latitude;
int locationType;
String longitude;
String phoneNumber;
String projectImageUrl;
int sortOrder;
int? cityId;
String? cityName;
int? distanceInKilometers;
String? latitude;
int? locationType;
String? longitude;
String? phoneNumber;
String? projectImageUrl;
int? sortOrder;
factory LocationModel.fromJson(Map<String, dynamic> json) => LocationModel(
expiryDate: expiryDateValues.map[json["ExpiryDate"]],
expiryDate: expiryDateValues.map![json["ExpiryDate"]],
sellingPrice: json["SellingPrice"].toDouble(),
quantity: json["Quantity"],
itemId: json["ItemID"],
@ -71,9 +71,9 @@ class LocationModel {
setupId: json["SetupID"],
locationDescription: json["LocationDescription"],
locationDescriptionN: json["LocationDescriptionN"],
itemDescription: itemDescriptionValues.map[json["ItemDescription"]],
itemDescription: itemDescriptionValues.map![json["ItemDescription"]],
itemDescriptionN: json["ItemDescriptionN"],
alias: aliasValues.map[json["Alias"]],
alias: aliasValues.map![json["Alias"]],
locationTypeId: json["LocationTypeID"],
barcode: json["Barcode"],
companybarcode: json["Companybarcode"],
@ -145,15 +145,15 @@ final itemDescriptionValues = EnumValues({
});
class EnumValues<T> {
Map<String, T> map;
Map<T, String> reverseMap;
Map<String, T>? map;
Map<T, String>? reverseMap;
EnumValues(this.map);
Map<T, String> get reverse {
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,
});
List<Review> reviews;
List<Review>? reviews;
factory ProductDetail.fromJson(Map<String, dynamic> json) => ProductDetail(
reviews: List<Review>.from(json["reviews"].map((x) => Review.fromJson(x))),
);
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,
});
int id;
int position;
int reviewId;
int customerId;
int productId;
int storeId;
bool isApproved;
String title;
String reviewText;
int? id;
int? position;
int? reviewId;
int? customerId;
int? productId;
int? storeId;
bool? isApproved;
String? title;
String? reviewText;
dynamic replyText;
int rating;
int helpfulYesTotal;
int helpfulNoTotal;
DateTime createdOnUtc;
Customer customer;
int? rating;
int? helpfulYesTotal;
int? helpfulNoTotal;
DateTime? createdOnUtc;
Customer? customer;
dynamic product;
factory Review.fromJson(Map<String, dynamic> json) => Review(
@ -90,8 +90,8 @@ class Review {
"rating": rating,
"helpful_yes_total": helpfulYesTotal,
"helpful_no_total": helpfulNoTotal,
"created_on_utc": createdOnUtc.toIso8601String(),
"customer": customer.toJson(),
"created_on_utc": createdOnUtc!.toIso8601String(),
"customer": customer!.toJson(),
"product": product,
};
}
@ -131,18 +131,18 @@ class Customer {
dynamic fileNumber;
dynamic iqamaNumber;
int isOutSa;
int patientType;
int? isOutSa;
int? patientType;
dynamic gender;
DateTime birthDate;
DateTime? birthDate;
dynamic phone;
dynamic countryCode;
dynamic yahalaAccountno;
dynamic billingAddress;
dynamic shippingAddress;
String id;
Email username;
Email email;
String? id;
Email? username;
Email? email;
dynamic firstName;
dynamic lastName;
dynamic languageId;
@ -172,8 +172,8 @@ class Customer {
billingAddress: json["billing_address"],
shippingAddress: json["shipping_address"],
id: json["id"],
username: emailValues.map[json["username"]],
email: emailValues.map[json["email"]],
username: emailValues.map![json["username"]],
email: emailValues.map![json["email"]],
firstName: json["first_name"],
lastName: json["last_name"],
languageId: json["language_id"],
@ -197,7 +197,7 @@ class Customer {
"is_out_sa": isOutSa,
"patient_type": patientType,
"gender": gender,
"birth_date": birthDate.toIso8601String(),
"birth_date": birthDate!.toIso8601String(),
"phone": phone,
"country_code": countryCode,
"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});
class EnumValues<T> {
Map<String, T> map;
Map<T, String> reverseMap;
Map<String, T>? map;
Map<T, String>? reverseMap;
EnumValues(this.map);
Map<T, String> get reverse {
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!;
}
}

@ -15,7 +15,7 @@ class Products {
});
dynamic messageStatus;
List<Product> products;
List<Product>? products;
factory Products.fromJson(Map<String, dynamic> json) => Products(
messageStatus: json["MessageStatus"],
@ -24,7 +24,7 @@ class Products {
Map<String, dynamic> toJson() => {
"MessageStatus": messageStatus,
"products": List<dynamic>.from(products.map((x) => x.toJson())),
"products": List<dynamic>.from(products!.map((x) => x.toJson())),
};
}
@ -143,117 +143,117 @@ class Product {
this.seName,
});
String id;
bool visibleIndividually;
String name;
String namen;
List<LocalizedName> localizedNames;
String shortDescription;
String shortDescriptionn;
String fullDescription;
String fullDescriptionn;
bool markasNew;
bool showOnHomePage;
String metaKeywords;
String metaDescription;
String metaTitle;
bool allowCustomerReviews;
int approvedRatingSum;
int notApprovedRatingSum;
int approvedTotalReviews;
int notApprovedTotalReviews;
String sku;
bool isRx;
bool prescriptionRequired;
String rxMessage;
String rxMessagen;
String? id;
bool? visibleIndividually;
String? name;
String? namen;
List<LocalizedName>? localizedNames;
String? shortDescription;
String? shortDescriptionn;
String? fullDescription;
String? fullDescriptionn;
bool? markasNew;
bool? showOnHomePage;
String? metaKeywords;
String? metaDescription;
String? metaTitle;
bool? allowCustomerReviews;
int? approvedRatingSum;
int? notApprovedRatingSum;
int? approvedTotalReviews;
int? notApprovedTotalReviews;
String? sku;
bool? isRx;
bool? prescriptionRequired;
String? rxMessage;
String? rxMessagen;
dynamic manufacturerPartNumber;
dynamic gtin;
bool isGiftCard;
bool requireOtherProducts;
bool automaticallyAddRequiredProducts;
bool isDownload;
bool unlimitedDownloads;
int maxNumberOfDownloads;
bool? isGiftCard;
bool? requireOtherProducts;
bool? automaticallyAddRequiredProducts;
bool? isDownload;
bool? unlimitedDownloads;
int? maxNumberOfDownloads;
dynamic downloadExpirationDays;
bool hasSampleDownload;
bool hasUserAgreement;
bool isRecurring;
int recurringCycleLength;
int recurringTotalCycles;
bool isRental;
int rentalPriceLength;
bool isShipEnabled;
bool isFreeShipping;
bool shipSeparately;
int additionalShippingCharge;
bool isTaxExempt;
bool isTelecommunicationsOrBroadcastingOrElectronicServices;
bool useMultipleWarehouses;
int manageInventoryMethodId;
int stockQuantity;
String stockAvailability;
String stockAvailabilityn;
bool displayStockAvailability;
bool displayStockQuantity;
int minStockQuantity;
int notifyAdminForQuantityBelow;
bool allowBackInStockSubscriptions;
int orderMinimumQuantity;
int orderMaximumQuantity;
bool? hasSampleDownload;
bool? hasUserAgreement;
bool? isRecurring;
int? recurringCycleLength;
int? recurringTotalCycles;
bool? isRental;
int? rentalPriceLength;
bool? isShipEnabled;
bool? isFreeShipping;
bool? shipSeparately;
int? additionalShippingCharge;
bool? isTaxExempt;
bool? isTelecommunicationsOrBroadcastingOrElectronicServices;
bool? useMultipleWarehouses;
int? manageInventoryMethodId;
int? stockQuantity;
String? stockAvailability;
String? stockAvailabilityn;
bool? displayStockAvailability;
bool? displayStockQuantity;
int? minStockQuantity;
int? notifyAdminForQuantityBelow;
bool? allowBackInStockSubscriptions;
int? orderMinimumQuantity;
int? orderMaximumQuantity;
dynamic allowedQuantities;
bool allowAddingOnlyExistingAttributeCombinations;
bool disableBuyButton;
bool disableWishlistButton;
bool availableForPreOrder;
bool? allowAddingOnlyExistingAttributeCombinations;
bool? disableBuyButton;
bool? disableWishlistButton;
bool? availableForPreOrder;
dynamic preOrderAvailabilityStartDateTimeUtc;
bool callForPrice;
double price;
int oldPrice;
double productCost;
bool? callForPrice;
double? price;
int? oldPrice;
double? productCost;
dynamic specialPrice;
dynamic specialPriceStartDateTimeUtc;
dynamic specialPriceEndDateTimeUtc;
bool customerEntersPrice;
int minimumCustomerEnteredPrice;
int maximumCustomerEnteredPrice;
bool basepriceEnabled;
int basepriceAmount;
int basepriceBaseAmount;
bool hasTierPrices;
bool hasDiscountsApplied;
String discountName;
String discountNamen;
String discountDescription;
String discountDescriptionn;
String discountPercentage;
String currency;
String currencyn;
double weight;
int length;
int width;
int height;
bool? customerEntersPrice;
int? minimumCustomerEnteredPrice;
int? maximumCustomerEnteredPrice;
bool? basepriceEnabled;
int? basepriceAmount;
int? basepriceBaseAmount;
bool? hasTierPrices;
bool? hasDiscountsApplied;
String? discountName;
String? discountNamen;
String? discountDescription;
String? discountDescriptionn;
String? discountPercentage;
String? currency;
String? currencyn;
double? weight;
int? length;
int? width;
int? height;
dynamic availableStartDateTimeUtc;
dynamic availableEndDateTimeUtc;
int displayOrder;
bool published;
bool deleted;
DateTime createdOnUtc;
DateTime updatedOnUtc;
String productType;
int parentGroupedProductId;
List<dynamic> roleIds;
List<int> discountIds;
List<dynamic> storeIds;
List<int> manufacturerIds;
List<Review> reviews;
List<Image> images;
List<dynamic> attributes;
List<Specification> specifications;
List<dynamic> associatedProductIds;
List<dynamic> tags;
int vendorId;
String seName;
int? displayOrder;
bool? published;
bool? deleted;
DateTime? createdOnUtc;
DateTime? updatedOnUtc;
String? productType;
int? parentGroupedProductId;
List<dynamic>? roleIds;
List<int>? discountIds;
List<dynamic>? storeIds;
List<int>? manufacturerIds;
List<Review>? reviews;
List<Image>? images;
List<dynamic>? attributes;
List<Specification>? specifications;
List<dynamic>? associatedProductIds;
List<dynamic>? tags;
int? vendorId;
String? seName;
factory Product.fromJson(Map<String, dynamic> json) => Product(
id: json["id"],
@ -374,7 +374,7 @@ class Product {
"visible_individually": visibleIndividually,
"name": name,
"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 == null ? null : shortDescription,
"short_descriptionn": shortDescriptionn == null ? null : shortDescriptionn,
"full_description": fullDescription,
@ -465,20 +465,20 @@ class Product {
"display_order": displayOrder,
"published": published,
"deleted": deleted,
"created_on_utc": createdOnUtc.toIso8601String(),
"updated_on_utc": updatedOnUtc.toIso8601String(),
"created_on_utc": createdOnUtc!.toIso8601String(),
"updated_on_utc": updatedOnUtc!.toIso8601String(),
"product_type": productType,
"parent_grouped_product_id": parentGroupedProductId,
"role_ids": List<dynamic>.from(roleIds.map((x) => x)),
"discount_ids": List<dynamic>.from(discountIds.map((x) => x)),
"store_ids": List<dynamic>.from(storeIds.map((x) => x)),
"manufacturer_ids": List<dynamic>.from(manufacturerIds.map((x) => x)),
"reviews": List<dynamic>.from(reviews.map((x) => x.toJson())),
"images": List<dynamic>.from(images.map((x) => x.toJson())),
"attributes": List<dynamic>.from(attributes.map((x) => x)),
"specifications": List<dynamic>.from(specifications.map((x) => x.toJson())),
"associated_product_ids": List<dynamic>.from(associatedProductIds.map((x) => x)),
"tags": List<dynamic>.from(tags.map((x) => x)),
"role_ids": List<dynamic>.from(roleIds!.map((x) => x)),
"discount_ids": List<dynamic>.from(discountIds!.map((x) => x)),
"store_ids": List<dynamic>.from(storeIds!.map((x) => x)),
"manufacturer_ids": List<dynamic>.from(manufacturerIds!.map((x) => x)),
"reviews": List<dynamic>.from(reviews!.map((x) => x.toJson())),
"images": List<dynamic>.from(images!.map((x) => x.toJson())),
"attributes": List<dynamic>.from(attributes!.map((x) => x)),
"specifications": List<dynamic>.from(specifications!.map((x) => x.toJson())),
"associated_product_ids": List<dynamic>.from(associatedProductIds!.map((x) => x)),
"tags": List<dynamic>.from(tags!.map((x) => x)),
"vendor_id": vendorId,
"se_name": seName,
};
@ -493,11 +493,11 @@ class Image {
this.attachment,
});
int id;
int position;
String src;
String thumb;
String attachment;
int? id;
int? position;
String? src;
String? thumb;
String? attachment;
factory Image.fromJson(Map<String, dynamic> json) => Image(
id: json["id"],
@ -522,8 +522,8 @@ class LocalizedName {
this.localizedName,
});
int languageId;
String localizedName;
int? languageId;
String? localizedName;
factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName(
languageId: json["language_id"],
@ -556,21 +556,21 @@ class Review {
this.product,
});
int id;
int position;
int reviewId;
int customerId;
int productId;
int storeId;
bool isApproved;
String title;
String reviewText;
int? id;
int? position;
int? reviewId;
int? customerId;
int? productId;
int? storeId;
bool? isApproved;
String? title;
String? reviewText;
dynamic replyText;
int rating;
int helpfulYesTotal;
int helpfulNoTotal;
DateTime createdOnUtc;
Customer customer;
int? rating;
int? helpfulYesTotal;
int? helpfulNoTotal;
DateTime? createdOnUtc;
Customer? customer;
dynamic product;
factory Review.fromJson(Map<String, dynamic> json) => Review(
@ -606,8 +606,8 @@ class Review {
"rating": rating,
"helpful_yes_total": helpfulYesTotal,
"helpful_no_total": helpfulNoTotal,
"created_on_utc": createdOnUtc.toIso8601String(),
"customer": customer.toJson(),
"created_on_utc": createdOnUtc!.toIso8601String(),
"customer": customer!.toJson(),
"product": product,
};
}
@ -649,19 +649,19 @@ class Customer {
dynamic fileNumber;
dynamic iqamaNumber;
int isOutSa;
int patientType;
int? isOutSa;
int? patientType;
dynamic gender;
DateTime birthDate;
DateTime? birthDate;
dynamic phone;
dynamic countryCode;
dynamic yahalaAccountno;
dynamic billingAddress;
dynamic shippingAddress;
List<dynamic> addresses;
String id;
Username username;
Email email;
List<dynamic>? addresses;
String? id;
Username? username;
Email? email;
dynamic firstName;
dynamic lastName;
dynamic languageId;
@ -677,7 +677,7 @@ class Customer {
dynamic lastLoginDateUtc;
dynamic lastActivityDateUtc;
dynamic registeredInStoreId;
List<dynamic> roleIds;
List<dynamic>? roleIds;
factory Customer.fromJson(Map<String, dynamic> json) => Customer(
fileNumber: json["file_number"],
@ -693,8 +693,8 @@ class Customer {
shippingAddress: json["shipping_address"],
addresses: List<dynamic>.from(json["addresses"].map((x) => x)),
id: json["id"],
username: usernameValues.map[json["username"]],
email: emailValues.map[json["email"]],
username: usernameValues.map![json["username"]],
email: emailValues.map![json["email"]],
firstName: json["first_name"],
lastName: json["last_name"],
languageId: json["language_id"],
@ -719,13 +719,13 @@ class Customer {
"is_out_sa": isOutSa,
"patient_type": patientType,
"gender": gender,
"birth_date": birthDate.toIso8601String(),
"birth_date": birthDate!.toIso8601String(),
"phone": phone,
"country_code": countryCode,
"yahala_accountno": yahalaAccountno,
"billing_address": billingAddress,
"shipping_address": shippingAddress,
"addresses": List<dynamic>.from(addresses.map((x) => x)),
"addresses": List<dynamic>.from(addresses!.map((x) => x)),
"id": id,
"username": usernameValues.reverse[username],
"email": emailValues.reverse[email],
@ -744,23 +744,17 @@ class Customer {
"last_login_date_utc": lastLoginDateUtc,
"last_activity_date_utc": lastActivityDateUtc,
"registered_in_store_id": registeredInStoreId,
"role_ids": List<dynamic>.from(roleIds.map((x) => x)),
"role_ids": List<dynamic>.from(roleIds!.map((x) => x)),
};
}
enum Email { MEMO17299_GMAIL_COM, STEVE_GATES_NOP_COMMERCE_COM }
final emailValues = EnumValues({
"Memo17299@gmail.com": Email.MEMO17299_GMAIL_COM,
"steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM
});
final emailValues = EnumValues({"Memo17299@gmail.com": Email.MEMO17299_GMAIL_COM, "steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM});
enum Username { AMAL_26, STEVE_GATES_NOP_COMMERCE_COM }
final usernameValues = EnumValues({
"amal_26": Username.AMAL_26,
"steve_gates@nopCommerce.com": Username.STEVE_GATES_NOP_COMMERCE_COM
});
final usernameValues = EnumValues({"amal_26": Username.AMAL_26, "steve_gates@nopCommerce.com": Username.STEVE_GATES_NOP_COMMERCE_COM});
class Specification {
Specification({
@ -772,20 +766,20 @@ class Specification {
this.nameN,
});
int id;
int displayOrder;
String defaultValue;
String defaultValuen;
Name name;
NameN nameN;
int? id;
int? displayOrder;
String? defaultValue;
String? defaultValuen;
Name? name;
NameN? nameN;
factory Specification.fromJson(Map<String, dynamic> json) => Specification(
id: json["id"],
displayOrder: json["display_order"],
defaultValue: json["default_value"],
defaultValuen: json["default_valuen"],
name: nameValues.map[json["name"]],
nameN: nameNValues.map[json["nameN"]],
name: nameValues.map![json["name"]],
nameN: nameNValues.map![json["nameN"]],
);
Map<String, dynamic> toJson() => {
@ -811,25 +805,19 @@ final nameValues = EnumValues({
enum NameN { EMPTY, NAME_N, PURPLE, FLUFFY, TENTACLED, SPF }
final nameNValues = EnumValues({
"وحدة القياس الأولية": NameN.EMPTY,
"تخزين": NameN.FLUFFY,
"علامة تجارية": NameN.NAME_N,
"اسم البلد المصنع": NameN.PURPLE,
"SPF": NameN.SPF,
"المكونات": NameN.TENTACLED
});
final nameNValues =
EnumValues({"وحدة القياس الأولية": NameN.EMPTY, "تخزين": NameN.FLUFFY, "علامة تجارية": NameN.NAME_N, "اسم البلد المصنع": NameN.PURPLE, "SPF": NameN.SPF, "المكونات": NameN.TENTACLED});
class EnumValues<T> {
Map<String, T> map;
Map<T, String> reverseMap;
Map<String, T>? map;
Map<T, String>? reverseMap;
EnumValues(this.map);
Map<T, String> get reverse {
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!;
}
}

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

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

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

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

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

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

@ -8,7 +8,7 @@ class ConfirmCancelOrderDialog extends StatefulWidget {
final CMCViewModel model;
final Function onTap;
ConfirmCancelOrderDialog({Key key, this.model, this.onTap});
ConfirmCancelOrderDialog({Key? key, required this.model, required this.onTap});
@override
_ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState();

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

@ -18,7 +18,7 @@ import 'package:provider/provider.dart';
import 'new_cmc_step_one_page.dart';
class NewCMCPage extends StatefulWidget {
NewCMCPage({this.model});
NewCMCPage({required this.model});
final CMCViewModel model;
@ -27,15 +27,15 @@ class NewCMCPage extends StatefulWidget {
}
class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
PageController _controller;
late PageController _controller;
int _currentIndex = 1;
double _latitude;
double _longitude;
late double _latitude;
late double _longitude;
CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel;
late CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel;
BuildContext _context;
late BuildContext _context;
@override
void initState() {
@ -51,10 +51,11 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
totalPrice: widget.model.cmcAllServicesList[0].priceTotal,
vAT: widget.model.cmcAllServicesList[0].priceVAT);
cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: [patientERCMCInsertServicesList]);
} else {
cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: []);
//changed By Aamir
}
cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: patientERCMCInsertServicesList != null ? [patientERCMCInsertServicesList] : []);
_controller = new PageController();
// _getCurrentLocation();
@ -62,7 +63,7 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
_getCurrentLocation() async {
await Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude;
_latitude = value!.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
@ -107,9 +108,9 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
));
}
int status = widget.model.pendingOrder != null ? widget.model.pendingOrder.statusId : 0;
String _statusDisp = widget.model.pendingOrder != null ? widget.model.pendingOrder.statusText : "";
Color _color;
int status = widget.model.pendingOrder != null ? widget.model.pendingOrder!.statusId! : 0;
String _statusDisp = widget.model.pendingOrder != null ? widget.model.pendingOrder!.statusText! : "";
late Color _color;
if (status == 1) {
//pending
_color = Color(0xffCC9B14);
@ -165,7 +166,7 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
),
SizedBox(height: 6),
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),
),
Row(
@ -177,7 +178,7 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
),
Expanded(
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),
),
),
@ -192,7 +193,7 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
),
Expanded(
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),
),
),
@ -206,14 +207,14 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
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),
),
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(
onTap: () {
showConfirmMessage(widget.model, widget.model.pendingOrder);
showConfirmMessage(widget.model, widget.model.pendingOrder!);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),

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

@ -27,7 +27,7 @@ class NewCMCStepThreePage extends StatefulWidget {
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
final CMCViewModel model;
NewCMCStepThreePage({Key key, this.model, this.cmcInsertPresOrderRequestModel});
NewCMCStepThreePage({Key? key, required this.model, required this.cmcInsertPresOrderRequestModel});
@override
_NewCMCStepThreePageState createState() => _NewCMCStepThreePageState();
@ -36,9 +36,9 @@ class NewCMCStepThreePage extends StatefulWidget {
class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
Completer<GoogleMapController> _controller = Completer();
String projectDropdownValue;
List<HospitalsModel> projectsList = [];
HospitalsModel selectedHospital;
String? projectDropdownValue;
late List<HospitalsModel> projectsList = [];
late HospitalsModel selectedHospital;
final GlobalKey projectDropdownKey = GlobalKey();
bool isLocationSelected = false;
@ -57,10 +57,10 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
markerId: MarkerId(
widget.cmcInsertPresOrderRequestModel.latitude.hashCode.toString(),
),
position: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, widget.cmcInsertPresOrderRequestModel.longitude)),
position: LatLng(widget.cmcInsertPresOrderRequestModel.latitude!, widget.cmcInsertPresOrderRequestModel.longitude!)),
);
_kGooglePlex = CameraPosition(
target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, widget.cmcInsertPresOrderRequestModel.longitude),
target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude!, widget.cmcInsertPresOrderRequestModel.longitude!),
zoom: 14.4746,
);
}
@ -148,12 +148,12 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
items: projectsList.map((item) {
return new DropdownMenuItem<HospitalsModel>(
value: item,
child: new Text(item.name),
child: new Text(item.name!),
);
}).toList(),
onChanged: (newValue) async {
setState(() {
selectedHospital = newValue;
selectedHospital = newValue!;
projectDropdownValue = newValue.mainProjectID.toString();
isLocationSelected = true;
widget.cmcInsertPresOrderRequestModel.projectID = newValue.mainProjectID;
@ -259,15 +259,15 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
),
),
...List.generate(
widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length,
widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList!.length,
(index) => Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
projectViewModel.isArabic
? widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index].selectedServiceNameAR
: widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index].selectedServiceName,
? widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList![index].selectedServiceNameAR!
: widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList![index].selectedServiceName!,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
@ -353,7 +353,7 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
getDirections() {
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 {
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/material.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:permission_handler/permission_handler.dart';
@ -33,7 +33,7 @@ class NewCMCStepTowPage extends StatefulWidget {
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
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
_NewCMCStepTowPageState createState() => _NewCMCStepTowPageState();
@ -42,16 +42,16 @@ class NewCMCStepTowPage extends StatefulWidget {
class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
double latitude = 0;
double longitude = 0;
AddressInfo _selectedAddress;
late AddressInfo _selectedAddress;
bool showCurrentLocation = false;
AppSharedPreferences sharedPref = AppSharedPreferences();
static CameraPosition cameraPosition = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
static gmaps.CameraPosition cameraPosition = gmaps.CameraPosition(
target: gmaps.LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
LatLng currentPostion;
late gmaps.LatLng currentPostion;
void _getUserLocation() async {
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);
latitude = lat;
longitude = long;
currentPostion = LatLng(lat, long);
currentPostion = gmaps.LatLng(lat, long);
setMap();
} else {
if (await PermissionService.isLocationEnabled()) {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
latitude = value!.latitude;
longitude = value.longitude;
currentPostion = LatLng(latitude, longitude);
currentPostion = gmaps.LatLng(latitude, longitude);
setMap();
});
} else {
if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
latitude = value!.latitude;
longitude = value.longitude;
currentPostion = LatLng(latitude, longitude);
currentPostion = gmaps.LatLng(latitude, longitude);
setMap();
});
});
} else {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
latitude = value!.latitude;
longitude = value.longitude;
currentPostion = LatLng(latitude, longitude);
currentPostion = gmaps.LatLng(latitude, longitude);
setMap();
});
}
@ -95,10 +95,12 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
void initState() {
super.initState();
appMap = AppMap(
cameraPosition.toMap(),
cameraPosition.toMap() as Map<dynamic, dynamic>,
// Changed by Aamir
onCameraMove: (camera) {
setState(() {});
_updatePosition(camera);
// Changed by Aamir
_updatePosition(camera as gmaps.CameraPosition);
},
onMapCreated: () {
print("_getUserLocation");
@ -109,7 +111,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
setMap() {
setState(() {
cameraPosition = CameraPosition(
cameraPosition = gmaps.CameraPosition(
target: currentPostion,
zoom: 14.4746,
);
@ -126,7 +128,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
return permissionResults;
}
setLatitudeAndLongitude({bool isSetState = false, String latLong}) async {
setLatitudeAndLongitude({bool isSetState = false, String? latLong}) async {
print("latLong " + latLong.toString());
if (latLong == null) {
if (widget.model.addressesList.isEmpty) {
@ -139,18 +141,18 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
}
if (!showCurrentLocation) {
List latLongArr = latLong.split(',');
List latLongArr = latLong!.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
print("sssss1 " + latitude.toString());
print("sssss2 " + longitude.toString());
currentPostion = LatLng(latitude, longitude);
currentPostion = gmaps.LatLng(latitude, longitude);
setMap();
}
}
AppMap appMap;
late AppMap appMap;
@override
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;
longitude = _position.target.longitude;
}
@ -308,7 +310,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
String getAddressName() {
if (_selectedAddress != null)
return _selectedAddress.address1;
return _selectedAddress.address1!;
else
return TranslationBase.of(context).selectAddress;
}

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

@ -23,7 +23,7 @@ import 'Dialog/confirm_cancel_order_dialog.dart';
class OrdersLogDetailsPage extends StatelessWidget {
final CMCViewModel model;
const OrdersLogDetailsPage({Key key, this.model}) : super(key: key);
const OrdersLogDetailsPage({Key ?key, required this.model}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -62,9 +62,9 @@ class OrdersLogDetailsPage extends StatelessWidget {
itemBuilder: (context, index) {
GetCMCAllOrdersResponseModel order = model.cmcAllPresOrders.reversed.toList()[index];
int status = order.statusId;
String _statusDisp = order.statusText;
Color _color;
int status = order.statusId!;
String _statusDisp = order.statusText!;
late Color _color;
if (status == 1) {
//pending
_color = Color(0xffCC9B14);
@ -133,7 +133,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
Expanded(
child: Text(
// !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),
),
),
@ -147,7 +147,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
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),
),
SizedBox(height: 12),

@ -16,7 +16,7 @@ class StartIndexForNewEReferral extends StatefulWidget {
}
class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral> with TickerProviderStateMixin {
PageController _controller;
late PageController _controller;
int _currentIndex = 0;
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(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

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

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

@ -25,7 +25,7 @@ class NewEReferralStepTowPage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel;
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
_NewEReferralStepTowPageState createState() => _NewEReferralStepTowPageState();
@ -35,15 +35,15 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
TextEditingController _patientNameTextController = TextEditingController();
TextEditingController _patientIdentificationTextController = TextEditingController();
String mobileNo = "";
GetAllCitiesResponseModel _selectedCity;
late GetAllCitiesResponseModel _selectedCity;
GetAllSharedRecordsByStatusList selectedPatientFamily;
late GetAllSharedRecordsByStatusList selectedPatientFamily;
// todo create a model for Country
// todo use country from the json
dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9};
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
late AuthenticatedUser authUser;
@override
void initState() {
@ -195,7 +195,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
}
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(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
@ -298,7 +298,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
String getRelationName() {
if (_selectedCity != null)
return _selectedCity.description;
return _selectedCity.description!;
else
return TranslationBase.of(context).selectCity /*TranslationBase.of(context).selectHospital*/;
}
@ -312,7 +312,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
}
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 String code;

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

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

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

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

@ -20,7 +20,7 @@ class EReferralPage extends StatefulWidget {
class _EReferralPageState extends State<EReferralPage>
with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
@override
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/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -10,7 +11,7 @@ import 'package:provider/provider.dart';
class ReferralDetails extends StatefulWidget {
final SearchEReferralResponseModel referral;
const ReferralDetails({Key key, @required this.referral}) : super(key: key);
const ReferralDetails({Key? key, required this.referral}) : super(key: key);
@override
_ReferralDetailsState createState() => _ReferralDetailsState();
@ -55,7 +56,7 @@ class _ReferralDetailsState extends State<ReferralDetails> {
],
),
),
mDivider(Colors.grey[600]),
mDivider(dividerColor!),
Container(
width: double.infinity,
padding: EdgeInsets.only(top: 10, bottom: 5),
@ -70,7 +71,7 @@ class _ReferralDetailsState extends State<ReferralDetails> {
],
),
),
mDivider(Colors.grey[600]),
mDivider(dividerColor!),
Container(
width: double.infinity,
padding: EdgeInsets.only(top: 10, bottom: 5),
@ -85,7 +86,7 @@ class _ReferralDetailsState extends State<ReferralDetails> {
],
),
),
mDivider(Colors.grey[600]),
mDivider(dividerColor!),
Container(
width: double.infinity,
padding: EdgeInsets.only(top: 10, bottom: 5),
@ -95,12 +96,12 @@ class _ReferralDetailsState extends State<ReferralDetails> {
child: _getNormalText(TranslationBase.of(context).referralDate),
),
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(
width: double.infinity,
padding: EdgeInsets.only(top: 10, bottom: 5),

@ -25,7 +25,7 @@ import 'package:provider/provider.dart';
import 'dialogs/select_country_ingo_Dialog.dart';
class SearchForReferralsPage extends StatefulWidget {
SearchForReferralsPage({Key key});
SearchForReferralsPage({Key? key});
@override
_SearchForReferralsPageState createState() => _SearchForReferralsPageState();
@ -50,14 +50,14 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context);
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) {
searchEReferralRequestModel.identificationNo = _searchTextController.text;
searchEReferralRequestModel.referralNumber = 0;
} else {
searchEReferralRequestModel.referralNumber = int.parse(_searchTextController.text);
searchEReferralRequestModel.identificationNo = projectViewModel.user.patientIdentificationNo;
searchEReferralRequestModel.identificationNo = projectViewModel.user!.patientIdentificationNo;
}
await model.getEReferrals(searchEReferralRequestModel);
GifLoaderDialogUtils.hideDialog(context);
@ -85,7 +85,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
];
List<RadioSelectionDialogModel> list = <RadioSelectionDialogModel>[];
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(
context: context,
@ -168,14 +168,14 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
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)),
Container(
margin: EdgeInsets.only(top: 5.0),
child: MyRichText(TranslationBase.of(context).patientName + ": ", model.allReferral[index].patientName, projectViewModel.isArabic)),
MyRichText(TranslationBase.of(context).hospital + ": ", model.allReferral[index].preferredBranchName, 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).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),
@ -248,7 +248,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
}
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(
onTap: hasSelection ? () {} : null,
child: Row(
@ -309,6 +309,6 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
}
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
final Function goToMyProfile;
AllHabibMedicalService({Key key, this.goToMyProfile});
AllHabibMedicalService({Key? key, required this.goToMyProfile});
@override
_AllHabibMedicalServiceState createState() => _AllHabibMedicalServiceState();
@ -61,7 +61,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
LocationUtils locationUtils;
late LocationUtils locationUtils;
var weather = '--';
WeatherService _weatherService = WeatherService();
List<HmgServices> hmgServices = [];
@ -70,7 +70,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
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();
}

@ -30,7 +30,7 @@ class AllHabibMedicalSevicePage2 extends StatefulWidget {
class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2> {
List<HmgServices> hmgServices = [];
LocationUtils locationUtils;
late LocationUtils locationUtils;
var weather = '--';
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser = new AuthenticatedUser();
@ -46,17 +46,17 @@ class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2>
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) async => {
if (await PermissionService.isLocationEnabled())
{Geolocator.getLastKnownPosition().then((value) => setLocation(value))}
{Geolocator.getLastKnownPosition().then((value) => setLocation(value!))}
else
{
if (Platform.isAndroid)
{
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) => setLocation(value));
Geolocator.getLastKnownPosition().then((value) => setLocation(value!));
})
}
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 {
TabController _tabController;
ProjectViewModel projectViewModel;
TabController? _tabController;
late ProjectViewModel projectViewModel;
void initState() {
super.initState();
@ -28,7 +28,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProv
void dispose() {
super.dispose();
_tabController.dispose();
_tabController!.dispose();
}
@override
@ -73,7 +73,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProv
),
mWidth(3),
Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -95,7 +95,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProv
),
mWidth(3),
Text(
projectViewModel.user.patientID.toString(),
projectViewModel!.user!.patientID.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -117,7 +117,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProv
),
mWidth(3),
Text(
projectViewModel.user.patientIdentificationNo,
projectViewModel!.user!.patientIdentificationNo!,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -146,18 +146,18 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProv
reverse: true,
itemBuilder: (context, index) {
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,
name: TranslationBase.of(context).dr.toString() + " " + (model.ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""),
billNo: model.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(),
name: TranslationBase.of(context).dr.toString() + " " + (model.ancillaryLists[0].ancillaryOrderList![index].doctorName ?? ""),
billNo: model.ancillaryLists[0].ancillaryOrderList![index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: model.ancillaryLists[0].projectName,
isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(model.ancillaryLists[0].ancillaryOrderList[index].orderDate),
date: DateUtil.convertStringToDate(model.ancillaryLists[0].ancillaryOrderList![index].orderDate!),
isSortByClinic: true,
);
},
itemCount: model.ancillaryLists[0].ancillaryOrderList.length,
itemCount: model.ancillaryLists[0].ancillaryOrderList!.length,
separatorBuilder: (context, index) => SizedBox(height: 14),
),
]);

@ -37,18 +37,18 @@ class AnicllaryOrdersDetails extends StatefulWidget {
}
class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTickerProviderStateMixin {
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
bool _agreeTerms = false;
String selectedPaymentMethod;
MyInAppBrowser browser;
String selectedPaymentMethod = "";
late MyInAppBrowser browser;
String transID = "";
BuildContext localContext;
String selectedInstallmentPlan;
late BuildContext localContext;
String? selectedInstallmentPlan;
List<AncillaryOrderProcDetailsList> selectedProcList = [];
String tamaraPaymentStatus;
String tamaraOrderID;
String? tamaraPaymentStatus;
String? tamaraOrderID;
void initState() {
super.initState();
@ -207,7 +207,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
),
mWidth(3),
Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -229,7 +229,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
),
mWidth(3),
Text(
projectViewModel.user.patientID.toString(),
projectViewModel.user!.patientID.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -251,7 +251,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
),
mWidth(3),
Text(
projectViewModel.user.patientIdentificationNo,
projectViewModel.user!.patientIdentificationNo!,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -296,7 +296,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
),
mWidth(3),
Text(
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList[0].orderNo.toString(),
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList![0].orderNo.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -366,8 +366,8 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
);
}
Widget getAncillaryDetails(model) {
Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList, (obj) => obj.procedureCategoryName);
Widget getAncillaryDetails(AnciallryOrdersViewModel model) {
Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList!, (obj) => obj.procedureCategoryName);
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),
decoration: BoxDecoration(
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(
bottomRight: 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(
context,
PaymentMethod(
onSelectedMethod: (String method, [String selectedInstallmentPlan]) {
onSelectedMethod: (String method, [String? selectedInstallmentPlan]) {
selectedPaymentMethod = method;
this.selectedInstallmentPlan = selectedInstallmentPlan;
openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, model, selectedInstallmentPlan);
this.selectedInstallmentPlan = selectedInstallmentPlan!;
openPayment(selectedPaymentMethod, projectViewModel.user!, double.parse(getTotalValue()), AppoitmentAllHistoryResultList(), model, selectedInstallmentPlan);
},
patientShare: double.parse(getTotalValue()),
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);
transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID);
transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user!.patientID!);
browser.openPaymentBrowser(
amount,
"Ancillary Orders Payment",
transID,
widget.projectID.toString(),
projectViewModel.user.emailAddress,
projectViewModel.user!.emailAddress!,
paymentMethod,
projectViewModel.user.patientType,
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
projectViewModel.user.patientID,
projectViewModel.user!.patientType,
projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!,
projectViewModel.user!.patientID,
authenticatedUser,
browser,
false,
@ -580,10 +580,10 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
service.getTamaraPaymentStatus(orderID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
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 {
updateTamaraRequestStatus(
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(this.selectedInstallmentPlan), appo);
updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID! : "",
int.parse(this.selectedInstallmentPlan!), appo);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
@ -598,7 +598,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
DoctorsListService service = new DoctorsListService();
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (tamaraPaymentStatus.toLowerCase() == "approved") {
if (tamaraPaymentStatus!.toLowerCase() == "approved") {
createAdvancePayment(res, appo);
// addAdvancedNumberRequestTamara("Tamara-Advance-0000", tamaraOrderID, appo.appointmentNo.toString(), appo);
}
@ -637,8 +637,8 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
// selectedProcList.forEach((element) {
// 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,
projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext,
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,
isAncillaryOrder: true)
.then((res) {
addAdvancedNumberRequest(
@ -714,7 +714,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
addToSelectedProcedures(AnciallryOrdersViewModel model) {
if (model.ancillaryListsDetails.isNotEmpty) {
selectedProcList.clear();
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList.forEach((element) {
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList!.forEach((element) {
if (!isProcedureDisabled(element)) {
selectedProcList.add(element);
}
@ -756,9 +756,9 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
}
bool isProcedureDisabled(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) {
if ((ancillaryOrderProcDetailsList.isApprovalRequired && !ancillaryOrderProcDetailsList.isApprovalCreated) ||
(ancillaryOrderProcDetailsList.isApprovalCreated && ancillaryOrderProcDetailsList.approvalNo == 0) ||
(ancillaryOrderProcDetailsList.isApprovalRequired && ancillaryOrderProcDetailsList.isApprovalCreated && ancillaryOrderProcDetailsList.approvalNo == 0)) {
if ((ancillaryOrderProcDetailsList.isApprovalRequired! && !ancillaryOrderProcDetailsList.isApprovalCreated!) ||
(ancillaryOrderProcDetailsList.isApprovalCreated! && ancillaryOrderProcDetailsList.approvalNo == 0) ||
(ancillaryOrderProcDetailsList.isApprovalRequired! && ancillaryOrderProcDetailsList.isApprovalCreated! && ancillaryOrderProcDetailsList.approvalNo == 0)) {
return true;
} else {
return false;

@ -6,7 +6,7 @@ class CommonRadioButtonDialog extends StatefulWidget {
final String title;
final int selectedIndex;
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
_CommonRadioButtonDialogState createState() {
@ -58,7 +58,7 @@ class _CommonRadioButtonDialogState extends State<CommonRadioButtonDialog> {
dense: true,
activeColor: Colors.black54,
groupValue: _selectedIndex,
onChanged: (_index) => setState(() => _selectedIndex = _index),
onChanged: (_index) => setState(() => _selectedIndex = _index!),
title: Text(
widget.list[index],
style: TextStyle(fontWeight: FontWeight.w500),

@ -22,7 +22,7 @@ class H2oSetting extends StatefulWidget {
final UserDetailModel userDetailModel;
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
_H2oSettingState createState() {
@ -51,7 +51,7 @@ class _H2oSettingState extends State<H2oSetting> {
DateTime _dobDate = DateTime.now();
DateTime _tempDate = DateTime.now();
UserDetailModel _userDetailModel;
late UserDetailModel _userDetailModel;
@override
void initState() {
@ -61,16 +61,16 @@ class _H2oSettingState extends State<H2oSetting> {
_weightValue = _userDetailModel?.weight ?? 50;
_heightController.text = _heightValue.toStringAsFixed(0);
_weightController.text = _weightValue.toStringAsFixed(0);
_nameController.text = _userDetailModel.firstName;
_nameController.text = _userDetailModel.firstName!;
_isWeightKG = _userDetailModel?.isWeightInKG ?? true;
_isHeightCM = _userDetailModel?.isHeightInCM ?? true;
_isGenderMale = (_userDetailModel?.gender ?? "M") == "M" ? true : false;
_dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB);
_dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB!);
_selectedActiveLevel = _userDetailModel.activityID ?? 1;
readPrefs();
}
SharedPreferences prefs;
late SharedPreferences prefs;
void readPrefs() async {
prefs = await SharedPreferences.getInstance();
@ -81,11 +81,8 @@ class _H2oSettingState extends State<H2oSetting> {
@override
void didChangeDependencies() {
// TODO: implement didChangeDependencies
super.didChangeDependencies();
_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}"];
}
@ -142,7 +139,7 @@ class _H2oSettingState extends State<H2oSetting> {
_commonRadioButtonsRow(TranslationBase.of(context).mililitre, TranslationBase.of(context).litre, _isUnitML, (value) {
if (_isUnitML != value) {
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) {
if (_isGenderMale != value) {
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(
onTap: hasSelection ? () {} : null,
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(
children: [
Row(
@ -509,7 +506,7 @@ class _H2oSettingState extends State<H2oSetting> {
Expanded(
flex: 1,
child: PopupMenuButton(
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, null),
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, (){}),
onSelected: (value) {
onUnitTap(value);
},
@ -554,13 +551,13 @@ class _H2oSettingState extends State<H2oSetting> {
final CalendarPlugin _myPlugin = CalendarPlugin();
void _addReminderToCalender(int _selectedRemindedTime) async {
bool _calendarPermission = await _myPlugin.hasPermissions();
if (_calendarPermission) {
bool? _calendarPermission = await _myPlugin.hasPermissions();
if (_calendarPermission!) {
} else {
await _myPlugin.requestPermissions();
}
_myPlugin.hasPermissions().then((value) {
if (!value) {
if (!value!) {
_myPlugin.requestPermissions();
} else {
_myPlugin.getCalendars().then((value) => {});
@ -574,8 +571,8 @@ class CommonDropDownView extends StatelessWidget {
final String title;
final String value;
final VoidCallback callback;
final IconData iconData;
CommonDropDownView(this.title, this.value, this.callback, {Key key, this.iconData}) : super(key: key);
final IconData? iconData;
CommonDropDownView(this.title, this.value, this.callback, {Key? key, this.iconData}) : super(key: key);
@override
Widget build(BuildContext context) {

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

@ -49,7 +49,7 @@ class MonthPage extends StatelessWidget {
style: TextStyle(fontSize: 16.0, color: Color(0xff2E303A), fontWeight: FontWeight.w600, letterSpacing: -0.64),
),
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';
class TodayPage extends StatefulWidget {
TodayPage({Key key}) : super(key: key);
TodayPage({Key? key}) : super(key: key);
@override
_TodayPageState createState() {
@ -60,7 +60,7 @@ class _TodayPageState extends State<TodayPage> {
builder: (context, data) {
String unit;
if (data.connectionState == ConnectionState.done) {
isUnitML = data.data;
isUnitML = data.data!;
}
if (isUnitML) {
unit = TranslationBase.of(context).ml;
@ -348,7 +348,7 @@ class _TodayPageState extends State<TodayPage> {
InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: amount);
await model.insertUserActivity(insertUserActivityRequestModel);
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),
),
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';
class H20BottomNavigationBar extends StatelessWidget {
H20BottomNavigationBar({Key key}) : super(key: key);
H20BottomNavigationBar({Key? key}) : super(key: key);
PageController pageController = PageController(keepPage: true);
int currentTab = 0;

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

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

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

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

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

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

@ -61,15 +61,15 @@ class _BodyFatState extends State<BodyFat> {
// int heightCm = 0;
// int heightFt = 0;
// int hip = 5;
double heightInches;
double minRange;
double maxRange;
double overWeightBy;
double? heightInches;
double? minRange;
double? maxRange;
double? overWeightBy;
// int waist = 5;
double bodyFat = 0;
double fat = 0;
String dropdownValue;
String? dropdownValue;
double calories = 0;
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(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
@ -628,7 +628,7 @@ class _BodyFatState extends State<BodyFat> {
Expanded(
flex: 1,
child: PopupMenuButton(
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, null),
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, (){}),
onSelected: (value) {
onUnitTap(value);
},
@ -644,9 +644,9 @@ class CommonDropDownView extends StatelessWidget {
final String title;
final String value;
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
Widget build(BuildContext context) {

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

@ -37,14 +37,14 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
TextEditingController _heightController = new TextEditingController();
TextEditingController _weightController = TextEditingController();
List<PopupMenuItem> _heightPopupList =[];
List<PopupMenuItem> _weightPopupList =[];
List<PopupMenuItem> _heightPopupList = [];
List<PopupMenuItem> _weightPopupList = [];
// int age = 0;
// int height = 0;
// int weight = 0;
double calories;
String dropdownValue;
double? calories;
String dropdownValue = '';
void updateColor(int type) {
//MG/DLT card
@ -261,7 +261,6 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
SizedBox(
height: 12.0,
),
InkWell(
onTap: () {
// dropdownKey.currentState;
@ -300,9 +299,9 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
height: 2,
color: Colors.black54,
),
onChanged: (String newValue) {
onChanged: (String? newValue) {
setState(() {
dropdownValue = newValue;
dropdownValue = newValue!;
});
},
items: <String>[
@ -350,7 +349,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
context,
FadePage(
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) {
GestureDetector detector;
GestureDetector? detector;
void searchForGestureDetector(BuildContext element) {
element.visitChildElements((element) {
if (element.widget != null && element.widget is GestureDetector) {
detector = element.widget;
return false;
detector = element.widget as GestureDetector?;
//return false;
} else {
searchForGestureDetector(element);
}
return true;
//return true;
});
}
searchForGestureDetector(key.currentContext);
searchForGestureDetector(key.currentContext!);
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(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
@ -533,7 +555,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
Expanded(
flex: 1,
child: PopupMenuButton(
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, null),
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, (){}),
onSelected: (value) {
onUnitTap(value);
},
@ -549,9 +571,9 @@ class CommonDropDownView extends StatelessWidget {
final String title;
final String value;
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
Widget build(BuildContext context) {

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

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

@ -27,7 +27,7 @@ class CarbsResult extends StatelessWidget {
double cCalMeal;
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
Widget build(BuildContext context) {
@ -170,7 +170,7 @@ class CarbsResult extends StatelessWidget {
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else {
_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(
width: double.infinity,
child: Column(
@ -170,7 +170,7 @@ class DeliveryDueResult extends StatelessWidget {
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else {
_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:flutter/cupertino.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 {
DiseasesByClinic diseaseByClinic;
DoctorList({Key key, this.diseaseByClinic}) : super(key: key);
DoctorList({Key? key, required this.diseaseByClinic}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -56,8 +57,7 @@ class DoctorList extends StatelessWidget {
flex: 1,
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(doctor.doctorImageURL,
fit: BoxFit.fill, height: 60.0, width: 60.0),
child: Image.network(doctor.doctorImageURL!, fit: BoxFit.fill, height: 60.0, width: 60.0),
),
),
Expanded(
@ -69,32 +69,51 @@ class DoctorList extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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(
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(
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(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: doctor.actualDoctorRate.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
// RatingBar.readOnly(
// initialRating: doctor.actualDoctorRate.toDouble(),
// size: 20.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: 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(
child: Image.network(doctor.nationalityFlagURL,
width: 25.0, height: 25.0),
child: Image.network(doctor.nationalityFlagURL!, width: 25.0, height: 25.0),
),
],
),

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

@ -18,7 +18,7 @@ class IdealBodyResult extends StatelessWidget {
final double overWeightBy;
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
Widget build(BuildContext context) {
@ -247,7 +247,7 @@ class IdealBodyResult extends StatelessWidget {
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
}

@ -1,7 +1,6 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -25,7 +24,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
// int cycleLength = 0;
// int lutealPhaseLength = 0;
String selectedDate;
late String selectedDate;
var dateFrom = DateTime.now();
var babyAgeWeeks;
var babyAgeDays;
@ -34,7 +33,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
var deliveryDue = DateTime.now();
var dt = DateTime.now();
var newFormat = DateFormat("yy-MM-dd");
String updatedDt;
String? updatedDt;
TextEditingController cycleLengthController = new TextEditingController();
TextEditingController lutelLengthController = new TextEditingController();
@ -57,8 +56,11 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
deliveryDue = selectedDateTime.add(Duration(days: 280));
// 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(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,

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

@ -52,10 +52,10 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
bool _visible = false;
TextEditingController textController = new TextEditingController();
TextEditingController resultTextController = new TextEditingController();
String finalValue;
late String finalValue;
double inputValue = 0.0;
String unit;
late String unit;
double conversionConst = 38.67;
@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(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,

@ -16,7 +16,7 @@ class BloodSugar extends StatefulWidget {
_BloodSugarState createState() => _BloodSugarState();
}
Color color;
Color? color;
class _BloodSugarState extends State<BloodSugar> {
Color cardMGColor = inactiveCardColor;
@ -64,10 +64,10 @@ class _BloodSugarState extends State<BloodSugar> {
bool _visible = false;
TextEditingController textController = new TextEditingController();
TextEditingController resultTextController = new TextEditingController();
String finalValue;
late String finalValue;
double inputValue = 0;
String unit;
late String unit;
@override
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(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,

@ -17,7 +17,7 @@ class Triglycerides extends StatefulWidget {
class _TriglyceridesState extends State<Triglycerides> {
Color cardMGColor = inactiveCardColor;
Color cardMMOLColor = inactiveCardColor;
int type;
late int type;
void updateColor(type) {
//MG/DLT card
@ -54,10 +54,10 @@ class _TriglyceridesState extends State<Triglycerides> {
bool _visible = false;
TextEditingController textController = new TextEditingController();
TextEditingController resultTextController = new TextEditingController();
String finalValue;
late String finalValue;
double inputValue = 0.0;
String unit;
late String unit;
double conversionConst = 88.57;
@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(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,

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

@ -66,11 +66,11 @@ class ParkingPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Texts(model.qrParkingModel.parkingDescriptionN),
Texts(model.qrParkingModel!.parkingDescriptionN),
Divider(
height: 3,
),
Texts(model.qrParkingModel.rowDescriptionN)
Texts(model.qrParkingModel!.rowDescriptionN)
],
),
),
@ -89,7 +89,7 @@ class ParkingPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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,
children: <Widget>[
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,
children: <Widget>[
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,
children: <Widget>[
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,
() => {
MapsLauncher.launchCoordinates(
model.qrParkingModel.latitude,
model.qrParkingModel.longitude,
model.qrParkingModel!.latitude!,
model.qrParkingModel!.longitude!,
),
}),
),

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

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

@ -1,3 +1,5 @@
import 'dart:js';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
@ -27,15 +29,15 @@ import 'dialogs/ConfirmSMSDialog.dart';
import 'new_text_Field.dart';
class ConfirmPaymentPage extends StatelessWidget {
final AdvanceModel advanceModel;
late AdvanceModel advanceModel;
final PatientInfoAndMobileNumber patientInfoAndMobileNumber;
final String selectedPaymentMethod;
MyInAppBrowser browser;
late MyInAppBrowser browser;
AuthenticatedUser authenticatedUser;
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
Widget build(BuildContext context) {
@ -45,7 +47,7 @@ class ConfirmPaymentPage extends StatelessWidget {
context: context,
barrierDismissible: false,
builder: (cxt) => ConfirmSMSDialog(
phoneNumber: patientInfoAndMobileNumber.mobileNumber,
phoneNumber: patientInfoAndMobileNumber.mobileNumber!,
),
).then((value) {
print("dialog dismissed");
@ -53,7 +55,7 @@ class ConfirmPaymentPage extends StatelessWidget {
if (value != null && value) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
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)),
),
Texts(
advanceModel.hospitalsModel.projectOutSA ? '${advanceModel.amount} AED' : '${advanceModel.amount} SAR',
advanceModel.hospitalsModel!.projectOutSA! ? '${advanceModel.amount} AED' : '${advanceModel.amount} SAR',
fontSize: 26,
bold: true,
)
@ -104,7 +106,7 @@ class ConfirmPaymentPage extends StatelessWidget {
margin: EdgeInsets.all(3),
child: NewTextFields(
hintText: TranslationBase.of(context).fileNumber,
initialValue: advanceModel.fileNumber,
initialValue: advanceModel.fileNumber!,
isEnabled: false,
),
),
@ -114,7 +116,7 @@ class ConfirmPaymentPage extends StatelessWidget {
margin: EdgeInsets.all(3),
child: NewTextFields(
hintText: TranslationBase.of(context).name,
initialValue: patientInfoAndMobileNumber.firstName,
initialValue: patientInfoAndMobileNumber.firstName!,
isEnabled: false,
),
),
@ -126,7 +128,7 @@ class ConfirmPaymentPage extends StatelessWidget {
),
NewTextFields(
hintText: TranslationBase.of(context).mobileNumber,
initialValue: patientInfoAndMobileNumber.mobileNumber,
initialValue: patientInfoAndMobileNumber.mobileNumber!,
isEnabled: false,
),
SizedBox(
@ -134,7 +136,7 @@ class ConfirmPaymentPage extends StatelessWidget {
),
NewTextFields(
hintText: TranslationBase.of(context).depositorName,
initialValue: advanceModel.depositorName,
initialValue: advanceModel.depositorName!,
isEnabled: false,
),
SizedBox(
@ -142,7 +144,7 @@ class ConfirmPaymentPage extends StatelessWidget {
),
NewTextFields(
hintText: TranslationBase.of(context).notes,
initialValue: advanceModel.note,
initialValue: advanceModel.note!,
isEnabled: false,
),
],
@ -159,7 +161,7 @@ class ConfirmPaymentPage extends StatelessWidget {
disabled: model.state == ViewState.Busy,
onTap: () {
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);
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';
}
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.openPaymentBrowser(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", "", null);
browser.openPaymentBrowser(
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) {
@ -231,7 +248,7 @@ class ConfirmPaymentPage extends StatelessWidget {
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
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);
print("Printing Payment Status Reponse!!!!");
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) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, appo.projectID)
Utils.isVidaPlusProject(projectViewModel, appo.projectID!)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,

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

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

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

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

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

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

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

@ -23,23 +23,23 @@ class DocAvailableAppointments extends StatefulWidget {
DoctorList doctor;
static bool areSlotsAvailable = false;
static bool areAppointmentsAvailable = false;
static DateTime selectedAppoDateTime;
static String selectedDate;
static String selectedTime;
static DateTime? selectedAppoDateTime;
static String? selectedDate;
static String? selectedTime;
bool isLiveCareAppointment;
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
_DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState();
}
class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> with TickerProviderStateMixin {
Map<DateTime, List> _events;
AnimationController _animationController;
CalendarController _calendarController;
late Map<DateTime, List> _events;
late AnimationController _animationController;
late CalendarController _calendarController;
AppSharedPreferences sharedPref = new AppSharedPreferences();
@ -54,10 +54,11 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
dynamic freeSlotsResponse;
ScrollController _scrollController;
late ScrollController _scrollController;
var language;
bool isLiveCareSchedule;
bool isLiveCareSchedule = false;
// String selectedLogSlots ='';
@override
@ -118,7 +119,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
});
}
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -183,7 +184,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1),
onTap: (CalendarTapDetails details) {
_calendarController.selectedDate = details.date;
_onDaySelected(details.date);
_onDaySelected(details.date!);
},
),
),
@ -214,19 +215,12 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
DocAvailableAppointments.areSlotsAvailable = true;
selectedButtonIndex = 0;
// selectedLogSlots = dayEvents[selectedButtonIndex].toString();
List<Map<String,dynamic>> timeList =[];
for(var i =0; i<dayEvents.length;i++){
Map<String,dynamic> timeSlot={
"isoTime":dayEvents[i].isoTime,
"start":dayEvents[i].start.toString(),
"end":dayEvents[i].end.toString(),
"vidaDate":dayEvents[i].vidaDate
};
List<Map<String, dynamic>> timeList = [];
for (var i = 0; i < dayEvents.length; i++) {
Map<String, dynamic> timeSlot = {"isoTime": dayEvents[i].isoTime, "start": dayEvents[i].start.toString(), "end": dayEvents[i].end.toString(), "vidaDate": dayEvents[i].vidaDate};
timeList.add(timeSlot);
}
AppSharedPreferences sharedPref = new AppSharedPreferences();
sharedPref.setString('selectedLogSlots', json.encode(timeList));
DocAvailableAppointments.selectedTime = dayEvents[selectedButtonIndex].isoTime;
@ -244,30 +238,60 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
for (var i = 0; i < freeSlotsResponse.length; i++) {
date = (isLiveCareSchedule != null && isLiveCareSchedule)
? 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']));
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);
setState(() {
DocAvailableAppointments.selectedDate = dateFormatter.format((isLiveCareSchedule != null && isLiveCareSchedule)
DocAvailableAppointments.selectedDate = dateFormatter.format(
(isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(freeSlotsResponse[0])
: DateUtil.convertStringToDateSaudiTimezone(freeSlotsResponse[0], widget.doctor.projectID));
: DateUtil.convertStringToDateSaudiTimezone(
freeSlotsResponse[0],
int.parse(
widget.doctor.projectID.toString(),
),
),
);
DocAvailableAppointments.selectedAppoDateTime = (isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(freeSlotsResponse[0])
: DateUtil.convertStringToDateSaudiTimezone(freeSlotsResponse[0], widget.doctor.projectID);
: DateUtil.convertStringToDateSaudiTimezone(
freeSlotsResponse[0],
int.parse(
widget.doctor.projectID.toString(),
),
);
selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(
(isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(freeSlotsResponse[0])
: DateUtil.convertStringToDateSaudiTimezone(freeSlotsResponse[0], widget.doctor.projectID),
: DateUtil.convertStringToDateSaudiTimezone(
freeSlotsResponse[0],
int.parse(
widget.doctor.projectID.toString(),
),
),
language);
selectedDateJSON = freeSlotsResponse[0];
});
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);
_calendarController.selectedDate =
(isLiveCareSchedule != null && isLiveCareSchedule) ? DateUtil.convertStringToDate(selectedDateJSON) : DateUtil.convertStringToDateSaudiTimezone(selectedDateJSON, widget.doctor.projectID);
_calendarController.selectedDate = (isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(selectedDateJSON)
: DateUtil.convertStringToDateSaudiTimezone(
selectedDateJSON,
int.parse(
widget.doctor.projectID.toString(),
),
);
_calendarController.displayDate = _calendarController.selectedDate;
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);
},
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);
});
},
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);
GifLoaderDialogUtils.showMyDialog(context);
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);
if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) {
@ -332,7 +369,12 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
_events.clear(),
_events = value,
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 {
@ -353,7 +395,15 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
getDoctorScheduledFreeSlots(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
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);
if (res['MessageStatus'] == 1) {
if (res['PatientER_DoctorFreeSlots'].length != 0) {
@ -390,37 +440,38 @@ class MeetingDataSource extends CalendarDataSource {
@override
DateTime getStartTime(int index) {
return _getMeetingData(index).from;
return _getMeetingData(index)!.from;
}
@override
DateTime getEndTime(int index) {
return _getMeetingData(index).to;
return _getMeetingData(index)!.to;
}
@override
String getSubject(int index) {
return _getMeetingData(index).eventName;
return _getMeetingData(index)!.eventName;
}
@override
Color getColor(int index) {
return _getMeetingData(index).background;
return _getMeetingData(index)!.background;
}
@override
bool isAllDay(int index) {
return _getMeetingData(index).isAllDay;
return _getMeetingData(index)!.isAllDay;
}
Meeting _getMeetingData(int index) {
final dynamic meeting = appointments[index];
Meeting meetingData;
Meeting? _getMeetingData(int index) {
final dynamic meeting = appointments?[index];
Meeting? meetingData;
if (meeting is Meeting) {
meetingData = meeting;
}
return meetingData;
}
}
class Meeting {

@ -1,12 +1,13 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
class DoctorInformation extends StatelessWidget {
DoctorProfileList docProfileList;
DoctorInformation({@required this.docProfileList});
DoctorInformation({required this.docProfileList});
@override
Widget build(BuildContext context) {
@ -46,7 +47,7 @@ class DoctorInformation extends StatelessWidget {
),
mWidth(2),
Text(
docProfileList.genderDescription,
docProfileList.genderDescription!,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
@ -69,7 +70,7 @@ class DoctorInformation extends StatelessWidget {
),
mWidth(2),
Text(
docProfileList.nationalityName,
docProfileList.nationalityName!,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
@ -104,7 +105,7 @@ class DoctorInformation extends StatelessWidget {
),
mHeight(10),
Text(
docProfileList.doctorProfileInfo != null ? docProfileList.doctorProfileInfo : "",
docProfileList.doctorProfileInfo != null ? docProfileList.doctorProfileInfo! : "",
style: TextStyle(
fontSize: 12,
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 {
HospitalsModel selectedHospital;
LaserClinic({this.selectedHospital});
LaserClinic({required this.selectedHospital});
@override
_LaserClinicState createState() {
@ -32,11 +32,11 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
List<int> _laserCategoryList = [1, 2, 11];
List<LaserBodyPart> _selectedBodyPartList = [];
bool _isFullBody = false;
LaserBodyPart fullBody;
late LaserBodyPart fullBody;
int _selectedCategoryIndex = 0;
List<LaserBodyPart> laserBodyPartsList = [];
TabController _tabController;
late TabController _tabController;
int _duration = 0;
List<LaserCategoryType> maleLaserCategory = [];
@ -49,8 +49,8 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
_tabController.addListener(() {
if (_tabController.indexIsChanging) {
} else {
_selectedBodyPartList = List<LaserBodyPart>();
laserBodyPartsList = List<LaserBodyPart>();
_selectedBodyPartList = [];
laserBodyPartsList = [];
_selectedCategoryIndex = 0;
setState(() {});
if (_tabController.index == 0) {
@ -73,7 +73,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['Laser_GetBodyPartsByCategoryList'].length != 0) {
List<LaserBodyPart> _tempList = List<LaserBodyPart>();
List<LaserBodyPart> _tempList = [];
res['Laser_GetBodyPartsByCategoryList'].forEach((v) {
_tempList.add(LaserBodyPart.fromJson(v));
});
@ -96,7 +96,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
bool lastIndexIsFirst = false;
bool isLastIndexIsBack = false;
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
bool get isMale => _tabController.index == 0;
@ -231,7 +231,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else {
_patientDoctorAppointmentListHospital
.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 duration = 0;
if (_isFullBody) {
_duration = int.parse(fullBody.timeDuration);
_duration = int.parse(fullBody.timeDuration!);
projectViewModel.laserSelectionDuration = 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() ?? [];
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) {
duration -= 30;
@ -365,7 +365,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
value: _isFullBody,
onChanged: (value) {
setState(() {
if (value) {
if (value!) {
_selectedBodyPartList.clear();
_selectedBodyPartList.add(fullBody);
} else {
@ -380,7 +380,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
),
SizedBox(width: 12),
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),
),
],
@ -412,7 +412,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
_selectedBodyPartList.removeWhere((element) => element.id == laserBodyPartsList[index].id);
// _selectedBodyPartList.remove(laserBodyPartsList[index]);
} else {
if (_duration + int.parse(laserBodyPartsList[index].timeDuration) > 90) {
if (_duration + int.parse(laserBodyPartsList[index].timeDuration!) > 90) {
AppToast.showToast(message: TranslationBase.of(context).laserMaxLimitReach);
return;
}
@ -440,7 +440,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
border: Border.all(color: _isSelected ? Color(0xffD02127) : Color(0xffEAEAEA), width: 2),
),
child: LaserBodyParts()
.getCategoryImage(isMale, (isMale ? maleLaserCategory : femaleLaserCategory)[_selectedCategoryIndex].laserCategoryID, laserBodyPartsList[index].mappingCode),
.getCategoryImage(isMale, (isMale ? maleLaserCategory : femaleLaserCategory)[_selectedCategoryIndex].laserCategoryID, laserBodyPartsList[index].mappingCode!),
),
if (_isSelected)
Container(
@ -459,7 +459,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
SizedBox(height: 6),
Expanded(
child: Text(
projectViewModel.isArabic ? laserBodyPartsList[index].bodyPartN : laserBodyPartsList[index].bodyPart,
projectViewModel.isArabic ? laserBodyPartsList[index].bodyPartN! : laserBodyPartsList[index].bodyPart!,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,

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

@ -19,8 +19,8 @@ class SearchByDoctor extends StatefulWidget {
class _SearchByDoctorState extends State<SearchByDoctor> {
TextEditingController doctorNameController = new TextEditingController();
bool _isButtonDisabled;
ProjectViewModel projectViewModel;
late bool _isButtonDisabled;
late ProjectViewModel projectViewModel;
@override
void initState() {
@ -109,7 +109,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else {
_patientDoctorAppointmentListHospital
.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)));
}
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(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,

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

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

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

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

Loading…
Cancel
Save