Merge branch 'master' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into sultan-patientapp
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,76 @@
|
||||
class GetAllProjectsResponseModel {
|
||||
String desciption;
|
||||
Null desciptionN;
|
||||
int iD;
|
||||
String legalName;
|
||||
String legalNameN;
|
||||
String name;
|
||||
Null nameN;
|
||||
String phoneNumber;
|
||||
String setupID;
|
||||
int distanceInKilometers;
|
||||
bool isActive;
|
||||
String latitude;
|
||||
String longitude;
|
||||
int mainProjectID;
|
||||
Null projectOutSA;
|
||||
bool usingInDoctorApp;
|
||||
|
||||
GetAllProjectsResponseModel(
|
||||
{this.desciption,
|
||||
this.desciptionN,
|
||||
this.iD,
|
||||
this.legalName,
|
||||
this.legalNameN,
|
||||
this.name,
|
||||
this.nameN,
|
||||
this.phoneNumber,
|
||||
this.setupID,
|
||||
this.distanceInKilometers,
|
||||
this.isActive,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.mainProjectID,
|
||||
this.projectOutSA,
|
||||
this.usingInDoctorApp});
|
||||
|
||||
GetAllProjectsResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
desciption = json['Desciption'];
|
||||
desciptionN = json['DesciptionN'];
|
||||
iD = json['ID'];
|
||||
legalName = json['LegalName'];
|
||||
legalNameN = json['LegalNameN'];
|
||||
name = json['Name'];
|
||||
nameN = json['NameN'];
|
||||
phoneNumber = json['PhoneNumber'];
|
||||
setupID = json['SetupID'];
|
||||
distanceInKilometers = json['DistanceInKilometers'];
|
||||
isActive = json['IsActive'];
|
||||
latitude = json['Latitude'];
|
||||
longitude = json['Longitude'];
|
||||
mainProjectID = json['MainProjectID'];
|
||||
projectOutSA = json['ProjectOutSA'];
|
||||
usingInDoctorApp = json['UsingInDoctorApp'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['Desciption'] = this.desciption;
|
||||
data['DesciptionN'] = this.desciptionN;
|
||||
data['ID'] = this.iD;
|
||||
data['LegalName'] = this.legalName;
|
||||
data['LegalNameN'] = this.legalNameN;
|
||||
data['Name'] = this.name;
|
||||
data['NameN'] = this.nameN;
|
||||
data['PhoneNumber'] = this.phoneNumber;
|
||||
data['SetupID'] = this.setupID;
|
||||
data['DistanceInKilometers'] = this.distanceInKilometers;
|
||||
data['IsActive'] = this.isActive;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['MainProjectID'] = this.mainProjectID;
|
||||
data['ProjectOutSA'] = this.projectOutSA;
|
||||
data['UsingInDoctorApp'] = this.usingInDoctorApp;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
class Addresses {
|
||||
String id;
|
||||
String firstName;
|
||||
String lastName;
|
||||
String email;
|
||||
String company;
|
||||
int countryId;
|
||||
String country;
|
||||
String stateProvinceId;
|
||||
String city;
|
||||
String address1;
|
||||
String address2;
|
||||
String zipPostalCode;
|
||||
String phoneNumber;
|
||||
String faxNumber;
|
||||
String customerAttributes;
|
||||
String createdOnUtc;
|
||||
String province;
|
||||
String latLong;
|
||||
|
||||
Addresses(
|
||||
{this.id,
|
||||
this.firstName,
|
||||
this.lastName,
|
||||
this.email,
|
||||
this.company,
|
||||
this.countryId,
|
||||
this.country,
|
||||
this.stateProvinceId,
|
||||
this.city,
|
||||
this.address1,
|
||||
this.address2,
|
||||
this.zipPostalCode,
|
||||
this.phoneNumber,
|
||||
this.faxNumber,
|
||||
this.customerAttributes,
|
||||
this.createdOnUtc,
|
||||
this.province,
|
||||
this.latLong});
|
||||
|
||||
Addresses.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
firstName = json['first_name'];
|
||||
lastName = json['last_name'];
|
||||
email = json['email'];
|
||||
company = json['company'];
|
||||
countryId = json['country_id'];
|
||||
country = json['country'];
|
||||
stateProvinceId = json['state_province_id'];
|
||||
city = json['city'];
|
||||
address1 = json['address1'];
|
||||
address2 = json['address2'];
|
||||
zipPostalCode = json['zip_postal_code'];
|
||||
phoneNumber = json['phone_number'];
|
||||
faxNumber = json['fax_number'];
|
||||
customerAttributes = json['customer_attributes'];
|
||||
createdOnUtc = json['created_on_utc'];
|
||||
province = json['province'];
|
||||
latLong = json['lat_long'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['first_name'] = this.firstName;
|
||||
data['last_name'] = this.lastName;
|
||||
data['email'] = this.email;
|
||||
data['company'] = this.company;
|
||||
data['country_id'] = this.countryId;
|
||||
data['country'] = this.country;
|
||||
data['state_province_id'] = this.stateProvinceId;
|
||||
data['city'] = this.city;
|
||||
data['address1'] = this.address1;
|
||||
data['address2'] = this.address2;
|
||||
data['zip_postal_code'] = this.zipPostalCode;
|
||||
data['phone_number'] = this.phoneNumber;
|
||||
data['fax_number'] = this.faxNumber;
|
||||
data['customer_attributes'] = this.customerAttributes;
|
||||
data['created_on_utc'] = this.createdOnUtc;
|
||||
data['province'] = this.province;
|
||||
data['lat_long'] = this.latLong;
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
class Customer {
|
||||
String fileNumber;
|
||||
String iqamaNumber;
|
||||
int isOutSa;
|
||||
int patientType;
|
||||
String gender;
|
||||
String birthDate;
|
||||
String phone;
|
||||
String countryCode;
|
||||
String yahalaAccountno;
|
||||
String billingAddress;
|
||||
String shippingAddress;
|
||||
String id;
|
||||
String username;
|
||||
String email;
|
||||
String firstName;
|
||||
String lastName;
|
||||
String languageId;
|
||||
String adminComment;
|
||||
String isTaxExempt;
|
||||
String hasShoppingCartItems;
|
||||
String active;
|
||||
String deleted;
|
||||
String isSystemAccount;
|
||||
String systemName;
|
||||
String lastIpAddress;
|
||||
String createdOnUtc;
|
||||
String lastLoginDateUtc;
|
||||
String lastActivityDateUtc;
|
||||
String registeredInStoreId;
|
||||
|
||||
Customer(
|
||||
{this.fileNumber,
|
||||
this.iqamaNumber,
|
||||
this.isOutSa,
|
||||
this.patientType,
|
||||
this.gender,
|
||||
this.birthDate,
|
||||
this.phone,
|
||||
this.countryCode,
|
||||
this.yahalaAccountno,
|
||||
this.billingAddress,
|
||||
this.shippingAddress,
|
||||
this.id,
|
||||
this.username,
|
||||
this.email,
|
||||
this.firstName,
|
||||
this.lastName,
|
||||
this.languageId,
|
||||
this.adminComment,
|
||||
this.isTaxExempt,
|
||||
this.hasShoppingCartItems,
|
||||
this.active,
|
||||
this.deleted,
|
||||
this.isSystemAccount,
|
||||
this.systemName,
|
||||
this.lastIpAddress,
|
||||
this.createdOnUtc,
|
||||
this.lastLoginDateUtc,
|
||||
this.lastActivityDateUtc,
|
||||
this.registeredInStoreId});
|
||||
|
||||
Customer.fromJson(Map<String, dynamic> json) {
|
||||
fileNumber = json['file_number'];
|
||||
iqamaNumber = json['iqama_number'];
|
||||
isOutSa = json['is_out_sa'];
|
||||
patientType = json['patient_type'];
|
||||
gender = json['gender'];
|
||||
birthDate = json['birth_date'];
|
||||
phone = json['phone'];
|
||||
countryCode = json['country_code'];
|
||||
yahalaAccountno = json['yahala_accountno'];
|
||||
billingAddress = json['billing_address'];
|
||||
shippingAddress = json['shipping_address'];
|
||||
id = json['id'];
|
||||
username = json['username'];
|
||||
email = json['email'];
|
||||
firstName = json['first_name'];
|
||||
lastName = json['last_name'];
|
||||
languageId = json['language_id'];
|
||||
adminComment = json['admin_comment'];
|
||||
isTaxExempt = json['is_tax_exempt'];
|
||||
hasShoppingCartItems = json['has_shopping_cart_items'];
|
||||
active = json['active'];
|
||||
deleted = json['deleted'];
|
||||
isSystemAccount = json['is_system_account'];
|
||||
systemName = json['system_name'];
|
||||
lastIpAddress = json['last_ip_address'];
|
||||
createdOnUtc = json['created_on_utc'];
|
||||
lastLoginDateUtc = json['last_login_date_utc'];
|
||||
lastActivityDateUtc = json['last_activity_date_utc'];
|
||||
registeredInStoreId = json['registered_in_store_id'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['file_number'] = this.fileNumber;
|
||||
data['iqama_number'] = this.iqamaNumber;
|
||||
data['is_out_sa'] = this.isOutSa;
|
||||
data['patient_type'] = this.patientType;
|
||||
data['gender'] = this.gender;
|
||||
data['birth_date'] = this.birthDate;
|
||||
data['phone'] = this.phone;
|
||||
data['country_code'] = this.countryCode;
|
||||
data['yahala_accountno'] = this.yahalaAccountno;
|
||||
data['billing_address'] = this.billingAddress;
|
||||
data['shipping_address'] = this.shippingAddress;
|
||||
data['id'] = this.id;
|
||||
data['username'] = this.username;
|
||||
data['email'] = this.email;
|
||||
data['first_name'] = this.firstName;
|
||||
data['last_name'] = this.lastName;
|
||||
data['language_id'] = this.languageId;
|
||||
data['admin_comment'] = this.adminComment;
|
||||
data['is_tax_exempt'] = this.isTaxExempt;
|
||||
data['has_shopping_cart_items'] = this.hasShoppingCartItems;
|
||||
data['active'] = this.active;
|
||||
data['deleted'] = this.deleted;
|
||||
data['is_system_account'] = this.isSystemAccount;
|
||||
data['system_name'] = this.systemName;
|
||||
data['last_ip_address'] = this.lastIpAddress;
|
||||
data['created_on_utc'] = this.createdOnUtc;
|
||||
data['last_login_date_utc'] = this.lastLoginDateUtc;
|
||||
data['last_activity_date_utc'] = this.lastActivityDateUtc;
|
||||
data['registered_in_store_id'] = this.registeredInStoreId;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
import 'PharmacyImageObject.dart';
|
||||
|
||||
class Manufacturer {
|
||||
String id;
|
||||
String name;
|
||||
String namen;
|
||||
// List<LocalizedNames> localizedNames;
|
||||
String description;
|
||||
int manufacturerTemplateId;
|
||||
String metaKeywords;
|
||||
String metaDescription;
|
||||
String metaTitle;
|
||||
int pageSize;
|
||||
String pageSizeOptions;
|
||||
String priceRanges;
|
||||
bool published;
|
||||
bool deleted;
|
||||
int displayOrder;
|
||||
String createdOnUtc;
|
||||
String updatedOnUtc;
|
||||
PharmacyImageObject image;
|
||||
|
||||
Manufacturer(
|
||||
{this.id,
|
||||
this.name,
|
||||
this.namen,
|
||||
// this.localizedNames,
|
||||
this.description,
|
||||
this.manufacturerTemplateId,
|
||||
this.metaKeywords,
|
||||
this.metaDescription,
|
||||
this.metaTitle,
|
||||
this.pageSize,
|
||||
this.pageSizeOptions,
|
||||
this.priceRanges,
|
||||
this.published,
|
||||
this.deleted,
|
||||
this.displayOrder,
|
||||
this.createdOnUtc,
|
||||
this.updatedOnUtc,
|
||||
this.image});
|
||||
|
||||
Manufacturer.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
namen = json['namen'];
|
||||
// if (json['localized_names'] != null) {
|
||||
// localizedNames = new List<LocalizedNames>();
|
||||
// json['localized_names'].forEach((v) {
|
||||
// localizedNames.add(new LocalizedNames.fromJson(v));
|
||||
// });
|
||||
// }
|
||||
description = json['description'];
|
||||
manufacturerTemplateId = json['manufacturer_template_id'];
|
||||
metaKeywords = json['meta_keywords'];
|
||||
metaDescription = json['meta_description'];
|
||||
metaTitle = json['meta_title'];
|
||||
pageSize = json['page_size'];
|
||||
pageSizeOptions = json['page_size_options'];
|
||||
priceRanges = json['price_ranges'];
|
||||
published = json['published'];
|
||||
deleted = json['deleted'];
|
||||
displayOrder = json['display_order'];
|
||||
createdOnUtc = json['created_on_utc'];
|
||||
updatedOnUtc = json['updated_on_utc'];
|
||||
image = json['image'] != null
|
||||
? new PharmacyImageObject.fromJson(json['image'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
data['namen'] = this.namen;
|
||||
// if (this.localizedNames != null) {
|
||||
// data['localized_names'] =
|
||||
// this.localizedNames.map((v) => v.toJson()).toList();
|
||||
// }
|
||||
data['description'] = this.description;
|
||||
data['manufacturer_template_id'] = this.manufacturerTemplateId;
|
||||
data['meta_keywords'] = this.metaKeywords;
|
||||
data['meta_description'] = this.metaDescription;
|
||||
data['meta_title'] = this.metaTitle;
|
||||
data['page_size'] = this.pageSize;
|
||||
data['page_size_options'] = this.pageSizeOptions;
|
||||
data['price_ranges'] = this.priceRanges;
|
||||
data['published'] = this.published;
|
||||
data['deleted'] = this.deleted;
|
||||
data['display_order'] = this.displayOrder;
|
||||
data['created_on_utc'] = this.createdOnUtc;
|
||||
data['updated_on_utc'] = this.updatedOnUtc;
|
||||
if (this.image != null) {
|
||||
data['image'] = this.image.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
class PharmacyImageObject {
|
||||
int id;
|
||||
int position;
|
||||
String src;
|
||||
String thumb;
|
||||
String attachment;
|
||||
|
||||
PharmacyImageObject({this.id, this.position, this.src, this.thumb, this.attachment});
|
||||
|
||||
PharmacyImageObject.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
position = json['position'];
|
||||
src = json['src'];
|
||||
thumb = json['thumb'];
|
||||
attachment = json['attachment'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['position'] = this.position;
|
||||
data['src'] = this.src;
|
||||
data['thumb'] = this.thumb;
|
||||
data['attachment'] = this.attachment;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
import 'PharmacyImageObject.dart';
|
||||
import 'Reviews.dart';
|
||||
|
||||
class PharmacyProduct {
|
||||
String id;
|
||||
String name;
|
||||
String namen;
|
||||
String shortDescription;
|
||||
String fullDescription;
|
||||
String fullDescriptionn;
|
||||
int approvedRatingSum;
|
||||
int approvedTotalReviews;
|
||||
String sku;
|
||||
bool isRx;
|
||||
String rxMessage;
|
||||
String rxMessagen;
|
||||
int stockQuantity;
|
||||
String stockAvailability;
|
||||
String stockAvailabilityn;
|
||||
bool allowBackInStockSubscriptions;
|
||||
int orderMinimumQuantity;
|
||||
int orderMaximumQuantity;
|
||||
double price;
|
||||
double oldPrice;
|
||||
String discountName;
|
||||
String discountNamen;
|
||||
String discountPercentage;
|
||||
int displayOrder;
|
||||
List<int> discountIds;
|
||||
List<Reviews> reviews;
|
||||
List<PharmacyImageObject> images;
|
||||
|
||||
PharmacyProduct(
|
||||
{this.id,
|
||||
this.name,
|
||||
this.namen,
|
||||
this.shortDescription,
|
||||
this.fullDescription,
|
||||
this.fullDescriptionn,
|
||||
this.approvedRatingSum,
|
||||
this.approvedTotalReviews,
|
||||
this.sku,
|
||||
this.isRx,
|
||||
this.rxMessage,
|
||||
this.rxMessagen,
|
||||
this.stockQuantity,
|
||||
this.stockAvailability,
|
||||
this.stockAvailabilityn,
|
||||
this.allowBackInStockSubscriptions,
|
||||
this.orderMinimumQuantity,
|
||||
this.orderMaximumQuantity,
|
||||
this.price,
|
||||
this.oldPrice,
|
||||
this.discountName,
|
||||
this.discountNamen,
|
||||
this.discountPercentage,
|
||||
this.displayOrder,
|
||||
this.discountIds,
|
||||
this.reviews,
|
||||
this.images});
|
||||
|
||||
PharmacyProduct.fromJson(Map<String, dynamic> json) {
|
||||
try {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
namen = json['namen'];
|
||||
shortDescription = json['short_description'];
|
||||
fullDescription = json['full_description'];
|
||||
fullDescriptionn = json['full_descriptionn'];
|
||||
approvedRatingSum = json['approved_rating_sum'];
|
||||
approvedTotalReviews = json['approved_total_reviews'];
|
||||
sku = json['sku'];
|
||||
isRx = json['is_rx'];
|
||||
rxMessage = json['rx_message'];
|
||||
rxMessagen = json['rx_messagen'];
|
||||
stockQuantity = json['stock_quantity'];
|
||||
stockAvailability = json['stock_availability'];
|
||||
stockAvailabilityn = json['stock_availabilityn'];
|
||||
allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions'];
|
||||
orderMinimumQuantity = json['order_minimum_quantity'];
|
||||
orderMaximumQuantity = json['order_maximum_quantity'];
|
||||
price = json['price'];
|
||||
oldPrice = json['old_price'];
|
||||
discountName = json['discount_name'];
|
||||
discountNamen = json['discount_namen'];
|
||||
discountPercentage = json['discount_percentage'];
|
||||
displayOrder = json['display_order'];
|
||||
if (json['discount_ids'] != null) {
|
||||
discountIds = new List<int>();
|
||||
json['discount_ids'].forEach((v) {
|
||||
discountIds.add(v);
|
||||
});
|
||||
}
|
||||
if (json['reviews'] != null) {
|
||||
reviews = new List<Reviews>();
|
||||
json['reviews'].forEach((v) {
|
||||
reviews.add(new Reviews.fromJson(v));
|
||||
});
|
||||
}
|
||||
if (json['images'] != null) {
|
||||
images = new List<PharmacyImageObject>();
|
||||
json['images'].forEach((v) {
|
||||
images.add(new PharmacyImageObject.fromJson(v));
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
data['namen'] = this.namen;
|
||||
data['short_description'] = this.shortDescription;
|
||||
data['full_description'] = this.fullDescription;
|
||||
data['full_descriptionn'] = this.fullDescriptionn;
|
||||
data['approved_rating_sum'] = this.approvedRatingSum;
|
||||
data['approved_total_reviews'] = this.approvedTotalReviews;
|
||||
data['sku'] = this.sku;
|
||||
data['is_rx'] = this.isRx;
|
||||
data['rx_message'] = this.rxMessage;
|
||||
data['rx_messagen'] = this.rxMessagen;
|
||||
data['stock_quantity'] = this.stockQuantity;
|
||||
data['stock_availability'] = this.stockAvailability;
|
||||
data['stock_availabilityn'] = this.stockAvailabilityn;
|
||||
data['allow_back_in_stock_subscriptions'] =
|
||||
this.allowBackInStockSubscriptions;
|
||||
data['order_minimum_quantity'] = this.orderMinimumQuantity;
|
||||
data['order_maximum_quantity'] = this.orderMaximumQuantity;
|
||||
data['price'] = this.price;
|
||||
data['old_price'] = this.oldPrice;
|
||||
data['discount_name'] = this.discountName;
|
||||
data['discount_namen'] = this.discountNamen;
|
||||
data['discount_percentage'] = this.discountPercentage;
|
||||
data['display_order'] = this.displayOrder;
|
||||
if (this.discountIds != String) {
|
||||
data['discount_ids'] = this.discountIds.map((v) => v).toList();
|
||||
}
|
||||
if (this.reviews != String) {
|
||||
data['reviews'] = this.reviews.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (this.images != String) {
|
||||
data['images'] = this.images.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
import '../pharmacies/Customer.dart';
|
||||
|
||||
class Reviews {
|
||||
int id;
|
||||
int position;
|
||||
int reviewId;
|
||||
int customerId;
|
||||
int productId;
|
||||
int storeId;
|
||||
bool isApproved;
|
||||
String title;
|
||||
String reviewText;
|
||||
Null replyText;
|
||||
int rating;
|
||||
int helpfulYesTotal;
|
||||
int helpfulNoTotal;
|
||||
String createdOnUtc;
|
||||
Customer customer;
|
||||
Null product;
|
||||
|
||||
Reviews(
|
||||
{this.id,
|
||||
this.position,
|
||||
this.reviewId,
|
||||
this.customerId,
|
||||
this.productId,
|
||||
this.storeId,
|
||||
this.isApproved,
|
||||
this.title,
|
||||
this.reviewText,
|
||||
this.replyText,
|
||||
this.rating,
|
||||
this.helpfulYesTotal,
|
||||
this.helpfulNoTotal,
|
||||
this.createdOnUtc,
|
||||
this.customer,
|
||||
this.product});
|
||||
|
||||
Reviews.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
position = json['position'];
|
||||
reviewId = json['review_id'];
|
||||
customerId = json['customer_id'];
|
||||
productId = json['product_id'];
|
||||
storeId = json['store_id'];
|
||||
isApproved = json['is_approved'];
|
||||
title = json['title'];
|
||||
reviewText = json['review_text'];
|
||||
replyText = json['reply_text'];
|
||||
rating = json['rating'];
|
||||
helpfulYesTotal = json['helpful_yes_total'];
|
||||
helpfulNoTotal = json['helpful_no_total'];
|
||||
createdOnUtc = json['created_on_utc'];
|
||||
customer = json['customer'] != null
|
||||
? new Customer.fromJson(json['customer'])
|
||||
: null;
|
||||
product = json['product'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['position'] = this.position;
|
||||
data['review_id'] = this.reviewId;
|
||||
data['customer_id'] = this.customerId;
|
||||
data['product_id'] = this.productId;
|
||||
data['store_id'] = this.storeId;
|
||||
data['is_approved'] = this.isApproved;
|
||||
data['title'] = this.title;
|
||||
data['review_text'] = this.reviewText;
|
||||
data['reply_text'] = this.replyText;
|
||||
data['rating'] = this.rating;
|
||||
data['helpful_yes_total'] = this.helpfulYesTotal;
|
||||
data['helpful_no_total'] = this.helpfulNoTotal;
|
||||
data['created_on_utc'] = this.createdOnUtc;
|
||||
if (this.customer != null) {
|
||||
data['customer'] = this.customer.toJson();
|
||||
}
|
||||
data['product'] = this.product;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,211 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../base_service.dart';
|
||||
|
||||
class CustomerAddressesService extends BaseService {
|
||||
|
||||
List<AddressInfo> addressesList = List();
|
||||
CustomerInfo customerInfo;
|
||||
|
||||
Future addAddressInfo({ AddNewAddressRequestModel
|
||||
addNewAddressRequestModel }) async {
|
||||
|
||||
addNewAddressRequestModel.customer.email = customerInfo.email;
|
||||
addNewAddressRequestModel.customer.id = customerInfo.customerId;
|
||||
addNewAddressRequestModel.customer.roleIds = [3];
|
||||
addNewAddressRequestModel.customer.addresses[0].email = customerInfo.email;
|
||||
addNewAddressRequestModel.customer.addresses[0].phoneNumber = customerInfo.mobileNumber;
|
||||
addNewAddressRequestModel.customer.addresses[0].firstName = user.firstName;
|
||||
addNewAddressRequestModel.customer.addresses[0].lastName = user.lastName;
|
||||
addNewAddressRequestModel.customer.addresses[0].countryId = 69;
|
||||
|
||||
var f = DateFormat('E, d MMM yyyy HH:mm:ss');
|
||||
var date = f.format(DateTime.now().toUtc()) + " GMT";
|
||||
addNewAddressRequestModel.customer.addresses[0].createdOnUtc = date;
|
||||
hasError = false;
|
||||
await baseAppClient.post(ADD_ADDRESS_INFO,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
addressesList.clear();
|
||||
response["customers"][0]["addresses"].forEach((data) {
|
||||
addressesList
|
||||
.add(AddressInfo.fromJson(data));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: addNewAddressRequestModel.toJson(), isExternal: true, isAllowAny: true);
|
||||
}
|
||||
|
||||
Future getCustomerAddresses() async {
|
||||
Map<String, String> queryParams = {
|
||||
'fields':'addresses'
|
||||
};
|
||||
hasError = false;
|
||||
await baseAppClient.get("$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}",
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
addressesList.clear();
|
||||
response["customers"][0]["addresses"].forEach((data) {
|
||||
addressesList
|
||||
.add(AddressInfo.fromJson(data));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, queryParams: queryParams, isExternal: true);
|
||||
}
|
||||
|
||||
|
||||
Future getCustomerInfo() async {
|
||||
Map<String, String> queryParams = {
|
||||
'FileNumber':'${user.patientID}'
|
||||
};
|
||||
|
||||
hasError = false;
|
||||
await baseAppClient.get(GET_CUSTOMER_INFO,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
customerInfo= CustomerInfo.fromJson(response);
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, queryParams: queryParams, isExternal: true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class CustomerInfo {
|
||||
bool isRegistered;
|
||||
String userName;
|
||||
Null password;
|
||||
String email;
|
||||
Null errorMessage;
|
||||
String mobileNumber;
|
||||
int customerId;
|
||||
|
||||
CustomerInfo(
|
||||
{this.isRegistered,
|
||||
this.userName,
|
||||
this.password,
|
||||
this.email,
|
||||
this.errorMessage,
|
||||
this.mobileNumber,
|
||||
this.customerId});
|
||||
|
||||
CustomerInfo.fromJson(Map<String, dynamic> json) {
|
||||
isRegistered = json['IsRegistered'];
|
||||
userName = json['UserName'];
|
||||
password = json['Password'];
|
||||
email = json['Email'];
|
||||
errorMessage = json['ErrorMessage'];
|
||||
mobileNumber = json['MobileNumber'];
|
||||
customerId = json['CustomerId'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['IsRegistered'] = this.isRegistered;
|
||||
data['UserName'] = this.userName;
|
||||
data['Password'] = this.password;
|
||||
data['Email'] = this.email;
|
||||
data['ErrorMessage'] = this.errorMessage;
|
||||
data['MobileNumber'] = this.mobileNumber;
|
||||
data['CustomerId'] = this.customerId;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class AddressInfo {
|
||||
String id;
|
||||
String firstName;
|
||||
String lastName;
|
||||
String email;
|
||||
Null company;
|
||||
int countryId;
|
||||
String country;
|
||||
Null stateProvinceId;
|
||||
String city;
|
||||
String address1;
|
||||
String address2;
|
||||
String zipPostalCode;
|
||||
String phoneNumber;
|
||||
Null faxNumber;
|
||||
String customerAttributes;
|
||||
String createdOnUtc;
|
||||
Null province;
|
||||
String latLong;
|
||||
|
||||
AddressInfo(
|
||||
{this.id,
|
||||
this.firstName,
|
||||
this.lastName,
|
||||
this.email,
|
||||
this.company,
|
||||
this.countryId,
|
||||
this.country,
|
||||
this.stateProvinceId,
|
||||
this.city,
|
||||
this.address1,
|
||||
this.address2,
|
||||
this.zipPostalCode,
|
||||
this.phoneNumber,
|
||||
this.faxNumber,
|
||||
this.customerAttributes,
|
||||
this.createdOnUtc,
|
||||
this.province,
|
||||
this.latLong});
|
||||
|
||||
AddressInfo.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
firstName = json['first_name'];
|
||||
lastName = json['last_name'];
|
||||
email = json['email'];
|
||||
company = json['company'];
|
||||
countryId = json['country_id'];
|
||||
country = json['country'];
|
||||
stateProvinceId = json['state_province_id'];
|
||||
city = json['city'];
|
||||
address1 = json['address1'];
|
||||
address2 = json['address2'];
|
||||
zipPostalCode = json['zip_postal_code'];
|
||||
phoneNumber = json['phone_number'];
|
||||
faxNumber = json['fax_number'];
|
||||
customerAttributes = json['customer_attributes'];
|
||||
createdOnUtc = json['created_on_utc'];
|
||||
province = json['province'];
|
||||
latLong = json['lat_long'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['first_name'] = this.firstName;
|
||||
data['last_name'] = this.lastName;
|
||||
data['email'] = this.email;
|
||||
data['company'] = this.company;
|
||||
data['country_id'] = this.countryId;
|
||||
data['country'] = this.country;
|
||||
data['state_province_id'] = this.stateProvinceId;
|
||||
data['city'] = this.city;
|
||||
data['address1'] = this.address1;
|
||||
data['address2'] = this.address2;
|
||||
data['zip_postal_code'] = this.zipPostalCode;
|
||||
data['phone_number'] = this.phoneNumber;
|
||||
data['fax_number'] = this.faxNumber;
|
||||
data['customer_attributes'] = this.customerAttributes;
|
||||
data['created_on_utc'] = this.createdOnUtc;
|
||||
data['province'] = this.province;
|
||||
data['lat_long'] = this.latLong;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/get_vacainations_itemsmodel.dart';
|
||||
|
||||
import '../base_service.dart';
|
||||
|
||||
class GetVccinationsItemsService extends BaseService {
|
||||
List<GET_VACCINATIONS_ITEMSMODEL> getVaccinationsItemModelList = List();
|
||||
Map<String, dynamic> body = Map();
|
||||
|
||||
|
||||
|
||||
Future getaccinationsitemOrders() async {
|
||||
hasError = false;
|
||||
await baseAppClient.post(GET_TABLE_REQUEST,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
getVaccinationsItemModelList.clear();
|
||||
response['List_CreateVaccinationTableModel'].forEach((vital) {
|
||||
getVaccinationsItemModelList.add(
|
||||
GET_VACCINATIONS_ITEMSMODEL.fromJson(vital));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: body);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
|
||||
class OrderPreviewService extends BaseService{
|
||||
bool isFinished = true;
|
||||
bool hasError = false;
|
||||
String errorMsg = '';
|
||||
|
||||
List<Addresses> addresses = List();
|
||||
|
||||
Future getBannerListList() async {
|
||||
hasError = false;
|
||||
try {
|
||||
await baseAppClient.get(GET_CUSTOMERS_ADDRESSES,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
addresses.clear();
|
||||
response['customers'][0]['addresses'].forEach((item) {
|
||||
addresses.add(Addresses.fromJson(item));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
});
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
|
||||
class PharmacyModuleService extends BaseService {
|
||||
bool isFinished = true;
|
||||
bool hasError = false;
|
||||
String errorMsg = '';
|
||||
|
||||
List<PharmacyImageObject> bannerItems = List();
|
||||
List<Manufacturer> manufacturerList = List();
|
||||
List<PharmacyProduct> bestSellerProducts = List();
|
||||
List<PharmacyProduct> lastVisitedProducts = List();
|
||||
|
||||
Future getBannerListList() async {
|
||||
hasError = false;
|
||||
try {
|
||||
await baseAppClient.get(GET_PHARMACY_BANNER,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
bannerItems.clear();
|
||||
response['images'].forEach((item) {
|
||||
bannerItems.add(PharmacyImageObject.fromJson(item));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
});
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Future getTopManufacturerList() async {
|
||||
Map<String, String> queryParams = {'page': '1', 'limit': '8'};
|
||||
try {
|
||||
await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
manufacturerList.clear();
|
||||
response['manufacturer'].forEach((item) {
|
||||
manufacturerList.add(Manufacturer.fromJson(item));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, queryParams: queryParams);
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Future getBestSellerProducts() async {
|
||||
Map<String, String> queryParams = {
|
||||
'fields':
|
||||
'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews',
|
||||
};
|
||||
try {
|
||||
await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
bestSellerProducts.clear();
|
||||
response['products'].forEach((item) {
|
||||
bestSellerProducts.add(PharmacyProduct.fromJson(item));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, queryParams: queryParams);
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Future getLastVisitedProducts() async {
|
||||
String lastVisited = "";
|
||||
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) !=
|
||||
null) {
|
||||
lastVisited =
|
||||
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
|
||||
try {
|
||||
await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
lastVisitedProducts.clear();
|
||||
response['products'].forEach((item) {
|
||||
lastVisitedProducts.add(PharmacyProduct.fromJson(item));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
});
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
class AddNewAddressRequestModel {
|
||||
Customer customer;
|
||||
|
||||
AddNewAddressRequestModel({this.customer});
|
||||
|
||||
AddNewAddressRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
customer = json['customer'] != null
|
||||
? new Customer.fromJson(json['customer'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
if (this.customer != null) {
|
||||
data['customer'] = this.customer.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Customer {
|
||||
List<Addresses> addresses;
|
||||
int id;
|
||||
String email;
|
||||
List<int> roleIds;
|
||||
|
||||
Customer({this.addresses, this.id, this.email, this.roleIds});
|
||||
|
||||
Customer.fromJson(Map<String, dynamic> json) {
|
||||
if (json['addresses'] != null) {
|
||||
addresses = new List<Addresses>();
|
||||
json['addresses'].forEach((v) {
|
||||
addresses.add(new Addresses.fromJson(v));
|
||||
});
|
||||
}
|
||||
id = json['id'];
|
||||
email = json['email'];
|
||||
roleIds = json['role_ids'].cast<int>();
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
if (this.addresses != null) {
|
||||
data['addresses'] = this.addresses.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['id'] = this.id;
|
||||
data['email'] = this.email;
|
||||
data['role_ids'] = this.roleIds;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Addresses {
|
||||
int id;
|
||||
String firstName;
|
||||
String lastName;
|
||||
String email;
|
||||
Null company;
|
||||
int countryId;
|
||||
String country;
|
||||
Null stateProvinceId;
|
||||
String city;
|
||||
String address1;
|
||||
String address2;
|
||||
String zipPostalCode;
|
||||
String phoneNumber;
|
||||
Null faxNumber;
|
||||
String customerAttributes;
|
||||
String createdOnUtc;
|
||||
Null province;
|
||||
String latLong;
|
||||
|
||||
Addresses(
|
||||
{this.id,
|
||||
this.firstName,
|
||||
this.lastName,
|
||||
this.email,
|
||||
this.company,
|
||||
this.countryId,
|
||||
this.country,
|
||||
this.stateProvinceId,
|
||||
this.city,
|
||||
this.address1,
|
||||
this.address2,
|
||||
this.zipPostalCode,
|
||||
this.phoneNumber,
|
||||
this.faxNumber,
|
||||
this.customerAttributes,
|
||||
this.createdOnUtc,
|
||||
this.province,
|
||||
this.latLong});
|
||||
|
||||
Addresses.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
firstName = json['first_name'];
|
||||
lastName = json['last_name'];
|
||||
email = json['email'];
|
||||
company = json['company'];
|
||||
countryId = json['country_id'];
|
||||
country = json['country'];
|
||||
stateProvinceId = json['state_province_id'];
|
||||
city = json['city'];
|
||||
address1 = json['address1'];
|
||||
address2 = json['address2'];
|
||||
zipPostalCode = json['zip_postal_code'];
|
||||
phoneNumber = json['phone_number'];
|
||||
faxNumber = json['fax_number'];
|
||||
customerAttributes = json['customer_attributes'];
|
||||
createdOnUtc = json['created_on_utc'];
|
||||
province = json['province'];
|
||||
latLong = json['lat_long'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['first_name'] = this.firstName;
|
||||
data['last_name'] = this.lastName;
|
||||
data['email'] = this.email;
|
||||
data['company'] = this.company;
|
||||
data['country_id'] = this.countryId;
|
||||
data['country'] = this.country;
|
||||
data['state_province_id'] = this.stateProvinceId;
|
||||
data['city'] = this.city;
|
||||
data['address1'] = this.address1;
|
||||
data['address2'] = this.address2;
|
||||
data['zip_postal_code'] = this.zipPostalCode;
|
||||
data['phone_number'] = this.phoneNumber;
|
||||
data['fax_number'] = this.faxNumber;
|
||||
data['customer_attributes'] = this.customerAttributes;
|
||||
data['created_on_utc'] = this.createdOnUtc;
|
||||
data['province'] = this.province;
|
||||
data['lat_long'] = this.latLong;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -1,30 +1,27 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/childvaccines/vaccination_table_service.dart';
|
||||
|
||||
import '../../../locator.dart';
|
||||
import '../base_view_model.dart';
|
||||
|
||||
class VaccinationTableViewModel extends BaseViewModel {
|
||||
VaccinationTableService _creteVaccinationTableService =
|
||||
locator<VaccinationTableService>();
|
||||
|
||||
class VaccinationTableViewModel extends BaseViewModel{
|
||||
List<CreateVaccinationTable> get creteVaccinationTableModelList =>
|
||||
_creteVaccinationTableService.createVaccinationTableModelList;
|
||||
|
||||
VaccinationTableService _creteVaccinationTableService = locator<VaccinationTableService>();
|
||||
|
||||
// String get creteVaccinationTableContent => _creteVaccinationTableService.userAgreementContent;
|
||||
//String get userAgreementContent => _creteNewBabyService.v//_reportsService.userAgreementContent;
|
||||
List<CreateVaccinationTable> get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;//.createNewBabyModelList;
|
||||
getCreateVaccinationTable() async {
|
||||
getCreateVaccinationTable({List_BabyInformationModel babyInfo, List_UserInformationModel informationModel, bool isSendEmail =false}) async {
|
||||
setState(ViewState.Busy);
|
||||
|
||||
await _creteVaccinationTableService.getCreateVaccinationTableOrders();//getCreateNewBabyOrders();
|
||||
|
||||
if ( _creteVaccinationTableService.hasError) {
|
||||
error = _creteVaccinationTableService.error;
|
||||
await _creteVaccinationTableService.getCreateVaccinationTableOrders(babyInfo: babyInfo,informationModel: informationModel,isSendEmail: isSendEmail);
|
||||
if (_creteVaccinationTableService.hasError) {
|
||||
error = _creteVaccinationTableService.error;
|
||||
setState(ViewState.Error);
|
||||
} else
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,8 @@
|
||||
import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart';
|
||||
|
||||
import '../../../locator.dart';
|
||||
import '../base_view_model.dart';
|
||||
|
||||
class OrderPreviewViewModel extends BaseViewModel {
|
||||
OrderPreviewService _orderService = locator<OrderPreviewService>();
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||
|
||||
import '../../../locator.dart';
|
||||
|
||||
class PharmacyModuleViewModel extends BaseViewModel {
|
||||
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
|
||||
|
||||
List<PharmacyImageObject> get bannerList => _pharmacyService.bannerItems;
|
||||
|
||||
List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList;
|
||||
|
||||
List<PharmacyProduct> get bestSellerProduct =>
|
||||
_pharmacyService.bestSellerProducts;
|
||||
|
||||
List<PharmacyProduct> get lastVisitedProducts =>
|
||||
_pharmacyService.lastVisitedProducts;
|
||||
|
||||
Future getPharmacyHomeData() async {
|
||||
setState(ViewState.Busy);
|
||||
await _pharmacyService.getBannerListList();
|
||||
if (_pharmacyService.hasError) {
|
||||
error = _pharmacyService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
_getTopManufacturerList();
|
||||
}
|
||||
}
|
||||
|
||||
List<String> getBannerImagesUrl() {
|
||||
List<String> images = List();
|
||||
images.add('assets/images/pharmacy_module/pharmacy_logo_green.png');
|
||||
_pharmacyService.bannerItems.forEach((element) {
|
||||
images.add(element.src);
|
||||
});
|
||||
|
||||
return images;
|
||||
}
|
||||
|
||||
_getTopManufacturerList() async {
|
||||
await _pharmacyService.getTopManufacturerList();
|
||||
if (_pharmacyService.hasError) {
|
||||
error = _pharmacyService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
_getBestSellerProducts();
|
||||
}
|
||||
}
|
||||
|
||||
_getBestSellerProducts() async {
|
||||
await _pharmacyService.getBestSellerProducts();
|
||||
if (_pharmacyService.hasError) {
|
||||
error = _pharmacyService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
_getLastVisitedProducts();
|
||||
}
|
||||
}
|
||||
|
||||
_getLastVisitedProducts() async {
|
||||
await _pharmacyService.getLastVisitedProducts();
|
||||
if (_pharmacyService.hasError) {
|
||||
error = _pharmacyService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class CMCLocationPage extends StatefulWidget {
|
||||
final Function(PickResult) onPick;
|
||||
final double latitude;
|
||||
final double longitude;
|
||||
final dynamic model;
|
||||
|
||||
const CMCLocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_CMCLocationPageState createState() =>
|
||||
_CMCLocationPageState();
|
||||
}
|
||||
|
||||
class _CMCLocationPageState
|
||||
extends State<CMCLocationPage> {
|
||||
double latitude = 0;
|
||||
double longitude = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
latitude = widget.latitude;
|
||||
longitude = widget.longitude;
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return BaseView<CMCViewModel>(
|
||||
onModelReady: (model) {},
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowDecPage: false,
|
||||
isShowAppBar: true,
|
||||
baseViewModel: model,
|
||||
body: PlacePicker(
|
||||
apiKey: GOOGLE_API_KEY,
|
||||
enableMyLocationButton: true,
|
||||
automaticallyImplyAppBarLeading: false,
|
||||
autocompleteOnTrailingWhitespace: true,
|
||||
selectInitialPosition: true,
|
||||
autocompleteLanguage: projectViewModel.currentLanguage,
|
||||
enableMapTypeButton: true,
|
||||
searchForInitialValue: false,
|
||||
onPlacePicked: (PickResult result) {
|
||||
print(result.adrAddress);
|
||||
|
||||
},
|
||||
selectedPlaceWidgetBuilder:
|
||||
(_, selectedPlace, state, isSearchBarFocused) {
|
||||
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
|
||||
return isSearchBarFocused
|
||||
? Container()
|
||||
: FloatingCard(
|
||||
bottomPosition: 0.0,
|
||||
leftPosition: 0.0,
|
||||
rightPosition: 0.0,
|
||||
width: 500,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
child: state == SearchingState.Searching
|
||||
? Center(child: CircularProgressIndicator())
|
||||
: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Column(
|
||||
children: [
|
||||
SecondaryButton(
|
||||
color: Colors.grey[800],
|
||||
textColor: Colors.white,
|
||||
onTap: () async {
|
||||
print(selectedPlace);
|
||||
AddNewAddressRequestModel
|
||||
addNewAddressRequestModel =
|
||||
new AddNewAddressRequestModel(
|
||||
customer: Customer(addresses: [
|
||||
Addresses(
|
||||
address1:
|
||||
selectedPlace.formattedAddress,
|
||||
address2: selectedPlace
|
||||
.formattedAddress,
|
||||
customerAttributes: "",
|
||||
city: "",
|
||||
createdOnUtc: "",
|
||||
id: 0,
|
||||
latLong: "$latitude,$longitude",
|
||||
email: "")
|
||||
]),
|
||||
);
|
||||
|
||||
selectedPlace.addressComponents.forEach((e) {
|
||||
if (e.types.contains("country")) {
|
||||
addNewAddressRequestModel.customer
|
||||
.addresses[0].country = e.longName;
|
||||
}
|
||||
if (e.types.contains("postal_code")) {
|
||||
addNewAddressRequestModel.customer
|
||||
.addresses[0].zipPostalCode =
|
||||
e.longName;
|
||||
}
|
||||
if (e.types.contains("locality")) {
|
||||
addNewAddressRequestModel.customer
|
||||
.addresses[0].city =
|
||||
e.longName;
|
||||
}
|
||||
});
|
||||
|
||||
await model.addAddressInfo(
|
||||
addNewAddressRequestModel: addNewAddressRequestModel);
|
||||
if (model.state == ViewState.ErrorLocal) {
|
||||
Utils.showErrorToast(model.error);
|
||||
} else {
|
||||
AppToast.showSuccessToast(
|
||||
message: "Address Added Successfully");
|
||||
}
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
label: " Add New Address ",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
initialPosition: LatLng(latitude, longitude),
|
||||
useCurrentLocation: false,
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
import 'cmc_page.dart';
|
||||
|
||||
class CMCIndexPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: TranslationBase.of(context).serviceInformation,
|
||||
body: SingleChildScrollView(
|
||||
padding: EdgeInsets.all(12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Texts(
|
||||
"CMC",
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 25,
|
||||
color: Color(0xff60686b),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Texts(
|
||||
"This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.",
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 17,
|
||||
),
|
||||
SizedBox(
|
||||
height: 22,
|
||||
),
|
||||
Center(
|
||||
child: Image.asset(
|
||||
'assets/images/AlHabibMedicalService/Wifi-AR.png')),
|
||||
SizedBox(
|
||||
height: 77,
|
||||
),
|
||||
],
|
||||
)),
|
||||
bottomSheet: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.10,
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
child: SecondaryButton(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: CMCPage(),
|
||||
),
|
||||
),
|
||||
label: "CMC",
|
||||
textColor: Theme.of(context).backgroundColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
@ -0,0 +1,129 @@
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SelectHospitalDialog extends StatefulWidget {
|
||||
|
||||
final List<GetAllProjectsResponseModel> hospitals;
|
||||
final Function(GetAllProjectsResponseModel) onValueSelected;
|
||||
GetAllProjectsResponseModel selectedHospital;
|
||||
|
||||
SelectHospitalDialog(
|
||||
{Key key, this.hospitals, this.onValueSelected, this.selectedHospital});
|
||||
|
||||
@override
|
||||
_SelectHospitalDialogState createState() => _SelectHospitalDialogState();
|
||||
}
|
||||
|
||||
class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Divider(),
|
||||
...List.generate(
|
||||
widget.hospitals.length,
|
||||
(index) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.selectedHospital = widget.hospitals[index];
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text(widget.hospitals[index].desciption),
|
||||
leading: Radio(
|
||||
value: widget.hospitals[index],
|
||||
groupValue: widget.selectedHospital,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
widget.selectedHospital = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).cancel.toUpperCase(),
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 1,
|
||||
height: 30,
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
widget.onValueSelected(widget.selectedHospital);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).ok,
|
||||
fontWeight: FontWeight.w400,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,145 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class LocationPage extends StatefulWidget {
|
||||
final Function(PickResult) onPick;
|
||||
final double latitude;
|
||||
final double longitude;
|
||||
final dynamic model;
|
||||
|
||||
const LocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_LocationPageState createState() =>
|
||||
_LocationPageState();
|
||||
}
|
||||
|
||||
class _LocationPageState
|
||||
extends State<LocationPage> {
|
||||
double latitude = 0;
|
||||
double longitude = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
latitude = widget.latitude;
|
||||
longitude = widget.longitude;
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return BaseView<HomeHealthCareViewModel>(
|
||||
onModelReady: (model) {},
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowDecPage: false,
|
||||
isShowAppBar: true,
|
||||
baseViewModel: model,
|
||||
body: PlacePicker(
|
||||
apiKey: GOOGLE_API_KEY,
|
||||
enableMyLocationButton: true,
|
||||
automaticallyImplyAppBarLeading: false,
|
||||
autocompleteOnTrailingWhitespace: true,
|
||||
selectInitialPosition: true,
|
||||
autocompleteLanguage: projectViewModel.currentLanguage,
|
||||
enableMapTypeButton: true,
|
||||
searchForInitialValue: false,
|
||||
onPlacePicked: (PickResult result) {
|
||||
print(result.adrAddress);
|
||||
|
||||
},
|
||||
selectedPlaceWidgetBuilder:
|
||||
(_, selectedPlace, state, isSearchBarFocused) {
|
||||
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
|
||||
return isSearchBarFocused
|
||||
? Container()
|
||||
: FloatingCard(
|
||||
bottomPosition: 0.0,
|
||||
leftPosition: 0.0,
|
||||
rightPosition: 0.0,
|
||||
width: 500,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
child: state == SearchingState.Searching
|
||||
? Center(child: CircularProgressIndicator())
|
||||
: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Column(
|
||||
children: [
|
||||
SecondaryButton(
|
||||
color: Colors.grey[800],
|
||||
textColor: Colors.white,
|
||||
onTap: () async {
|
||||
AddNewAddressRequestModel
|
||||
addNewAddressRequestModel =
|
||||
new AddNewAddressRequestModel(
|
||||
customer: Customer(addresses: [
|
||||
Addresses(
|
||||
address1:
|
||||
selectedPlace.formattedAddress,
|
||||
address2: selectedPlace
|
||||
.formattedAddress,
|
||||
customerAttributes: "",
|
||||
city: "",
|
||||
createdOnUtc: "",
|
||||
id: 0,
|
||||
latLong: "$latitude,$longitude",
|
||||
email: "")
|
||||
]),
|
||||
);
|
||||
|
||||
selectedPlace.addressComponents.forEach((e) {
|
||||
if (e.types.contains("country")) {
|
||||
addNewAddressRequestModel.customer
|
||||
.addresses[0].country = e.longName;
|
||||
}
|
||||
if (e.types.contains("postal_code")) {
|
||||
addNewAddressRequestModel.customer
|
||||
.addresses[0].zipPostalCode =
|
||||
e.longName;
|
||||
}
|
||||
if (e.types.contains("locality")) {
|
||||
addNewAddressRequestModel.customer
|
||||
.addresses[0].city =
|
||||
e.longName;
|
||||
}
|
||||
});
|
||||
|
||||
await model.addAddressInfo(
|
||||
addNewAddressRequestModel: addNewAddressRequestModel);
|
||||
if (model.state == ViewState.ErrorLocal) {
|
||||
Utils.showErrorToast(model.error);
|
||||
} else {
|
||||
AppToast.showSuccessToast(
|
||||
message: "Address Added Successfully");
|
||||
}
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
label: " Add New Address ",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
initialPosition: LatLng(latitude, longitude),
|
||||
useCurrentLocation: false,
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
|
||||
import 'home_health_care_page.dart';
|
||||
|
||||
class HomeHealthCareIndexPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: TranslationBase.of(context).serviceInformation,
|
||||
body: SingleChildScrollView(
|
||||
padding: EdgeInsets.all(12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Texts(
|
||||
TranslationBase.of(context).homeHealthCare,
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 25,
|
||||
color: Color(0xff60686b),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Texts(
|
||||
TranslationBase.of(context).homeHealthCareText,
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 17,
|
||||
),
|
||||
SizedBox(
|
||||
height: 22,
|
||||
),
|
||||
Center(
|
||||
child: Image.asset(
|
||||
'assets/images/AlHabibMedicalService/Wifi-AR.png')),
|
||||
SizedBox(
|
||||
height: 77,
|
||||
),
|
||||
],
|
||||
)),
|
||||
bottomSheet: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.10,
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
child: SecondaryButton(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: HomeHealthCarePage(),
|
||||
),
|
||||
),
|
||||
label: TranslationBase.of(context).loginRegister,
|
||||
textColor: Theme.of(context).backgroundColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
|
||||
|
||||
import 'dialogs/delete_child.dart';
|
||||
|
||||
class ChildDetailsWidget extends StatelessWidget {
|
||||
final ChildVaccinesViewModel model;
|
||||
final List_BabyInformationModel babyInfo;
|
||||
final List_UserInformationModel informationModel;
|
||||
final Function onTapDelete;
|
||||
|
||||
ChildDetailsWidget({this.model, this.babyInfo, this.informationModel, this.onTapDelete});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: (){
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VaccinationTablePage(
|
||||
babyInfo: babyInfo,
|
||||
informationModel: informationModel,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 5, right: 5, bottom: 10),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
border: Border.all(color: Colors.white, width: 0.5),
|
||||
borderRadius: BorderRadius.all(Radius.circular(5)),
|
||||
color: Colors.white,
|
||||
),
|
||||
padding: EdgeInsets.all(12),
|
||||
width: 200,
|
||||
//double.infinity,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(children: [
|
||||
Texts(TranslationBase.of(context).childName),
|
||||
]),
|
||||
Row(children: [
|
||||
Texts(babyInfo.babyName.trim()),
|
||||
]),
|
||||
Row(children: [
|
||||
IconButton(
|
||||
icon: Image.asset(babyInfo.gender == 1
|
||||
? 'assets/images/new-design/male.png'
|
||||
: 'assets/images/new-design/female.png'),
|
||||
tooltip: '',
|
||||
onPressed: () {
|
||||
},
|
||||
),
|
||||
Texts(babyInfo.genderDescription),
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.remove_red_eye,
|
||||
color: Colors.red,
|
||||
),
|
||||
tooltip: '',
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: VaccinationTablePage(
|
||||
babyInfo: babyInfo,
|
||||
informationModel: informationModel,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
)
|
||||
]),
|
||||
Row(children: [
|
||||
Texts(TranslationBase.of(context).childDob),
|
||||
]),
|
||||
Row(
|
||||
children: [
|
||||
IconButton(
|
||||
icon: new Image.asset(
|
||||
'assets/images/new-design/calender-secondary.png'),
|
||||
tooltip: '',
|
||||
),
|
||||
Texts(
|
||||
DateUtil.yearMonthDay(babyInfo.dOB),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(children: [
|
||||
IconButton(
|
||||
icon: new Image.asset('assets/images/new-design/garbage.png'),
|
||||
tooltip: '',
|
||||
onPressed: () async {
|
||||
onTapDelete();
|
||||
},
|
||||
),
|
||||
Texts(TranslationBase.of(context).delete),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class AppUpdatePage extends StatefulWidget {
|
||||
String appUpdateText;
|
||||
|
||||
AppUpdatePage({@required this.appUpdateText});
|
||||
|
||||
@override
|
||||
_AppUpdatePageState createState() => _AppUpdatePageState();
|
||||
}
|
||||
|
||||
class _AppUpdatePageState extends State<AppUpdatePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: "App Update",
|
||||
backgroundColor: Colors.white,
|
||||
isShowAppBar: false,
|
||||
isShowDecPage: false,
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Stack(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
"assets/images/new-design/update_rocket_image.svg",
|
||||
fit: BoxFit.fill),
|
||||
]),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 40.0),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Text(TranslationBase.of(context).appUpdate,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0xff2d6c90).withOpacity(1.0),
|
||||
fontSize: 22.0,
|
||||
fontWeight: FontWeight.bold))),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
|
||||
child: SvgPicture.asset("assets/images/new-design/HMG_logo.svg",
|
||||
fit: BoxFit.fill),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Text(widget.appUpdateText,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.grey[600],
|
||||
fontSize: 16.0,
|
||||
height: 1.5,
|
||||
fontWeight: FontWeight.bold))),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
|
||||
child: ButtonTheme(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
minWidth: MediaQuery.of(context).size.width,
|
||||
height: 45.0,
|
||||
child: RaisedButton(
|
||||
color: Colors.red[800],
|
||||
textColor: Colors.white,
|
||||
disabledTextColor: Colors.white,
|
||||
disabledColor: new Color(0xFFbcc2c4),
|
||||
onPressed: () {
|
||||
openAppUpdateLink();
|
||||
},
|
||||
child: Text(TranslationBase.of(context).appUpdate,
|
||||
style: TextStyle(fontSize: 18.0)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
openAppUpdateLink() {
|
||||
if (Platform.isAndroid) {
|
||||
_launchURL("https://play.google.com/store/apps/details?id=com.ejada.hmg");
|
||||
}
|
||||
if (Platform.isIOS) {
|
||||
_launchURL("https://itunes.apple.com/app/id733503978");
|
||||
}
|
||||
}
|
||||
|
||||
_launchURL(String url) async {
|
||||
if (await canLaunch(url)) {
|
||||
await launch(url);
|
||||
} else {
|
||||
throw 'Could not launch $url';
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class OrderPreviewPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<OrderPreviewViewModel>(
|
||||
builder: (_, model, wi) => AppScaffold(
|
||||
title: "Shopping Cart",
|
||||
isShowAppBar: true,
|
||||
isShowDecPage: false,
|
||||
baseViewModel: model,
|
||||
backgroundColor: Colors.white,
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureIconButton(
|
||||
TranslationBase.of(context).deleteAllItems,
|
||||
Icon(Icons.delete_outline_sharp, color: Colors.grey.shade800,),
|
||||
onTap: () => {},
|
||||
),
|
||||
const Divider(
|
||||
color: Colors.grey,
|
||||
height: 20,
|
||||
thickness: 1,
|
||||
indent: 0,
|
||||
endIndent: 0,
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,245 @@
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/pharmacies/screens/order-preview-page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/BannerPager.dart';
|
||||
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart';
|
||||
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/manufacturerItem.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PharmacyPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<PharmacyModuleViewModel>(
|
||||
// onModelReady: (model) => model.getPharmacyHomeData(),
|
||||
onModelReady: (model) => model.getPharmacyHomeData(),
|
||||
builder: (_, model, wi) => AppScaffold(
|
||||
title: "",
|
||||
isShowAppBar: true,
|
||||
isShowDecPage: false,
|
||||
baseViewModel: model,
|
||||
backgroundColor: Colors.white,
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
BannerPager(model),
|
||||
GridViewButtons(),
|
||||
/*BannerPager(model.getBannerImagesUrl()),*/
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).shopByBrands,
|
||||
bold: true,
|
||||
),
|
||||
BorderedButton(
|
||||
TranslationBase.of(context).viewAll,
|
||||
hasBorder: true,
|
||||
vPadding: 6,
|
||||
borderColor: Colors.green,
|
||||
color: Colors.green,
|
||||
handler: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 60,
|
||||
child: ListView.builder(
|
||||
itemBuilder: (ctx, i) =>
|
||||
ManufacturerItem(model.manufacturerList[i]),
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: model.manufacturerList.length,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).recentlyViewed,
|
||||
bold: true,
|
||||
),
|
||||
BorderedButton(
|
||||
TranslationBase.of(context).viewAll,
|
||||
hasBorder: true,
|
||||
vPadding: 6,
|
||||
borderColor: Colors.green,
|
||||
color: Colors.green,
|
||||
handler: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: model.lastVisitedProducts.length > 0 ? MediaQuery.of(context).size.height / 4 : 0,
|
||||
child: ListView.builder(
|
||||
itemBuilder: (ctx, i) =>
|
||||
ProductTileItem(model.lastVisitedProducts[i]),
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: model.lastVisitedProducts.length,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).bestSellers,
|
||||
bold: true,
|
||||
),
|
||||
BorderedButton(
|
||||
TranslationBase.of(context).viewAll,
|
||||
hasBorder: true,
|
||||
borderColor: Colors.green,
|
||||
color: Colors.green,
|
||||
vPadding: 6,
|
||||
handler: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height / 4,
|
||||
child: ListView.builder(
|
||||
itemBuilder: (ctx, i) =>
|
||||
ProductTileItem(model.bestSellerProduct[i]),
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: model.bestSellerProduct.length,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class GridViewButtons extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final gridHeight = (MediaQuery.of(context).size.width * 0.3) * 1.8;
|
||||
return Container(
|
||||
child: SizedBox(
|
||||
height: gridHeight,
|
||||
child: GridView.count(
|
||||
childAspectRatio: 2.2,
|
||||
crossAxisSpacing: 10,
|
||||
mainAxisSpacing: 10,
|
||||
controller: new ScrollController(keepScrollOffset: false),
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
crossAxisCount: 2,
|
||||
children: [
|
||||
DashboardItem(
|
||||
imageName: 'pharmacy_module/bg_1.png',
|
||||
hasColorFilter: false,
|
||||
opacity: 0.8,
|
||||
child: GridViewCard(
|
||||
TranslationBase.of(context).offersAndPromotions,
|
||||
'assets/images/pharmacy_module/offer_icon.png',
|
||||
() {
|
||||
Navigator.push(context, FadePage(page: OrderPreviewPage()));
|
||||
}),
|
||||
),
|
||||
DashboardItem(
|
||||
imageName: 'pharmacy_module/bg_2.png',
|
||||
opacity: 0,
|
||||
hasColorFilter: false,
|
||||
child: GridViewCard(TranslationBase.of(context).medicationRefill,
|
||||
'assets/images/pharmacy_module/medication_icon.png', () {}),
|
||||
),
|
||||
DashboardItem(
|
||||
imageName: 'pharmacy_module/bg_3.png',
|
||||
opacity: 0,
|
||||
hasColorFilter: false,
|
||||
child: GridViewCard(TranslationBase.of(context).myPrescriptions,
|
||||
'assets/images/pharmacy_module/prescription_icon.png', () {}),
|
||||
),
|
||||
DashboardItem(
|
||||
imageName: 'pharmacy_module/bg_4.png',
|
||||
opacity: 0,
|
||||
hasColorFilter: false,
|
||||
child: GridViewCard(
|
||||
TranslationBase.of(context).searchAndScanMedication,
|
||||
'assets/images/pharmacy_module/search_scan_icon.png',
|
||||
() {}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class GridViewCard extends StatelessWidget {
|
||||
final String text;
|
||||
final String cardImage;
|
||||
final Function handler;
|
||||
|
||||
GridViewCard(this.text, this.cardImage, this.handler);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(6),
|
||||
child: Texts(
|
||||
text,
|
||||
color: Colors.white,
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: BorderedButton(
|
||||
TranslationBase.of(context).viewAll,
|
||||
handler: handler,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Image.asset(
|
||||
cardImage,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ProductDetailScreen extends StatelessWidget {
|
||||
final PharmacyProduct product;
|
||||
|
||||
ProductDetailScreen(this.product);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
body: Center(
|
||||
child: Texts("id = ${product.id}"),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
import 'package:carousel_slider/carousel_slider.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||
|
||||
class BannerPager extends StatefulWidget {
|
||||
final PharmacyModuleViewModel _model;
|
||||
|
||||
BannerPager(this._model);
|
||||
|
||||
@override
|
||||
_BannerPagerState createState() => _BannerPagerState();
|
||||
}
|
||||
|
||||
class _BannerPagerState extends State<BannerPager> {
|
||||
int _current = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: Column(
|
||||
children: [
|
||||
CarouselSlider(
|
||||
options: CarouselOptions(
|
||||
aspectRatio: 7 / 2,
|
||||
enlargeCenterPage: true,
|
||||
enableInfiniteScroll: false,
|
||||
initialPage: 0,
|
||||
autoPlay: true,
|
||||
autoPlayInterval: Duration(seconds: 3),
|
||||
autoPlayAnimationDuration: Duration(milliseconds: 800),
|
||||
autoPlayCurve: Curves.decelerate,
|
||||
onPageChanged: (index, reason) {
|
||||
setState(() {
|
||||
_current = index;
|
||||
});
|
||||
},
|
||||
),
|
||||
items: widget._model
|
||||
.getBannerImagesUrl()
|
||||
.mapIndexed(
|
||||
(item, index) => Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 1.0),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(5.0)),
|
||||
child: Center(
|
||||
child: index == 0
|
||||
? Image.asset(
|
||||
item,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: Image.network(
|
||||
item,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: widget._model
|
||||
.getBannerImagesUrl()
|
||||
.mapIndexed(
|
||||
(item, index) => Container(
|
||||
width: 12.0,
|
||||
height: 4.0,
|
||||
margin:
|
||||
EdgeInsets.symmetric(vertical: 0.0, horizontal: 2.0),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: _current == index
|
||||
? Color.fromRGBO(0, 250, 0, 0.9)
|
||||
: Color.fromRGBO(0, 0, 0, 0.4),
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ProductOrderItem extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
leading: Icon(
|
||||
Icons.delete_outline_sharp,
|
||||
color: Colors.grey.shade800,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,146 @@
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/pharmacies/screens/phramacy-product-detail-page.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class ProductTileItem extends StatelessWidget {
|
||||
final AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
final PharmacyProduct item;
|
||||
|
||||
ProductTileItem(this.item);
|
||||
|
||||
void productOnClick(BuildContext ctx) {
|
||||
_saveLastVisitProducts();
|
||||
Navigator.push(ctx, FadePage(page: ProductDetailScreen(item)));
|
||||
}
|
||||
|
||||
void _saveLastVisitProducts() async {
|
||||
String lastVisited = "";
|
||||
bool isIdExist = false;
|
||||
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) !=
|
||||
null) {
|
||||
lastVisited =
|
||||
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
|
||||
lastVisited.split(",").forEach((id) {
|
||||
if (id == item.id) {
|
||||
isIdExist = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!isIdExist) {
|
||||
if (lastVisited == "") {
|
||||
// it means there is no lastVisited yet
|
||||
lastVisited = "${item.id}";
|
||||
} else {
|
||||
// there is lastVisited id's and this product id is not found
|
||||
lastVisited += ",${item.id}";
|
||||
}
|
||||
sharedPref.setString(PHARMACY_LAST_VISITED_PRODUCTS, lastVisited);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectProvider = Provider.of(context);
|
||||
return InkWell(
|
||||
onTap: () => productOnClick(context),
|
||||
splashColor: Theme.of(context).primaryColor,
|
||||
child: Card(
|
||||
elevation: 2,
|
||||
shape: Border(right: BorderSide(color: Colors.grey.shade300, width: 1)),
|
||||
margin: EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 0),
|
||||
width: MediaQuery.of(context).size.width / 3,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Stack(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
|
||||
alignment: Alignment.center,
|
||||
child: Image.network(
|
||||
item.images[0].src,
|
||||
fit: BoxFit.cover,
|
||||
height: 80,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: item.rxMessage != null
|
||||
? MediaQuery.of(context).size.width / 5
|
||||
: 0,
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xffb23838),
|
||||
borderRadius:
|
||||
BorderRadius.only(topLeft: Radius.circular(6)),
|
||||
),
|
||||
child: Texts(
|
||||
item.rxMessage != null ? item.rxMessage : "",
|
||||
color: Colors.white,
|
||||
regular: true,
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(
|
||||
horizontal: 6,
|
||||
vertical: 0,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
projectProvider.isArabic ? item.name : item.namen,
|
||||
regular: true,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 4, bottom: 4),
|
||||
child: Texts(
|
||||
"SAR ${item.price}",
|
||||
bold: true,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
StarRating(
|
||||
totalAverage: item.approvedTotalReviews > 0
|
||||
? (item.approvedRatingSum.toDouble() /
|
||||
item.approvedTotalReviews.toDouble())
|
||||
.toDouble()
|
||||
: 0,
|
||||
forceStars: true),
|
||||
Texts(
|
||||
"(${item.approvedTotalReviews})",
|
||||
regular: true,
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w400,
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ManufacturerItem extends StatelessWidget {
|
||||
final Manufacturer item;
|
||||
|
||||
ManufacturerItem(this.item);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
margin: EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
right: BorderSide(color: Colors.grey.shade300, width: 1),
|
||||
bottom: BorderSide(color: Colors.grey.shade300, width: 1),
|
||||
left: BorderSide(color: Colors.grey.shade300, width: 1),
|
||||
top: BorderSide(color: Colors.grey.shade300, width: 1)),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Image.network(
|
||||
item.image.src,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class GestureIconButton extends StatefulWidget {
|
||||
GestureIconButton(
|
||||
this.label,
|
||||
this.icon, {
|
||||
Key key,
|
||||
this.onTap,
|
||||
this.backgroundColor,
|
||||
}) : super(key: key);
|
||||
|
||||
final String label;
|
||||
final Widget icon;
|
||||
final VoidCallback onTap;
|
||||
final Color backgroundColor;
|
||||
|
||||
@override
|
||||
_GestureIconButtonState createState() => _GestureIconButtonState();
|
||||
}
|
||||
|
||||
class _GestureIconButtonState extends State<GestureIconButton> {
|
||||
bool _buttonLongPress = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onLongPressStart: (_) =>
|
||||
setState(() => _buttonLongPress = !_buttonLongPress),
|
||||
onLongPressEnd: (_) =>
|
||||
setState(() => _buttonLongPress = !_buttonLongPress),
|
||||
child: Wrap(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: widget.backgroundColor != null
|
||||
? widget.backgroundColor
|
||||
: Colors.grey[200],
|
||||
),
|
||||
color: widget.backgroundColor != null
|
||||
? widget.backgroundColor
|
||||
: Colors.grey.shade200,
|
||||
borderRadius: BorderRadius.all(Radius.circular(8))),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: Expanded(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0),
|
||||
child: widget.icon,
|
||||
),
|
||||
Texts(
|
||||
widget.label,
|
||||
color: _buttonLongPress ? Colors.white : Colors.black,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BorderedButton extends StatelessWidget {
|
||||
final String text;
|
||||
final Function handler;
|
||||
final Color color;
|
||||
final bool hasBorder;
|
||||
final Color borderColor;
|
||||
final Color backgroundColor;
|
||||
final double vPadding;
|
||||
final double hPadding;
|
||||
|
||||
BorderedButton(
|
||||
this.text, {
|
||||
this.handler,
|
||||
this.color,
|
||||
this.hasBorder = false,
|
||||
this.borderColor,
|
||||
this.backgroundColor,
|
||||
this.vPadding = 0,
|
||||
this.hPadding = 0,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 4, vertical: 4),
|
||||
child: ButtonTheme(
|
||||
//adds padding inside the button
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
//limits the touch area to the button area
|
||||
minWidth: 0,
|
||||
//wraps child's width
|
||||
height: 0,
|
||||
//wraps child's height
|
||||
child: RaisedButton(
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: vPadding),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(4.0),
|
||||
side: BorderSide(color: hasBorder ? borderColor : Colors.white, width: 0.8),),
|
||||
color: backgroundColor ?? Colors.white,
|
||||
textColor: color ?? Color(0xffc4aa54),
|
||||
disabledTextColor: color ?? Colors.black,
|
||||
disabledColor: backgroundColor ?? Colors.white,
|
||||
onPressed: handler,
|
||||
child: Text(
|
||||
text,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: SizeConfig.textMultiplier * 1.6,
|
||||
fontWeight: FontWeight.normal),
|
||||
),
|
||||
), //your original button
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class SelectLocationDialog extends StatefulWidget {
|
||||
final List<AddressInfo> addresses;
|
||||
final Function(AddressInfo) onValueSelected;
|
||||
AddressInfo selectedAddress;
|
||||
|
||||
SelectLocationDialog(
|
||||
{Key key, this.addresses, this.onValueSelected, this.selectedAddress});
|
||||
|
||||
@override
|
||||
_SelectLocationDialogState createState() => _SelectLocationDialogState();
|
||||
}
|
||||
|
||||
class _SelectLocationDialogState extends State<SelectLocationDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
widget.selectedAddress = widget.selectedAddress ?? widget.addresses[0];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
title: Texts("sdsdsd"),
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 150,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Divider(),
|
||||
...List.generate(
|
||||
widget.addresses.length,
|
||||
(index) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.selectedAddress = widget.addresses[index];
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text(widget.addresses[index].address1),
|
||||
leading: Radio(
|
||||
value: widget.addresses[index],
|
||||
groupValue: widget.selectedAddress,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
widget.selectedAddress = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).cancel.toUpperCase(),
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 1,
|
||||
height: 30,
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
widget.onValueSelected(widget.selectedAddress);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).ok,
|
||||
fontWeight: FontWeight.w400,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|