Merge branch 'development' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into development

# Conflicts:
#	lib/config/localized_values.dart
#	lib/uitl/translations_delegate_base.dart
merge-requests/357/head
haroon amjad 3 years ago
commit cbbef80bd5

File diff suppressed because it is too large Load Diff

@ -23,8 +23,7 @@ class PrescriptionsService extends BaseService {
hasError = false;
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(PRESCRIPTIONS,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(PRESCRIPTIONS, onSuccess: (dynamic response, int statusCode) {
prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((prescriptions) {
prescriptionsList.add(Prescriptions.fromJson(prescriptions));
@ -38,13 +37,10 @@ class PrescriptionsService extends BaseService {
Future getPrescriptionsOrders() async {
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, onSuccess: (dynamic response, int statusCode) {
prescriptionsOrderList.clear();
response['PatientER_GetPatientAllPresOrdersList']
.forEach((prescriptionsOrder) {
prescriptionsOrderList
.add(PrescriptionsOrder.fromJson(prescriptionsOrder));
response['PatientER_GetPatientAllPresOrdersList'].forEach((prescriptionsOrder) {
prescriptionsOrderList.add(PrescriptionsOrder.fromJson(prescriptionsOrder));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -53,8 +49,7 @@ class PrescriptionsService extends BaseService {
}
RequestPrescriptionReport _requestPrescriptionReport =
RequestPrescriptionReport(
appointmentNo: 0, isDentalAllowedBackend: false);
RequestPrescriptionReport(appointmentNo: 0, isDentalAllowedBackend: false);
List<PrescriptionReport> prescriptionReportList = List();
Future getPrescriptionReport({Prescriptions prescriptions}) async {
@ -70,25 +65,19 @@ class PrescriptionsService extends BaseService {
_requestPrescriptionReport.episodeID = prescriptions.episodeID;
_requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo;
await baseAppClient.post(
prescriptions.isInOutPatient
? GET_PRESCRIPTION_REPORT_ENH
: GET_PRESCRIPTION_REPORT,
await baseAppClient.post(prescriptions.isInOutPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT,
onSuccess: (dynamic response, int statusCode) {
prescriptionReportList.clear();
prescriptionReportEnhList.clear();
if (prescriptions.isInOutPatient) {
response['ListPRM'].forEach((prescriptions) {
prescriptionReportList
.add(PrescriptionReport.fromJson(prescriptions));
prescriptionReportEnhList
.add(PrescriptionReportEnh.fromJson(prescriptions));
prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions));
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions));
});
} else {
prescriptionReportListINP.clear();
response['INP_GetPrescriptionReport_List'].forEach((prescriptions) {
prescriptionReportListINP
.add(PrescriptionReportINP.fromJson(prescriptions));
prescriptionReportListINP.add(PrescriptionReportINP.fromJson(prescriptions));
});
}
}, onFailure: (String error, int statusCode) {
@ -97,13 +86,12 @@ class PrescriptionsService extends BaseService {
}, body: _requestPrescriptionReport.toJson());
}
RequestSendPrescriptionEmail _requestSendPrescriptionEmail =
RequestSendPrescriptionEmail(
RequestSendPrescriptionEmail _requestSendPrescriptionEmail = RequestSendPrescriptionEmail(
isDentalAllowedBackend: false,
);
Future sendPrescriptionEmail(String appointmentDate, int patientID,
String clinicName, String doctorName, int doctorID, int projectID) async {
Future sendPrescriptionEmail(
String appointmentDate, int patientID, String clinicName, String doctorName, int doctorID, int projectID) async {
_requestSendPrescriptionEmail.listPrescriptions = prescriptionReportList;
_requestSendPrescriptionEmail.appointmentDate = appointmentDate;
_requestSendPrescriptionEmail.patientID = patientID;
@ -112,25 +100,21 @@ class PrescriptionsService extends BaseService {
_requestSendPrescriptionEmail.projectID = projectID;
_requestSendPrescriptionEmail.to = user.emailAddress;
_requestSendPrescriptionEmail.dateofBirth = user.dateofBirth;
_requestSendPrescriptionEmail.patientIditificationNum =
user.patientIdentificationNo;
_requestSendPrescriptionEmail.patientIditificationNum = user.patientIdentificationNo;
_requestSendPrescriptionEmail.patientMobileNumber = user.mobileNumber;
_requestSendPrescriptionEmail.doctorID = doctorID;
_requestSendPrescriptionEmail.patientName =
user.firstName + " " + user.lastName;
_requestSendPrescriptionEmail.patientName = user.firstName + " " + user.lastName;
_requestSendPrescriptionEmail.setupID = user.setupID;
_requestSendPrescriptionEmail.to = user.emailAddress;
hasError = false;
await baseAppClient
.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) {},
onFailure: (String error, int statusCode) {
await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestSendPrescriptionEmail.toJson());
}
RequestGetListPharmacyForPrescriptions
requestGetListPharmacyForPrescriptions =
RequestGetListPharmacyForPrescriptions requestGetListPharmacyForPrescriptions =
RequestGetListPharmacyForPrescriptions(
latitude: 0,
longitude: 0,
@ -141,12 +125,11 @@ class PrescriptionsService extends BaseService {
Future getListPharmacyForPrescriptions({int itemId}) async {
hasError = false;
requestGetListPharmacyForPrescriptions.itemID = itemId;
await baseAppClient.post(GET_PHARMACY_LIST,
onSuccess: (dynamic response, int statusCode) {
pharmacyPrescriptionsList.clear();
await baseAppClient.post(GET_PHARMACY_LIST, onSuccess: (dynamic response, int statusCode) {
pharmacyPrescriptionsList.clear();
response['PharmList'].forEach((prescriptions) {
pharmacyPrescriptionsList
.add(PharmacyPrescriptions.fromJson(prescriptions));
pharmacyPrescriptionsList.add(PharmacyPrescriptions.fromJson(prescriptions));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -154,15 +137,13 @@ class PrescriptionsService extends BaseService {
}, body: requestGetListPharmacyForPrescriptions.toJson());
}
RequestPrescriptionReportEnh _requestPrescriptionReportEnh =
RequestPrescriptionReportEnh(
RequestPrescriptionReportEnh _requestPrescriptionReportEnh = RequestPrescriptionReportEnh(
isDentalAllowedBackend: false,
);
List<PrescriptionReportEnh> prescriptionReportEnhList = List();
Future getPrescriptionReportEnh(
{PrescriptionsOrder prescriptionsOrder}) async {
Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async {
///This logic copy from the old app from class [order-history.component.ts] in line 45
bool isInPatient = false;
prescriptionsList.forEach((element) {
@ -177,8 +158,7 @@ class PrescriptionsService extends BaseService {
isInPatient = element.isInOutPatient;
}
} else {
if (int.parse(prescriptionsOrder.appointmentNo) ==
element.appointmentNo) {
if (int.parse(prescriptionsOrder.appointmentNo) == element.appointmentNo) {
_requestPrescriptionReportEnh.appointmentNo = element.appointmentNo;
_requestPrescriptionReportEnh.clinicID = element.clinicID;
_requestPrescriptionReportEnh.projectID = element.projectID;
@ -194,20 +174,17 @@ class PrescriptionsService extends BaseService {
hasError = false;
await baseAppClient.post(
isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT,
await baseAppClient.post(isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT,
onSuccess: (dynamic response, int statusCode) {
prescriptionReportEnhList.clear();
if (isInPatient) {
response['ListPRM'].forEach((prescriptions) {
prescriptionReportEnhList
.add(PrescriptionReportEnh.fromJson(prescriptions));
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions));
});
} else {
response['INP_GetPrescriptionReport_List'].forEach((prescriptions) {
PrescriptionReportEnh reportEnh =
PrescriptionReportEnh.fromJson(prescriptions);
PrescriptionReportEnh reportEnh = PrescriptionReportEnh.fromJson(prescriptions);
reportEnh.itemDescription = prescriptions['ItemDescriptionN'];
prescriptionReportEnhList.add(reportEnh);
});
@ -226,8 +203,7 @@ class PrescriptionsService extends BaseService {
body['RejectionReason'] = '';
body['PresOrderStatus'] = 4;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_PRESS_ORDER,
onSuccess: (dynamic response, int statusCode) {},
await baseAppClient.post(UPDATE_PRESS_ORDER, onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -19,25 +19,18 @@ class PrescriptionsViewModel extends BaseViewModel {
List<PrescriptionsList> _prescriptionsOrderListClinic = List();
List<PrescriptionsList> _prescriptionsOrderListHospital = List();
List<PrescriptionReport> get prescriptionReportList =>
_prescriptionsService.prescriptionReportList;
List<PrescriptionReport> get prescriptionReportList => _prescriptionsService.prescriptionReportList;
List<PrescriptionReportINP> get prescriptionReportListINP =>
_prescriptionsService.prescriptionReportListINP;
List<PrescriptionReportINP> get prescriptionReportListINP => _prescriptionsService.prescriptionReportListINP;
List<Prescriptions> get prescriptionsList =>
_prescriptionsService.prescriptionsList;
List<Prescriptions> get prescriptionsList => _prescriptionsService.prescriptionsList;
List<PrescriptionsOrder> get prescriptionsHistory =>
_prescriptionsService.prescriptionsOrderList;
List<PrescriptionsOrder> get prescriptionsHistory => _prescriptionsService.prescriptionsOrderList;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList =>
_prescriptionsService.pharmacyPrescriptionsList;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionsList> get prescriptionsOrderList =>
filterType == FilterType.Clinic
? _prescriptionsOrderListClinic
: _prescriptionsOrderListHospital;
filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital;
getPrescriptions() async {
setState(ViewState.Busy);
@ -55,38 +48,32 @@ class PrescriptionsViewModel extends BaseViewModel {
void _filterList() {
_prescriptionsService.prescriptionsList.forEach((element) {
/// PrescriptionsList list sort clinic
List<PrescriptionsList> prescriptionsByClinic =
_prescriptionsOrderListClinic
.where((elementClinic) =>
elementClinic.filterName == element.clinicDescription)
.toList();
List<PrescriptionsList> prescriptionsByClinic = _prescriptionsOrderListClinic
.where((elementClinic) => elementClinic.filterName == element.clinicDescription)
.toList();
if (prescriptionsByClinic.length != 0) {
_prescriptionsOrderListClinic[
_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])]
_prescriptionsOrderListClinic[_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])]
.prescriptionsList
.add(element);
} else {
_prescriptionsOrderListClinic.add(PrescriptionsList(
filterName: element.clinicDescription, prescriptions: element));
_prescriptionsOrderListClinic
.add(PrescriptionsList(filterName: element.clinicDescription, prescriptions: element));
}
/// PrescriptionsList list sort via hospital
List<PrescriptionsList> prescriptionsByHospital =
_prescriptionsOrderListHospital
.where(
(elementClinic) => elementClinic.filterName == element.name,
)
.toList();
List<PrescriptionsList> prescriptionsByHospital = _prescriptionsOrderListHospital
.where(
(elementClinic) => elementClinic.filterName == element.name,
)
.toList();
if (prescriptionsByHospital.length != 0) {
_prescriptionsOrderListHospital[_prescriptionsOrderListHospital
.indexOf(prescriptionsByHospital[0])]
_prescriptionsOrderListHospital[_prescriptionsOrderListHospital.indexOf(prescriptionsByHospital[0])]
.prescriptionsList
.add(element);
} else {
_prescriptionsOrderListHospital.add(PrescriptionsList(
filterName: element.name, prescriptions: element));
_prescriptionsOrderListHospital.add(PrescriptionsList(filterName: element.name, prescriptions: element));
}
});
}
@ -108,8 +95,7 @@ class PrescriptionsViewModel extends BaseViewModel {
getPrescriptionReport({Prescriptions prescriptions}) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReport(
prescriptions: prescriptions);
await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);
@ -127,8 +113,8 @@ class PrescriptionsViewModel extends BaseViewModel {
String mes,
int projectID}) async {
setState(ViewState.BusyLocal);
await _prescriptionsService.sendPrescriptionEmail(appointmentDate,
patientID, clinicName, doctorName, doctorID, projectID);
await _prescriptionsService.sendPrescriptionEmail(
appointmentDate, patientID, clinicName, doctorName, doctorID, projectID);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);
@ -144,19 +130,17 @@ class PrescriptionsViewModel extends BaseViewModel {
await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
List<PrescriptionReportEnh> get prescriptionReportEnhList =>
_prescriptionsService.prescriptionReportEnhList;
List<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList;
getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReportEnh(
prescriptionsOrder: prescriptionsOrder);
await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:intl/intl.dart';
import 'package:jiffy/jiffy.dart';
import 'ovulation_result_page.dart';
@ -22,6 +23,8 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
int lutealPhaseLength = 0;
String selectedDate;
var dateFrom = DateTime.now();
var babyAgeWeeks;
var babyAgeDays;
var dateTo = DateTime.now();
var conceivedDate = DateTime.now();
var deliveryDue = DateTime.now();
@ -78,10 +81,15 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
bloodSugarDate = date;
dateFrom = date.add(Duration(days: 10));
updatedDt = DateFormat.yMMMEd().format(dateFrom);
dateTo = date.add(Duration(days: 20));
conceivedDate = date.add(Duration(days: 14));
deliveryDue = date.add(Duration(days: 280));
// babyAge = Jiffy([DateTime.now()]).diff(Jiffy([date]), Units.WEEK);
babyAgeWeeks = Jiffy([DateTime.now().year, DateTime.now().month, DateTime.now().day])
.diff(Jiffy([date.year, date.month, dateTo.day]), Units.WEEK);
babyAgeDays = Jiffy([DateTime.now().year, DateTime.now().month, DateTime.now().day])
.diff(Jiffy([date.year, date.month, dateTo.day]), Units.DAY);
});
},
currentTime: DateTime.now(),
@ -91,9 +99,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -124,8 +130,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
child: Row(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0),
child: Center(
child: Container(
width: 60.0,
@ -146,10 +151,8 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
Container(
height: 38.0,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
@ -166,8 +169,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
),
onTap: () {
setState(() {
if (cycleLength < 45)
cycleLength++;
if (cycleLength < 45) cycleLength++;
});
},
),
@ -179,8 +181,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
),
onTap: () {
setState(() {
if (cycleLength > 0)
cycleLength--;
if (cycleLength > 0) cycleLength--;
});
},
),
@ -229,8 +230,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
child: Row(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0),
child: Center(
child: Container(
width: 60.0,
@ -245,17 +245,14 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
children: <Widget>[
Expanded(
child: Center(
child:
Text(lutealPhaseLength.toString()),
child: Text(lutealPhaseLength.toString()),
),
),
Container(
height: 38.0,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
@ -272,8 +269,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
),
onTap: () {
setState(() {
if (lutealPhaseLength < 15)
lutealPhaseLength++;
if (lutealPhaseLength < 15) lutealPhaseLength++;
});
},
),
@ -285,8 +281,7 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
),
onTap: () {
setState(() {
if (lutealPhaseLength > 0)
lutealPhaseLength--;
if (lutealPhaseLength > 0) lutealPhaseLength--;
});
},
),
@ -332,11 +327,13 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
context,
FadePage(
page: OvulationResult(
conceivedDate: conceivedDate,
dateFrom: dateFrom,
dateTo: dateTo,
deliveryDue: deliveryDue,
)),
conceivedDate: conceivedDate,
dateFrom: dateFrom,
dateTo: dateTo,
deliveryDue: deliveryDue,
babyAge: babyAgeWeeks,
babyAgeDays: babyAgeDays,
)),
);
}
});

@ -11,7 +11,17 @@ class OvulationResult extends StatelessWidget {
var dateTo;
var conceivedDate;
var deliveryDue;
OvulationResult({this.dateFrom, this.dateTo, this.deliveryDue, this.conceivedDate});
var babyAge;
var babyAgeDays;
OvulationResult({
this.dateFrom,
this.dateTo,
this.deliveryDue,
this.conceivedDate,
this.babyAge,
this.babyAgeDays,
});
//var newFormat = DateFormat("yy-MM-dd");
@override
@ -68,7 +78,7 @@ class OvulationResult extends StatelessWidget {
fontWeight: FontWeight.w400,
),
Texts(
'5 Weeks, 2',
babyAge.toString() + " Weeks," + "2",
fontWeight: FontWeight.w800,
fontSize: 21.0,
),

@ -40,8 +40,7 @@ class HomePage extends StatefulWidget {
}
class _HomePageState extends State<HomePage> {
PharmacyModuleViewModel pharmacyModuleViewModel =
locator<PharmacyModuleViewModel>();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
@override
Widget build(BuildContext context) {
@ -66,9 +65,7 @@ class _HomePageState extends State<HomePage> {
height: 210,
decoration: BoxDecoration(
image: DecorationImage(
image: ExactAssetImage(
'assets/images/dashboard_top_bg.png'),
fit: BoxFit.cover),
image: ExactAssetImage('assets/images/dashboard_top_bg.png'), fit: BoxFit.cover),
),
child: Stack(
children: <Widget>[
@ -77,131 +74,112 @@ class _HomePageState extends State<HomePage> {
left: 5,
right: 5,
child: Container(
width:
MediaQuery.of(context).size.width * 0.8,
width: MediaQuery.of(context).size.width * 0.8,
child: Row(
children: <Widget>[
Expanded(
child: Container(
height: 125,
padding: EdgeInsets.all(5),
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
"assets/images/new-design/covid_bg_transparent.png"),
fit: BoxFit.fill,
),
color:
Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(
Radius.circular(5))),
child: Container(
child: Column(
children: <Widget>[
Texts(
TranslationBase.of(context)
.covidTest,
color: Colors.white,
fontWeight: FontWeight.w700,
height: 125,
padding: EdgeInsets.all(5),
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
image: DecorationImage(
image:
AssetImage("assets/images/new-design/covid_bg_transparent.png"),
fit: BoxFit.fill,
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
children: <Widget>[
Container(
margin: EdgeInsets.only(
top: 15.0,
),
child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg',
width: 45.0,
height: 45.0),
color: Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(Radius.circular(5))),
child: (model.user != null && model.user.outSA == 1)
? Container(
width: double.infinity,
height: double.infinity,
color: Colors.grey.shade500.withOpacity(0.3),
child: Icon(
Icons.lock_outline,
size: 40,
),
Container(
margin: EdgeInsets.only(
top: 5.0),
child: Column(
children: <Widget>[
Texts(
TranslationBase.of(
context)
.driveThru,
fontWeight:
FontWeight.w700,
color: Colors.white,
),
ButtonTheme(
shape:
RoundedRectangleBorder(
borderRadius:
BorderRadius
.circular(
5.0),
)
: Container(
child: Column(
children: <Widget>[
Texts(
TranslationBase.of(context).covidTest,
color: Colors.white,
fontWeight: FontWeight.w700,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Container(
margin: EdgeInsets.only(
top: 15.0,
),
child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg',
width: 45.0,
height: 45.0),
),
minWidth: MediaQuery.of(
context)
.size
.width *
0.15,
height: 25.0,
child: RaisedButton(
color: Colors
.red[800],
textColor:
Colors.white,
disabledTextColor:
Colors.white,
disabledColor:
new Color(
0xFFbcc2c4),
onPressed: () {
navigateToCovidDriveThru();
},
child: Center(
child: Center(
child: Center(
child:
Center(
child:
Texts(
TranslationBase.of(context)
.bookNow,
fontWeight:
FontWeight.w700,
color: Colors
.white,
Container(
margin: EdgeInsets.only(top: 5.0),
child: Column(
children: <Widget>[
Texts(
TranslationBase.of(context).driveThru,
fontWeight: FontWeight.w700,
color: Colors.white,
),
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
),
minWidth: MediaQuery.of(context).size.width * 0.15,
height: 25.0,
child: RaisedButton(
color: Colors.red[800],
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed:
(model.user != null && model.user.outSA == 1)
? () {}
: () {
navigateToCovidDriveThru();
},
child: Center(
child: Center(
child: Center(
child: Center(
child: Texts(
TranslationBase.of(context).bookNow,
fontWeight: FontWeight.w700,
color: Colors.white,
),
),
),
),
),
),
),
),
],
),
),
),
],
),
],
),
],
),
],
),
],
),
),
),
)),
),
Expanded(
child: InkWell(
onTap: () => Navigator.push(context,
FadePage(page: LiveCareHome())),
onTap: () => Navigator.push(context, FadePage(page: LiveCareHome())),
child: Container(
height: 125,
padding: EdgeInsets.all(15),
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
color: Colors.white
.withOpacity(0.3),
borderRadius: BorderRadius.all(
Radius.circular(5))),
color: Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(Radius.circular(5))),
child: SvgPicture.asset(
projectViewModel.isArabic
? 'assets/images/new-design/livecare_arabic_logo.svg'
@ -217,23 +195,15 @@ class _HomePageState extends State<HomePage> {
],
),
),
Container(
width: double.infinity,
height: projectViewModel.isArabic ? 110 : 80)
Container(width: double.infinity, height: projectViewModel.isArabic ? 110 : 80)
],
),
Positioned(
top: 155,
left: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation ==
Orientation.landscape
? 0.02
: 0.03),
(MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03),
right: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation ==
Orientation.landscape
? 0.02
: 0.03),
(MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03),
child: (!model.isLogin)
? Container(
width: double.infinity,
@ -241,14 +211,10 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration(
color: HexColor('#A59E9E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent, width: 0.5),
borderRadius:
BorderRadius.all(Radius.circular(9)),
border: Border.all(color: Colors.transparent, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(9)),
image: DecorationImage(
image: ExactAssetImage(
'assets/images/bg_graphic.png'),
fit: BoxFit.cover)),
image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover)),
child: Container(
margin: EdgeInsets.all(5),
child: Column(
@ -264,37 +230,30 @@ class _HomePageState extends State<HomePage> {
fontSize: 23,
),
Texts(
TranslationBase.of(context)
.myMedicalFileSubTitle,
TranslationBase.of(context).myMedicalFileSubTitle,
color: Colors.black,
fontSize: 16,
),
Align(
alignment: projectViewModel.isArabic
? Alignment.bottomLeft
: Alignment.bottomRight,
alignment:
projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
child: InkWell(
onTap: () {
widget.goToMyProfile();
},
child: Container(
margin: EdgeInsets.only(
left: 15, right: 15),
margin: EdgeInsets.only(left: 15, right: 15),
width: 90,
height: 30,
decoration: BoxDecoration(
color: HexColor('#D81A2E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent,
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(0)),
border: Border.all(color: Colors.transparent, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(0)),
),
child: Center(
child: Texts(
TranslationBase.of(context)
.viewMore,
TranslationBase.of(context).viewMore,
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize: 12,
@ -313,14 +272,10 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration(
color: HexColor('#A59E9E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent, width: 0.5),
borderRadius:
BorderRadius.all(Radius.circular(9)),
border: Border.all(color: Colors.transparent, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(9)),
image: DecorationImage(
image: ExactAssetImage(
'assets/images/bg_graphic.png'),
fit: BoxFit.cover),
image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover),
),
child: Container(
margin: EdgeInsets.all(5),
@ -328,81 +283,51 @@ class _HomePageState extends State<HomePage> {
children: <Widget>[
Row(
children: <Widget>[
if (projectViewModel.user != null &&
model.isLogin)
if (projectViewModel.user != null && model.isLogin)
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 8,
),
model.user.cRSVerificationStatus ==
2
model.user.cRSVerificationStatus == 2
? Row(
children: [
Texts(
model.user
.firstName +
" " +
model.user
.lastName,
color: Colors
.grey[100],
model.user.firstName + " " + model.user.lastName,
color: Colors.grey[100],
bold: true,
fontSize: 15,
),
Container(
margin: EdgeInsets
.fromLTRB(
8.0,
0.0,
8.0,
0.0),
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
child: SvgPicture.asset(
"assets/images/new-design/verification_check.svg"),
),
],
)
: model.user.cRSVerificationStatus ==
3
: model.user.cRSVerificationStatus == 3
? Row(
children: [
Texts(
model.user
.firstName +
" " +
model.user
.lastName,
color: Colors
.grey[100],
model.user.firstName + " " + model.user.lastName,
color: Colors.grey[100],
bold: true,
fontSize: 15,
),
Container(
margin: EdgeInsets
.fromLTRB(
8.0,
0.0,
8.0,
0.0),
child: SvgPicture
.asset(
"assets/images/new-design/pending.svg"),
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
child: SvgPicture.asset(
"assets/images/new-design/pending.svg"),
),
],
)
: Row(
children: [
Texts(
model.user
.firstName +
" " +
model.user
.lastName,
color: Colors
.grey[100],
model.user.firstName + " " + model.user.lastName,
color: Colors.grey[100],
bold: true,
fontSize: 15,
),
@ -436,17 +361,14 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration(
color: HexColor('#D81A2E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent,
width: 0.5),
border: Border.all(color: Colors.transparent, width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
child: Center(
child: Texts(
TranslationBase.of(context)
.myMedicalFile,
TranslationBase.of(context).myMedicalFile,
color: Colors.white,
fontSize: 12,
textAlign: TextAlign.center,
@ -485,10 +407,8 @@ class _HomePageState extends State<HomePage> {
width: 25,
height: 40,
),
Texts(
'${model.weightKg} ${TranslationBase.of(context).kg}',
color: Colors.white,
fontSize: 17)
Texts('${model.weightKg} ${TranslationBase.of(context).kg}',
color: Colors.white, fontSize: 17)
],
),
),
@ -503,9 +423,7 @@ class _HomePageState extends State<HomePage> {
width: 35,
height: 40,
),
Texts('${model.booldType}',
color: Colors.white,
fontSize: 17)
Texts('${model.booldType}', color: Colors.white, fontSize: 17)
],
),
),
@ -519,12 +437,10 @@ class _HomePageState extends State<HomePage> {
],
),
Padding(
padding:
const EdgeInsets.only(bottom: 15, right: 15, left: 15),
padding: const EdgeInsets.only(bottom: 15, right: 15, left: 15),
child: InkWell(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => PackagesHomePage()));
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage()));
},
child: Container(
decoration: BoxDecoration(
@ -571,13 +487,14 @@ class _HomePageState extends State<HomePage> {
},
child: Center(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: (model.user != null &&
model.user.outSA == 1)
padding: (model.user != null && model.user.outSA == 1)
? const EdgeInsets.all(0.0)
: const EdgeInsets.all(15.0),
child: (model.user != null && model.user.outSA == 1)
? Container(
width: double.infinity,
height: double.infinity,
color: Colors.grey.withOpacity(0.7),
color: Colors.grey.shade500.withOpacity(0.3),
child: Icon(
Icons.lock_outline,
size: 40,
@ -594,14 +511,11 @@ class _HomePageState extends State<HomePage> {
height: 10,
),
Texts(
TranslationBase.of(context)
.homeHealthCare,
TranslationBase.of(context).homeHealthCare,
textAlign: TextAlign.center,
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize:
SizeConfig.textMultiplier *
1.55,
fontSize: SizeConfig.textMultiplier * 1.55,
)
],
)),
@ -613,18 +527,17 @@ class _HomePageState extends State<HomePage> {
if (projectViewModel.havePrivilege(65))
DashboardItem(
onTap: () =>
(model.user != null && model.user.outSA == 1)
? () {}
: getPharmacyToken(model),
(model.user != null && model.user.outSA == 1) ? () {} : getPharmacyToken(model),
child: Center(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: (model.user != null &&
model.user.outSA == 1)
padding: (model.user != null && model.user.outSA == 1)
? const EdgeInsets.all(0.0)
: const EdgeInsets.all(15.0),
child: (model.user != null && model.user.outSA == 1)
? Container(
width: double.infinity,
height: double.infinity,
color: Colors.grey.withOpacity(0.7),
color: Colors.grey.shade500.withOpacity(0.3),
child: Icon(
Icons.lock_outline,
size: 40,
@ -647,14 +560,11 @@ class _HomePageState extends State<HomePage> {
height: 20,
),
Texts(
TranslationBase.of(context)
.onlinePharmacy,
TranslationBase.of(context).onlinePharmacy,
textAlign: TextAlign.center,
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize:
SizeConfig.textMultiplier *
1.55,
fontSize: SizeConfig.textMultiplier * 1.55,
)
],
),
@ -677,13 +587,14 @@ class _HomePageState extends State<HomePage> {
},
child: Center(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: (model.user != null &&
model.user.outSA == 1)
padding: (model.user != null && model.user.outSA == 1)
? const EdgeInsets.all(0.0)
: const EdgeInsets.all(15.0),
child: (model.user != null && model.user.outSA == 1)
? Container(
width: double.infinity,
height: double.infinity,
color: Colors.grey.withOpacity(0.7),
color: Colors.grey.shade500.withOpacity(0.3),
child: Icon(
Icons.lock_outline,
size: 40,
@ -700,14 +611,11 @@ class _HomePageState extends State<HomePage> {
height: 10,
),
Texts(
TranslationBase.of(context)
.cmcHeading,
TranslationBase.of(context).cmcHeading,
textAlign: TextAlign.center,
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize:
SizeConfig.textMultiplier *
1.55,
fontSize: SizeConfig.textMultiplier * 1.55,
)
],
)),
@ -723,8 +631,7 @@ class _HomePageState extends State<HomePage> {
height: 8,
),
InkWell(
onTap: () =>
Navigator.push(context, FadePage(page: PaymentService())),
onTap: () => Navigator.push(context, FadePage(page: PaymentService())),
child: Container(
margin: EdgeInsets.only(left: 15, right: 15),
child: Row(
@ -745,8 +652,7 @@ class _HomePageState extends State<HomePage> {
height: 5,
),
Texts(
TranslationBase.of(context)
.onlinePaymentService,
TranslationBase.of(context).onlinePaymentService,
textAlign: TextAlign.center,
color: Colors.black87,
bold: false,
@ -777,8 +683,7 @@ class _HomePageState extends State<HomePage> {
height: 10,
),
Texts(
TranslationBase.of(context)
.offersAndPackages,
TranslationBase.of(context).offersAndPackages,
textAlign: TextAlign.center,
color: Colors.black87,
bold: false,
@ -818,13 +723,11 @@ class _HomePageState extends State<HomePage> {
height: 10,
),
Texts(
TranslationBase.of(context)
.emergencyServices,
TranslationBase.of(context).emergencyServices,
textAlign: TextAlign.center,
color: Colors.black87,
bold: false,
fontSize:
SizeConfig.textMultiplier * 1.7,
fontSize: SizeConfig.textMultiplier * 1.7,
)
],
),
@ -862,8 +765,7 @@ class _HomePageState extends State<HomePage> {
fontWeight: FontWeight.normal,
),
Texts(
TranslationBase.of(context)
.viewAllHabibMedicalService,
TranslationBase.of(context).viewAllHabibMedicalService,
color: Colors.white,
fontWeight: FontWeight.normal,
fontSize: 10,
@ -884,15 +786,13 @@ class _HomePageState extends State<HomePage> {
opacity: 0.5,
color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45,
onTap: () => Navigator.push(
context, FadePage(page: AllHabibMedicalService())),
onTap: () => Navigator.push(context, FadePage(page: AllHabibMedicalService())),
),
DashboardItem(
onTap: () {
// Navigator.push(
// context, FadePage(page: FeedbackHomePage()));
Navigator.push(
context, FadePage(page: ContactUsPage()));
Navigator.push(context, FadePage(page: ContactUsPage()));
},
child: Container(
width: double.infinity,
@ -1014,10 +914,8 @@ class DashboardItem extends StatelessWidget {
? DecorationImage(
image: ExactAssetImage('assets/images/$imageName'),
fit: BoxFit.cover,
colorFilter: hasColorFilter
? new ColorFilter.mode(
Colors.black.withOpacity(0.2), BlendMode.dstIn)
: null,
colorFilter:
hasColorFilter ? new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn) : null,
)
: null,
),

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
@ -29,22 +30,7 @@ class WeightMonthlyPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
body: model.weighMonthTimeSeriesData.isEmpty
? Container(
child: Center(
child: Container(
child: Center(
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
),
),
)
: ListView(
body: ListView(
children: [
Container(
width: double.maxFinite,
@ -52,7 +38,7 @@ class WeightMonthlyPage extends StatelessWidget {
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData,
timeSeries: model.weighMonthTimeSeriesData.isEmpty?[TimeSeriesSales3(0, 0.0)]:model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
)),
SizedBox(
@ -68,7 +54,11 @@ class WeightMonthlyPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
model.weighMonthTimeSeriesData.isEmpty? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
):Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.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';
@ -25,22 +26,7 @@ class WeightWeeklyPage extends StatelessWidget {
return AppScaffold(
isShowDecPage: false,
body: model.weightWeekTimeSeriesData.isEmpty
? Container(
child: Center(
child: Container(
child: Center(
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
),
),
)
: ListView(
body: ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
@ -48,7 +34,9 @@ class WeightWeeklyPage extends StatelessWidget {
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData,
timeSeries: model.weightWeekTimeSeriesData.isEmpty
? [TimeSeriesSales2(DateTime.now(), 0.0)]
: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
@ -65,9 +53,14 @@ class WeightWeeklyPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
model.weightWeekTimeSeriesData.isEmpty? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
):Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
inside:
BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
@ -79,7 +72,8 @@ class WeightWeeklyPage extends StatelessWidget {
);
}
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> fullData(BuildContext context,
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -88,8 +82,12 @@ class WeightWeeklyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
),
),
child: Center(
@ -129,8 +127,12 @@ class WeightWeeklyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
),
),
child: Center(

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
@ -28,22 +29,8 @@ class WeightYearPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
body: model.weightYearTimeSeriesData.isEmpty
? Container(
child: Center(
child: Container(
child: Center(
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
),
),
)
: ListView(
body:
ListView(
children: [
Container(
width: double.maxFinite,
@ -51,7 +38,7 @@ class WeightYearPage extends StatelessWidget {
child: LineChartCurved(
horizontalInterval: 2.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData,
timeSeries: model.weightYearTimeSeriesData.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightYearTimeSeriesData,
indexes: model.weightYearTimeSeriesData.length ~/ 5.5 ?? "",
)),
SizedBox(
@ -67,7 +54,11 @@ class WeightYearPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
model.weightYearTimeSeriesData.isEmpty? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
):Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),

@ -144,7 +144,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
),
InkWell(
onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeEnList : measureTimeArList);
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
},
child: Container(
padding: EdgeInsets.all(12),

@ -30,7 +30,7 @@ class BloodMonthlyPage extends StatelessWidget {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
baseViewModel: bloodSugarViewMode,
// baseViewModel: bloodSugarViewMode,
body: ListView(
children: [
Container(

@ -25,7 +25,7 @@ class BloodYearPage extends StatelessWidget {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
baseViewModel: bloodSugarViewMode,
// baseViewModel: bloodSugarViewMode,
body: ListView(
children: [
Container(

@ -31,7 +31,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
baseViewModel: bloodSugarViewMode,
// baseViewModel: bloodSugarViewMode,
body: ListView(
children: [
Container(

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -11,91 +12,136 @@ import 'package:url_launcher/url_launcher.dart';
class PharmacyForPrescriptionsPage extends StatelessWidget {
final itemID;
final PrescriptionReport prescriptionReport;
PharmacyForPrescriptionsPage({Key key, this.itemID});
PharmacyForPrescriptionsPage({Key key, this.itemID, this.prescriptionReport});
@override
Widget build(BuildContext context) {
return BaseView<PrescriptionsViewModel>(
onModelReady: (model) =>
model.getListPharmacyForPrescriptions(itemId: itemID),
onModelReady: (model) => model.getListPharmacyForPrescriptions(itemId: itemID),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).availability,
baseViewModel: model,
body: ListView.builder(
itemBuilder: (context, index) => Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
body: Column(
children: [
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200], width: 0.5),
),
border: Border.all(color: Colors.grey[200], width: 0.5),
),
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
model.pharmacyPrescriptionsList[index].projectImageURL,
fit: BoxFit.cover,
width: 60,
height: 70,
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReport.imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(model.pharmacyPrescriptionsList[index]
.locationDescription),
SizedBox(
height: 5,
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(prescriptionReport.itemDescription.isNotEmpty
? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN ?? ''),
),
),
)
],
),
),
model.pharmacyPrescriptionsList.isNotEmpty == true
? ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemBuilder: (context, index) => Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
Texts(model.pharmacyPrescriptionsList[index].cityName),
],
border: Border.all(color: Colors.grey[200], width: 0.5),
),
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
model.pharmacyPrescriptionsList[index].projectImageURL,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(model.pharmacyPrescriptionsList[index].locationDescription),
SizedBox(
height: 5,
),
Texts(model.pharmacyPrescriptionsList[index].cityName),
],
),
),
),
InkWell(
onTap: () {
MapsLauncher.launchCoordinates(
double.parse(model.pharmacyPrescriptionsList[index].latitude),
double.parse(model.pharmacyPrescriptionsList[index].longitude));
},
child: Icon(
Icons.pin_drop,
size: 18,
color: Colors.red[900],
),
),
SizedBox(
width: 15,
),
InkWell(
onTap: Feedback.wrapForTap(() {
launch("tel://${model.pharmacyPrescriptionsList[index].phoneNumber}");
}, context),
child: Container(
child: Icon(
Icons.call,
size: 18,
color: Colors.red[900],
),
),
)
],
),
),
),
),
InkWell(
onTap: () {
MapsLauncher.launchCoordinates(
double.parse(
model.pharmacyPrescriptionsList[index].latitude),
double.parse(
model.pharmacyPrescriptionsList[index].longitude));
},
child: Icon(
Icons.pin_drop,
size: 18,
color: Colors.red[900],
),
),
SizedBox(
width: 15,
),
InkWell(
onTap: Feedback.wrapForTap(() {
launch(
"tel://${model.pharmacyPrescriptionsList[index].phoneNumber}");
}, context),
child: Container(
child: Icon(
Icons.call,
size: 18,
color: Colors.red[900],
itemCount: model.pharmacyPrescriptionsList.length,
)
: Padding(
padding: const EdgeInsets.only(top: 65.0),
child: Texts(
TranslationBase.of(context).thisItemIsNotAvailable,
textAlign: TextAlign.center,
),
),
)
],
),
),
itemCount: model.pharmacyPrescriptionsList.length,
],
),
),
);

@ -51,10 +51,9 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
prescriptionReport.itemDescription.isNotEmpty
? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN ?? ''),
child: Texts(prescriptionReport.itemDescription.isNotEmpty
? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN ?? ''),
),
),
)
@ -71,7 +70,8 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
context,
FadePage(
page: PharmacyForPrescriptionsPage(
itemID: prescriptionReport.itemID),
itemID: prescriptionReport.itemID,
),
),
),
child: Center(
@ -79,9 +79,7 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
children: <Widget>[
Container(
width: 50,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle),
decoration: BoxDecoration(color: Colors.white, shape: BoxShape.rectangle),
child: Column(
children: <Widget>[
Icon(
@ -108,9 +106,7 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
color: Colors.white,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
child: Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 0.5),
outside: BorderSide(width: 0.5)),
border: TableBorder.symmetric(inside: BorderSide(width: 0.5), outside: BorderSide(width: 0.5)),
children: [
TableRow(
children: [
@ -159,28 +155,22 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(
child: Text(prescriptionReport.routeN ?? ''))),
child: Center(child: Text(prescriptionReport.routeN ?? ''))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(
child:
Text(prescriptionReport.frequencyN ?? ''))),
child: Center(child: Text(prescriptionReport.frequencyN ?? ''))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(
child: Text(
'${prescriptionReport.doseDailyQuantity}'))),
child: Center(child: Text('${prescriptionReport.doseDailyQuantity}'))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child:
Center(child: Text('${prescriptionReport.days}')))
child: Center(child: Text('${prescriptionReport.days}')))
],
),
],
@ -222,18 +212,15 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
return GestureDetector(
onTap: () {
DateTime startDate = DateTime.now();
DateTime endDate = DateTime(startDate.year, startDate.month,
startDate.day + prescriptionReport.days);
DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionReport.days);
print(prescriptionReport);
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue =
Curves.easeInOutBack.transform(a1.value) - 1.0;
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform:
Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: ReminderDialog(
@ -241,8 +228,7 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
title: "Prescription Reminder",
description:
"${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
startDate:
"/Date(${startDate.millisecondsSinceEpoch}+0300)/",
startDate: "/Date(${startDate.millisecondsSinceEpoch}+0300)/",
endDate: "/Date(${endDate.millisecondsSinceEpoch}+0300)/",
location: prescriptionReport.remarks,
),
@ -262,10 +248,10 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
// height: 100.0,
margin: EdgeInsets.all(7.0),
padding: EdgeInsets.only(bottom: 4.0),
decoration: BoxDecoration(boxShadow: [
BoxShadow(
color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)
], borderRadius: BorderRadius.circular(10), color: Colors.white),
decoration: BoxDecoration(
boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)],
borderRadius: BorderRadius.circular(10),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
@ -274,31 +260,20 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
margin: EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0),
child: Text("add",
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xffB8382C),
letterSpacing: 1.0,
fontSize: 18.0)),
style: TextStyle(color: new Color(0xffB8382C), letterSpacing: 1.0, fontSize: 18.0)),
),
Container(
margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
child: Text("reminder",
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.black,
letterSpacing: 1.0,
fontSize: 15.0)),
style: TextStyle(color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)),
),
Container(
alignment: projectViewModel.isArabic
? Alignment.bottomLeft
: Alignment.bottomRight,
alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
margin: projectViewModel.isArabic
? EdgeInsets.fromLTRB(10.0, 7.0, 0.0, 8.0)
: EdgeInsets.fromLTRB(0.0, 7.0, 10.0, 8.0),
child: Image.asset(
"assets/images/new-design/reminder_icon.png",
width: 45.0,
height: 45.0),
child: Image.asset("assets/images/new-design/reminder_icon.png", width: 45.0, height: 45.0),
),
],
),

@ -50,10 +50,9 @@ class PrescriptionDetailsPage extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
prescriptionReport.itemDescription.isNotEmpty
? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN ?? ''),
child: Texts(prescriptionReport.itemDescription.isNotEmpty
? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN ?? ''),
),
),
)
@ -70,7 +69,9 @@ class PrescriptionDetailsPage extends StatelessWidget {
context,
FadePage(
page: PharmacyForPrescriptionsPage(
itemID: prescriptionReport.itemID),
itemID: prescriptionReport.itemID,
prescriptionReport: prescriptionReport,
),
),
),
child: Center(
@ -78,9 +79,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
children: <Widget>[
Container(
width: 50,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle),
decoration: BoxDecoration(color: Colors.white, shape: BoxShape.rectangle),
child: Column(
children: <Widget>[
Icon(
@ -107,9 +106,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
color: Colors.white,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
child: Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 0.5),
outside: BorderSide(width: 0.5)),
border: TableBorder.symmetric(inside: BorderSide(width: 0.5), outside: BorderSide(width: 0.5)),
children: [
TableRow(
children: [
@ -158,28 +155,22 @@ class PrescriptionDetailsPage extends StatelessWidget {
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(
child: Text(prescriptionReport.routeN ?? ''))),
child: Center(child: Text(prescriptionReport.routeN ?? ''))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(
child:
Text(prescriptionReport.frequencyN ?? ''))),
child: Center(child: Text(prescriptionReport.frequencyN ?? ''))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(
child: Text(
'${prescriptionReport.doseDailyQuantity}'))),
child: Center(child: Text('${prescriptionReport.doseDailyQuantity}'))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child:
Center(child: Text('${prescriptionReport.days}')))
child: Center(child: Text('${prescriptionReport.days}')))
],
),
],
@ -221,18 +212,15 @@ class PrescriptionDetailsPage extends StatelessWidget {
return GestureDetector(
onTap: () {
DateTime startDate = DateTime.now();
DateTime endDate = DateTime(startDate.year, startDate.month,
startDate.day + prescriptionReport.days);
DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionReport.days);
print(prescriptionReport);
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue =
Curves.easeInOutBack.transform(a1.value) - 1.0;
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform:
Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: ReminderDialog(
@ -240,8 +228,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
title: "Prescription Reminder",
description:
"${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
startDate:
"/Date(${startDate.millisecondsSinceEpoch}+0300)/",
startDate: "/Date(${startDate.millisecondsSinceEpoch}+0300)/",
endDate: "/Date(${endDate.millisecondsSinceEpoch}+0300)/",
location: prescriptionReport.remarks,
),
@ -261,10 +248,10 @@ class PrescriptionDetailsPage extends StatelessWidget {
// height: 100.0,
margin: EdgeInsets.all(7.0),
padding: EdgeInsets.only(bottom: 4.0),
decoration: BoxDecoration(boxShadow: [
BoxShadow(
color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)
], borderRadius: BorderRadius.circular(10), color: Colors.white),
decoration: BoxDecoration(
boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)],
borderRadius: BorderRadius.circular(10),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
@ -273,31 +260,20 @@ class PrescriptionDetailsPage extends StatelessWidget {
margin: EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0),
child: Text("add",
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xffB8382C),
letterSpacing: 1.0,
fontSize: 18.0)),
style: TextStyle(color: new Color(0xffB8382C), letterSpacing: 1.0, fontSize: 18.0)),
),
Container(
margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
child: Text("reminder",
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.black,
letterSpacing: 1.0,
fontSize: 15.0)),
style: TextStyle(color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)),
),
Container(
alignment: projectViewModel.isArabic
? Alignment.bottomLeft
: Alignment.bottomRight,
alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
margin: projectViewModel.isArabic
? EdgeInsets.fromLTRB(10.0, 7.0, 0.0, 8.0)
: EdgeInsets.fromLTRB(0.0, 7.0, 10.0, 8.0),
child: Image.asset(
"assets/images/new-design/reminder_icon.png",
width: 45.0,
height: 45.0),
child: Image.asset("assets/images/new-design/reminder_icon.png", width: 45.0, height: 45.0),
),
],
),

@ -22,6 +22,8 @@ int price = 0;
var languageID;
bool isOverQuantity = false;
bool isInWishlit = false;
//int isSelected = 1;
bool isSelected= true;
String itemID;
var customerId;
CompareList compareItems = new CompareList();
@ -642,14 +644,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
padding: EdgeInsets.only(bottom: 5),
// margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4),
child: BaseView<PharmacyModuleViewModel>(
onModelReady: (model) =>
model.getRecommendedProducts(
widget.product.id.toString()),
onModelReady: (model) => model.getRecommendedProducts(widget.product.id.toString()),
builder: (_, model, wi) => Container(
child:
// Text(model.recommendedProductList[0].id),
model.recommendedProductList.length !=
null
model.recommendedProductList.length != null
? Expanded(
child: ListView.builder(
scrollDirection:
@ -657,11 +657,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
shrinkWrap: true,
physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
itemCount: model
.recommendedProductList
.length,
itemBuilder:
(context, index) {
itemCount: model.recommendedProductList.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
Navigator.push(
@ -674,42 +671,22 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
elevation: 2,
shape: RoundedRectangleBorder(
side: BorderSide(
color: Colors
.grey[
300],
color: Colors.grey[300],
width: 2),
borderRadius:
BorderRadius
.circular(
10)),
margin: EdgeInsets
.symmetric(
borderRadius: BorderRadius.circular(10)),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 0,
),
child: Container(
decoration:
BoxDecoration(
borderRadius:
BorderRadius
.all(
Radius.circular(
15),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(15),
),
),
padding: EdgeInsets
.symmetric(
horizontal:
4),
width: MediaQuery.of(
context)
.size
.width /
3,
padding: EdgeInsets.symmetric(horizontal: 4),
width: MediaQuery.of(context).size.width / 3,
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
@ -717,11 +694,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
child: Align(
alignment: Alignment.topRight,
child: IconButton(
icon: Icon(!isInWishlit
? Icons.favorite_border
: Icons.favorite),
icon: Icon(!isInWishlit ? Icons.favorite_border : Icons.favorite),
color: !isInWishlit ? Colors.grey : Colors.red,
onPressed: () async {
if (customerId != null) {
if (!isInWishlit) {
await addToWishlistFunction(model.recommendedProductList[index].id);
@ -734,29 +710,36 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
setState(() {});
},
)),
// itemID.contains(model.recommendedProductList[index].id)
// child: Align(
// alignment: Alignment.topRight,
// child:itemID.contains(model.recommendedProductList[index].id)
// // !isInWishlist
// ? IconButton(
// icon: Icon(Icons.favorite_border),
// color: Colors.red,
// color: Colors.grey,
// iconSize: 30,
// onPressed: () {
// setState(() {
// deleteFromWishlistFunction(itemID);
// });
// if (customerId != null && isInWishlit ) {
// deleteFromWishlistFunction(
// model.recommendedProductList[index].id);
// } });
// },
// )
// : IconButton(
// icon: Icon(Icons.favorite),
// color: Colors.grey,
// color: Colors.red,
// iconSize: 30,
// onPressed: () {
// setState(() {
// addToWishlistFunction(itemID);
// });
// if (customerId != null && !isInWishlit ) {
// addToWishlistFunction(
// model.recommendedProductList[index].id);
// } });
// },
// )
//
// ),
),
Container(

@ -231,37 +231,21 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
Stack(children: [
Container(
child: Align(
alignment:
Alignment
.topRight,
child:
itemID.contains(e.id)
alignment: Alignment.topRight,
child: itemID.contains(e.id)
// !isInWishlist
? IconButton(
icon:
Icon(Icons.favorite_border),
color:
Colors.grey,
iconSize:
30,
? IconButton(icon: Icon(Icons.favorite_border),
color: Colors.grey, iconSize: 30,
onPressed:
() {
setState(() {
addToWishlistFunction(itemID);
setState(() {addToWishlistFunction(itemID);
});
},
)
:
IconButton(
icon:
Icon(Icons.favorite),
color:
Colors.red,
iconSize:
30,
: IconButton(icon: Icon(Icons.favorite),
color: Colors.red, iconSize: 30,
onPressed:
() {
setState(() {
() {setState(() {
deleteFromWishlistFunction(itemID);
});
},
@ -269,149 +253,74 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
//
),
),
Container(
margin: EdgeInsets
.fromLTRB(0, 16,
10, 16),
alignment:
Alignment.center,
Container(margin: EdgeInsets.fromLTRB(0, 16, 10, 16),
alignment: Alignment.center,
// padding: EdgeInsets.only(left: 25, bottom: 20),
child: (e.images !=
null &&
e.images.length >
0)
? Image.network(
e.images[0]
.src
.toString(),
child: (e.images != null && e.images.length > 0)
? Image.network(e.images[0].src.toString(),
// item.images[0].src,
fit: BoxFit
.cover,
height: 60,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit
.cover,
height: 60,
fit: BoxFit.cover, height: 60,)
: Image.asset("assets/images/no_image.png", fit: BoxFit.cover, height: 60,
),
),
Container(
width: e.rxMessage !=
null
? MediaQuery.of(
context)
.size
.width /
5
: 0,
padding:
EdgeInsets.all(4),
decoration:
BoxDecoration(
color: Color(
0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
Container(width: e.rxMessage != null ? MediaQuery.of(context)
.size.width / 5 : 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
),
child: Texts(
e.rxMessage != null
? e.rxMessage
: "",
child: Texts(e.rxMessage != null ? e.rxMessage : "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
fontWeight: FontWeight.w400,
),
),
]),
Container(
margin: EdgeInsets
.symmetric(
horizontal: 6,
vertical: 0,
.symmetric(horizontal: 6, vertical: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
languageID == "ar"
? e.namen
: e.name,
languageID == "ar" ? e.namen : e.name,
style: TextStyle(
color: Colors
.black,
fontSize: 13.0,
color: Colors.black, fontSize: 13.0,
// fontWeight: FontWeight.bold,
),
),
Padding(
// padding: const EdgeInsets.only(top: 15, bottom: 10),
padding:
const EdgeInsets
.only(
top: 10,
bottom:
5),
child: Texts(
"SAR ${e.price}",
bold: true,
fontSize: 14,
padding: const EdgeInsets.only(top: 10, bottom: 5),
child: Texts("SAR ${e.price}",
bold: true, fontSize: 14,
),
),
],
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
padding: EdgeInsets
.only(
right:
10),
padding: EdgeInsets.only(right: 10),
// margin: EdgeInsets.only(left: 5),
child: Align(
alignment:
Alignment
.topLeft,
child: RatingBar
.readOnly(
initialRating: e
.approvedRatingSum
.toDouble(),
child: Align(alignment: Alignment.topLeft,
child: RatingBar.readOnly(initialRating: e.approvedRatingSum.toDouble(),
// initialRating: productRate,
size: 13.0,
filledColor:
Colors.yellow[
700],
emptyColor:
Colors.grey[
500],
isHalfAllowed:
true,
halfFilledIcon:
Icons
.star_half,
filledIcon:
Icons
.star,
emptyIcon:
Icons
.star,
size: 13.0, filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
),
Texts(
"(${e.approvedTotalReviews.toString()})",
Texts("(${e.approvedTotalReviews.toString()})",
// bold: true,
fontSize: 12,
),
@ -664,8 +573,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
return Card(
elevation: 2,
shape: RoundedRectangleBorder(
side:
BorderSide(color: Colors.grey[300], width: 2),
side: BorderSide(color: Colors.grey[300], width: 2),
borderRadius: BorderRadius.circular(10)),
//
margin: EdgeInsets.symmetric(
@ -692,14 +600,12 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
//wishlistVar[index].id.contains(model.recommendedProductList[index].id)
!isInWishlist
? IconButton(
icon: Icon(
Icons.favorite_border),
icon: Icon(Icons.favorite_border),
color: Colors.grey,
iconSize: 30,
onPressed: () {
setState(() {
addToWishlistFunction(
itemID);
addToWishlistFunction(itemID);
});
},
)
@ -709,8 +615,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
iconSize: 30,
onPressed: () {
setState(() {
deleteFromWishlistFunction(
itemID);
deleteFromWishlistFunction(itemID);
});
},
)
@ -721,30 +626,20 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
margin: EdgeInsets.fromLTRB(0, 16, 10, 16),
alignment: Alignment.center,
// padding: EdgeInsets.only(left: 25, bottom: 20),
child: (model.recommendedProductList[index]
.images !=
null &&
model.recommendedProductList[index]
.images.length >
0)
? Image.network(
model.recommendedProductList[index]
.images[0].src
.toString(),
child: (model.recommendedProductList[index].images != null &&
model.recommendedProductList[index].images.length > 0)
? Image.network(model.recommendedProductList[index].images[0].src.toString(),
// item.images[0].src,
fit: BoxFit.cover,
height: 60,
)
: Image.asset(
"assets/images/no_image.png",
: Image.asset("assets/images/no_image.png",
fit: BoxFit.cover,
height: 60,
),
),
Container(
width: model.recommendedProductList[index]
.rxMessage !=
null
width: model.recommendedProductList[index].rxMessage != null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
@ -754,11 +649,8 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
topLeft: Radius.circular(6)),
),
child: Texts(
model.recommendedProductList[index]
.rxMessage !=
null
? model.recommendedProductList[index]
.rxMessage
model.recommendedProductList[index].rxMessage != null
? model.recommendedProductList[index].rxMessage
: "",
color: Colors.white,
regular: true,
@ -773,12 +665,9 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
vertical: 2,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
model
.recommendedProductList[index].name,
Text(model.recommendedProductList[index].name,
style: TextStyle(
color: Colors.black,
fontSize: 13.0,
@ -799,8 +688,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
padding: EdgeInsets.only(
@ -809,10 +697,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: model
.recommendedProductList[index]
.approvedRatingSum
.toDouble(),
initialRating: model.recommendedProductList[index].approvedRatingSum.toDouble(),
// initialRating: productRate,
size: 13.0,
filledColor: Colors.yellow[700],

File diff suppressed because it is too large Load Diff

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/mobile_number.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import '../../Constants.dart';
@ -127,7 +128,9 @@ class _MobileNo extends State<MobileNo> {
controller: widget.controller,
keyboardType: TextInputType.number,
maxLength: 10,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.allow(RegExp("[0-9]")),
],
// maxLengthEnforced: true,
// onChanged: (value) {
// widget.controller.text = countryCode;

@ -148,6 +148,8 @@ dependencies:
#Handle Geolocation
geolocator: ^6.1.10
jiffy: ^3.0.0
screen: ^0.0.5
#google maps places
google_maps_place_picker: ^1.0.0

Loading…
Cancel
Save