merge changes-2

merge-update-with-lab-changes
Sikander Saleem 5 years ago
parent 14561d0ac6
commit c07a8f54c7

@ -29,3 +29,5 @@ const BLOOD_TYPE = 'blood-type';
const NOTIFICATION_COUNT = 'notification-count'; const NOTIFICATION_COUNT = 'notification-count';
const PHARMACY_SELECTED_ADDRESS = 'selected-address'; const PHARMACY_SELECTED_ADDRESS = 'selected-address';
const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN'; const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN';
const H2O_UNIT = 'H2O_UNIT';
const H2O_REMINDER = 'H2O_REMINDER';

@ -1,4 +1,4 @@
class ReauestInsuranceApprovalModel { class RequestInsuranceApprovalModel {
double versionID; double versionID;
int channel; int channel;
int languageID; int languageID;
@ -15,7 +15,7 @@ class ReauestInsuranceApprovalModel {
int eXuldAPPNO; int eXuldAPPNO;
int projectID; int projectID;
ReauestInsuranceApprovalModel( RequestInsuranceApprovalModel(
{this.versionID, {this.versionID,
this.channel, this.channel,
this.languageID, this.languageID,
@ -32,7 +32,7 @@ class ReauestInsuranceApprovalModel {
this.eXuldAPPNO, this.eXuldAPPNO,
this.projectID}); this.projectID});
ReauestInsuranceApprovalModel.fromJson(Map<String, dynamic> json) { RequestInsuranceApprovalModel.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID']; versionID = json['VersionID'];
channel = json['Channel']; channel = json['Channel'];
languageID = json['LanguageID']; languageID = json['LanguageID'];

@ -23,6 +23,7 @@ class RequestSendPrescriptionEmail {
String setupID; String setupID;
String clinicName; String clinicName;
String doctorName; String doctorName;
int doctorID;
int projectID; int projectID;
List<PrescriptionReport> listPrescriptions; List<PrescriptionReport> listPrescriptions;
@ -49,7 +50,8 @@ class RequestSendPrescriptionEmail {
this.setupID, this.setupID,
this.clinicName, this.clinicName,
this.doctorName, this.doctorName,
this.projectID}); this.projectID,
this.doctorID});
RequestSendPrescriptionEmail.fromJson(Map<String, dynamic> json) { RequestSendPrescriptionEmail.fromJson(Map<String, dynamic> json) {
appointmentDate = json['AppointmentDate']; appointmentDate = json['AppointmentDate'];
@ -75,6 +77,7 @@ class RequestSendPrescriptionEmail {
clinicName = json['ClinicName']; clinicName = json['ClinicName'];
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
doctorID = json['DoctorID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -106,7 +109,7 @@ class RequestSendPrescriptionEmail {
data['ClinicName'] = this.clinicName; data['ClinicName'] = this.clinicName;
data['DoctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['DoctorID'] = this.doctorID;
return data; return data;
} }
} }

@ -0,0 +1,48 @@
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import '../base_view_model.dart';
class RRTService extends BaseService{
}
class RRTViewModel extends BaseViewModel{
var _service = RRTService();
Future createRequest(){
return null;
}
Future getAllRequest(){
return null;
}
Future getRequestDetails(){
return null;
}
Future getAllQuestions(){
return null;
}
Future getCancelReasons(){
return null;
}
Future cancelRequest(){
return null;
}
}

@ -14,6 +14,10 @@ class ReportsMonthlyViewModel extends BaseViewModel {
ReportsService _reportsService = locator<ReportsService>(); ReportsService _reportsService = locator<ReportsService>();
String get userAgreementContent => _reportsService.userAgreementContent; String get userAgreementContent => _reportsService.userAgreementContent;
bool get receiveHealthSummaryReport => _reportsService?.user?.receiveHealthSummaryReport ?? false;
set receiveHealthSummaryReport(bool val) {
_reportsService?.user?.receiveHealthSummaryReport = val;
}
getUserTermsAndConditions() async { getUserTermsAndConditions() async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -26,14 +30,9 @@ class ReportsMonthlyViewModel extends BaseViewModel {
} }
} }
updatePatientHealthSummaryReport( updatePatientHealthSummaryReport({String message, bool isSummary, bool isUpdateEmail = false, String email}) async {
{String message,
bool isSummary,
bool isUpdateEmail = false,
String email}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _reportsService.updatePatientHealthSummaryReport( await _reportsService.updatePatientHealthSummaryReport(isSummary: isSummary);
isSummary: isSummary);
if (_reportsService.hasError) { if (_reportsService.hasError) {
error = _reportsService.error; error = _reportsService.error;
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);

@ -50,9 +50,9 @@ class ResultPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
appBarTitle: appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
@ -112,11 +112,10 @@ class ResultPage extends StatelessWidget {
backgroundColor: Theme.of(context).primaryColor, backgroundColor: Theme.of(context).primaryColor,
radius: 8, radius: 8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
handler: (){ handler: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(page: BariatricsPage(1, 1, finalResult)),
page: BariatricsPage(1, 1, finalResult)),
); );
}, },
), ),

@ -13,8 +13,10 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:nfc_in_flutter/nfc_in_flutter.dart';
class QRCode extends StatefulWidget { class QRCode extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
@ -30,17 +32,27 @@ class QRCode extends StatefulWidget {
class _QRCodeState extends State<QRCode> { class _QRCodeState extends State<QRCode> {
Uint8List _bytes; Uint8List _bytes;
bool _supportsNFC = false;
BuildContext _context;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
_bytes = base64.decode(widget.appoQR.split(',').last); _bytes = base64.decode(widget.appoQR.split(',').last);
widget.authUser = new AuthenticatedUser(); widget.authUser = new AuthenticatedUser();
NFC.isNDEFSupported.then((supported) {
setState(() {
print("nfc supprted");
_supportsNFC = true;
});
});
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_context = context;
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).attendRegisterCode, appBarTitle: TranslationBase.of(context).attendRegisterCode,
isShowAppBar: true, isShowAppBar: true,
@ -51,9 +63,56 @@ class _QRCodeState extends State<QRCode> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( Container(
width: double.infinity,
height: MediaQuery.of(context).size.width / 3,
child: Row(
children: [
_supportsNFC
? Expanded(
flex: 1,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
InkWell(
child: Container(
margin: EdgeInsets.only(top: 30.0), margin: EdgeInsets.only(top: 30.0),
alignment: Alignment.center, alignment: Alignment.center,
child: Image.memory(_bytes, scale: 0.5), padding: EdgeInsets.all(8),
decoration: BoxDecoration(
border: Border.all(color: Colors.black),
borderRadius: BorderRadius.circular(10),
),
child: Image.asset(
"assets/images/nfc/ic_nfc.png"),
),
onTap: () {
showNfcReader(context,
onNcfScan: (String nfcId) {
Future.delayed(
const Duration(milliseconds: 100),
() {
sendNfcCheckInRequest(nfcId);
});
});
},
),
],
),
)
: Container(),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.only(top: 30.0),
alignment: Alignment.center,
child: Image.memory(
_bytes,
),
),
),
],
),
), ),
Container( Container(
margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0), margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0),
@ -70,19 +129,21 @@ class _QRCodeState extends State<QRCode> {
EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0), EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0),
child: Image.asset( child: Image.asset(
"assets/images/new-design/device_icon.png", "assets/images/new-design/device_icon.png",
width: 120.0, width: MediaQuery.of(context).size.width / 3.4,
height: 120.0), height: MediaQuery.of(context).size.width / 3.4),
), ),
Container( Expanded(
width: MediaQuery.of(context).size.width * 0.5, child: Container(
width: double.infinity,
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text(TranslationBase.of(context).scanQRHospital, child: Text(TranslationBase.of(context).scanQRHospital,
style: TextStyle( style: TextStyle(
color: Colors.red[700], color: Colors.red[700],
fontSize: 20.0, fontSize: 18.0,
fontWeight: FontWeight.bold)), fontWeight: FontWeight.bold)),
), ),
),
], ],
), ),
), ),
@ -300,4 +361,51 @@ class _QRCodeState extends State<QRCode> {
} }
return docSpeciality; return docSpeciality;
} }
sendNfcCheckInRequest(String nfcId) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId,
widget.patientShareResponse.projectID, context)
.then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context);
_showMyDialog(res["SuccessMsg"], this.context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
_showMyDialog(err, this.context);
});
}
Future<void> _showMyDialog(String message, BuildContext context) async {
return showDialog<void>(
context: context,
barrierDismissible: true, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Alert'),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
Text(message),
],
),
),
actions: <Widget>[
TextButton(
child: const Text('OK'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
}
} }

