Merge branch 'master' into pharmacy
# Conflicts: # lib/config/config.dart # lib/widgets/others/app_scaffold_widget.dartmerge-update-with-lab-changes
@ -1,36 +1,11 @@
|
||||
package com.cloud.diplomaticquarterapp
|
||||
import android.content.ContentResolver
|
||||
import android.content.Context
|
||||
import android.media.RingtoneManager
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
import io.flutter.embedding.engine.FlutterEngine
|
||||
import io.flutter.plugin.common.MethodCall
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import io.flutter.plugins.GeneratedPluginRegistrant
|
||||
import androidx.annotation.NonNull;
|
||||
import io.flutter.embedding.android.FlutterFragmentActivity
|
||||
import io.flutter.embedding.engine.FlutterEngine
|
||||
import io.flutter.plugins.GeneratedPluginRegistrant
|
||||
|
||||
class MainActivity : FlutterActivity() {
|
||||
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
||||
GeneratedPluginRegistrant.registerWith(flutterEngine)
|
||||
MethodChannel(flutterEngine.dartExecutor, "crossingthestreams.io/resourceResolver").setMethodCallHandler { call: MethodCall, result: MethodChannel.Result ->
|
||||
if ("drawableToUri" == call.method) {
|
||||
val resourceId = this@MainActivity.resources.getIdentifier(call.arguments as String, "drawable", this@MainActivity.packageName)
|
||||
result.success(resourceToUriString(this@MainActivity.applicationContext, resourceId))
|
||||
}
|
||||
if ("getAlarmUri" == call.method) {
|
||||
result.success(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM).toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private fun resourceToUriString(context: Context, resId: Int): String {
|
||||
return (ContentResolver.SCHEME_ANDROID_RESOURCE
|
||||
+ "://"
|
||||
+ context.resources.getResourcePackageName(resId)
|
||||
+ "/"
|
||||
+ context.resources.getResourceTypeName(resId)
|
||||
+ "/"
|
||||
+ context.resources.getResourceEntryName(resId))
|
||||
}
|
||||
}
|
||||
class MainActivity: FlutterFragmentActivity() {
|
||||
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
|
||||
GeneratedPluginRegistrant.registerWith(flutterEngine);
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 130 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 154 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
@ -0,0 +1,68 @@
|
||||
class CMCGetItemsRequestModel {
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
int checkupType;
|
||||
|
||||
CMCGetItemsRequestModel(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType,
|
||||
this.checkupType});
|
||||
|
||||
CMCGetItemsRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
checkupType = json['CheckupType'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['CheckupType'] = this.checkupType;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
class CMCGetItemsResponseModel {
|
||||
String itemDescription;
|
||||
String itemName;
|
||||
|
||||
CMCGetItemsResponseModel({this.itemDescription, this.itemName});
|
||||
|
||||
CMCGetItemsResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
itemDescription = json['ItemDescription'];
|
||||
itemName = json['ItemName'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ItemDescription'] = this.itemDescription;
|
||||
data['ItemName'] = this.itemName;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,135 @@
|
||||
class CMCInsertPresOrderRequestModel {
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
double latitude;
|
||||
double longitude;
|
||||
int createdBy;
|
||||
int orderServiceID;
|
||||
List<PatientERCMCInsertServicesList> patientERCMCInsertServicesList;
|
||||
|
||||
CMCInsertPresOrderRequestModel(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.createdBy,
|
||||
this.orderServiceID,
|
||||
this.patientERCMCInsertServicesList});
|
||||
|
||||
CMCInsertPresOrderRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
latitude = json['Latitude'];
|
||||
longitude = json['Longitude'];
|
||||
createdBy = json['CreatedBy'];
|
||||
orderServiceID = json['OrderServiceID'];
|
||||
if (json['PatientER_CMC_InsertServicesList'] != null) {
|
||||
patientERCMCInsertServicesList =
|
||||
new List<PatientERCMCInsertServicesList>();
|
||||
json['PatientER_CMC_InsertServicesList'].forEach((v) {
|
||||
patientERCMCInsertServicesList
|
||||
.add(new PatientERCMCInsertServicesList.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['OrderServiceID'] = this.orderServiceID;
|
||||
if (this.patientERCMCInsertServicesList != null) {
|
||||
data['PatientER_CMC_InsertServicesList'] =
|
||||
this.patientERCMCInsertServicesList.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class PatientERCMCInsertServicesList {
|
||||
int recordID;
|
||||
String serviceID;
|
||||
String selectedServiceName;
|
||||
String selectedServiceNameAR;
|
||||
dynamic price;
|
||||
dynamic vAT;
|
||||
dynamic totalPrice;
|
||||
|
||||
PatientERCMCInsertServicesList(
|
||||
{this.recordID,
|
||||
this.serviceID,
|
||||
this.selectedServiceName,
|
||||
this.selectedServiceNameAR,
|
||||
this.price,
|
||||
this.vAT,
|
||||
this.totalPrice});
|
||||
|
||||
PatientERCMCInsertServicesList.fromJson(Map<String, dynamic> json) {
|
||||
recordID = json['RecordID'];
|
||||
serviceID = json['ServiceID'];
|
||||
selectedServiceName = json['selectedServiceName'];
|
||||
selectedServiceNameAR = json['selectedServiceNameAR'];
|
||||
price = json['Price'];
|
||||
vAT = json['VAT'];
|
||||
totalPrice = json['TotalPrice'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['RecordID'] = this.recordID;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
data['selectedServiceName'] = this.selectedServiceName;
|
||||
data['selectedServiceNameAR'] = this.selectedServiceNameAR;
|
||||
data['Price'] = this.price;
|
||||
data['VAT'] = this.vAT;
|
||||
data['TotalPrice'] = this.totalPrice;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
class GetCMCServicesRequestModel {
|
||||
int channel;
|
||||
int deviceTypeID;
|
||||
int genderID;
|
||||
String generalid;
|
||||
String identificationNo;
|
||||
String iPAdress;
|
||||
bool isDentalAllowedBackend;
|
||||
int languageID;
|
||||
int patientID;
|
||||
int patientOutSA;
|
||||
int patientType;
|
||||
int patientTypeID;
|
||||
String sessionID;
|
||||
String tokenID;
|
||||
double versionID;
|
||||
|
||||
GetCMCServicesRequestModel(
|
||||
{this.channel,
|
||||
this.deviceTypeID,
|
||||
this.genderID,
|
||||
this.generalid,
|
||||
this.identificationNo,
|
||||
this.iPAdress,
|
||||
this.isDentalAllowedBackend,
|
||||
this.languageID,
|
||||
this.patientID,
|
||||
this.patientOutSA,
|
||||
this.patientType,
|
||||
this.patientTypeID,
|
||||
this.sessionID,
|
||||
this.tokenID,
|
||||
this.versionID});
|
||||
|
||||
GetCMCServicesRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
channel = json['Channel'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
genderID = json['GenderID'];
|
||||
generalid = json['generalid'];
|
||||
identificationNo = json['IdentificationNo'];
|
||||
iPAdress = json['IPAdress'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
languageID = json['LanguageID'];
|
||||
patientID = json['PatientID'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
patientType = json['PatientType'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
sessionID = json['SessionID'];
|
||||
tokenID = json['TokenID'];
|
||||
versionID = json['VersionID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['Channel'] = this.channel;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['GenderID'] = this.genderID;
|
||||
data['generalid'] = this.generalid;
|
||||
data['IdentificationNo'] = this.identificationNo;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['VersionID'] = this.versionID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
class GetCMCServicesResponseModel {
|
||||
String description;
|
||||
String descriptionN;
|
||||
int iD;
|
||||
bool isActive;
|
||||
dynamic price;
|
||||
int serviceID;
|
||||
dynamic totalPrice;
|
||||
dynamic vAT;
|
||||
|
||||
GetCMCServicesResponseModel(
|
||||
{this.description,
|
||||
this.descriptionN,
|
||||
this.iD,
|
||||
this.isActive,
|
||||
this.price,
|
||||
this.serviceID,
|
||||
this.totalPrice,
|
||||
this.vAT});
|
||||
|
||||
GetCMCServicesResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
description = json['Description'];
|
||||
descriptionN = json['DescriptionN'];
|
||||
iD = json['ID'];
|
||||
isActive = json['IsActive'];
|
||||
price = json['Price'];
|
||||
serviceID = json['ServiceID'];
|
||||
totalPrice = json['TotalPrice'];
|
||||
vAT = json['VAT'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['Description'] = this.description;
|
||||
data['DescriptionN'] = this.descriptionN;
|
||||
data['ID'] = this.iD;
|
||||
data['IsActive'] = this.isActive;
|
||||
data['Price'] = this.price;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
data['TotalPrice'] = this.totalPrice;
|
||||
data['VAT'] = this.vAT;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
class HHCGetAllServicesRequestModel {
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
|
||||
HHCGetAllServicesRequestModel(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType});
|
||||
|
||||
HHCGetAllServicesRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
class HHCGetAllServicesResponseModel {
|
||||
int iD;
|
||||
int serviceID;
|
||||
String description;
|
||||
String descriptionN;
|
||||
bool isActive;
|
||||
|
||||
HHCGetAllServicesResponseModel(
|
||||
{this.iD,
|
||||
this.serviceID,
|
||||
this.description,
|
||||
this.descriptionN,
|
||||
this.isActive});
|
||||
|
||||
HHCGetAllServicesResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
serviceID = json['ServiceID'];
|
||||
description = json['Description'];
|
||||
descriptionN = json['DescriptionN'];
|
||||
isActive = json['IsActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ID'] = this.iD;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
data['Description'] = this.description;
|
||||
data['DescriptionN'] = this.descriptionN;
|
||||
data['IsActive'] = this.isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
|
||||
class PatientERHHCInsertServicesList {
|
||||
int recordID;
|
||||
int serviceID;
|
||||
String serviceName;
|
||||
|
||||
PatientERHHCInsertServicesList(
|
||||
{this.recordID, this.serviceID, this.serviceName});
|
||||
|
||||
PatientERHHCInsertServicesList.fromJson(Map<String, dynamic> json) {
|
||||
recordID = json['RecordID'];
|
||||
serviceID = json['ServiceID'];
|
||||
serviceName = json['ServiceName'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['RecordID'] = this.recordID;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
data['ServiceName'] = this.serviceName;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
class GetHHCAllPresOrdersRequestModel {
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
|
||||
GetHHCAllPresOrdersRequestModel(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType});
|
||||
|
||||
GetHHCAllPresOrdersRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,132 @@
|
||||
class GetHHCAllPresOrdersResponseModel {
|
||||
int iD;
|
||||
String patientID;
|
||||
bool patientOutSA;
|
||||
bool isOutPatient;
|
||||
int projectID;
|
||||
int nearestProjectID;
|
||||
double longitude;
|
||||
double latitude;
|
||||
String appointmentNo;
|
||||
String dischargeID;
|
||||
int lineItemNo;
|
||||
int status;
|
||||
String description;
|
||||
String descriptionN;
|
||||
String createdOn;
|
||||
int serviceID;
|
||||
int createdBy;
|
||||
String editedOn;
|
||||
int editedBy;
|
||||
int channel;
|
||||
dynamic clientRequestID;
|
||||
bool returnedToQueue;
|
||||
dynamic pickupDateTime;
|
||||
dynamic pickupLocationName;
|
||||
dynamic dropoffLocationName;
|
||||
int realRRTHaveTransactions;
|
||||
String nearestProjectDescription;
|
||||
String nearestProjectDescriptionN;
|
||||
String projectDescription;
|
||||
String projectDescriptionN;
|
||||
|
||||
GetHHCAllPresOrdersResponseModel(
|
||||
{this.iD,
|
||||
this.patientID,
|
||||
this.patientOutSA,
|
||||
this.isOutPatient,
|
||||
this.projectID,
|
||||
this.nearestProjectID,
|
||||
this.longitude,
|
||||
this.latitude,
|
||||
this.appointmentNo,
|
||||
this.dischargeID,
|
||||
this.lineItemNo,
|
||||
this.status,
|
||||
this.description,
|
||||
this.descriptionN,
|
||||
this.createdOn,
|
||||
this.serviceID,
|
||||
this.createdBy,
|
||||
this.editedOn,
|
||||
this.editedBy,
|
||||
this.channel,
|
||||
this.clientRequestID,
|
||||
this.returnedToQueue,
|
||||
this.pickupDateTime,
|
||||
this.pickupLocationName,
|
||||
this.dropoffLocationName,
|
||||
this.realRRTHaveTransactions,
|
||||
this.nearestProjectDescription,
|
||||
this.nearestProjectDescriptionN,
|
||||
this.projectDescription,
|
||||
this.projectDescriptionN});
|
||||
|
||||
GetHHCAllPresOrdersResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
patientID = json['PatientID'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
isOutPatient = json['IsOutPatient'];
|
||||
projectID = json['ProjectID'];
|
||||
nearestProjectID = json['NearestProjectID'];
|
||||
longitude = json['Longitude'];
|
||||
latitude = json['Latitude'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
dischargeID = json['DischargeID'];
|
||||
lineItemNo = json['LineItemNo'];
|
||||
status = json['Status'];
|
||||
description = json['Description'];
|
||||
descriptionN = json['DescriptionN'];
|
||||
createdOn = json['CreatedOn'];
|
||||
serviceID = json['ServiceID'];
|
||||
createdBy = json['CreatedBy'];
|
||||
editedOn = json['EditedOn'];
|
||||
editedBy = json['EditedBy'];
|
||||
channel = json['Channel'];
|
||||
clientRequestID = json['ClientRequestID'];
|
||||
returnedToQueue = json['ReturnedToQueue'];
|
||||
pickupDateTime = json['PickupDateTime'];
|
||||
pickupLocationName = json['PickupLocationName'];
|
||||
dropoffLocationName = json['DropoffLocationName'];
|
||||
realRRTHaveTransactions = json['RealRRT_HaveTransactions'];
|
||||
nearestProjectDescription = json['NearestProjectDescription'];
|
||||
nearestProjectDescriptionN = json['NearestProjectDescriptionN'];
|
||||
projectDescription = json['ProjectDescription'];
|
||||
projectDescriptionN = json['ProjectDescriptionN'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ID'] = this.iD;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['IsOutPatient'] = this.isOutPatient;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['NearestProjectID'] = this.nearestProjectID;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
data['DischargeID'] = this.dischargeID;
|
||||
data['LineItemNo'] = this.lineItemNo;
|
||||
data['Status'] = this.status;
|
||||
data['Description'] = this.description;
|
||||
data['DescriptionN'] = this.descriptionN;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['EditedOn'] = this.editedOn;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
data['Channel'] = this.channel;
|
||||
data['ClientRequestID'] = this.clientRequestID;
|
||||
data['ReturnedToQueue'] = this.returnedToQueue;
|
||||
data['PickupDateTime'] = this.pickupDateTime;
|
||||
data['PickupLocationName'] = this.pickupLocationName;
|
||||
data['DropoffLocationName'] = this.dropoffLocationName;
|
||||
data['RealRRT_HaveTransactions'] = this.realRRTHaveTransactions;
|
||||
data['NearestProjectDescription'] = this.nearestProjectDescription;
|
||||
data['NearestProjectDescriptionN'] = this.nearestProjectDescriptionN;
|
||||
data['ProjectDescription'] = this.projectDescription;
|
||||
data['ProjectDescriptionN'] = this.projectDescriptionN;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
class GetOrderDetailByOrderIDRequestModel {
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
int presOrderID;
|
||||
|
||||
GetOrderDetailByOrderIDRequestModel(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType,
|
||||
this.presOrderID});
|
||||
|
||||
GetOrderDetailByOrderIDRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
presOrderID = json['PresOrderID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['PresOrderID'] = this.presOrderID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
class GetOrderDetailByOrderIDResponseModel {
|
||||
int iD;
|
||||
int presOrderID;
|
||||
int hHCServiceID;
|
||||
int createdBy;
|
||||
String createdOn;
|
||||
int editedBy;
|
||||
String editedOn;
|
||||
bool isActive;
|
||||
String description;
|
||||
String descriptionN;
|
||||
|
||||
GetOrderDetailByOrderIDResponseModel(
|
||||
{this.iD,
|
||||
this.presOrderID,
|
||||
this.hHCServiceID,
|
||||
this.createdBy,
|
||||
this.createdOn,
|
||||
this.editedBy,
|
||||
this.editedOn,
|
||||
this.isActive,
|
||||
this.description,
|
||||
this.descriptionN});
|
||||
|
||||
GetOrderDetailByOrderIDResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
presOrderID = json['PresOrderID'];
|
||||
hHCServiceID = json['HHC_ServiceID'];
|
||||
createdBy = json['CreatedBy'];
|
||||
createdOn = json['CreatedOn'];
|
||||
editedBy = json['EditedBy'];
|
||||
editedOn = json['EditedOn'];
|
||||
isActive = json['IsActive'];
|
||||
description = json['Description'];
|
||||
descriptionN = json['DescriptionN'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ID'] = this.iD;
|
||||
data['PresOrderID'] = this.presOrderID;
|
||||
data['HHC_ServiceID'] = this.hHCServiceID;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
data['EditedOn'] = this.editedOn;
|
||||
data['IsActive'] = this.isActive;
|
||||
data['Description'] = this.description;
|
||||
data['DescriptionN'] = this.descriptionN;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
import 'PatientERHHCInsertServicesList.dart';
|
||||
|
||||
class PatientERInsertPresOrderRequestModel {
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
double latitude;
|
||||
double longitude;
|
||||
int createdBy;
|
||||
int orderServiceID;
|
||||
List<PatientERHHCInsertServicesList> patientERHHCInsertServicesList = List();
|
||||
|
||||
PatientERInsertPresOrderRequestModel(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.createdBy,
|
||||
this.orderServiceID,
|
||||
this.patientERHHCInsertServicesList
|
||||
});
|
||||
|
||||
PatientERInsertPresOrderRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
latitude = json['Latitude'];
|
||||
longitude = json['Longitude'];
|
||||
createdBy = json['CreatedBy'];
|
||||
orderServiceID = json['OrderServiceID'];
|
||||
if (json['PatientER_HHC_InsertServicesList'] != null) {
|
||||
patientERHHCInsertServicesList =
|
||||
new List<PatientERHHCInsertServicesList>();
|
||||
json['PatientER_HHC_InsertServicesList'].forEach((v) {
|
||||
patientERHHCInsertServicesList
|
||||
.add(new PatientERHHCInsertServicesList.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['OrderServiceID'] = this.orderServiceID;
|
||||
if (this.patientERHHCInsertServicesList != null) {
|
||||
data['PatientER_HHC_InsertServicesList'] =
|
||||
this.patientERHHCInsertServicesList.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
class UpdatePresOrderRequestModel {
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
int presOrderID;
|
||||
int presOrderStatus;
|
||||
int editedBy;
|
||||
String rejectionReason;
|
||||
|
||||
UpdatePresOrderRequestModel(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType,
|
||||
this.presOrderID,
|
||||
this.presOrderStatus,
|
||||
this.editedBy,
|
||||
this.rejectionReason});
|
||||
|
||||
UpdatePresOrderRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
presOrderID = json['PresOrderID'];
|
||||
presOrderStatus = json['PresOrderStatus'];
|
||||
editedBy = json['EditedBy'];
|
||||
rejectionReason = json['RejectionReason'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['PresOrderID'] = this.presOrderID;
|
||||
data['PresOrderStatus'] = this.presOrderStatus;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
data['RejectionReason'] = this.rejectionReason;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,115 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_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/update_pres_oreder_request_model.dart';
|
||||
|
||||
import '../base_service.dart';
|
||||
|
||||
class CMCService extends BaseService {
|
||||
List<GetCMCServicesResponseModel> cmcAllServicesList = List();
|
||||
List<GetHHCAllPresOrdersResponseModel> cmcAllPresOrdersList = List();
|
||||
|
||||
List<GetOrderDetailByOrderIDResponseModel> cmcAllOrderDetail = List();
|
||||
List<CMCGetItemsResponseModel> checkupItemsList = List();
|
||||
|
||||
bool isOrderUpdated;
|
||||
|
||||
Future getCMCAllServices() async {
|
||||
|
||||
|
||||
GetCMCServicesRequestModel getCMCServicesRequestModel= new GetCMCServicesRequestModel(genderID: user.gender, identificationNo: user.patientIdentificationNo);
|
||||
hasError = false;
|
||||
await baseAppClient.post(HHC_GET_ALL_CMC_SERVICES,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
cmcAllServicesList.clear();
|
||||
response['PatientER_CMC_GetAllServicesList'].forEach((data) {
|
||||
cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: getCMCServicesRequestModel.toJson());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Future getCmcAllPresOrders() async {
|
||||
|
||||
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel= GetHHCAllPresOrdersRequestModel();
|
||||
hasError = false;
|
||||
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
cmcAllPresOrdersList.clear();
|
||||
response['PatientER_GetPatientAllPresOrdersList'].forEach((data) {
|
||||
if (data['ServiceID'] == 3)
|
||||
cmcAllPresOrdersList
|
||||
.add(GetHHCAllPresOrdersResponseModel.fromJson(data));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: getHHCAllPresOrdersRequestModel.toJson());
|
||||
}
|
||||
|
||||
Future getOrderDetailByOrderID(GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel) async {
|
||||
|
||||
hasError = false;
|
||||
await baseAppClient.post(GET_CMC_ORDER_DETAIL_BY_ID,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
cmcAllOrderDetail.clear();
|
||||
response['PatientER_CMC_GetTransactionsForOrderList'].forEach((data) {
|
||||
cmcAllOrderDetail.add(GetOrderDetailByOrderIDResponseModel.fromJson(data));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: getOrderDetailByOrderIDRequestModel.toJson());
|
||||
}
|
||||
|
||||
|
||||
Future getCheckupItems(CMCGetItemsRequestModel cMCGetItemsRequestModel) async {
|
||||
|
||||
hasError = false;
|
||||
await baseAppClient.post(GET_CHECK_UP_ITEMS,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
checkupItemsList.clear();
|
||||
response['GetCheckUpItemsList'].forEach((data) {
|
||||
checkupItemsList.add(CMCGetItemsResponseModel.fromJson(data));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: cMCGetItemsRequestModel.toJson());
|
||||
}
|
||||
|
||||
Future updateCmcPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
|
||||
|
||||
hasError = false;
|
||||
await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
isOrderUpdated = true;
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: updatePresOrderRequestModel.toJson());
|
||||
}
|
||||
|
||||
Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
|
||||
|
||||
hasError = false;
|
||||
await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
isOrderUpdated = true;
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: order.toJson());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
import 'package:diplomaticquarterapp/config/config.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 '../base_service.dart';
|
||||
|
||||
class HomeHealthCareService extends BaseService {
|
||||
List<HHCGetAllServicesResponseModel> hhcAllServicesList = List();
|
||||
List<GetHHCAllPresOrdersResponseModel> hhcAllPresOrdersList = List();
|
||||
|
||||
List<GetOrderDetailByOrderIDResponseModel> hhcAllOrderDetail = List();
|
||||
|
||||
bool isOrderUpdated;
|
||||
|
||||
Future getHHCAllServices(
|
||||
HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async {
|
||||
hasError = false;
|
||||
await baseAppClient.post(HHC_GET_ALL_SERVICES,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
hhcAllServicesList.clear();
|
||||
response['PatientER_HHC_GetAllServicesList'].forEach((data) {
|
||||
hhcAllServicesList.add(HHCGetAllServicesResponseModel.fromJson(data));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: hHCGetAllServicesRequestModel.toJson());
|
||||
}
|
||||
|
||||
Future getHHCAllPresOrders() async {
|
||||
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel =
|
||||
GetHHCAllPresOrdersRequestModel();
|
||||
hasError = false;
|
||||
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
hhcAllPresOrdersList.clear();
|
||||
response['PatientER_GetPatientAllPresOrdersList'].forEach((data) {
|
||||
if (data['ServiceID'] == 2)
|
||||
hhcAllPresOrdersList
|
||||
.add(GetHHCAllPresOrdersResponseModel.fromJson(data));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: getHHCAllPresOrdersRequestModel.toJson());
|
||||
}
|
||||
|
||||
Future getOrderDetailByOrderID(int presOrderID) async {
|
||||
hasError = false;
|
||||
Map<String, dynamic> body = Map();
|
||||
body['PresOrderID'] = presOrderID;
|
||||
body['isDentalAllowedBackend'] = false;
|
||||
await baseAppClient.post(GET_ORDER_DETAIL_BY_ID,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
hhcAllOrderDetail.clear();
|
||||
response['PatientER_HHC_GetTransactionsForOrderList'].forEach((data) {
|
||||
hhcAllOrderDetail
|
||||
.add(GetOrderDetailByOrderIDResponseModel.fromJson(data));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: body);
|
||||
}
|
||||
|
||||
Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
|
||||
hasError = false;
|
||||
await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
isOrderUpdated = true;
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: updatePresOrderRequestModel.toJson());
|
||||
}
|
||||
|
||||
Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async {
|
||||
hasError = false;
|
||||
await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: order.toJson());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,110 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_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/update_pres_oreder_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/cmc_service.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||
|
||||
import '../../../locator.dart';
|
||||
|
||||
class CMCViewModel extends BaseViewModel {
|
||||
CMCService _cMCService =
|
||||
locator<CMCService>();
|
||||
|
||||
List<GetCMCServicesResponseModel> get cmcAllServicesList =>
|
||||
|
||||
_cMCService.cmcAllServicesList;
|
||||
|
||||
List<GetHHCAllPresOrdersResponseModel> get cmcAllPresOrders =>
|
||||
_cMCService.cmcAllPresOrdersList;
|
||||
|
||||
List<GetOrderDetailByOrderIDResponseModel> get cmcAllOrderDetail =>
|
||||
_cMCService.cmcAllOrderDetail;
|
||||
List<CMCGetItemsResponseModel> get checkupItems =>
|
||||
_cMCService.checkupItemsList;
|
||||
|
||||
bool get isOrderUpdated => _cMCService.isOrderUpdated;
|
||||
|
||||
Future getCMCAllServices() async {
|
||||
await _cMCService
|
||||
.getCMCAllServices();
|
||||
CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: cmcAllServicesList[0].iD);
|
||||
|
||||
await getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel,isFirst: true);
|
||||
if (_cMCService.hasError) {
|
||||
error = _cMCService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
Future getCheckupItems({CMCGetItemsRequestModel cMCGetItemsRequestModel, bool isFirst = false}) async {
|
||||
if(!isFirst)
|
||||
setState(ViewState.Busy);
|
||||
await _cMCService.getCheckupItems(cMCGetItemsRequestModel);
|
||||
if (_cMCService.hasError) {
|
||||
error = _cMCService.error;
|
||||
setState(ViewState.Error);
|
||||
}
|
||||
if(!isFirst)
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
|
||||
Future getCmcAllPresOrders() async {
|
||||
setState(ViewState.Busy);
|
||||
await _cMCService.getCmcAllPresOrders();
|
||||
if (_cMCService.hasError) {
|
||||
error = _cMCService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
var pendingOrder = _cMCService.cmcAllPresOrdersList.firstWhere(
|
||||
(element) => element.status == 1 || element.status == 2,
|
||||
orElse: () => null);
|
||||
if (pendingOrder != null) {
|
||||
await getOrderDetailByOrderID(pendingOrder);
|
||||
setState(ViewState.Idle);
|
||||
} else {
|
||||
getCMCAllServices();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future updateCmcPresOrder(
|
||||
UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
|
||||
setState(ViewState.BusyLocal);
|
||||
await _cMCService.updateCmcPresOrder(
|
||||
updatePresOrderRequestModel);
|
||||
if (_cMCService.hasError) {
|
||||
error = _cMCService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
Future getOrderDetailByOrderID(GetHHCAllPresOrdersResponseModel order) async {
|
||||
GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel =
|
||||
GetOrderDetailByOrderIDRequestModel(presOrderID: order.iD);
|
||||
await _cMCService
|
||||
.getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel);
|
||||
}
|
||||
//TODO check it in uat
|
||||
Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
|
||||
setState(ViewState.Busy);
|
||||
order.createdBy = user.patientID;
|
||||
order.orderServiceID = OrderService.Comprehensive_Medical_Checkup.getIdOrderService();
|
||||
await _cMCService.insertPresPresOrder(order: order);
|
||||
if (_cMCService.hasError) {
|
||||
error = _cMCService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else {
|
||||
getCmcAllPresOrders();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.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/PatientERHHCInsertServicesList.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/service/AlHabibMedicalService/home_health_care_service.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||
|
||||
import '../../../locator.dart';
|
||||
|
||||
class HomeHealthCareViewModel extends BaseViewModel {
|
||||
HomeHealthCareService _homeHealthCareService =
|
||||
locator<HomeHealthCareService>();
|
||||
|
||||
List<HHCGetAllServicesResponseModel> get hhcAllServicesList =>
|
||||
_homeHealthCareService.hhcAllServicesList;
|
||||
|
||||
List<GetHHCAllPresOrdersResponseModel> get hhcAllPresOrders =>
|
||||
_homeHealthCareService.hhcAllPresOrdersList;
|
||||
|
||||
List<GetOrderDetailByOrderIDResponseModel> get hhcAllOrderDetail =>
|
||||
_homeHealthCareService.hhcAllOrderDetail;
|
||||
|
||||
bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated;
|
||||
|
||||
GetHHCAllPresOrdersResponseModel pendingOrder;
|
||||
|
||||
List<PatientERHHCInsertServicesList> patientERHHCInsertServicesList = List();
|
||||
|
||||
Future getHHCAllServices() async {
|
||||
HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel =
|
||||
new HHCGetAllServicesRequestModel();
|
||||
//setState(ViewState.Busy);
|
||||
await _homeHealthCareService
|
||||
.getHHCAllServices(hHCGetAllServicesRequestModel);
|
||||
if (_homeHealthCareService.hasError) {
|
||||
error = _homeHealthCareService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
Future getHHCAllPresOrders() async {
|
||||
pendingOrder = null;
|
||||
setState(ViewState.Busy);
|
||||
await _homeHealthCareService.getHHCAllPresOrders();
|
||||
if (_homeHealthCareService.hasError) {
|
||||
error = _homeHealthCareService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
pendingOrder = _homeHealthCareService.hhcAllPresOrdersList
|
||||
.firstWhere((element) => element.status == 1 || element.status == 2,
|
||||
orElse: () => null);
|
||||
if (pendingOrder != null) {
|
||||
await _homeHealthCareService.getOrderDetailByOrderID(pendingOrder.iD);
|
||||
setState(ViewState.Idle);
|
||||
} else {
|
||||
getHHCAllServices();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
|
||||
setState(ViewState.Busy);
|
||||
await _homeHealthCareService.updateHHCPresOrder(
|
||||
updatePresOrderRequestModel);
|
||||
if (_homeHealthCareService.hasError) {
|
||||
error = _homeHealthCareService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async {
|
||||
setState(ViewState.Busy);
|
||||
order.createdBy = user.patientID;
|
||||
order.orderServiceID = OrderService.HOME_HEALTH_CARE.getIdOrderService();
|
||||
await _homeHealthCareService.insertPresPresOrder(order: order);
|
||||
if (_homeHealthCareService.hasError) {
|
||||
error = _homeHealthCareService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else {
|
||||
getHHCAllPresOrders();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
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/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 ConfirmCancelOrderDialog extends StatefulWidget {
|
||||
final CMCViewModel model;
|
||||
final Function onTap;
|
||||
|
||||
|
||||
ConfirmCancelOrderDialog(
|
||||
{Key key, this.model, this.onTap});
|
||||
|
||||
@override
|
||||
_ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState();
|
||||
}
|
||||
|
||||
class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
|
||||
title: Center(
|
||||
child: Texts(
|
||||
"Confirm",
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Divider(),
|
||||
Center(
|
||||
child: Texts(
|
||||
"Are you sure!! want to cancel this order",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
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: () async{
|
||||
widget.onTap();
|
||||
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,346 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_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/update_pres_oreder_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
|
||||
import 'new_cmc_step_one_page.dart';
|
||||
import 'new_cmc_step_three_page.dart';
|
||||
import 'new_cmc_step_tow_page.dart';
|
||||
|
||||
class NewCMCPage extends StatefulWidget {
|
||||
NewCMCPage({this.model});
|
||||
|
||||
final CMCViewModel model;
|
||||
|
||||
@override
|
||||
_NewCMCPageState createState() =>
|
||||
_NewCMCPageState();
|
||||
}
|
||||
|
||||
class _NewCMCPageState extends State<NewCMCPage>
|
||||
with TickerProviderStateMixin {
|
||||
PageController _controller;
|
||||
int _currentIndex = 1;
|
||||
|
||||
double _latitude;
|
||||
double _longitude;
|
||||
|
||||
CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
PatientERCMCInsertServicesList patientERCMCInsertServicesList;
|
||||
if (widget.model.cmcAllServicesList.length > 0) {
|
||||
patientERCMCInsertServicesList = new PatientERCMCInsertServicesList(
|
||||
price: widget.model.cmcAllServicesList[0].price,
|
||||
serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(),
|
||||
selectedServiceName: widget.model.cmcAllServicesList[0].description,
|
||||
selectedServiceNameAR: widget.model.cmcAllServicesList[0].description,
|
||||
recordID: 1,
|
||||
totalPrice: widget.model.cmcAllServicesList[0].totalPrice,
|
||||
vAT: widget.model.cmcAllServicesList[0].vAT);
|
||||
cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(
|
||||
patientERCMCInsertServicesList: [patientERCMCInsertServicesList]);
|
||||
}
|
||||
|
||||
cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(
|
||||
patientERCMCInsertServicesList: patientERCMCInsertServicesList != null
|
||||
? [patientERCMCInsertServicesList]
|
||||
: []);
|
||||
|
||||
_controller = new PageController();
|
||||
|
||||
_getCurrentLocation();
|
||||
}
|
||||
|
||||
_getCurrentLocation() async {
|
||||
await getLastKnownPosition().then((value) {
|
||||
_latitude = value.latitude;
|
||||
_longitude = value.longitude;
|
||||
}).catchError((e) {
|
||||
_longitude = 0;
|
||||
_latitude = 0;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
changePageViewIndex(pageIndex) {
|
||||
_controller.jumpToPage(pageIndex);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
void showConfirmMessage(
|
||||
CMCViewModel model, GetOrderDetailByOrderIDResponseModel order) {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: ConfirmCancelOrderDialog(
|
||||
model: model,
|
||||
onTap: () async {
|
||||
UpdatePresOrderRequestModel updatePresOrderRequestModel =
|
||||
UpdatePresOrderRequestModel(
|
||||
presOrderID: order.presOrderID,
|
||||
rejectionReason: "",
|
||||
presOrderStatus: 4, editedBy: 3);
|
||||
await model.updateCmcPresOrder(updatePresOrderRequestModel);
|
||||
if (model.state == ViewState.ErrorLocal) {
|
||||
Utils.showErrorToast(model.error);
|
||||
} else {
|
||||
AppToast.showSuccessToast(message: "Done Successfully");
|
||||
await model.getCmcAllPresOrders();
|
||||
}
|
||||
},
|
||||
));
|
||||
}
|
||||
return Scaffold(
|
||||
body: SafeArea(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.8,
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05),
|
||||
child: StepsWidget(
|
||||
index: _currentIndex,
|
||||
changeCurrentTab: changePageViewIndex,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: PageView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
controller: _controller,
|
||||
onPageChanged: (index) {
|
||||
setState(() {
|
||||
_currentIndex = index;
|
||||
});
|
||||
},
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
widget.model.cmcAllOrderDetail.length != 0
|
||||
? FractionallySizedBox(
|
||||
heightFactor: 0.8,
|
||||
widthFactor: 0.9,
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border:
|
||||
Border.all(color: Colors.grey, width: 1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Request ID",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
widget.model.cmcAllOrderDetail[0].iD.toString(),
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Status",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
"Pending",
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Pickup Date",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
DateUtil.getDayMonthYearDateFormatted(
|
||||
DateUtil.convertStringToDate(
|
||||
widget.model.cmcAllOrderDetail[0]
|
||||
.createdOn)),
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Service Name",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
widget.model.cmcAllOrderDetail[0].description
|
||||
.toString() ??
|
||||
widget.model.cmcAllOrderDetail[0]
|
||||
.descriptionN
|
||||
.toString(),
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Center(
|
||||
child: Container(
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width *
|
||||
0.85,
|
||||
child: SecondaryButton(
|
||||
label: "Cancel".toUpperCase(),
|
||||
onTap: () {
|
||||
showConfirmMessage(widget.model,
|
||||
widget.model.cmcAllOrderDetail[0]);
|
||||
}
|
||||
,
|
||||
color: Colors.red[800],
|
||||
disabled: false,
|
||||
textColor: Theme
|
||||
.of(context)
|
||||
.backgroundColor),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: NewCMCStepOnePage(
|
||||
changePageViewIndex: changePageViewIndex,
|
||||
cMCInsertPresOrderRequestModel:
|
||||
cMCInsertPresOrderRequestModel,
|
||||
model: widget.model,
|
||||
),
|
||||
NewCMCStepTowPage(
|
||||
longitude: _longitude,
|
||||
latitude: _latitude,
|
||||
changePageViewIndex: changePageViewIndex,
|
||||
cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel,
|
||||
model: widget.model,
|
||||
), NewCMCStepThreePage(
|
||||
changePageViewIndex: changePageViewIndex,
|
||||
cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel,
|
||||
model: widget.model,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,231 @@
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.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:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class NewCMCStepOnePage extends StatefulWidget {
|
||||
final CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel;
|
||||
final Function changePageViewIndex;
|
||||
final CMCViewModel model;
|
||||
|
||||
const NewCMCStepOnePage(
|
||||
{Key key,
|
||||
this.cMCInsertPresOrderRequestModel,
|
||||
this.model,
|
||||
this.changePageViewIndex})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_NewCMCStepOnePageState createState() => _NewCMCStepOnePageState();
|
||||
}
|
||||
|
||||
class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowAppBar: false,
|
||||
baseViewModel: widget.model,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
FractionallySizedBox(
|
||||
widthFactor: 0.94,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Texts(
|
||||
"Select Home Health Care Services",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Column(
|
||||
children:
|
||||
widget.model.cmcAllServicesList.map((service) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border:
|
||||
Border.all(color: Colors.grey, width: 1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: service.serviceID,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (newValue) async {
|
||||
PatientERCMCInsertServicesList
|
||||
patientERCMCInsertServicesList =
|
||||
new PatientERCMCInsertServicesList(
|
||||
price: service.price,
|
||||
serviceID: service.serviceID
|
||||
.toString(),
|
||||
selectedServiceName:
|
||||
service.description,
|
||||
selectedServiceNameAR:
|
||||
service.description,
|
||||
recordID: 1,
|
||||
totalPrice:
|
||||
service.totalPrice,
|
||||
vAT: service.vAT);
|
||||
setState(() {
|
||||
widget
|
||||
.cMCInsertPresOrderRequestModel
|
||||
.patientERCMCInsertServicesList = [
|
||||
patientERCMCInsertServicesList
|
||||
];
|
||||
});
|
||||
CMCGetItemsRequestModel
|
||||
cMCGetItemsRequestModel =
|
||||
new CMCGetItemsRequestModel(
|
||||
checkupType: newValue);
|
||||
await widget.model.getCheckupItems(
|
||||
cMCGetItemsRequestModel:
|
||||
cMCGetItemsRequestModel);
|
||||
},
|
||||
groupValue: widget
|
||||
.cMCInsertPresOrderRequestModel
|
||||
.patientERCMCInsertServicesList
|
||||
.length >
|
||||
0
|
||||
? int.parse(widget
|
||||
.cMCInsertPresOrderRequestModel
|
||||
.patientERCMCInsertServicesList[
|
||||
0]
|
||||
.serviceID)
|
||||
: 1),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Texts(
|
||||
service.description,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: widget.model.checkupItems.map((item) {
|
||||
return Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 1,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
decoration: BoxDecoration(color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 5, top: 5),
|
||||
decoration: BoxDecoration(
|
||||
border: BorderDirectional(
|
||||
bottom: BorderSide(
|
||||
style: BorderStyle.solid,
|
||||
width: 0.5,
|
||||
color: Colors.grey)),
|
||||
//borderRadius: ,
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
item.itemName,
|
||||
fontSize: 15,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList()),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
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(
|
||||
label: "Next",
|
||||
textColor: Theme.of(context).backgroundColor,
|
||||
onTap: () {
|
||||
if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length = null) {
|
||||
int index = widget.model.cmcAllServicesList.length;
|
||||
PatientERCMCInsertServicesList
|
||||
patientERCMCInsertServicesList =
|
||||
new PatientERCMCInsertServicesList(
|
||||
price: widget.model.cmcAllServicesList[index-1].price,
|
||||
serviceID: widget.model.cmcAllServicesList[index-1].serviceID.toString(),
|
||||
selectedServiceName: widget.model.cmcAllServicesList[index-1].description,
|
||||
selectedServiceNameAR: widget.model.cmcAllServicesList[index-1].description,
|
||||
recordID: 1,
|
||||
totalPrice: widget.model.cmcAllServicesList[index-1].totalPrice,
|
||||
vAT: widget.model.cmcAllServicesList[index-1].vAT);
|
||||
|
||||
widget.cMCInsertPresOrderRequestModel
|
||||
.patientERCMCInsertServicesList = [
|
||||
patientERCMCInsertServicesList
|
||||
];
|
||||
|
||||
widget.changePageViewIndex(1);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,165 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_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/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
class NewCMCStepThreePage extends StatefulWidget {
|
||||
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
|
||||
final Function changePageViewIndex;
|
||||
final CMCViewModel model;
|
||||
|
||||
NewCMCStepThreePage(
|
||||
{Key key,
|
||||
this.changePageViewIndex,
|
||||
this.model,
|
||||
this.cmcInsertPresOrderRequestModel});
|
||||
|
||||
@override
|
||||
_NewCMCStepThreePageState createState() =>
|
||||
_NewCMCStepThreePageState();
|
||||
}
|
||||
|
||||
class _NewCMCStepThreePageState
|
||||
extends State<NewCMCStepThreePage> {
|
||||
Completer<GoogleMapController> _controller = Completer();
|
||||
|
||||
static CameraPosition _kGooglePlex = CameraPosition(
|
||||
target: LatLng(37.42796133580664, -122.085749655962),
|
||||
zoom: 14.4746,
|
||||
);
|
||||
final Set<Marker> markers = new Set();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
if (widget.cmcInsertPresOrderRequestModel.latitude != null) {
|
||||
markers.clear();
|
||||
markers.add(
|
||||
Marker(
|
||||
markerId: MarkerId(
|
||||
widget.cmcInsertPresOrderRequestModel.latitude.hashCode
|
||||
.toString(),
|
||||
),
|
||||
position: LatLng(
|
||||
widget.cmcInsertPresOrderRequestModel.latitude,
|
||||
widget.cmcInsertPresOrderRequestModel.longitude)),
|
||||
);
|
||||
_kGooglePlex = CameraPosition(
|
||||
target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude,
|
||||
widget.cmcInsertPresOrderRequestModel.longitude),
|
||||
zoom: 14.4746,
|
||||
);
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowDecPage: false,
|
||||
baseViewModel: widget.model,
|
||||
body: SingleChildScrollView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Container(
|
||||
height: 400,
|
||||
width: double.maxFinite,
|
||||
margin: EdgeInsets.only(left: 12, right: 12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts('Order Details'),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts('Location :'),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
height: 200,
|
||||
child: GoogleMap(
|
||||
mapType: MapType.normal,
|
||||
markers: markers,
|
||||
initialCameraPosition: _kGooglePlex,
|
||||
onMapCreated: (GoogleMapController controller) {
|
||||
_controller.complete(controller);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Texts('Selected Service :'),
|
||||
...List.generate(
|
||||
widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length,
|
||||
(index) => Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
'Service Name :',
|
||||
fontSize: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Texts(
|
||||
widget
|
||||
.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index]
|
||||
.selectedServiceName,
|
||||
fontSize: 15,
|
||||
bold: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
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(
|
||||
label: "Confirm",
|
||||
onTap: () async {
|
||||
await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel);
|
||||
if (widget.model.state != ViewState.ErrorLocal) {
|
||||
widget.changePageViewIndex(0);
|
||||
}
|
||||
},
|
||||
textColor: Theme.of(context).backgroundColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_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/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/close_back.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class NewCMCStepTowPage extends StatefulWidget {
|
||||
final Function(PickResult) onPick;
|
||||
final double latitude;
|
||||
final double longitude;
|
||||
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
|
||||
final Function changePageViewIndex;
|
||||
final CMCViewModel model;
|
||||
|
||||
const NewCMCStepTowPage(
|
||||
{Key key,
|
||||
this.onPick,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.cmcInsertPresOrderRequestModel,
|
||||
this.changePageViewIndex,
|
||||
this.model})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_NewCMCStepTowPageState createState() =>
|
||||
_NewCMCStepTowPageState();
|
||||
}
|
||||
|
||||
class _NewCMCStepTowPageState
|
||||
extends State<NewCMCStepTowPage> {
|
||||
double latitude = 0;
|
||||
double longitude = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
if (widget.cmcInsertPresOrderRequestModel.latitude == null) {
|
||||
latitude = widget.latitude;
|
||||
longitude = widget.longitude;
|
||||
} else {
|
||||
latitude = widget.cmcInsertPresOrderRequestModel.latitude;
|
||||
longitude = widget.cmcInsertPresOrderRequestModel.longitude;
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return AppScaffold(
|
||||
isShowDecPage: false,
|
||||
body: PlacePicker(
|
||||
apiKey: GOOGLE_API_KEY,
|
||||
enableMyLocationButton: true,
|
||||
automaticallyImplyAppBarLeading: false,
|
||||
autocompleteOnTrailingWhitespace: true,
|
||||
selectInitialPosition: true,
|
||||
autocompleteLanguage: projectViewModel.currentLanguage,
|
||||
enableMapTypeButton: true,
|
||||
onPlacePicked: (PickResult result) {
|
||||
print(result.adrAddress);
|
||||
widget.changePageViewIndex(3);
|
||||
},
|
||||
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: SecondaryButton(
|
||||
color: Colors.grey[800],
|
||||
textColor: Colors.white,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.cmcInsertPresOrderRequestModel
|
||||
.latitude =
|
||||
selectedPlace.geometry.location.lat;
|
||||
widget.cmcInsertPresOrderRequestModel
|
||||
.longitude =
|
||||
selectedPlace.geometry.location.lng;
|
||||
});
|
||||
widget.changePageViewIndex(3);
|
||||
},
|
||||
label: TranslationBase.of(context).next,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
initialPosition: LatLng(latitude, longitude),
|
||||
useCurrentLocation: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
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,130 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'NewCMC/new_cmc_page.dart';
|
||||
import 'orders_log_details_page.dart';
|
||||
|
||||
class CMCPage extends StatefulWidget {
|
||||
@override
|
||||
_CMCPageState createState() => _CMCPageState();
|
||||
}
|
||||
|
||||
class _CMCPageState extends State<CMCPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
TabController _tabController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: 2, vsync: this);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_tabController.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<CMCViewModel>(
|
||||
onModelReady: (model){
|
||||
model.getCmcAllPresOrders();
|
||||
},
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: TranslationBase.of(context).homeHealthCare,
|
||||
body: Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(65.0),
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
Positioned(
|
||||
bottom: 1,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
||||
child: Container(
|
||||
color: Theme.of(context)
|
||||
.scaffoldBackgroundColor
|
||||
.withOpacity(0.8),
|
||||
height: 70.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Container(
|
||||
height: 60.0,
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 0.7),
|
||||
),
|
||||
color: Colors.white),
|
||||
child: Center(
|
||||
child: TabBar(
|
||||
isScrollable: true,
|
||||
controller: _tabController,
|
||||
indicatorWeight: 5.0,
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
indicatorColor: Colors.red[800],
|
||||
labelColor: Theme.of(context).primaryColor,
|
||||
labelPadding:
|
||||
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
|
||||
unselectedLabelColor: Colors.grey[800],
|
||||
tabs: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.37,
|
||||
child: Center(
|
||||
child: Texts("CMC Service"),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.37,
|
||||
child: Center(
|
||||
child: Texts(TranslationBase.of(context).orderLog),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
controller: _tabController,
|
||||
children: <Widget>[
|
||||
NewCMCPage(
|
||||
model: model,
|
||||
),
|
||||
OrdersLogDetailsPage(
|
||||
model: model,
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,250 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils.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:flutter/material.dart';
|
||||
|
||||
import 'Dialog/confirm_cancel_order_dialog.dart';
|
||||
|
||||
class OrdersLogDetailsPage extends StatelessWidget {
|
||||
final CMCViewModel model;
|
||||
|
||||
const OrdersLogDetailsPage({Key key, this.model}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
void showConfirmMessage(
|
||||
CMCViewModel model, GetHHCAllPresOrdersResponseModel order) {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: ConfirmCancelOrderDialog(
|
||||
model: model,
|
||||
onTap: () async {
|
||||
UpdatePresOrderRequestModel updatePresOrderRequestModel =
|
||||
UpdatePresOrderRequestModel(
|
||||
presOrderID: order.iD,
|
||||
rejectionReason: "",
|
||||
presOrderStatus: 4, editedBy: 3);
|
||||
await model.updateCmcPresOrder(updatePresOrderRequestModel);
|
||||
if(model.state == ViewState.ErrorLocal) {
|
||||
Utils.showErrorToast(model.error);
|
||||
} else {
|
||||
AppToast.showSuccessToast(message: "Done Successfully");
|
||||
await model.getCmcAllPresOrders();
|
||||
}
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
return AppScaffold(
|
||||
isShowAppBar: false,
|
||||
baseViewModel: model,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.94,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: model.cmcAllPresOrders.map((order) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border:
|
||||
Border.all(color: Colors.grey, width: 1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Request ID",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
order.iD.toString(),
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Status",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
order.description,
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Pickup Date",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
DateUtil.getDayMonthYearDateFormatted(
|
||||
DateUtil.convertStringToDate(
|
||||
order.createdOn)),
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Location",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
order.nearestProjectDescription
|
||||
.toString() ??
|
||||
order.nearestProjectDescriptionN
|
||||
.toString(),
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
if (order.status == 1 ||order.status == 2 )
|
||||
Center(
|
||||
child: Container(
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width *
|
||||
0.85,
|
||||
child: SecondaryButton(
|
||||
label: "Cancel".toUpperCase(),
|
||||
onTap: () {
|
||||
showConfirmMessage(model, order);
|
||||
}
|
||||
,
|
||||
color: Colors.red[800],
|
||||
disabled: false,
|
||||
textColor: Theme
|
||||
.of(context)
|
||||
.backgroundColor),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList())
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.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 ConfirmCancelOrderDialog extends StatefulWidget {
|
||||
final HomeHealthCareViewModel model;
|
||||
final Function onTap;
|
||||
|
||||
|
||||
ConfirmCancelOrderDialog(
|
||||
{Key key, this.model, this.onTap});
|
||||
|
||||
@override
|
||||
_ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState();
|
||||
}
|
||||
|
||||
class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
|
||||
title: Center(
|
||||
child: Texts(
|
||||
"Confirm",
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Divider(),
|
||||
Center(
|
||||
child: Texts(
|
||||
"Are you sure!! want to cancel this order",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
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: () async{
|
||||
widget.onTap();
|
||||
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,177 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.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/pickupLocation/PickupLocationFromMap.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
|
||||
|
||||
class NewHomeHealthCareStepOnePage extends StatefulWidget {
|
||||
final PatientERInsertPresOrderRequestModel
|
||||
patientERInsertPresOrderRequestModel;
|
||||
final Function changePageViewIndex;
|
||||
final HomeHealthCareViewModel model;
|
||||
|
||||
const NewHomeHealthCareStepOnePage(
|
||||
{Key key,
|
||||
this.patientERInsertPresOrderRequestModel,
|
||||
this.model,
|
||||
this.changePageViewIndex})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_NewHomeHealthCareStepOnePageState createState() =>
|
||||
_NewHomeHealthCareStepOnePageState();
|
||||
}
|
||||
|
||||
class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOnePage> {
|
||||
|
||||
PickResult _result;
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
if (widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList == null)
|
||||
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = [];
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowAppBar: false,
|
||||
baseViewModel: widget.model,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: MediaQuery.of(context).size.width * 0.05,
|
||||
right: MediaQuery.of(context).size.width * 0.05),
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 1,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Texts(
|
||||
"Select Home Health Care Services",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Column(
|
||||
children: widget.model.hhcAllServicesList.map((service) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey, width: 1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: isServiceSelected(service.serviceID),
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (bool newValue) {
|
||||
setState(() {
|
||||
if (!isServiceSelected(
|
||||
service.serviceID))
|
||||
widget
|
||||
.patientERInsertPresOrderRequestModel
|
||||
.patientERHHCInsertServicesList
|
||||
.add(PatientERHHCInsertServicesList(
|
||||
recordID: widget
|
||||
.patientERInsertPresOrderRequestModel
|
||||
.patientERHHCInsertServicesList
|
||||
.length,
|
||||
serviceID: service.serviceID,
|
||||
serviceName:
|
||||
service.description));
|
||||
else
|
||||
removeSelected(service.serviceID);
|
||||
// widget.patientERInsertPresOrderRequestModel
|
||||
// isPatientInsured = newValue;
|
||||
});
|
||||
}),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Texts(
|
||||
service.description,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
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(
|
||||
label: "Next",
|
||||
disabled: this
|
||||
.widget
|
||||
.patientERInsertPresOrderRequestModel
|
||||
.patientERHHCInsertServicesList
|
||||
.length == 0,
|
||||
onTap: (){
|
||||
widget.changePageViewIndex(1);
|
||||
},
|
||||
textColor: Theme.of(context).backgroundColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
isServiceSelected(int serviceId) {
|
||||
Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =
|
||||
widget
|
||||
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
|
||||
.where((element) => serviceId == element.serviceID);
|
||||
if (patientERHHCInsertServicesList.length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
removeSelected(int serviceId) {
|
||||
Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =
|
||||
widget
|
||||
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
|
||||
.where((element) => serviceId == element.serviceID);
|
||||
|
||||
if (patientERHHCInsertServicesList.length > 0)
|
||||
setState(() {
|
||||
widget
|
||||
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
|
||||
.remove(patientERHHCInsertServicesList.first);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,172 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.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:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
class NewHomeHealthCareStepThreePage extends StatefulWidget {
|
||||
final PatientERInsertPresOrderRequestModel
|
||||
patientERInsertPresOrderRequestModel;
|
||||
final Function changePageViewIndex;
|
||||
final HomeHealthCareViewModel model;
|
||||
|
||||
NewHomeHealthCareStepThreePage(
|
||||
{Key key,
|
||||
this.patientERInsertPresOrderRequestModel,
|
||||
this.changePageViewIndex,
|
||||
this.model});
|
||||
|
||||
@override
|
||||
_NewHomeHealthCareStepThreePageState createState() =>
|
||||
_NewHomeHealthCareStepThreePageState();
|
||||
}
|
||||
|
||||
class _NewHomeHealthCareStepThreePageState
|
||||
extends State<NewHomeHealthCareStepThreePage> {
|
||||
Completer<GoogleMapController> _controller = Completer();
|
||||
|
||||
static CameraPosition _kGooglePlex = CameraPosition(
|
||||
target: LatLng(37.42796133580664, -122.085749655962),
|
||||
zoom: 14.4746,
|
||||
);
|
||||
final Set<Marker> markers = new Set();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
if (widget.patientERInsertPresOrderRequestModel.latitude != null) {
|
||||
markers.clear();
|
||||
markers.add(
|
||||
Marker(
|
||||
markerId: MarkerId(
|
||||
widget.patientERInsertPresOrderRequestModel.latitude.hashCode
|
||||
.toString(),
|
||||
),
|
||||
position: LatLng(
|
||||
widget.patientERInsertPresOrderRequestModel.latitude,
|
||||
widget.patientERInsertPresOrderRequestModel.longitude)),
|
||||
);
|
||||
_kGooglePlex = CameraPosition(
|
||||
target: LatLng(widget.patientERInsertPresOrderRequestModel.latitude,
|
||||
widget.patientERInsertPresOrderRequestModel.longitude),
|
||||
zoom: 14.4746,
|
||||
);
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowDecPage: false,
|
||||
baseViewModel: widget.model,
|
||||
body: SingleChildScrollView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
margin: EdgeInsets.only(left: 12, right: 12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts('Order Details'),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts('Location :'),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
height: 200,
|
||||
child: GoogleMap(
|
||||
mapType: MapType.normal,
|
||||
markers: markers,
|
||||
initialCameraPosition: _kGooglePlex,
|
||||
onMapCreated: (GoogleMapController controller) {
|
||||
_controller.complete(controller);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Texts('Selected Service :'),
|
||||
...List.generate(
|
||||
widget.patientERInsertPresOrderRequestModel
|
||||
.patientERHHCInsertServicesList.length,
|
||||
(index) => Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
'Service Name :',
|
||||
fontSize: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Texts(
|
||||
widget
|
||||
.patientERInsertPresOrderRequestModel
|
||||
.patientERHHCInsertServicesList[index]
|
||||
.serviceName,
|
||||
fontSize: 15,
|
||||
bold: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 57,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
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(
|
||||
label: "Confirm",
|
||||
disabled: widget.patientERInsertPresOrderRequestModel
|
||||
.patientERHHCInsertServicesList.length ==
|
||||
0,
|
||||
onTap: () async {
|
||||
await widget.model.insertPresPresOrder(
|
||||
order: widget.patientERInsertPresOrderRequestModel);
|
||||
if (widget.model.state != ViewState.ErrorLocal) {
|
||||
widget.changePageViewIndex(0);
|
||||
}
|
||||
},
|
||||
textColor: Theme.of(context).backgroundColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,112 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_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/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/close_back.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class NewHomeHealthCareStepTowPage extends StatefulWidget {
|
||||
final Function(PickResult) onPick;
|
||||
final double latitude;
|
||||
final double longitude;
|
||||
final PatientERInsertPresOrderRequestModel
|
||||
patientERInsertPresOrderRequestModel;
|
||||
final Function changePageViewIndex;
|
||||
final HomeHealthCareViewModel model;
|
||||
|
||||
const NewHomeHealthCareStepTowPage(
|
||||
{Key key,
|
||||
this.onPick,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.patientERInsertPresOrderRequestModel,
|
||||
this.changePageViewIndex,
|
||||
this.model})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_NewHomeHealthCareStepTowPageState createState() =>
|
||||
_NewHomeHealthCareStepTowPageState();
|
||||
}
|
||||
|
||||
class _NewHomeHealthCareStepTowPageState
|
||||
extends State<NewHomeHealthCareStepTowPage> {
|
||||
double latitude = 0;
|
||||
double longitude = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
if (widget.patientERInsertPresOrderRequestModel.latitude == null) {
|
||||
latitude = widget.latitude;
|
||||
longitude = widget.longitude;
|
||||
} else {
|
||||
latitude = widget.patientERInsertPresOrderRequestModel.latitude;
|
||||
longitude = widget.patientERInsertPresOrderRequestModel.longitude;
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return AppScaffold(
|
||||
isShowDecPage: false,
|
||||
body: PlacePicker(
|
||||
apiKey: GOOGLE_API_KEY,
|
||||
enableMyLocationButton: true,
|
||||
automaticallyImplyAppBarLeading: false,
|
||||
autocompleteOnTrailingWhitespace: true,
|
||||
selectInitialPosition: true,
|
||||
autocompleteLanguage: projectViewModel.currentLanguage,
|
||||
enableMapTypeButton: true,
|
||||
onPlacePicked: (PickResult result) {
|
||||
print(result.adrAddress);
|
||||
widget.changePageViewIndex(3);
|
||||
},
|
||||
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: SecondaryButton(
|
||||
color: Colors.grey[800],
|
||||
textColor: Colors.white,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.patientERInsertPresOrderRequestModel
|
||||
.latitude =
|
||||
selectedPlace.geometry.location.lat;
|
||||
widget.patientERInsertPresOrderRequestModel
|
||||
.longitude =
|
||||
selectedPlace.geometry.location.lng;
|
||||
});
|
||||
widget.changePageViewIndex(3);
|
||||
},
|
||||
label: TranslationBase.of(context).next,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
initialPosition: LatLng(latitude, longitude),
|
||||
useCurrentLocation: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,325 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.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/home_health_care_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
|
||||
import '../StepsWidget.dart';
|
||||
import 'new_Home_health_care_step_one_page.dart';
|
||||
|
||||
class NewHomeHealthCarePage extends StatefulWidget {
|
||||
NewHomeHealthCarePage({this.model});
|
||||
|
||||
final HomeHealthCareViewModel model;
|
||||
@override
|
||||
_NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState();
|
||||
}
|
||||
|
||||
class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
|
||||
with TickerProviderStateMixin {
|
||||
PageController _controller;
|
||||
int _currentIndex = 1;
|
||||
double _latitude;
|
||||
double _longitude;
|
||||
|
||||
PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel =
|
||||
new PatientERInsertPresOrderRequestModel();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = new PageController();
|
||||
_getCurrentLocation();
|
||||
}
|
||||
|
||||
_getCurrentLocation() async {
|
||||
await getLastKnownPosition().then((value) {
|
||||
_latitude = value.latitude;
|
||||
_longitude = value.longitude;
|
||||
}).catchError((e) {
|
||||
_longitude = 0;
|
||||
_latitude = 0;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
_changeCurrentTab(int tab) {
|
||||
setState(() {
|
||||
_currentIndex = tab;
|
||||
});
|
||||
_controller.animateToPage(tab,
|
||||
duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
void showConfirmMessage(HomeHealthCareViewModel model,
|
||||
GetOrderDetailByOrderIDResponseModel order) {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: ConfirmCancelOrderDialog(
|
||||
model: model,
|
||||
onTap: () async {
|
||||
UpdatePresOrderRequestModel updatePresOrderRequestModel =
|
||||
UpdatePresOrderRequestModel(
|
||||
presOrderID: order.presOrderID,
|
||||
rejectionReason: "",
|
||||
presOrderStatus: 4,
|
||||
editedBy: 3);
|
||||
await model.updateHHCPresOrder(updatePresOrderRequestModel);
|
||||
if (model.state == ViewState.ErrorLocal) {
|
||||
Utils.showErrorToast(model.error);
|
||||
} else {
|
||||
AppToast.showSuccessToast(message: "Done Successfully");
|
||||
await model.getHHCAllPresOrders();
|
||||
// await model.getHHCAllServices();
|
||||
}
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
body: SafeArea(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.8,
|
||||
child: Column(
|
||||
children: [
|
||||
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05),
|
||||
child: StepsWidget(
|
||||
index: _currentIndex,
|
||||
changeCurrentTab: _changeCurrentTab,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: PageView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
controller: _controller,
|
||||
onPageChanged: (index) {
|
||||
setState(() {
|
||||
_currentIndex = index;
|
||||
});
|
||||
},
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
widget.model.pendingOrder != null
|
||||
? FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey, width: 1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Request ID",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
widget.model.pendingOrder.iD.toString(),
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Status",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
widget.model.pendingOrder.description,
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Pickup Date",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
DateUtil.getDayMonthYearDateFormatted(
|
||||
DateUtil.convertStringToDate(widget
|
||||
.model.pendingOrder.createdOn)),
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
...List.generate(
|
||||
widget.model.hhcAllOrderDetail.length,
|
||||
(index) => Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Service Name",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
widget.model.hhcAllOrderDetail[index]
|
||||
.description,
|
||||
fontSize: 22,
|
||||
bold: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Center(
|
||||
child: Container(
|
||||
width:
|
||||
MediaQuery.of(context).size.width * 0.85,
|
||||
child: SecondaryButton(
|
||||
label: "Cancel".toUpperCase(),
|
||||
onTap: () {
|
||||
showConfirmMessage(widget.model,
|
||||
widget.model.hhcAllOrderDetail[0]);
|
||||
},
|
||||
color: Colors.red[800],
|
||||
disabled: false,
|
||||
textColor:
|
||||
Theme.of(context).backgroundColor),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: NewHomeHealthCareStepOnePage(
|
||||
changePageViewIndex: _changeCurrentTab,
|
||||
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
|
||||
model: widget.model,
|
||||
),
|
||||
NewHomeHealthCareStepTowPage(
|
||||
latitude: _latitude,
|
||||
longitude: _longitude,
|
||||
changePageViewIndex: _changeCurrentTab,
|
||||
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
|
||||
model: widget.model,
|
||||
),
|
||||
NewHomeHealthCareStepThreePage(
|
||||
changePageViewIndex: _changeCurrentTab,
|
||||
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
|
||||
model: widget.model,
|
||||
)
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,181 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class StepsWidget extends StatelessWidget {
|
||||
final int index;
|
||||
final Function changeCurrentTab;
|
||||
|
||||
StepsWidget({Key key, this.index, this.changeCurrentTab});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return !projectViewModel.isArabic? Stack(
|
||||
children: [
|
||||
Container(
|
||||
height: 50,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
color: Colors.transparent,
|
||||
child: Center(
|
||||
child: Divider(
|
||||
color: Colors.grey,
|
||||
height: 0.75,
|
||||
thickness: 0.75,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 10,
|
||||
left: 0,
|
||||
child: InkWell(
|
||||
onTap: () => changeCurrentTab(0),
|
||||
child: Container(
|
||||
width: 35,
|
||||
height: 35,
|
||||
decoration: BoxDecoration(
|
||||
border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75),
|
||||
shape: BoxShape.circle,
|
||||
color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white,
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'1',
|
||||
color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 10,
|
||||
left: MediaQuery.of(context).size.width * 0.42,
|
||||
child: InkWell(
|
||||
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
|
||||
child: Container(
|
||||
width: 35,
|
||||
height: 35,
|
||||
decoration: BoxDecoration(
|
||||
border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75),
|
||||
shape: BoxShape.circle,
|
||||
color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'2',
|
||||
color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 10,
|
||||
right: 0,
|
||||
child: InkWell(
|
||||
onTap: () => index == 2 ?changeCurrentTab(3) : null,
|
||||
child: Container(
|
||||
width: 35,
|
||||
height: 35,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: Colors.black,width: 0.75),
|
||||
color: index == 2 ? Colors.grey[800] : Colors.white,
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'3',
|
||||
color: index == 2 ? Colors.white : Colors.grey[800],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
):Stack(
|
||||
children: [
|
||||
Container(
|
||||
height: 50,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
color: Colors.transparent,
|
||||
child: Center(
|
||||
child: Divider(
|
||||
color: Colors.grey,
|
||||
height: 0.75,
|
||||
thickness: 0.75,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 10,
|
||||
right: 0,
|
||||
child: InkWell(
|
||||
onTap: () => changeCurrentTab(0),
|
||||
child: Container(
|
||||
width: 35,
|
||||
height: 35,
|
||||
decoration: BoxDecoration(
|
||||
border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75),
|
||||
shape: BoxShape.circle,
|
||||
color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white,
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'1',
|
||||
color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 10,
|
||||
left: MediaQuery.of(context).size.width * 0.42,
|
||||
child: InkWell(
|
||||
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
|
||||
child: Container(
|
||||
width: 35,
|
||||
height: 35,
|
||||
decoration: BoxDecoration(
|
||||
border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75),
|
||||
shape: BoxShape.circle,
|
||||
color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'2',
|
||||
color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 10,
|
||||
left: 0,
|
||||
child: InkWell(
|
||||
onTap: () => index == 2 ?changeCurrentTab(3) : null,
|
||||
child: Container(
|
||||
width: 35,
|
||||
height: 35,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: Colors.black,width: 0.75),
|
||||
color: index == 2 ? Colors.grey[800] : Colors.white,
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'3',
|
||||
color: index == 2 ? Colors.white : Colors.grey[800],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
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,132 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'NewHomeHealthCare/new_home_health_care_page.dart';
|
||||
import 'orders_log_details_page.dart';
|
||||
|
||||
class HomeHealthCarePage extends StatefulWidget {
|
||||
@override
|
||||
_HomeHealthCarePageState createState() => _HomeHealthCarePageState();
|
||||
}
|
||||
|
||||
class _HomeHealthCarePageState extends State<HomeHealthCarePage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
TabController _tabController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: 2, vsync: this);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_tabController.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<HomeHealthCareViewModel>(
|
||||
onModelReady: (model){
|
||||
// model.getHHCAllServices();
|
||||
model.getHHCAllPresOrders();
|
||||
},
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: TranslationBase.of(context).homeHealthCare,
|
||||
body: Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(65.0),
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
Positioned(
|
||||
bottom: 1,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
||||
child: Container(
|
||||
color: Theme.of(context)
|
||||
.scaffoldBackgroundColor
|
||||
.withOpacity(0.8),
|
||||
height: 70.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Container(
|
||||
height: 60.0,
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 0.7),
|
||||
),
|
||||
color: Colors.white),
|
||||
child: Center(
|
||||
child: TabBar(
|
||||
isScrollable: true,
|
||||
controller: _tabController,
|
||||
indicatorWeight: 5.0,
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
indicatorColor: Colors.red[800],
|
||||
labelColor: Theme.of(context).primaryColor,
|
||||
labelPadding:
|
||||
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
|
||||
unselectedLabelColor: Colors.grey[800],
|
||||
tabs: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.37,
|
||||
child: Center(
|
||||
child: Texts(TranslationBase.of(context).homeHealthCare),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.37,
|
||||
child: Center(
|
||||
child: Texts(TranslationBase.of(context).orderLog),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
controller: _tabController,
|
||||
children: <Widget>[
|
||||
NewHomeHealthCarePage(
|
||||
model: model,
|
||||
),
|
||||
OrdersLogDetailsPage(
|
||||
model: model,
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,251 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils.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:flutter/material.dart';
|
||||
|
||||
import 'Dialog/confirm_cancel_order_dialog.dart';
|
||||
|
||||
class OrdersLogDetailsPage extends StatelessWidget {
|
||||
final HomeHealthCareViewModel model;
|
||||
|
||||
const OrdersLogDetailsPage({Key key, this.model}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
void showConfirmMessage(
|
||||
HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: ConfirmCancelOrderDialog(
|
||||
model: model,
|
||||
onTap: () async {
|
||||
UpdatePresOrderRequestModel updatePresOrderRequestModel =
|
||||
UpdatePresOrderRequestModel(
|
||||
presOrderID: order.iD,
|
||||
rejectionReason: "",
|
||||
presOrderStatus: 4, editedBy: 3);
|
||||
await model.updateHHCPresOrder(updatePresOrderRequestModel);
|
||||
if(model.state == ViewState.ErrorLocal) {
|
||||
Utils.showErrorToast(model.error);
|
||||
} else {
|
||||
AppToast.showSuccessToast(message: "Done Successfully");
|
||||
await model.getHHCAllPresOrders();
|
||||
// await model.getHHCAllServices();
|
||||
}
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
return AppScaffold(
|
||||
isShowAppBar: false,
|
||||
baseViewModel: model,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.94,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: model.hhcAllPresOrders.map((order) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border:
|
||||
Border.all(color: Colors.grey, width: 1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Request ID",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
order.iD.toString(),
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Status",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
order.description,
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Pickup Date",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
DateUtil.getDayMonthYearDateFormatted(
|
||||
DateUtil.convertStringToDate(
|
||||
order.createdOn)),
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 15, bottom: 15, top: 15),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
"Location",
|
||||
bold: false,
|
||||
fontSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Texts(
|
||||
order.nearestProjectDescription
|
||||
.toString() ??
|
||||
order.nearestProjectDescriptionN
|
||||
.toString(),
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
if (order.status == 1 ||order.status == 2 )
|
||||
Center(
|
||||
child: Container(
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width *
|
||||
0.85,
|
||||
child: SecondaryButton(
|
||||
label: "Cancel".toUpperCase(),
|
||||
onTap: () {
|
||||
showConfirmMessage(model, order);
|
||||
}
|
||||
,
|
||||
color: Colors.red[800],
|
||||
disabled: false,
|
||||
textColor: Theme
|
||||
.of(context)
|
||||
.backgroundColor),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList())
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||