Merge branch 'development_new_design_2.0' into haroon-new-design

# Conflicts:
#	lib/pages/medical/prescriptions/prescription_details_page.dart
merge-update-with-lab-changes
haroon amjad 5 years ago
commit bf4709fef6

@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products';
const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -10,11 +10,11 @@ class ActivePrescriptionReport {
int doseDailyQuantity; int doseDailyQuantity;
String frequency; String frequency;
int frequencyNumber; int frequencyNumber;
List<int> image; // List<int> image;
String imageExtension; // String imageExtension;
dynamic imageSRCUrl; // dynamic imageSRCUrl;
String imageString; // String imageString;
dynamic imageThumbUrl; // dynamic imageThumbUrl;
dynamic isCovered; dynamic isCovered;
String itemDescription; String itemDescription;
int itemID; int itemID;
@ -23,7 +23,7 @@ class ActivePrescriptionReport {
dynamic patientName; dynamic patientName;
dynamic phoneOffice1; dynamic phoneOffice1;
dynamic prescriptionQR; dynamic prescriptionQR;
double prescriptionTimes; int prescriptionTimes;
dynamic productImage; dynamic productImage;
String productImageBase64; String productImageBase64;
String productImageString; String productImageString;
@ -45,11 +45,11 @@ class ActivePrescriptionReport {
this.doseDailyQuantity, this.doseDailyQuantity,
this.frequency, this.frequency,
this.frequencyNumber, this.frequencyNumber,
this.image, // this.image,
this.imageExtension, // this.imageExtension,
this.imageSRCUrl, // this.imageSRCUrl,
this.imageString, // this.imageString,
this.imageThumbUrl, // this.imageThumbUrl,
this.isCovered, this.isCovered,
this.itemDescription, this.itemDescription,
this.itemID, this.itemID,
@ -80,11 +80,11 @@ class ActivePrescriptionReport {
doseDailyQuantity = json['DoseDailyQuantity']; doseDailyQuantity = json['DoseDailyQuantity'];
frequency = json['Frequency']; frequency = json['Frequency'];
frequencyNumber = json['FrequencyNumber']; frequencyNumber = json['FrequencyNumber'];
image = json['Image'].cast<int>(); // image = json['Image'].cast<int>();
imageExtension = json['ImageExtension']; // imageExtension = json['ImageExtension'];
imageSRCUrl = json['ImageSRCUrl']; // imageSRCUrl = json['ImageSRCUrl'];
imageString = json['ImageString']; // imageString = json['ImageString'];
imageThumbUrl = json['ImageThumbUrl']; // imageThumbUrl = json['ImageThumbUrl'];
isCovered = json['IsCovered']; isCovered = json['IsCovered'];
itemDescription = json['ItemDescription']; itemDescription = json['ItemDescription'];
itemID = json['ItemID']; itemID = json['ItemID'];
@ -117,11 +117,11 @@ class ActivePrescriptionReport {
data['DoseDailyQuantity'] = this.doseDailyQuantity; data['DoseDailyQuantity'] = this.doseDailyQuantity;
data['Frequency'] = this.frequency; data['Frequency'] = this.frequency;
data['FrequencyNumber'] = this.frequencyNumber; data['FrequencyNumber'] = this.frequencyNumber;
data['Image'] = this.image; // data['Image'] = this.image;
data['ImageExtension'] = this.imageExtension; // data['ImageExtension'] = this.imageExtension;
data['ImageSRCUrl'] = this.imageSRCUrl; // data['ImageSRCUrl'] = this.imageSRCUrl;
data['ImageString'] = this.imageString; // data['ImageString'] = this.imageString;
data['ImageThumbUrl'] = this.imageThumbUrl; // data['ImageThumbUrl'] = this.imageThumbUrl;
data['IsCovered'] = this.isCovered; data['IsCovered'] = this.isCovered;
data['ItemDescription'] = this.itemDescription; data['ItemDescription'] = this.itemDescription;
data['ItemID'] = this.itemID; data['ItemID'] = this.itemID;

@ -11,6 +11,8 @@ class ActiveMedicationsService extends BaseService{
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
// body['PatientID'] = 1298851;
// body['TokenID'] = "@dm!n";
await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID, await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
activePrescriptionReport.clear(); activePrescriptionReport.clear();

@ -34,6 +34,7 @@ import 'package:intl/intl.dart';
import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/config/config.dart';
class ConfirmLogin extends StatefulWidget { class ConfirmLogin extends StatefulWidget {
@override @override
@ -403,12 +404,13 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
if (authenticated == true) { if (authenticated == true) {
if (user != null && (user.logInType == 2 || user.logInType == 3)) { // if (user != null && (user.logInType == 2 || user.logInType == 3)) {
this.checkActivationCode(); // this.checkActivationCode();
} else { // } else {
var request = this.getCommonRequest(type: type);
this.getMobileInfo(request); var request = this.getCommonRequest(type: type);
} this.getMobileInfo(request);
//}
} }
} }
} }
@ -418,13 +420,18 @@ class _ConfirmLogin extends State<ConfirmLogin> {
this.authService.getLoginInfo(request).then((result) { this.authService.getLoginInfo(request).then((result) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (result['SMSLoginRequired'] == false) { if (result['SMSLoginRequired'] == false) {
this.loginTokenID = result.logInTokenID; this.loginTokenID = result['LogInTokenID'];
this.patientOutSA = result.patientOutSA; this.patientOutSA = result['PatientOutSA'];
// sms for register the biometric // sms for register the biometric
if (result.isSMSSent) { if (result['isSMSSent']) {
this.onlySMSBox = false; setState(() {
isMoreOption = true;
this.onlySMSBox = true;
// this.fingrePrintBefore = true;
});
//this.button(); //this.button();
} else { } else {
setDefault();
checkActivationCode(); checkActivationCode();
} }
} else { } else {
@ -505,7 +512,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
checkActivationCode({value}) async { checkActivationCode({value}) async {
Navigator.pop(context); // Navigator.pop(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
var request = this.getCommonRequest().toJson(); var request = this.getCommonRequest().toJson();
@ -587,12 +594,13 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}); });
} }
goToHome() { goToHome() async {
authenticatedUserObject.isLogin = true; authenticatedUserObject.isLogin = true;
appointmentRateViewModel.isLogin = true; appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true; projectViewModel.isLogin = true;
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
Provider.of<ProjectViewModel>(context, listen: false).setUser(authenticatedUserObject.user); await authenticatedUserObject.getUser(getUser: true);
getToDoCount(); getToDoCount();
// pharmacyModuleViewModel.generatePharmacyToken().then((value) async { // pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
@ -603,7 +611,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
.then((value) => { .then((value) => {
getToDoCount(), getToDoCount(),
// GifLoaderDialogUtils.hideDialog(context), GifLoaderDialogUtils.hideDialog(AppGlobal.context),
if (appointmentRateViewModel.isHaveAppointmentNotRate) if (appointmentRateViewModel.isHaveAppointmentNotRate)
{ {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(

@ -17,9 +17,12 @@ class ActiveMedicationsPage extends StatelessWidget {
return BaseView<ActiveMedicationsViewModel>( return BaseView<ActiveMedicationsViewModel>(
onModelReady: (model) => model.getActiveMedication(), onModelReady: (model) => model.getActiveMedication(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
isShowDecPage: false,
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).activeMedications, appBarTitle: TranslationBase.of(context).activeMedications,
isShowAppBar: true,
body: Container( body: Container(
child: ListView.builder( child: ListView.builder(
itemCount: model.activePrescriptionReport.length, itemCount: model.activePrescriptionReport.length,

@ -1,9 +1,15 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog_prescription.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog_prescription.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -19,262 +25,232 @@ class PrescriptionDetailsPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).prescriptions, appBarTitle: TranslationBase.of(context).prescriptions,
body: SingleChildScrollView( body: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ DoctorHeader(
Container( headerModel: HeaderModel(
width: double.infinity, prescriptionReport?.doctorName ?? "" + "a",
margin: EdgeInsets.only(top: 10, left: 10, right: 10), "",
padding: EdgeInsets.all(8.0), [],
decoration: BoxDecoration( "",
color: Colors.white, "",
borderRadius: BorderRadius.all( DateUtil.convertStringToDate(prescriptionReport.orderDate),
Radius.circular(10.0), DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptionReport.orderDate)),
null,
null,
null,
null,
"",
),
isNeedToShowButton: false,
),
Expanded(
child: ListView(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.all(21),
children: [
Container(
padding: EdgeInsets.all(14),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10.0)),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
),
],
),
child: Table(children: fullData(context)),
), ),
border: Border.all(color: Colors.grey[200], width: 0.5), Container(
), width: double.infinity,
child: Row( margin: EdgeInsets.only(top: 10, left: 10, right: 10),
children: <Widget>[ padding: EdgeInsets.all(8.0),
ClipRRect( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5)), color: Colors.white,
child: Image.network( borderRadius: BorderRadius.all(
prescriptionReport.imageSRCUrl, Radius.circular(10.0),
fit: BoxFit.cover,
width: 60,
height: 70,
), ),
border: Border.all(color: Colors.grey[200], width: 0.5),
), ),
Expanded( child: Row(
child: Padding( children: <Widget>[
padding: const EdgeInsets.all(8.0), ClipRRect(
child: Center( borderRadius: BorderRadius.all(Radius.circular(5)),
child: Texts(prescriptionReport.itemDescription.isNotEmpty child: Image.network(
? prescriptionReport.itemDescription prescriptionReport.imageSRCUrl,
: prescriptionReport.itemDescriptionN ?? ''), fit: BoxFit.cover,
width: 60,
height: 70,
),
), ),
), Expanded(
) child: Padding(
], padding: const EdgeInsets.all(8.0),
),
),
Container(
margin: EdgeInsets.all(8),
child: Row(
children: [
Expanded(
child: InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: PharmacyForPrescriptionsPage(
itemID: prescriptionReport.itemID,
prescriptionReport: prescriptionReport,
),
),
),
child: Center(
child: Column(
children: <Widget>[
Container(
width: 50,
decoration: BoxDecoration(color: Colors.white, shape: BoxShape.rectangle),
child: Column(
children: <Widget>[
Icon(
Icons.pin_drop,
color: Colors.red[800],
size: 55,
),
],
),
),
SizedBox(
height: 5,
),
Texts(TranslationBase.of(context).availability)
],
),
)),
),
_addReminderButton(context)
],
),
),
Container(
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)),
children: [
TableRow(
children: [
Container(
color: Colors.white,
height: 40,
width: double.infinity,
child: Center(
child: Texts(
TranslationBase.of(context).route,
fontSize: 14,
))),
Container(
color: Colors.white,
height: 40,
width: double.infinity,
child: Center(
child: Texts(
TranslationBase.of(context).frequency,
fontSize: 14,
))),
Container(
color: Colors.white,
height: 40,
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 4),
child: Center( child: Center(
child: Texts( child: Texts(prescriptionReport.itemDescription.isNotEmpty ? prescriptionReport.itemDescription : prescriptionReport.itemDescriptionN ?? ''),
"${TranslationBase.of(context).dailyDoses}", ),
fontSize: 14, ),
))), )
Container(
color: Colors.white,
height: 40,
width: double.infinity,
child: Center(
child: Texts(
TranslationBase.of(context).duration,
fontSize: 14,
))),
], ],
), ),
TableRow( ),
Container(
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)),
children: [ children: [
Container( TableRow(
color: Colors.white, children: [
height: 50, Container(
width: double.infinity, color: Colors.white,
child: Center(child: Text(prescriptionReport.routeN ?? ''))), height: 40,
Container( width: double.infinity,
color: Colors.white, child: Center(
height: 50, child: Texts(
width: double.infinity, TranslationBase.of(context).route,
child: Center(child: Text(prescriptionReport.frequencyN ?? ''))), fontSize: 14,
Container( ))),
color: Colors.white, Container(
height: 50, color: Colors.white,
width: double.infinity, height: 40,
child: Center(child: Text('${prescriptionReport.doseDailyQuantity}'))), width: double.infinity,
Container( child: Center(
color: Colors.white, child: Texts(
height: 50, TranslationBase.of(context).frequency,
width: double.infinity, fontSize: 14,
child: Center(child: Text('${prescriptionReport.days}'))) ))),
Container(
color: Colors.white,
height: 40,
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 4),
child: Center(
child: Texts(
"${TranslationBase.of(context).dailyDoses}",
fontSize: 14,
))),
Container(
color: Colors.white,
height: 40,
width: double.infinity,
child: Center(
child: Texts(
TranslationBase.of(context).duration,
fontSize: 14,
))),
],
),
TableRow(
children: [
Container(color: Colors.white, height: 50, width: double.infinity, child: Center(child: Text(prescriptionReport.routeN ?? ''))),
Container(color: Colors.white, height: 50, width: double.infinity, child: Center(child: Text(prescriptionReport.frequencyN ?? ''))),
Container(color: Colors.white, height: 50, width: double.infinity, child: Center(child: Text('${prescriptionReport.doseDailyQuantity}'))),
Container(color: Colors.white, height: 50, width: double.infinity, child: Center(child: Text('${prescriptionReport.days}')))
],
),
], ],
), ),
],
),
),
Container(
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
width: double.infinity,
color: Colors.white,
padding: EdgeInsets.all(5),
child: Center(
child: Column(
children: <Widget>[
Texts(TranslationBase.of(context).notes),
SizedBox(
height: 5,
),
Divider(
height: 0.5,
color: Colors.grey[300],
),
SizedBox(
height: 5,
),
Texts(prescriptionReport.remarks ?? ''),
],
), ),
), Container(
) margin: EdgeInsets.only(top: 10, left: 10, right: 10),
], width: double.infinity,
), color: Colors.white,
), padding: EdgeInsets.all(5),
); child: Center(
} child: Column(
children: <Widget>[
Widget _addReminderButton(BuildContext context) { Texts(TranslationBase.of(context).notes),
ProjectViewModel projectViewModel = Provider.of(context); SizedBox(
height: 5,
return GestureDetector( ),
onTap: () { Divider(
DateTime startDate = DateTime.now(); height: 0.5,
DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionReport.days); color: Colors.grey[300],
),
print(prescriptionReport); SizedBox(
showGeneralDialog( height: 5,
barrierColor: Colors.black.withOpacity(0.5), ),
transitionBuilder: (context, a1, a2, widget) { Texts(prescriptionReport.remarks ?? ''),
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; ],
return Transform( ),
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: PrescriptionReminderDialog(
eventId: prescriptionReport.itemID.toString(),
title: "${prescriptionReport.itemDescriptionN} Prescription Reminder",
description:
"${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
startDate: startDate,
endDate: endDate,
location: prescriptionReport.remarks,
days: 1,
), ),
), ),
); ],
}, ),
transitionDuration: Duration(milliseconds: 500), ),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
},
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Container( Container(
// height: 100.0, color: Colors.white,
margin: EdgeInsets.all(7.0), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
padding: EdgeInsets.only(bottom: 4.0), child: Row(
decoration: BoxDecoration( mainAxisSize: MainAxisSize.min,
boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)], children: [
borderRadius: BorderRadius.circular(10), Expanded(
color: Colors.white), child: DefaultButton(
child: Column( TranslationBase.of(context).availability,
crossAxisAlignment: CrossAxisAlignment.start, () {
mainAxisSize: MainAxisSize.max, Navigator.push(
children: <Widget>[ context,
Container( FadePage(
margin: EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0), page: PharmacyForPrescriptionsPage(
child: Text("add", itemID: prescriptionReport.itemID,
overflow: TextOverflow.clip, prescriptionReport: prescriptionReport,
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", iconData: Icons.location_on,
overflow: TextOverflow.clip, color: Color(0xff359846),
style: TextStyle(color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), ),
), ),
Container( SizedBox(width: 10),
alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, Expanded(
margin: projectViewModel.isArabic child: DefaultButton(
? EdgeInsets.fromLTRB(10.0, 7.0, 0.0, 8.0) TranslationBase.of(context).addReminder,
: 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), DateTime startDate = DateTime.now();
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;
return Transform(
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: PrescriptionReminderDialog(
eventId: prescriptionReport.itemID.toString(),
title: "${prescriptionReport.itemDescriptionN} Prescription Reminder",
description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
startDate: startDate,
endDate: endDate,
location: prescriptionReport.remarks,
days: 1,
),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
},
iconData: Icons.notifications_active,
color: Color(0xffEAEAEA),
textColor: Color(0xff2B353E),
),
), ),
], ],
), ),
@ -283,4 +259,29 @@ class PrescriptionDetailsPage extends StatelessWidget {
), ),
); );
} }
List<TableRow> fullData(context) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
children: [
Utils.tableColumnTitle(TranslationBase.of(context).route),
Utils.tableColumnTitle(TranslationBase.of(context).frequency),
Utils.tableColumnTitle(TranslationBase.of(context).dailyDoses),
Utils.tableColumnTitle(TranslationBase.of(context).duration)
],
),
);
tableRow.add(
TableRow(
children: [
Utils.tableColumnValue(prescriptionReport?.routeN ?? '', isLast: true),
Utils.tableColumnValue(prescriptionReport?.frequencyN ?? '', isLast: true),
Utils.tableColumnValue(prescriptionReport?.doseDailyQuantity.toString() ?? '', isLast: true),
Utils.tableColumnValue(prescriptionReport?.days.toString() ?? '', isLast: true),
],
),
);
return tableRow;
}
} }