@ -93,6 +93,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
service service
.getDoctorsListByName(doctorNameController.text, context) .getDoctorsListByName(doctorNameController.text, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['DoctorList'].length != 0) { if (res['DoctorList'].length != 0) {
@ -129,9 +130,12 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
navigateToSearchResults( navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital); context, doctorsList, _patientDoctorAppointmentListHospital);
} else { } else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err); print(err);
}); });
} }

@ -206,7 +206,7 @@ class _SelectTransportationMethodState
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts(TranslationBase.of(context).directionHeading), Texts(TranslationBase.of(context).wayHeading),
SizedBox( SizedBox(
height: 5, height: 5,
), ),

@ -0,0 +1,94 @@
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class RRTLogPage extends StatefulWidget{
@override
State<StatefulWidget> createState() => RRTLogPageState();
}
class RRTLogPageState extends State<RRTLogPage>{
@override
Widget build(BuildContext context) {
return BaseView<RRTViewModel>(
onModelReady: (viewModel){
},
builder: (ctx, vm, widget){
return ListView.builder(
itemCount: 10,
itemBuilder: (ctx, idx) => RRTLogListItem()
);
}
);
}
}
// ------------------------
// List Item Widget
// ------------------------
final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5));
class RRTLogListItem extends StatelessWidget{
BuildContext _context;
@override
Widget build(BuildContext context) {
_context = context;
return Container(
padding: EdgeInsets.all(15), margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.25), spreadRadius: 1, blurRadius: 3)]
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
_contentItem(label: "Request ID", value: "2318"),
_item_content_seperator,
_contentItem(label: "Status", value: "2318"),
_item_content_seperator,
_contentItem(label: "Pickup Date", value: "2318"),
_item_content_seperator,
_contentItem(label: "Location", value: "2318"),
_item_content_seperator,
SizedBox(height: 10),
FractionallySizedBox(child: cancelButton())
],
),
);
}
Widget _contentItem({@required String label, String value}){
return Container(
padding: EdgeInsets.symmetric(vertical: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(label, style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontSize: 9, letterSpacing: 1),),
SizedBox(height: 5,),
Text(value, style: TextStyle(color: Theme.of(_context).appBarTheme.color,fontWeight: FontWeight.bold, fontSize: 14),),
],
),
);
}
Widget cancelButton() => MaterialButton(
height: 45,
color: Color(0xFFc5272d),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
onPressed: () { },
child: Text("CANCEL", style: TextStyle(color: Colors.white, fontSize: 13),),
);
}

