Merge branch 'development_new_design_2.0' into mirza_home_page

# Conflicts:
#	lib/pages/BookAppointment/components/SearchByClinic.dart
#	lib/widgets/drawer/app_drawer_widget.dart
merge-requests/390/head
Mirza.Shafique 4 years ago
commit bd1cf9bcc7

@ -127,11 +127,14 @@ const INSERT_ER_INERT_PRES_ORDER =
/// ER RRT
const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation';
const GET_ALL_TRANSPORTATIONS_RC = 'rc/api/Transportation/getalltransportation';
const GET_ALL_RRT_QUESTIONS =
'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions';
const GET_RRT_SERVICE_PRICE =
'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice';
const INSERT_TRANSPORTATION_ORDER_RC = "rc/api/Transportation/add";
///FindUs
const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';

@ -8,7 +8,7 @@ class PatientER {
int languageID;
String iPAdress;
String generalid;
int patientOutSA;
dynamic patientOutSA;
String sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
@ -164,7 +164,7 @@ class PatientER {
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
data['PatientID'] = this.patientID;
data['PatientID'] = this.patientID.toString();
data['TokenID'] = this.tokenID;
data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType;

@ -1,79 +1,56 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class PatientERTransportationMethod {
dynamic id;
DateTime createDate;
DateTime lastEditDate;
dynamic createdBy;
dynamic lastEditBy;
bool isActive;
String title;
String titleAR;
int id;
String serviceID;
int orderServiceID;
String text;
String textN;
dynamic price;
dynamic isDefault;
dynamic visibility;
dynamic durationId;
String description;
String descriptionAR;
dynamic totalPrice;
dynamic vAT;
dynamic priceVAT;
dynamic priceTotal;
bool isEnabled;
int orderId;
int quantity;
PatientERTransportationMethod(
{
this.id,
this.createDate,
this.lastEditDate,
this.createdBy,
this.lastEditBy,
this.isActive,
this.title,
this.titleAR,
{this.id,
this.serviceID,
this.orderServiceID,
this.text,
this.textN,
this.price,
this.isDefault,
this.visibility,
this.durationId,
this.description,
this.descriptionAR,
this.totalPrice,
this.vAT});
this.priceVAT,
this.priceTotal,
this.isEnabled,
this.orderId,
this.quantity});
PatientERTransportationMethod.fromJson(
Map<String, dynamic> json) {
id = json['Id'];
createDate = DateUtil.convertStringToDate(json['CreateDate']);
lastEditDate = DateUtil.convertStringToDate(json['LastEditDate']);
createdBy = json['CreatedBy'];
lastEditBy = json['LastEditBy'];
isActive = json['IsActive'];
title = json['Title'];
titleAR = json['TitleAR'];
price = json['Price'];
isDefault = json['isDefault'];
visibility = json['Visibility'];
durationId = json['DurationId'];
description = json['Description'];
descriptionAR = json['DescriptionAR'];
totalPrice = json['TotalPrice'];
vAT = json['VAT'];
PatientERTransportationMethod.fromJson(Map<String, dynamic> json) {
id = json['id'];
serviceID = json['serviceID'];
orderServiceID = json['orderServiceID'];
text = json['text'];
textN = json['textN'];
price = json['price'];
priceVAT = json['priceVAT'];
priceTotal = json['priceTotal'];
isEnabled = json['isEnabled'];
orderId = json['orderId'];
quantity = json['quantity'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Id'] = this.id;
data['CreateDate'] = this.createDate;
data['LastEditDate'] = this.lastEditDate;
data['CreatedBy'] = this.createdBy;
data['LastEditBy'] = this.lastEditBy;
data['IsActive'] = this.isActive;
data['Title'] = this.title;
data['TitleAR'] = this.titleAR;
data['Price'] = this.price;
data['isDefault'] = this.isDefault;
data['Visibility'] = this.visibility;
data['DurationId'] = this.durationId;
data['Description'] = this.description;
data['DescriptionAR'] = this.descriptionAR;
data['TotalPrice'] = this.totalPrice;
data['VAT'] = this.vAT;
data['id'] = this.id;
data['serviceID'] = this.serviceID;
data['orderServiceID'] = this.orderServiceID;
data['text'] = this.text;
data['textN'] = this.textN;
data['price'] = this.price;
data['priceVAT'] = this.priceVAT;
data['priceTotal'] = this.priceTotal;
data['isEnabled'] = this.isEnabled;
data['orderId'] = this.orderId;
data['quantity'] = this.quantity;
return data;
}
}
}

@ -118,7 +118,8 @@ class BaseAppClient {
}
print("URL : $url");
print("Body : ${json.encode(body)}");
final jsonBody = json.encode(body);
print(jsonBody);
if (await Utils.checkConnection()) {
final response = await http.post(url.trim(), body: json.encode(body), headers: headers);

@ -1,11 +1,11 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PickUpRequestPresOrder.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
import 'package:flutter/cupertino.dart';
import '../base_service.dart';
class AmService extends BaseService {
@ -22,16 +22,27 @@ class AmService extends BaseService {
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['IdentificationNo'] = user.patientIdentificationNo;
await baseAppClient.post(GET_AMBULANCE_REQUEST,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.get(
GET_ALL_TRANSPORTATIONS_RC + "?patientID=" + user.patientID.toString(),
isExternal: false, onSuccess: (dynamic response, int statusCode) {
amModelList.clear();
response['PatientER_RRT_GetAllTransportationMethodList'].forEach((item) {
response['data']['transportationservices'].forEach((item) {
amModelList.add(PatientERTransportationMethod.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
});
// await baseAppClient.post(GET_AMBULANCE_REQUEST,
// onSuccess: (dynamic response, int statusCode) {
// amModelList.clear();
// response['PatientER_RRT_GetAllTransportationMethodList'].forEach((item) {
// amModelList.add(PatientERTransportationMethod.fromJson(item));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// }, body: body);
}
Future getPatientAllPresOrdersList() async {
@ -85,9 +96,8 @@ class AmService extends BaseService {
body['PresOrderStatus'] = OrderService.AMBULANCE.getIdOrderService();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_PRESS_ORDER,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
@ -96,10 +106,9 @@ class AmService extends BaseService {
Future insertERPressOrder({@required PatientER patientER}) async {
hasError = false;
await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC,
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patientER.toJson());

@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
@ -44,7 +43,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
bool isProjectLoaded = false;
ListClinicCentralized selectedClinic;
final GlobalKey dropdownKey = GlobalKey();
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
@ -58,127 +56,87 @@ class _SearchByClinicState extends State<SearchByClinic> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 2,right: 2),
child: Row(
children: <Widget>[
Checkbox(
activeColor: new Color(0xFF40ACC9),
value: nearestAppo,
onChanged: (bool value) {
setState(() {
nearestAppo = value;
print(nearestAppo);
if (nearestAppo)
getProjectsList();
else
isProjectLoaded = false;
});
},
),
Text(
TranslationBase.of(context).nearestAppo,
style: TextStyle(fontSize: 14.0, letterSpacing: -0.56),
),
],
),
Row(
children: <Widget>[
Checkbox(
activeColor: new Color(0xFF40ACC9),
value: nearestAppo,
onChanged: (bool value) {
setState(() {
nearestAppo = value;
print(nearestAppo);
if (nearestAppo)
getProjectsList();
else
isProjectLoaded = false;
});
},
),
Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
],
),
widget.clnicIds != null && widget.clnicIds.length > 1 && isLoaded == true
? Padding(
padding: const EdgeInsets.only(left: 20,right: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: clinicsList.map<Widget>((result) {
return RoundedContainer(
child: ListTile(
onTap: () {
// setState(() {
dropdownValue = result.clinicID.toString();
setState(() {
if (!isDentalSelectedAndSupported()) {
projectDropdownValue = "";
getDoctorsList(context);
}
});
},
title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0))));
}).toList()),
)
: InkWell(
onTap: () {
dropdownKey.currentState;
},
child: Container(
width: double.infinity,
margin: const EdgeInsets.only(left: 16,right: 16),
decoration: containerRadius(Colors.white, 12),
padding: EdgeInsets.only(left: 12, right: 12, top: 14, bottom: 14),
child: Row(
children: [
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Select Clinic",
style: TextStyle(
color: Colors.black,
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
Container(
height: 20,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
key: dropdownKey,
hint: new Text(TranslationBase.of(context).selectClinic),
value: dropdownValue,
iconSize: 0,
style: TextStyle(
color: Color(0xFF575757),
fontSize: 14,
letterSpacing: -0.56,
),
isExpanded: true,
items: clinicsList.map((item) {
return new DropdownMenuItem<String>(
value: item.clinicID.toString() +
"-" +
item.isLiveCareClinicAndOnline.toString() +
"-" +
item.liveCareClinicID.toString() +
"-" +
item.liveCareServiceID.toString(),
child: Text(item.clinicDescription),
);
}).toList(),
onChanged: (newValue) {
setState(() {
print(newValue);
dropdownValue = newValue;
if (!isDentalSelectedAndSupported() && !nearestAppo) {
projectDropdownValue = "";
getDoctorsList(context);
}
});
},
),
),
),
],
),
),
Icon(
Icons.keyboard_arrow_down_rounded,
),
],
)),
),
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: clinicsList.map<Widget>((result) {
return RoundedContainer(
child: ListTile(
onTap: () {
// setState(() {
dropdownValue = result.clinicID.toString();
setState(() {
if (!isDentalSelectedAndSupported()) {
projectDropdownValue = "";
getDoctorsList(context);
} else {}
});
},
title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0))));
}).toList())
: Container(
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey[400],
width: 1.0,
),
borderRadius: BorderRadius.circular(10),
),
// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
padding: EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
hint: new Text(TranslationBase.of(context).selectClinic),
value: dropdownValue,
items: clinicsList.map((item) {
return new DropdownMenuItem<String>(
value: item.clinicID.toString() + "-" + item.isLiveCareClinicAndOnline.toString() + "-" + item.liveCareClinicID.toString() + "-" + item.liveCareServiceID.toString(),
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Text(item.clinicDescription),
item.isLiveCareClinicAndOnline ? SvgPicture.asset('assets/images/new-design/video_icon_green_right.svg', height: 15, width: 15, fit: BoxFit.cover) : Container(),
]),
);
}).toList(),
onChanged: (newValue) {
setState(() {
print(newValue);
dropdownValue = newValue;
if (!isDentalSelectedAndSupported() && !nearestAppo) {
projectDropdownValue = "";
getDoctorsList(context);
} else {
print("Dental");
}
});
},
),
)),
isDentalSelectedAndSupported() == true || (nearestAppo && isProjectLoaded)
? Container(
height: 60.0,
@ -218,7 +176,10 @@ class _SearchByClinicState extends State<SearchByClinic> {
}
bool isDentalSelectedAndSupported() {
return dropdownValue != "" && (dropdownValue == "17") && isMobileAppDentalAllow;
if (dropdownValue != null)
return dropdownValue != "" && (dropdownValue.split("-")[0] == "17") && isMobileAppDentalAllow;
else
return false;
}
getClinicsList() {
@ -265,9 +226,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
// TODO Mosa_REMARk to come back later
getDoctorsList(BuildContext context) {
SearchInfo searchInfo = new SearchInfo();
if (dropdownValue == "17") {
if (dropdownValue.split("-")[0] == "17") {
searchInfo.ProjectID = int.parse(projectDropdownValue);
searchInfo.ClinicID = int.parse(dropdownValue);
searchInfo.ClinicID = int.parse(dropdownValue.split("-")[0]);
searchInfo.date = DateTime.now();
navigateToDentalComplaints(context, searchInfo);

@ -36,9 +36,6 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
@override
void initState() {
WidgetsBinding.instance
.addPostFrameCallback((_) => getProjectsList(context));
imagesInfo.add(
ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png',
@ -353,6 +350,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context);
service.getCovidProjectsList(context).then((res) {
projectsList.clear();
if (res['MessageStatus'] == 1) {
setState(() {
res['List_COVID19_ProjectDriveThroughTestingCenter'].forEach((v) {

@ -126,7 +126,7 @@ class _BillAmountState extends State<BillAmount> {
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.vAT}',
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.priceVAT}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
@ -167,7 +167,7 @@ class _BillAmountState extends State<BillAmount> {
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}',
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.priceTotal}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,

@ -97,9 +97,9 @@ class _SelectTransportationMethodState
child: ListTile(
title: Texts(projectViewModel.isArabic
? widget.amRequestViewModel
.amRequestModeList[index].titleAR
.amRequestModeList[index].textN
: widget.amRequestViewModel
.amRequestModeList[index].title),
.amRequestModeList[index].text),
leading: Radio(
value: widget
.amRequestViewModel.amRequestModeList[index],
@ -317,10 +317,10 @@ class _SelectTransportationMethodState
_orderService.getIdOrderService();
widget.patientER.pickupUrgency = 1;
widget.patientER.lineItemNo = 1;
widget.patientER.cost = _erTransportationMethod.price;
widget.patientER.vAT = _erTransportationMethod.vAT ?? 0;
widget.patientER.cost = _erTransportationMethod.price.toDouble();
widget.patientER.vAT = _erTransportationMethod.priceVAT ?? 0;
widget.patientER.totalPrice =
_erTransportationMethod.totalPrice;
_erTransportationMethod.priceTotal.toDouble();
widget.changeCurrentTab(1);
});
},

@ -44,7 +44,7 @@ class _SummaryState extends State<Summary> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,),
Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,),
Texts('${widget.patientER.patientERTransportationMethod.text}',bold: true,),
SizedBox(height: 8,),
Texts(TranslationBase.of(context).directions,color: Colors.grey,),
@ -84,7 +84,7 @@ class _SummaryState extends State<Summary> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).patientShareTotal+':'),
Texts(TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}')
Texts(TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.priceTotal}')
],
),
),

@ -179,7 +179,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false,
onRatingAndReviewTap: getDoctorRatingsDetails,
onTap: (){},
onTap: () {},
),
SizedBox(height: 10),
TabBar(

@ -227,7 +227,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
locationUtils =
new LocationUtils(isShowConfirmDialog: false, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) {
locationUtils.getCurrentLocation();
// locationUtils.getCurrentLocation();
if (projectViewModel.isLogin) {
familyFileProvider.getSharedRecordByStatus();
}
@ -254,7 +254,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (projectViewModel.isLogin) this.getNotificationCount(DEVICE_TOKEN);
}
});
if (results[Permission.location].isGranted) ;
if (results[Permission.location].isGranted) {}
// if (results[Permission.storage].isGranted) ;
// if (results[Permission.camera].isGranted) ;
// if (results[Permission.photos].isGranted) ;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save