@ -10,13 +10,15 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/new_confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import '../../../widgets/dialogs/confirm_send_email_dialog.dart'; import '../../../widgets/dialogs/confirm_send_email_dialog.dart';
import 'PrescriptionIDeliveryAddressPage.dart'; import 'PrescriptionIDeliveryAddressPage.dart';
@ -59,6 +61,7 @@ class PrescriptionItemsPage extends StatelessWidget {
model.user.emailAddress, model.user.emailAddress,
), ),
isNeedToShowButton: projectViewModel.havePrivilege(13), isNeedToShowButton: projectViewModel.havePrivilege(13),
showConfirmMessageDialog: false,
onTap: () { onTap: () {
showConfirmMessage(context, model); showConfirmMessage(context, model);
}, },
@ -188,6 +191,7 @@ class PrescriptionItemsPage extends StatelessWidget {
itemCount: model.prescriptionReportListINP.length) itemCount: model.prescriptionReportListINP.length)
else else
ListView.separated( ListView.separated(
padding: EdgeInsets.all(21),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
@ -211,99 +215,73 @@ class PrescriptionItemsPage extends StatelessWidget {
), ),
); );
}, },
child: Card( child: Container(
margin: EdgeInsets.only(left: 16, right: 16, top: index == 0 ? 16 : 4, bottom: 4), decoration: BoxDecoration(
shape: cardRadius(12), color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
),
child: Padding( child: Padding(
padding: const EdgeInsets.only(top: 12, bottom: 20, left: 20, right: 20), padding: const EdgeInsets.only(top: 12, bottom: 20, left: 20, right: 20),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
model.prescriptionReportEnhList[index].itemDescription.isNotEmpty (model.prescriptionReportEnhList[index].itemDescription.isNotEmpty
? model.prescriptionReportEnhList[index].itemDescription ? model.prescriptionReportEnhList[index].itemDescription
: model.prescriptionReportEnhList[index].itemDescriptionN ?? '', : model.prescriptionReportEnhList[index].itemDescriptionN ?? '')
.toLowerCase()
.capitalizeFirstofEach,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Color(0xff2E303A),
letterSpacing: -0.64, letterSpacing: -0.64,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
mHeight(10), mHeight(10),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Card(
child: Card( child: Image.network(
child: Image.network( model.prescriptionReportEnhList[index].imageSRCUrl,
model.prescriptionReportEnhList[index].imageSRCUrl, fit: BoxFit.cover,
fit: BoxFit.cover, width: 48,
width: 60, height: 48,
height: 60,
),
margin: EdgeInsets.zero,
clipBehavior: Clip.antiAlias,
shape: cardRadius(2000),
), ),
margin: EdgeInsets.zero,
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: containerColorRadiusBorderWidth(Colors.white, 200, Colors.grey[200], 1), shape: cardRadius(2000),
), ),
mWidth(12), mWidth(12),
Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Row( children: [
children: [ myRichText(TranslationBase.of(context).route + ": ", model.prescriptionReportEnhList[index].route, projectViewModel.isArabic),
Text( myRichText(
TranslationBase.of(context).route + ": ", TranslationBase.of(context).dailyDoses + ": ", model.prescriptionReportEnhList[index].doseDailyQuantity.toString(), projectViewModel.isArabic),
style: TextStyle( mHeight(9),
color: Colors.grey, Text(
fontSize: 10, model.prescriptionReportEnhList[index].remarks,
letterSpacing: -0.4, style: TextStyle(
fontWeight: FontWeight.w600, color: Color(0xff575757),
), fontSize: 12,
), letterSpacing: -0.4,
Text( fontWeight: FontWeight.w600,
model.prescriptionReportEnhList[index].route,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).dailyDoses + ": ",
style: TextStyle(
color: Colors.grey,
fontSize: 10,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
),
Text(
model.prescriptionReportEnhList[index].doseDailyQuantity.toString(),
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
), ),
],
),
mHeight(12),
Text(
model.prescriptionReportEnhList[index].remarks,
style: TextStyle(
color: Colors.grey,
fontSize: 10,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
), ),
), ],
], ),
) )
], ],
), ),
@ -314,7 +292,7 @@ class PrescriptionItemsPage extends StatelessWidget {
); );
}, },
separatorBuilder: (context, index) { separatorBuilder: (context, index) {
return mHeight(8); return mHeight(12);
}, },
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -324,26 +302,23 @@ class PrescriptionItemsPage extends StatelessWidget {
), ),
), ),
Container( Container(
width: double.infinity, color: Colors.white,
padding: EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 20), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: Container( child: DefaultButton(
width: MediaQuery.of(context).size.width * 0.8, TranslationBase.of(context).resendOrder,
child: DefaultButton( () {
TranslationBase.of(context).resendOrder, Navigator.push(
() { context,
Navigator.push( FadePage(
context, page: PrescriptionDeliveryAddressPage(
FadePage( prescriptions: prescriptions,
page: PrescriptionDeliveryAddressPage( prescriptionReportList: model.prescriptionReportList,
prescriptions: prescriptions, prescriptionReportEnhList: model.prescriptionReportEnhList,
prescriptionReportList: model.prescriptionReportList,
prescriptionReportEnhList: model.prescriptionReportEnhList,
),
), ),
); ),
}, );
color: Colors.green[800], },
), color: Color(0xff359846),
), ),
), ),
], ],
@ -355,7 +330,7 @@ class PrescriptionItemsPage extends StatelessWidget {
void showConfirmMessage(BuildContext context, PrescriptionsViewModel model) { void showConfirmMessage(BuildContext context, PrescriptionsViewModel model) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmSendEmailDialog( child: NewConfirmSendEmailDialog(
email: model.user.emailAddress, email: model.user.emailAddress,
onTapSendEmail: () { onTapSendEmail: () {
model.sendPrescriptionEmail( model.sendPrescriptionEmail(

@ -42,6 +42,7 @@ class PrescriptionsPage extends StatelessWidget {
ListView.separated( ListView.separated(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.only(top: 12),
separatorBuilder: (context, index) { separatorBuilder: (context, index) {
return Container( return Container(
height: 12, height: 12,

@ -24,29 +24,20 @@ enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal(); AppGlobal appGlobal = new AppGlobal();
const String INSERT_DEVICE_IMEI = const String INSERT_DEVICE_IMEI = 'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI';
'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI'; const String SELECT_DEVICE_IMEI = 'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI';
const String SELECT_DEVICE_IMEI = const String CHECK_PATIENT_AUTH = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI';
const String CHECK_PATIENT_AUTH =
'Services/Authentication.svc/REST/CheckPatientAuthentication';
const GET_MOBILE_INFO = 'Services/Authentication.svc/REST/GetMobileLoginInfo'; const GET_MOBILE_INFO = 'Services/Authentication.svc/REST/GetMobileLoginInfo';
const SEND_ACTIVATION_CODE = const SEND_ACTIVATION_CODE = 'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType';
'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType'; const CHECK_ACTIVATION_CODE = 'Services/Authentication.svc/REST/CheckActivationCode';
const CHECK_ACTIVATION_CODE = const FORGOT_PASSWORD = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo';
'Services/Authentication.svc/REST/CheckActivationCode'; const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration";
const FORGOT_PASSWORD =
'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo';
const CHECK_PATIENT_FOR_REGISTRATION =
"Services/Authentication.svc/REST/CheckPatientForRegisteration";
const CHECK_USER_STATUS = "Services/NHIC.svc/REST/GetPatientInfo"; const CHECK_USER_STATUS = "Services/NHIC.svc/REST/GetPatientInfo";
const REGISTER_USER = 'Services/Authentication.svc/REST/PatientRegistration'; const REGISTER_USER = 'Services/Authentication.svc/REST/PatientRegistration';
const LOGGED_IN_USER_URL = const LOGGED_IN_USER_URL = 'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo';
'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo';
const FORGOT_PATIENT_ID = const FORGOT_PATIENT_ID = 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber';
'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber';
const DASHBOARD = 'Services/Patients.svc/REST/PatientDashboard'; const DASHBOARD = 'Services/Patients.svc/REST/PatientDashboard';
const PROFILE_SETTING = 'Services/Patients.svc/REST/GetPateintInfoForUpdate'; const PROFILE_SETTING = 'Services/Patients.svc/REST/GetPateintInfoForUpdate';
const SAVE_SETTING = 'Services/Patients.svc/REST/UpdatePateintInfo'; const SAVE_SETTING = 'Services/Patients.svc/REST/UpdatePateintInfo';
@ -55,8 +46,7 @@ class AuthProvider with ChangeNotifier {
bool isLogin = false; bool isLogin = false;
bool isLoading = true; bool isLoading = true;
dynamic authenticatedUser; dynamic authenticatedUser;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
AuthProvider() { AuthProvider() {
getUserAuthentication(); getUserAuthentication();
@ -110,17 +100,14 @@ class AuthProvider with ChangeNotifier {
var lastLogin = lstLogin; //await sharedPref.getInt( var lastLogin = lstLogin; //await sharedPref.getInt(
// LAST_LOGIN); //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); //this.cs.sharedService.getSharedData(AuthenticationService.LAST_LOGIN, false); // LAST_LOGIN); //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); //this.cs.sharedService.getSharedData(AuthenticationService.LAST_LOGIN, false);
var request = var request = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
var newRequest = INSERTDeviceIMEIRequest(); var newRequest = INSERTDeviceIMEIRequest();
var imei = await sharedPref.getString(PUSH_TOKEN); var imei = await sharedPref.getString(PUSH_TOKEN);
// if (!request.) { // if (!request.) {
newRequest.iMEI = imei; //imei!=null ? imei : ''; newRequest.iMEI = imei; //imei!=null ? imei : '';
newRequest.firstName = newRequest.firstName = request.firstName ?? "" + " " + request.lastName ?? "";
request.firstName ?? "" + " " + request.lastName ?? ""; newRequest.firstNameN = request.firstNameN ?? "" + " " + request.lastNameN ?? "";
newRequest.firstNameN =
request.firstNameN ?? "" + " " + request.lastNameN ?? "";
newRequest.lastNameN = request.lastNameN ?? ""; newRequest.lastNameN = request.lastNameN ?? "";
newRequest.outSA = request.outSA == 1 ? true : false; newRequest.outSA = request.outSA == 1 ? true : false;
newRequest.biometricEnabled = false; newRequest.biometricEnabled = false;
@ -135,8 +122,7 @@ class AuthProvider with ChangeNotifier {
newRequest.tokenID = await sharedPref.getString(TOKEN); newRequest.tokenID = await sharedPref.getString(TOKEN);
// } // }
await new BaseAppClient().post(INSERT_DEVICE_IMEI, await new BaseAppClient().post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -153,10 +139,8 @@ class AuthProvider with ChangeNotifier {
dynamic localRes; dynamic localRes;
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request['IMEI'] = imei; request['IMEI'] = imei;
await new BaseAppClient().post(SELECT_DEVICE_IMEI, await new BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { localRes = SelectDeviceIMEIRES.fromJson(response['Patient_SELECTDeviceIMEIbyIMEIList'][0]);
localRes = SelectDeviceIMEIRES.fromJson(
response['Patient_SELECTDeviceIMEIbyIMEIList'][0]);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
@ -166,8 +150,7 @@ class AuthProvider with ChangeNotifier {
} }
} }
Future<dynamic> checkPatientAuthentication( Future<dynamic> checkPatientAuthentication(CheckPatientAuthenticationReq request) async {
CheckPatientAuthenticationReq request) async {
request.versionID = VERSION_ID; request.versionID = VERSION_ID;
request.channel = CHANNEL; request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS; request.iPAdress = IP_ADDRESS;
@ -176,8 +159,7 @@ class AuthProvider with ChangeNotifier {
request.patientOutSA = request.zipCode == '966' ? 0 : 1; request.patientOutSA = request.zipCode == '966' ? 0 : 1;
try { try {
dynamic localRes; dynamic localRes;
await new BaseAppClient().post(CHECK_PATIENT_AUTH, await new BaseAppClient().post(CHECK_PATIENT_AUTH, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -198,10 +180,10 @@ class AuthProvider with ChangeNotifier {
request.deviceTypeID = DeviceTypeID; request.deviceTypeID = DeviceTypeID;
request.patientOutSA = request.zipCode == '966' ? 0 : 1; request.patientOutSA = request.zipCode == '966' ? 0 : 1;
request.isDentalAllowedBackend = false; request.isDentalAllowedBackend = false;
// request.patientTypeID = request.patientType;
// request.patientType = request.patientType;
dynamic localRes; dynamic localRes;
await new BaseAppClient().post(GET_MOBILE_INFO, await new BaseAppClient().post(GET_MOBILE_INFO, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -220,8 +202,7 @@ class AuthProvider with ChangeNotifier {
request.isDentalAllowedBackend = false; request.isDentalAllowedBackend = false;
dynamic localRes; dynamic localRes;
await new BaseAppClient().post(SEND_ACTIVATION_CODE, await new BaseAppClient().post(SEND_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
authenticatedUser = CheckActivationCode.fromJson(localRes); authenticatedUser = CheckActivationCode.fromJson(localRes);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -243,14 +224,12 @@ class AuthProvider with ChangeNotifier {
neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1; neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1;
neRequest.projectOutSA = neRequest.zipCode == '966' ? false : true; neRequest.projectOutSA = neRequest.zipCode == '966' ? false : true;
neRequest.isDentalAllowedBackend = false; neRequest.isDentalAllowedBackend = false;
neRequest.deviceToken = null; // neRequest.deviceToken = null;
neRequest.forRegisteration = neRequest.forRegisteration = neRequest.isRegister != null ? neRequest.isRegister : false;
neRequest.isRegister != null ? neRequest.isRegister : false;
neRequest.isRegister = false; neRequest.isRegister = false;
dynamic localRes; dynamic localRes;
try { try {
await new BaseAppClient().post(CHECK_ACTIVATION_CODE, await new BaseAppClient().post(CHECK_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; //CheckActivationCode.fromJson(); localRes = response; //CheckActivationCode.fromJson();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
localRes = error; localRes = error;
@ -270,8 +249,7 @@ class AuthProvider with ChangeNotifier {
return authenticatedUser; return authenticatedUser;
} }
Future<dynamic> checkPatientForRegisteration( Future<dynamic> checkPatientForRegisteration(CheckPatientForRegistration request) async {
CheckPatientForRegistration request) async {
request.versionID = VERSION_ID; request.versionID = VERSION_ID;
request.channel = CHANNEL; request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS; request.iPAdress = IP_ADDRESS;
@ -282,8 +260,7 @@ class AuthProvider with ChangeNotifier {
// request.tokenID = ''; // request.tokenID = '';
dynamic localRes; dynamic localRes;
try { try {
await new BaseAppClient().post(CHECK_PATIENT_FOR_REGISTRATION, await new BaseAppClient().post(CHECK_PATIENT_FOR_REGISTRATION, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
localRes = error; localRes = error;
@ -306,8 +283,7 @@ class AuthProvider with ChangeNotifier {
// request.tokenID = ''; // request.tokenID = '';
dynamic localRes; dynamic localRes;
try { try {
await new BaseAppClient().post(CHECK_USER_STATUS, await new BaseAppClient().post(CHECK_USER_STATUS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
localRes = error; localRes = error;
@ -332,8 +308,7 @@ class AuthProvider with ChangeNotifier {
// request.tokenID = ''; // request.tokenID = '';
dynamic localRes; dynamic localRes;
try { try {
await new BaseAppClient().post(REGISTER_USER, await new BaseAppClient().post(REGISTER_USER, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
localRes = error; localRes = error;
@ -345,30 +320,26 @@ class AuthProvider with ChangeNotifier {
} }
} }
Future registeredAuthenticatedUser( Future registeredAuthenticatedUser(AuthenticatedUser user, deviceToken, lat, long) async {
AuthenticatedUser user, deviceToken, lat, long) async {
var request = new RegisteredAuthenticatedUserRequest(); var request = new RegisteredAuthenticatedUserRequest();
request.deviceToken = deviceToken; request.deviceToken = deviceToken;
request.voipToken = request.voipToken = ""; //this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false);
""; //this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false);
request.deviceType = DeviceTypeID.toString(); request.deviceType = DeviceTypeID.toString();
request.patientMobileNumber = '0' + user.mobileNumber; request.patientMobileNumber = user.mobileNumber[0] == '0' ? user.mobileNumber : '0' + user.mobileNumber;
request.nationalID = user.patientIdentificationNo; request.nationalID = user.patientIdentificationNo;
request.gender = user.gender; request.gender = user.gender;
request.patientID = user.patientID; request.patientID = user.patientID;
request.patientOutSA = user.outSA; request.patientOutSA = user.outSA;
request.loginType = await sharedPref.getInt(LAST_LOGIN) != null request.loginType = await sharedPref.getInt(LAST_LOGIN) != null ? await sharedPref.getInt(LAST_LOGIN) : 1;
? await sharedPref.getInt(LAST_LOGIN)
: 1;
request.mACAddress = '00:00:00:00:00:00'; request.mACAddress = '00:00:00:00:00:00';
request.latitude = lat; request.latitude = lat;
request.longitude = long; request.longitude = long;
request.languageID = int.parse(user.preferredLanguage); request.languageID = int.parse(user.preferredLanguage);
request.patientTypeID = 2; request.patientTypeID = user.patientType;
request.patientType = user.patientType;
dynamic localRes; dynamic localRes;
try { try {
await new BaseAppClient().post(LOGGED_IN_USER_URL, await new BaseAppClient().post(LOGGED_IN_USER_URL, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
localRes = error; localRes = error;
@ -394,8 +365,7 @@ class AuthProvider with ChangeNotifier {
dynamic localRes; dynamic localRes;
await new BaseAppClient().post(FORGOT_PATIENT_ID, await new BaseAppClient().post(FORGOT_PATIENT_ID, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -416,8 +386,7 @@ class AuthProvider with ChangeNotifier {
dynamic localRes; dynamic localRes;
try { try {
await new BaseAppClient().post(FORGOT_PASSWORD, await new BaseAppClient().post(FORGOT_PASSWORD, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; //CheckActivationCode.fromJson(); localRes = response; //CheckActivationCode.fromJson();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
localRes = error; localRes = error;
@ -439,12 +408,10 @@ class AuthProvider with ChangeNotifier {
request['generalid'] = GENERAL_ID; request['generalid'] = GENERAL_ID;
request['LanguageID'] = LANGUAGE_ID; request['LanguageID'] = LANGUAGE_ID;
request['DeviceTypeID'] = DeviceTypeID; request['DeviceTypeID'] = DeviceTypeID;
request["PatientTypeID"] = 1;
request["PatientType"] = 1;
dynamic localRes; dynamic localRes;
try { try {
await new BaseAppClient().post(DASHBOARD, await new BaseAppClient().post(DASHBOARD, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; //CheckActivationCode.fromJson(); localRes = response; //CheckActivationCode.fromJson();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
localRes = error; localRes = error;
@ -461,8 +428,7 @@ class AuthProvider with ChangeNotifier {
getSettings() async { getSettings() async {
dynamic localRes; dynamic localRes;
try { try {
await new BaseAppClient().post(PROFILE_SETTING, await new BaseAppClient().post(PROFILE_SETTING, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; //CheckActivationCode.fromJson(); localRes = response; //CheckActivationCode.fromJson();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
localRes = error; localRes = error;
@ -479,8 +445,7 @@ class AuthProvider with ChangeNotifier {
Future saveSettings(request) async { Future saveSettings(request) async {
dynamic localRes; dynamic localRes;
try { try {
await new BaseAppClient().post(SAVE_SETTING, await new BaseAppClient().post(SAVE_SETTING, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; //CheckActivationCode.fromJson(); localRes = response; //CheckActivationCode.fromJson();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
localRes = error; localRes = error;

@ -6,7 +6,8 @@ class DefaultButton extends StatelessWidget {
final Color textColor; final Color textColor;
final Color color; final Color color;
final Color disabledColor; final Color disabledColor;
DefaultButton(this.text, this.onPress, {this.color, this.disabledColor, this.textColor = Colors.white}); final IconData iconData;
DefaultButton(this.text, this.onPress, {this.color, this.disabledColor, this.textColor = Colors.white, this.iconData});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -15,9 +16,17 @@ class DefaultButton extends StatelessWidget {
width: double.infinity, width: double.infinity,
child: FlatButton( child: FlatButton(
onPressed: onPress, onPressed: onPress,
child: Text( child: Row(
text, children: [
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48), if (iconData != null) Icon(iconData, color: textColor),
Expanded(
child: Text(
text,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48),
),
),
],
), ),
// color: Color(0xffD02127), // color: Color(0xffD02127),
color: color ?? const Color(0xffD02127), color: color ?? const Color(0xffD02127),

@ -55,12 +55,12 @@ class DoctorCard extends StatelessWidget {
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all( border: Border.all(
width: 1, // width: 1,
color: Color(0xffEFEFEF) // <--- border width here color: Color(0xffEFEFEF)
), ),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Color(0xff000000).withOpacity(.01), color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5, //spreadRadius: 5,
blurRadius: 27, blurRadius: 27,
offset: Offset(0, -3), offset: Offset(0, -3),

@ -0,0 +1,219 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/settings/settings.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../routes.dart';
class NewConfirmSendEmailDialog extends StatefulWidget {
final String email;
final GestureTapCallback onTapSendEmail;
NewConfirmSendEmailDialog({this.email, this.onTapSendEmail});
@override
_NewConfirmSendEmailDialogState createState() => _NewConfirmSendEmailDialogState();
}
class _NewConfirmSendEmailDialogState extends State<NewConfirmSendEmailDialog> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Dialog(
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(),
insetPadding: EdgeInsets.only(left: 21, right: 21),
child: Container(
padding: EdgeInsets.only(left: 20, right: 20, top: 36, bottom: 36),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
TranslationBase.of(context).confirm,
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: Color(0xff2B353E), height: 35 / 24, letterSpacing: -0.96),
),
),
IconButton(
padding: EdgeInsets.zero,
icon: Icon(Icons.close),
constraints: BoxConstraints(),
onPressed: () {
Navigator.pop(context);
},
)
],
),
Text(
TranslationBase.of(context).sendConfEmail,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff808080), letterSpacing: -0.48),
),
SizedBox(height: 18),
Container(
padding: EdgeInsets.symmetric(vertical: 16, horizontal: 11),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
color: Color(0xffEAEAEA),
),
child: Row(
children: [
Expanded(
child: Text(
widget.email,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
),
IconButton(
padding: EdgeInsets.zero,
icon: Icon(Icons.edit),
iconSize: 16,
constraints: BoxConstraints(),
onPressed: () {
Navigator.pop(context);
Navigator.push(
context,
FadePage(
page: Settings(
type: 1,
),
),
);
},
)
],
),
),
SizedBox(height: 18),
Row(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: DefaultButton(
TranslationBase.of(context).cancel,
() {
Navigator.pop(context);
},
textColor: Color(0xff2B353E),
color: Color(0xffEAEAEA),
),
),
SizedBox(width: 10),
Expanded(
child: DefaultButton(
TranslationBase.of(context).send,
() {
Navigator.pop(context);
widget.onTapSendEmail();
},
),
),
],
),
],
),
),
);
return SimpleDialog(
// contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
title: Center(
child: Texts(
TranslationBase.of(context).confirm,
color: Colors.black,
),
),
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: Texts(
TranslationBase.of(context).sendConfEmail,
fontSize: 14,
color: Colors.grey,
),
),
Texts(
widget.email,
color: Colors.grey,
),
SizedBox(
height: 5,
),
Divider(),
SizedBox(
height: 5.0,
),
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Container(
width: double.maxFinite,
child: Center(
child: Texts(
TranslationBase.of(context).cancel,
color: Colors.red,
),
),
),
),
SizedBox(
height: 15.0,
),
InkWell(
onTap: () {
Navigator.pop(context);
widget.onTapSendEmail();
},
child: Container(
width: double.maxFinite,
child: Center(
child: Texts(TranslationBase.of(context).sendEmail),
),
),
),
SizedBox(
height: 15.0,
),
InkWell(
onTap: () {
Navigator.pop(context);
Navigator.push(
context,
FadePage(
page: Settings(
type: 1,
),
),
);
},
child: Container(
width: double.maxFinite,
child: Center(
child: Texts(TranslationBase.of(context).updateEmail),
),
),
),
SizedBox(
height: 20.0,
),
],
)
],
);
}
}
Loading…
Cancel
Save