@ -0,0 +1,77 @@
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-logs-page.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-request-page.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class RRTMainScreen extends StatefulWidget{
@override
State<StatefulWidget> createState() => RRTMainScreenState();
}
class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProviderStateMixin{
int currentIndex = 0;
TabController tabController;
PageController pageController = PageController(initialPage: 0, keepPage: true);
@override
void initState() {
super.initState();
tabController = TabController(length: 2, vsync: this);
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: 'Rapid Response Team',
isShowAppBar: true,
body: Column(
children: [
tabBar(),
Expanded(
child: contentPager()
)
],
),
);
}
Widget tabBar() => Container(
margin: EdgeInsets.all(15),
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)),
child: TabBar(
onTap: onPageChanged,
indicatorWeight: 3,
indicatorColor: Color(0xFFc5272d),
isScrollable: false,
controller: tabController,
indicatorSize: TabBarIndicatorSize.label,
tabs: [
Tab(
child: Text("Rapid Response Team", style: TextStyle(color: Theme.of(context).appBarTheme.color),),
),
Tab(
child: Text("Order Log", style: TextStyle(color: Theme.of(context).appBarTheme.color),),
),
]
),
);
Widget contentPager() => PageView(
onPageChanged: onPageChanged,
controller: pageController,
children: [
RRTRequestPage(),
RRTLogPage(),
],
);
void onPageChanged(int index) {
pageController.animateToPage(index, duration: Duration(milliseconds: 200), curve: Curves.easeInOut);
tabController.animateTo(index);
}
}

