Merge branch 'master' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into hhc_cmc
Conflicts: lib/config/config.dartmerge-update-with-lab-changes
@ -0,0 +1,9 @@
|
|||||||
|
{\rtf1\ansi\ansicpg1252\cocoartf2513
|
||||||
|
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||||
|
{\colortbl;\red255\green255\blue255;}
|
||||||
|
{\*\expandedcolortbl;;}
|
||||||
|
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
|
||||||
|
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||||
|
|
||||||
|
\f0\fs24 \cf0 keyPassword=HmGsa123\
|
||||||
|
storePassword=HmGsa123}
|
||||||
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 142 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 445 B |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 244 KiB |
|
Before Width: | Height: | Size: 644 B After Width: | Height: | Size: 475 B |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 475 B |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
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 |
|
After Width: | Height: | Size: 139 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 606 B |
|
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1 @@
|
|||||||
|
da98d9f0c1f407e541c636e84847ac81
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
storePassword=HmGsa123
|
||||||
|
keyPassword=HmGsa123
|
||||||
|
keyAlias=DQKey
|
||||||
|
storeFile=DQKey.jks
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
class GetNotificationsRequestModel {
|
||||||
|
int notificationStatusID;
|
||||||
|
int pagingSize;
|
||||||
|
int currentPage;
|
||||||
|
|
||||||
|
GetNotificationsRequestModel(
|
||||||
|
{this.notificationStatusID, this.pagingSize, this.currentPage});
|
||||||
|
|
||||||
|
GetNotificationsRequestModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
notificationStatusID = json['NotificationStatusID'];
|
||||||
|
pagingSize = json['pagingSize'];
|
||||||
|
currentPage = json['currentPage'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['NotificationStatusID'] = this.notificationStatusID;
|
||||||
|
data['pagingSize'] = this.pagingSize;
|
||||||
|
data['currentPage'] = this.currentPage;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,96 @@
|
|||||||
|
class GetNotificationsResponseModel {
|
||||||
|
int id;
|
||||||
|
int recordId;
|
||||||
|
int patientID;
|
||||||
|
bool projectOutSA;
|
||||||
|
String deviceType;
|
||||||
|
String deviceToken;
|
||||||
|
String message;
|
||||||
|
String messageType;
|
||||||
|
String messageTypeData;
|
||||||
|
dynamic videoURL;
|
||||||
|
bool isQueue;
|
||||||
|
String isQueueOn;
|
||||||
|
String createdOn;
|
||||||
|
String createdBy;
|
||||||
|
String notificationType;
|
||||||
|
bool isSent;
|
||||||
|
String isSentOn;
|
||||||
|
bool isRead;
|
||||||
|
String isReadOn;
|
||||||
|
int channelID;
|
||||||
|
int projectID;
|
||||||
|
|
||||||
|
GetNotificationsResponseModel(
|
||||||
|
{this.id,
|
||||||
|
this.recordId,
|
||||||
|
this.patientID,
|
||||||
|
this.projectOutSA,
|
||||||
|
this.deviceType,
|
||||||
|
this.deviceToken,
|
||||||
|
this.message,
|
||||||
|
this.messageType,
|
||||||
|
this.messageTypeData,
|
||||||
|
this.videoURL,
|
||||||
|
this.isQueue,
|
||||||
|
this.isQueueOn,
|
||||||
|
this.createdOn,
|
||||||
|
this.createdBy,
|
||||||
|
this.notificationType,
|
||||||
|
this.isSent,
|
||||||
|
this.isSentOn,
|
||||||
|
this.isRead,
|
||||||
|
this.isReadOn,
|
||||||
|
this.channelID,
|
||||||
|
this.projectID});
|
||||||
|
|
||||||
|
GetNotificationsResponseModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['Id'];
|
||||||
|
recordId = json['RecordId'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
projectOutSA = json['ProjectOutSA'];
|
||||||
|
deviceType = json['DeviceType'];
|
||||||
|
deviceToken = json['DeviceToken'];
|
||||||
|
message = json['Message'];
|
||||||
|
messageType = json['MessageType'];
|
||||||
|
messageTypeData = json['MessageTypeData'];
|
||||||
|
videoURL = json['VideoURL'];
|
||||||
|
isQueue = json['IsQueue'];
|
||||||
|
isQueueOn = json['IsQueueOn'];
|
||||||
|
createdOn = json['CreatedOn'];
|
||||||
|
createdBy = json['CreatedBy'];
|
||||||
|
notificationType = json['NotificationType'];
|
||||||
|
isSent = json['IsSent'];
|
||||||
|
isSentOn = json['IsSentOn'];
|
||||||
|
isRead = json['IsRead'];
|
||||||
|
isReadOn = json['IsReadOn'];
|
||||||
|
channelID = json['ChannelID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['Id'] = this.id;
|
||||||
|
data['RecordId'] = this.recordId;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['ProjectOutSA'] = this.projectOutSA;
|
||||||
|
data['DeviceType'] = this.deviceType;
|
||||||
|
data['DeviceToken'] = this.deviceToken;
|
||||||
|
data['Message'] = this.message;
|
||||||
|
data['MessageType'] = this.messageType;
|
||||||
|
data['MessageTypeData'] = this.messageTypeData;
|
||||||
|
data['VideoURL'] = this.videoURL;
|
||||||
|
data['IsQueue'] = this.isQueue;
|
||||||
|
data['IsQueueOn'] = this.isQueueOn;
|
||||||
|
data['CreatedOn'] = this.createdOn;
|
||||||
|
data['CreatedBy'] = this.createdBy;
|
||||||
|
data['NotificationType'] = this.notificationType;
|
||||||
|
data['IsSent'] = this.isSent;
|
||||||
|
data['IsSentOn'] = this.isSentOn;
|
||||||
|
data['IsRead'] = this.isRead;
|
||||||
|
data['IsReadOn'] = this.isReadOn;
|
||||||
|
data['ChannelID'] = this.channelID;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
class MarkMessageAsReadRequestModel {
|
||||||
|
int notificationPoolID;
|
||||||
|
|
||||||
|
MarkMessageAsReadRequestModel({this.notificationPoolID});
|
||||||
|
|
||||||
|
MarkMessageAsReadRequestModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
notificationPoolID = json['NotificationPoolID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['NotificationPoolID'] = this.notificationPoolID;
|
||||||
|
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,40 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/notifications/mark_message_as_read_request_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||||
|
|
||||||
|
class NotificationService extends BaseService {
|
||||||
|
List<GetNotificationsResponseModel> notificationsList = List();
|
||||||
|
|
||||||
|
Future getAllNotifications(GetNotificationsRequestModel getNotificationsRequestModel ) async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
if(getNotificationsRequestModel.currentPage ==0)
|
||||||
|
notificationsList.clear();
|
||||||
|
response['List_GetAllNotificationsFromPool'].forEach((appoint) {
|
||||||
|
notificationsList.add(GetNotificationsResponseModel.fromJson(appoint));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: getNotificationsRequestModel.toJson());
|
||||||
|
}
|
||||||
|
Future markAsRead(MarkMessageAsReadRequestModel markMessageAsReadRequestModel ) async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
updateNotification(markMessageAsReadRequestModel.notificationPoolID);
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: markMessageAsReadRequestModel.toJson());
|
||||||
|
}
|
||||||
|
|
||||||
|
updateNotification(id) {
|
||||||
|
int index = notificationsList.indexWhere((element) => element.id == id);
|
||||||
|
notificationsList[index].isRead = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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,40 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/notifications/mark_message_as_read_request_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/notifications_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../locator.dart';
|
||||||
|
import 'base_view_model.dart';
|
||||||
|
|
||||||
|
class NotificationViewModel extends BaseViewModel {
|
||||||
|
NotificationService _notificationService = locator<NotificationService>();
|
||||||
|
|
||||||
|
List<GetNotificationsResponseModel> get notifications =>
|
||||||
|
_notificationService.notificationsList;
|
||||||
|
|
||||||
|
Future getNotifications(
|
||||||
|
GetNotificationsRequestModel getNotificationsRequestModel, BuildContext context) async {
|
||||||
|
if(getNotificationsRequestModel.currentPage == 0)
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
|
||||||
|
await _notificationService
|
||||||
|
.getAllNotifications(getNotificationsRequestModel);
|
||||||
|
if (_notificationService.hasError) {
|
||||||
|
error = _notificationService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else {
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future markAsRead(id) async {
|
||||||
|
// setState(ViewState.Busy);
|
||||||
|
MarkMessageAsReadRequestModel markMessageAsReadRequestModel =
|
||||||
|
new MarkMessageAsReadRequestModel(notificationPoolID: id);
|
||||||
|
await _notificationService.markAsRead(markMessageAsReadRequestModel);
|
||||||
|
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,12 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
|
class ToDoCountProviderModel with ChangeNotifier {
|
||||||
|
int _count;
|
||||||
|
|
||||||
|
int get count => _count == null ? 0 : _count;
|
||||||
|
|
||||||
|
void setState(int count) {
|
||||||
|
_count = count;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||