@ -0,0 +1,92 @@
import 'dart:async';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
class RRTRequestPickupAddressPage extends StatefulWidget{
@override
State<StatefulWidget> createState() => RRTRequestPickupAddressPageState();
}
class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage>{
bool acceptTerms = false;
Completer<GoogleMapController> mapController = Completer();
static final CameraPosition mapCamera = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
@override
Widget build(BuildContext context) {
return BaseView<RRTViewModel>(
onModelReady: (viewModel){
},
builder: (ctx, vm, widget) => AppScaffold(
appBarTitle: TranslationBase.of(context).pickupLocation,
isShowAppBar: true,
body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
selectAddress(),
Expanded(
child: GoogleMap(
mapType: MapType.normal,
initialCameraPosition: mapCamera,
onCameraIdle: (){
},
onMapCreated: (controller){
mapController.complete(controller);
},
)
),
continueButton()
],
)
)
);
}
Widget selectAddress(){
return Container(
margin: EdgeInsets.all(15),
child: Expanded(
child: MaterialButton(
height: 50,
color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
onPressed: () { },
child: Row(
children: [
Text(TranslationBase.of(context).selectAddress, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),),
Spacer(),
Icon(Icons.keyboard_arrow_down, size: 15, color: Colors.grey,)
],
),
),
),
);
}
Widget continueButton(){
return Padding(
padding: const EdgeInsets.all(15),
child: MaterialButton(
height: 50,
color: Theme.of(context).appBarTheme.color,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
onPressed: () { },
child: Text(TranslationBase.of(context).continues, style: TextStyle(color: Colors.white, fontSize: 15, letterSpacing: 1),),
),
);
}
}

@ -0,0 +1,176 @@
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class RRTRequestPage extends StatefulWidget{
@override
State<StatefulWidget> createState() => RRTRequestPageState();
}
class RRTRequestPageState extends State<RRTRequestPage>{
bool acceptTerms = false;
@override
Widget build(BuildContext context) {
return BaseView<RRTViewModel>(
onModelReady: (viewModel){
},
builder: (ctx, vm, widget) => Column(
children: [
Expanded(
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
children: [
serviceDescription(context),
SizedBox(height: 20),
priceTable(context),
acceptPolicy(),
Container(height: 0.5, color: Theme.of(context).appBarTheme.color),// Seperator
Container(
padding: EdgeInsets.only(top: 20, bottom: 5),
alignment: Alignment.center,
child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2)
),
paymentOptions(),
],
),
),
actionButtons()
],
)
);
}
Widget serviceDescription(BuildContext context) =>
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text(
TranslationBase.of(context).RRTDDetails,
textAlign: TextAlign.justify,
style: TextStyle(color: Theme.of(context).appBarTheme.color, fontSize: 15, height: 1.5, fontWeight: FontWeight.w300),
),
);
Widget priceTable(BuildContext context){
var radius = Radius.circular(8);
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
height: 30,
decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)),
child: Center(child: Text(TranslationBase.of(context).ApproximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))),
),
pricingRow(label: TranslationBase.of(context).AmountBeforeTax, value: '500 SAR'),
Container(height: 0.5, color: Theme.of(context).appBarTheme.color),
pricingRow(label: TranslationBase.of(context).TaxAmount, value: '50 SAR'),
Container(height: 0.5, color: Theme.of(context).appBarTheme.color),
pricingRow(label: TranslationBase.of(context).TotalAmountPayable, value: '550 SAR', labelBold: true),
Container(height: 0.5, color: Theme.of(context).appBarTheme.color),
],
);
}
Widget pricingRow({@required String label, @required String value, bool labelBold = false, bool valueBold = false}){
return
Container(
height: 40, margin: EdgeInsets.symmetric(horizontal: 10),
child: Row(
children: [
Text(label, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: labelBold ? FontWeight.bold : FontWeight.normal)),
Spacer(),
Container(height: 40, color: Theme.of(context).appBarTheme.color, width: 0.5,),
Container(
alignment: Alignment.center,
width: MediaQuery.of(context).size.width * 0.25,
child: Text(value, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: valueBold ? FontWeight.bold : FontWeight.normal))
),
],
),
);
}
Widget acceptPolicy(){
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Row(
children: [
Checkbox(value: acceptTerms, onChanged: (v){
setState(() => acceptTerms = v);
}),
SizedBox(width: 10),
Expanded(
child: Text(TranslationBase.of(context).iAcceptTermsConditions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color), maxLines: 2)
),
Container(
alignment: Alignment.center,
width: MediaQuery.of(context).size.width * 0.25,
child: TextButton(
child: Text(TranslationBase.of(context).clickHere, style: TextStyle(fontSize: 12, color: Colors.blue, fontWeight: FontWeight.w400)),
onPressed: (){
}
),
)
],
),
);
}
Widget paymentOptions()=> Container(
height: 30,
alignment: Alignment.center,
child: Image.asset("assets/payment_options/payment_options.png", fit: BoxFit.fill,)
);
Widget actionButtons(){
return Container(
margin: EdgeInsets.all(15),
child: Row(
children: [
Expanded(
child: MaterialButton(
height: 50,
color: Theme.of(context).appBarTheme.color,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
onPressed: () { },
child: Text(TranslationBase.of(context).cancel, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),),
),
),
SizedBox(width: 20,),
Expanded(
child: MaterialButton(
height: 50,
color: Theme.of(context).appBarTheme.color,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
child: Text(TranslationBase.of(context).ok, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),),
onPressed: () {
Navigator.push(
context,
FadePage(
page: RRTRequestPickupAddressPage()));
},
),
)
],
),
);
}
}

@ -19,6 +19,7 @@ import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart'
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
@ -326,9 +327,9 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
fontSize: 13.5, fontSize: 13.5,
hintColor: Colors.black, hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
onChanged: (v){setState(() { onChanged: (v) {
setState(() {});
});}, },
validator: (value) { validator: (value) {
if (value.isEmpty) if (value.isEmpty)
return TranslationBase.of(context).emptySubject; return TranslationBase.of(context).emptySubject;
@ -349,11 +350,13 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
controller: messageController, controller: messageController,
suffixIcon: Icons.mic, suffixIcon: Icons.mic,
onSuffixTap: () { onSuffixTap: () {
requestPermissions();
openSpeechReco(); openSpeechReco();
}, },
onChanged: (v){setState(() { onChanged: (v) {
setState(() {});
});}, },
validator: (value) { validator: (value) {
if (value.isEmpty) if (value.isEmpty)
return TranslationBase.of(context).emptyMessage; return TranslationBase.of(context).emptyMessage;
@ -437,7 +440,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12, height: 80,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),
child: Center( child: Center(
@ -447,11 +450,10 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
label: TranslationBase.of(context).send, label: TranslationBase.of(context).send,
textColor: Colors.white, textColor: Colors.white,
disabled: (titleController.text.toString().isEmpty || disabled: (titleController.text.toString().isEmpty ||
messageController.text.toString().isEmpty ), messageController.text.toString().isEmpty),
onTap: () { onTap: () {
final form = formKey.currentState; final form = formKey.currentState;
if (form.validate()) { if (form.validate()) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model model
.sendCOCItem( .sendCOCItem(
@ -479,7 +481,6 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }
}); });
} }
}, },
), ),
@ -544,7 +545,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (available) { if (available) {
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,
// listenMode: ListenMode.confirmation, listenMode: stt.ListenMode.confirmation,
localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA',
); );
} else { } else {
@ -552,12 +553,23 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
} }
} }
void errorListener(SpeechRecognitionError error) {} void errorListener(SpeechRecognitionError error) {
event.setValue({"searchText": 'null'});
//SpeechToText.closeAlertDialog(context);
print(error);
}
void statusListener(String status) { void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
} }
void requestPermissions() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.microphone,
].request();
print(statuses);
}
void resultListener(result) { void resultListener(result) {
reconizedWord = result.recognizedWords; reconizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord}); event.setValue({"searchText": reconizedWord});
@ -565,10 +577,18 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
RoboSearch.closeAlertDialog(context); RoboSearch.closeAlertDialog(context);
messageController.text = reconizedWord; speech.stop();
messageController.text = reconizedWord + '\n';
}); });
} }
} }
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
} }
class FeedbackTypeDialog extends StatefulWidget { class FeedbackTypeDialog extends StatefulWidget {
@ -588,7 +608,6 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
setMessageDialogType(MessageType messageType) { setMessageDialogType(MessageType messageType) {
setState(() { setState(() {
messageTypeDialog = messageType; messageTypeDialog = messageType;
}); });
} }

@ -278,23 +278,27 @@ class _RegisterInfo extends State<RegisterInfo> {
registerNow() { registerNow() {
dynamic request = getTempUserRequest(); dynamic request = getTempUserRequest();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
this.authService.registerUser(request).then((result) => { this
.authService
.registerUser(request)
.then((result) => {
GifLoaderDialogUtils.hideDialog(context), GifLoaderDialogUtils.hideDialog(context),
// userData = result.list; // userData = result.list;
//AuthenticatedUser.fromJson(result['List'][0]), //AuthenticatedUser.fromJson(result['List'][0]),
if(result is String){ if (result is String)
{
new ConfirmDialog( new ConfirmDialog(
context: context, context: context,
confirmMessage: result, confirmMessage: result,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => { okFunction: () =>
{ConfirmDialog.closeAlertDialog(context)},
cancelFunction: () => {
ConfirmDialog.closeAlertDialog(context) ConfirmDialog.closeAlertDialog(context)
}, }).showAlertDialog(context)
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}) }
.showAlertDialog(context) else
}else
{ {
result.list.isFamily = false, result.list.isFamily = false,
sharedPref.setObject(USER_PROFILE, result.list), sharedPref.setObject(USER_PROFILE, result.list),
@ -303,19 +307,17 @@ class _RegisterInfo extends State<RegisterInfo> {
sharedPref.setString(TOKEN, result.authenticationTokenID), sharedPref.setString(TOKEN, result.authenticationTokenID),
Navigator.of(context).pushNamed(HOME) Navigator.of(context).pushNamed(HOME)
} }
}).catchError((err) { })
.catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: err, confirmMessage: err,
okText: TranslationBase.of(context).confirm, okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => { okFunction: () => {ConfirmDialog.closeAlertDialog(context)},
ConfirmDialog.closeAlertDialog(context)
},
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
}); });
} }
@ -347,17 +349,18 @@ class _RegisterInfo extends State<RegisterInfo> {
"PatientIdentificationNo": registerInfo.idNumber, "PatientIdentificationNo": registerInfo.idNumber,
"MobileNumber": registerd_data.patientMobileNumber, "MobileNumber": registerd_data.patientMobileNumber,
"PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1, "PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1,
"FirstNameN":registerInfo.firstNameAr =='-' ?"": registerInfo.firstNameAr, "FirstNameN": registerInfo.firstNameAr,
"FirstName": registerInfo.firstNameEn =='-' ?"":registerInfo.firstNameEn, "FirstName": registerInfo.firstNameEn,
"MiddleNameN":registerInfo.secondNameAr =='-' ? "" : registerInfo.secondNameAr, "MiddleNameN": registerInfo.secondNameAr,
"MiddleName":registerInfo.secondNameEn == '-' ? "": registerInfo.secondNameEn, "MiddleName": registerInfo.secondNameEn,
"LastNameN": registerInfo.lastNameAr =='-'? "" : registerInfo.lastNameAr, "LastNameN": registerInfo.lastNameAr,
"LastName": registerInfo.lastNameEn =='-' ? "": registerInfo.lastNameEn, "LastName": registerInfo.lastNameEn,
"StrDateofBirth": registerInfo.dateOfBirth, "StrDateofBirth": registerInfo.dateOfBirth,
"DateofBirth": DateUtil.convertISODateToJsonDate( "DateofBirth": DateUtil.convertISODateToJsonDate(
registerInfo.dateOfBirth.replaceAll('/', '-')), registerInfo.dateOfBirth.replaceAll('/', '-')),
"Gender": registerInfo.gender == 'M' ? 1 : 2, "Gender": registerInfo.gender == 'M' ? 1 : 2,
"NationalityID": registerInfo.nationality, "NationalityID": registerInfo.nationalityCode,
"eHealthIDField": registerInfo.healthId,
"DateofBirthN": date, "DateofBirthN": date,
"EmailAddress": email, "EmailAddress": email,
"SourceType": location, "SourceType": location,

@ -21,6 +21,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_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:intl/intl.dart';
class Register extends StatefulWidget { class Register extends StatefulWidget {
@override @override
@ -294,12 +295,12 @@ class _Register extends State<Register> {
// DOB: this.dateOption === '1' ? this.dateOfBirth : moment(this.dateOfBirth).format('DD/MM/YYYY'), // DOB: this.dateOption === '1' ? this.dateOfBirth : moment(this.dateOfBirth).format('DD/MM/YYYY'),
// IsHijri: Number(this.dateOption) // IsHijri: Number(this.dateOption)
// } // }
final DateFormat dateFormat = DateFormat('dd/MM/yyyy');
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
var request = CheckUserStatusRequest(); var request = CheckUserStatusRequest();
request.patientIdentificationID = nationalIDorFile.text; request.patientIdentificationID = nationalIDorFile.text;
request.dOB = isHijri == 1 request.dOB = isHijri == 1 ? dob : dateFormat.format(selectedDate);
? dob
: "${selectedDate.toLocal()}".split(' ')[0].replaceAll('-', '/');
request.isHijri = isHijri; request.isHijri = isHijri;
request.patientOutSA = countryCode == '966' ? 0 : 1; request.patientOutSA = countryCode == '966' ? 0 : 1;
this.authService.checkUserStatus(request).then((result) => { this.authService.checkUserStatus(request).then((result) => {
@ -311,7 +312,12 @@ class _Register extends State<Register> {
Navigator.of(context).push(FadePage(page: ConfirmLogin())), Navigator.of(context).push(FadePage(page: ConfirmLogin())),
} }
else else
{AppToast.showErrorToast(message: result)} {
AppToast.showErrorToast(
message: result
? result
: TranslationBase.of(context).somethingWentWrong)
}
}); });
} }

@ -104,7 +104,8 @@ class _RequestTypePageState extends State<RequestTypePage> {
), ),
bottomSheet: Container( bottomSheet: Container(
width: double.maxFinite, width: double.maxFinite,
height: MediaQuery.of(context).size.height * 0.1, // height: MediaQuery.of(context).size.height * 0.1,
height: 80.0,
child: Padding( child: Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: SecondaryButton( child: SecondaryButton(

@ -61,15 +61,13 @@ class ReportListWidget extends StatelessWidget {
), ),
Texts(reportList[index].projectName), Texts(reportList[index].projectName),
Texts(reportList[index].clinicDescription), Texts(reportList[index].clinicDescription),
Texts(TranslationBase.of(context).invoiceNo + Texts(TranslationBase.of(context).invoiceNo + ': ${reportList[index].invoiceNo}'),
': ${reportList[index].invoiceNo}'),
SizedBox(height: 12), SizedBox(height: 12),
], ],
), ),
reportList[index].status == 2 reportList[index].status == 2
? Container( ? Container(
margin: margin: EdgeInsets.only(left: 15.0, right: 15.0),
EdgeInsets.only(left: 15.0, right: 15.0),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
showConfirmMessage(reportList[index]); showConfirmMessage(reportList[index]);
@ -78,7 +76,7 @@ class ReportListWidget extends StatelessWidget {
child: Icon( child: Icon(
Icons.email, Icons.email,
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
size: 35.0, size: 30.0,
), ),
), ),
) )
@ -123,8 +121,7 @@ class ReportListWidget extends StatelessWidget {
report.setupId) report.setupId)
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showSuccessToast( AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully);
message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print(err); print(err);

@ -94,6 +94,11 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
height: 8, height: 8,
), ),
LargeAvatar( LargeAvatar(
url:
'https://hmgwebservices.com/Images/Hospitals/' +
model.appointmentDetails.projectID
.toString() +
'.jpg',
name: model.appointmentDetails.clinicName, name: model.appointmentDetails.clinicName,
width: 110, width: 110,
height: 110, height: 110,
@ -146,19 +151,17 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
child: Container( child: Container(
key: ValueKey<int>(rating), key: ValueKey<int>(rating),
child: IconButton( child: IconButton(
iconSize: 45.0, //iconSize: 45.0,
onPressed: () { onPressed: () {
setState(() { setState(() {
rating = index + 1; rating = index + 1;
}); });
}, },
color: rating >= (index + 1) iconSize: rating == (index + 1) ? 60 : 40,
? Color.fromRGBO(255, 186, 0, 1.0)
: Colors.grey[400],
// Theme.of(context).hintColor, // Theme.of(context).hintColor,
icon: Icon(rating >= (index + 1) icon: Image.asset('assets/images/' +
? EvaIcons.star (index + 1).toString() +
: EvaIcons.star)), '.png')),
), ),
), ),
) )
@ -208,7 +211,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
} }
}, },
label: TranslationBase.of(context).submit, label: TranslationBase.of(context).submit,
disabled: (model.state == ViewState.Busy || rating==0), disabled: (model.state == ViewState.Busy || rating == 0),
// loading: model.state == ViewState.BusyLocal, // loading: model.state == ViewState.BusyLocal,
textColor: Theme.of(context).backgroundColor), textColor: Theme.of(context).backgroundColor),
), ),

@ -44,7 +44,7 @@ class _ProfileSettings extends State<ProfileSettings>
child: model.user != null child: model.user != null
? ListView(scrollDirection: Axis.vertical, children: <Widget>[ ? ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container( Container(
color: Theme.of(context).primaryColor, color: Theme.of(context).textTheme.headline2.color,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -74,7 +74,7 @@ class _ProfileSettings extends State<ProfileSettings>
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
), ),
Container( Container(
color: Theme.of(context).primaryColor, color: Theme.of(context).textTheme.headline2.color,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
@ -93,7 +93,7 @@ class _ProfileSettings extends State<ProfileSettings>
], ],
)), )),
Container( Container(
color: Theme.of(context).primaryColor, color: Theme.of(context).textTheme.headline2.color,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
@ -116,7 +116,7 @@ class _ProfileSettings extends State<ProfileSettings>
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
), ),
Container( Container(
color: Theme.of(context).primaryColor, color: Theme.of(context).textTheme.headline2.color,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
@ -136,7 +136,7 @@ class _ProfileSettings extends State<ProfileSettings>
], ],
)), )),
Container( Container(
color: Theme.of(context).primaryColor, color: Theme.of(context).textTheme.headline2.color,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
@ -160,7 +160,7 @@ class _ProfileSettings extends State<ProfileSettings>
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
), ),
Container( Container(
color: Theme.of(context).primaryColor, color: Theme.of(context).textTheme.headline2.color,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Column( child: Column(
@ -175,7 +175,7 @@ class _ProfileSettings extends State<ProfileSettings>
], ],
)), )),
Container( Container(
color: Theme.of(context).primaryColor, color: Theme.of(context).textTheme.headline2.color,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Column( child: Column(
@ -190,7 +190,7 @@ class _ProfileSettings extends State<ProfileSettings>
], ],
)), )),
Container( Container(
color: Theme.of(context).primaryColor, color: Theme.of(context).textTheme.headline2.color,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Column( child: Column(

@ -241,7 +241,7 @@ class _SecondaryButtonState extends State<SecondaryButton>
widget.label, widget.label,
style: TextStyle( style: TextStyle(
color: widget.textColor, color: widget.textColor,
fontSize: widget.small ? 12.0 : 15.0, fontSize: widget.small ? 12.0 : 14.0,
// fontWeight: FontWeight.w800, // fontWeight: FontWeight.w800,
fontFamily: projectViewModel.isArabic fontFamily: projectViewModel.isArabic
? 'Cairo' ? 'Cairo'

Loading…
Cancel
Save