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 PHARMACY_SELECTED_ADDRESS = 'selected-address';
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;
int channel;
int languageID;
@ -15,7 +15,7 @@ class ReauestInsuranceApprovalModel {
int eXuldAPPNO;
int projectID;
ReauestInsuranceApprovalModel(
RequestInsuranceApprovalModel(
{this.versionID,
this.channel,
this.languageID,
@ -32,7 +32,7 @@ class ReauestInsuranceApprovalModel {
this.eXuldAPPNO,
this.projectID});
ReauestInsuranceApprovalModel.fromJson(Map<String, dynamic> json) {
RequestInsuranceApprovalModel.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];

@ -23,6 +23,7 @@ class RequestSendPrescriptionEmail {
String setupID;
String clinicName;
String doctorName;
int doctorID;
int projectID;
List<PrescriptionReport> listPrescriptions;
@ -49,7 +50,8 @@ class RequestSendPrescriptionEmail {
this.setupID,
this.clinicName,
this.doctorName,
this.projectID});
this.projectID,
this.doctorID});
RequestSendPrescriptionEmail.fromJson(Map<String, dynamic> json) {
appointmentDate = json['AppointmentDate'];
@ -75,6 +77,7 @@ class RequestSendPrescriptionEmail {
clinicName = json['ClinicName'];
doctorName = json['DoctorName'];
projectID = json['ProjectID'];
doctorID = json['DoctorID'];
}
Map<String, dynamic> toJson() {
@ -106,7 +109,7 @@ class RequestSendPrescriptionEmail {
data['ClinicName'] = this.clinicName;
data['DoctorName'] = this.doctorName;
data['ProjectID'] = this.projectID;
data['DoctorID'] = this.doctorID;
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>();
String get userAgreementContent => _reportsService.userAgreementContent;
bool get receiveHealthSummaryReport => _reportsService?.user?.receiveHealthSummaryReport ?? false;
set receiveHealthSummaryReport(bool val) {
_reportsService?.user?.receiveHealthSummaryReport = val;
}
getUserTermsAndConditions() async {
setState(ViewState.Busy);
@ -26,14 +30,9 @@ class ReportsMonthlyViewModel extends BaseViewModel {
}
}
updatePatientHealthSummaryReport(
{String message,
bool isSummary,
bool isUpdateEmail = false,
String email}) async {
updatePatientHealthSummaryReport({String message, bool isSummary, bool isUpdateEmail = false, String email}) async {
setState(ViewState.BusyLocal);
await _reportsService.updatePatientHealthSummaryReport(
isSummary: isSummary);
await _reportsService.updatePatientHealthSummaryReport(isSummary: isSummary);
if (_reportsService.hasError) {
error = _reportsService.error;
AppToast.showErrorToast(message: error);

@ -50,9 +50,9 @@ class ResultPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowDecPage: false,
isShowAppBar: true,
appBarTitle:
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: Column(
children: [
Expanded(
@ -112,11 +112,10 @@ class ResultPage extends StatelessWidget {
backgroundColor: Theme.of(context).primaryColor,
radius: 8,
fontWeight: FontWeight.bold,
handler: (){
handler: () {
Navigator.push(
context,
FadePage(
page: BariatricsPage(1, 1, finalResult)),
FadePage(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/translations_delegate_base.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:flutter/material.dart';
import 'package:nfc_in_flutter/nfc_in_flutter.dart';
class QRCode extends StatefulWidget {
PatientShareResponse patientShareResponse;
@ -30,17 +32,27 @@ class QRCode extends StatefulWidget {
class _QRCodeState extends State<QRCode> {
Uint8List _bytes;
bool _supportsNFC = false;
BuildContext _context;
@override
void initState() {
// TODO: implement initState
_bytes = base64.decode(widget.appoQR.split(',').last);
widget.authUser = new AuthenticatedUser();
NFC.isNDEFSupported.then((supported) {
setState(() {
print("nfc supprted");
_supportsNFC = true;
});
});
super.initState();
}
@override
Widget build(BuildContext context) {
_context = context;
return AppScaffold(
appBarTitle: TranslationBase.of(context).attendRegisterCode,
isShowAppBar: true,
@ -51,9 +63,56 @@ class _QRCodeState extends State<QRCode> {
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 30.0),
alignment: Alignment.center,
child: Image.memory(_bytes, scale: 0.5),
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),
alignment: Alignment.center,
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(
margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0),
@ -70,18 +129,20 @@ class _QRCodeState extends State<QRCode> {
EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0),
child: Image.asset(
"assets/images/new-design/device_icon.png",
width: 120.0,
height: 120.0),
width: MediaQuery.of(context).size.width / 3.4,
height: MediaQuery.of(context).size.width / 3.4),
),
Container(
width: MediaQuery.of(context).size.width * 0.5,
margin: EdgeInsets.only(
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text(TranslationBase.of(context).scanQRHospital,
style: TextStyle(
color: Colors.red[700],
fontSize: 20.0,
fontWeight: FontWeight.bold)),
Expanded(
child: Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text(TranslationBase.of(context).scanQRHospital,
style: TextStyle(
color: Colors.red[700],
fontSize: 18.0,
fontWeight: FontWeight.bold)),
),
),
],
),
@ -300,4 +361,51 @@ class _QRCodeState extends State<QRCode> {
}
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
.getDoctorsListByName(doctorNameController.text, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
@ -129,9 +130,12 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}

@ -206,7 +206,7 @@ class _SelectTransportationMethodState
SizedBox(
height: 8,
),
Texts(TranslationBase.of(context).directionHeading),
Texts(TranslationBase.of(context).wayHeading),
SizedBox(
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/material.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 'dart:convert';
import 'dart:io';
@ -326,9 +327,9 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
fontSize: 13.5,
hintColor: Colors.black,
fontWeight: FontWeight.w600,
onChanged: (v){setState(() {
});},
onChanged: (v) {
setState(() {});
},
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context).emptySubject;
@ -349,11 +350,13 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
controller: messageController,
suffixIcon: Icons.mic,
onSuffixTap: () {
requestPermissions();
openSpeechReco();
},
onChanged: (v){setState(() {
});},
onChanged: (v) {
setState(() {});
},
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context).emptyMessage;
@ -437,7 +440,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12,
height: 80,
width: double.infinity,
padding: EdgeInsets.all(15.0),
child: Center(
@ -447,39 +450,37 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
label: TranslationBase.of(context).send,
textColor: Colors.white,
disabled: (titleController.text.toString().isEmpty ||
messageController.text.toString().isEmpty ),
messageController.text.toString().isEmpty),
onTap: () {
final form = formKey.currentState;
if (form.validate()) {
GifLoaderDialogUtils.showMyDialog(context);
model
.sendCOCItem(
title: titleController.text,
attachment: images.length > 0 ? images[0] : "",
details: messageController.text,
cOCTypeName: getCOCName(),
appointHistory: messageType ==
MessageType.ComplaintOnAnAppointment
? appointHistory
: null)
.then((value) {
if (value) {
setState(() {
titleController.text = "";
messageController.text = "";
images = [];
});
setMessageType(MessageType.NON);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(
message: TranslationBase.of(context).yourFeedback);
} else {
AppToast.showErrorToast(message: model.error);
GifLoaderDialogUtils.hideDialog(context);
}
});
GifLoaderDialogUtils.showMyDialog(context);
model
.sendCOCItem(
title: titleController.text,
attachment: images.length > 0 ? images[0] : "",
details: messageController.text,
cOCTypeName: getCOCName(),
appointHistory: messageType ==
MessageType.ComplaintOnAnAppointment
? appointHistory
: null)
.then((value) {
if (value) {
setState(() {
titleController.text = "";
messageController.text = "";
images = [];
});
setMessageType(MessageType.NON);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(
message: TranslationBase.of(context).yourFeedback);
} else {
AppToast.showErrorToast(message: model.error);
GifLoaderDialogUtils.hideDialog(context);
}
});
}
},
),
@ -544,7 +545,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (available) {
speech.listen(
onResult: resultListener,
// listenMode: ListenMode.confirmation,
listenMode: stt.ListenMode.confirmation,
localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA',
);
} 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) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
}
void requestPermissions() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.microphone,
].request();
print(statuses);
}
void resultListener(result) {
reconizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord});
@ -565,10 +577,18 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (result.finalResult == true) {
setState(() {
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 {
@ -588,7 +608,6 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
setMessageDialogType(MessageType messageType) {
setState(() {
messageTypeDialog = messageType;
});
}

@ -278,44 +278,46 @@ class _RegisterInfo extends State<RegisterInfo> {
registerNow() {
dynamic request = getTempUserRequest();
GifLoaderDialogUtils.showMyDialog(context);
this.authService.registerUser(request).then((result) => {
GifLoaderDialogUtils.hideDialog(context),
// userData = result.list;
//AuthenticatedUser.fromJson(result['List'][0]),
if(result is String){
new ConfirmDialog(
context: context,
confirmMessage: result,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context)
},
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)})
.showAlertDialog(context)
}else
{
result.list.isFamily = false,
sharedPref.setObject(USER_PROFILE, result.list),
this.sharedPref.setObject(MAIN_USER, result.list),
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
sharedPref.setString(TOKEN, result.authenticationTokenID),
Navigator.of(context).pushNamed(HOME)
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
this
.authService
.registerUser(request)
.then((result) => {
GifLoaderDialogUtils.hideDialog(context),
// userData = result.list;
//AuthenticatedUser.fromJson(result['List'][0]),
if (result is String)
{
new ConfirmDialog(
context: context,
confirmMessage: result,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () =>
{ConfirmDialog.closeAlertDialog(context)},
cancelFunction: () => {
ConfirmDialog.closeAlertDialog(context)
}).showAlertDialog(context)
}
else
{
result.list.isFamily = false,
sharedPref.setObject(USER_PROFILE, result.list),
this.sharedPref.setObject(MAIN_USER, result.list),
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
sharedPref.setString(TOKEN, result.authenticationTokenID),
Navigator.of(context).pushNamed(HOME)
}
})
.catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: err,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context)
},
okFunction: () => {ConfirmDialog.closeAlertDialog(context)},
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
dialog.showAlertDialog(context);
});
}
@ -347,17 +349,18 @@ class _RegisterInfo extends State<RegisterInfo> {
"PatientIdentificationNo": registerInfo.idNumber,
"MobileNumber": registerd_data.patientMobileNumber,
"PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1,
"FirstNameN":registerInfo.firstNameAr =='-' ?"": registerInfo.firstNameAr,
"FirstName": registerInfo.firstNameEn =='-' ?"":registerInfo.firstNameEn,
"MiddleNameN":registerInfo.secondNameAr =='-' ? "" : registerInfo.secondNameAr,
"MiddleName":registerInfo.secondNameEn == '-' ? "": registerInfo.secondNameEn,
"LastNameN": registerInfo.lastNameAr =='-'? "" : registerInfo.lastNameAr,
"LastName": registerInfo.lastNameEn =='-' ? "": registerInfo.lastNameEn,
"FirstNameN": registerInfo.firstNameAr,
"FirstName": registerInfo.firstNameEn,
"MiddleNameN": registerInfo.secondNameAr,
"MiddleName": registerInfo.secondNameEn,
"LastNameN": registerInfo.lastNameAr,
"LastName": registerInfo.lastNameEn,
"StrDateofBirth": registerInfo.dateOfBirth,
"DateofBirth": DateUtil.convertISODateToJsonDate(
registerInfo.dateOfBirth.replaceAll('/', '-')),
"Gender": registerInfo.gender == 'M' ? 1 : 2,
"NationalityID": registerInfo.nationality,
"NationalityID": registerInfo.nationalityCode,
"eHealthIDField": registerInfo.healthId,
"DateofBirthN": date,
"EmailAddress": email,
"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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class Register extends StatefulWidget {
@override
@ -294,12 +295,12 @@ class _Register extends State<Register> {
// DOB: this.dateOption === '1' ? this.dateOfBirth : moment(this.dateOfBirth).format('DD/MM/YYYY'),
// IsHijri: Number(this.dateOption)
// }
final DateFormat dateFormat = DateFormat('dd/MM/yyyy');
GifLoaderDialogUtils.showMyDialog(context);
var request = CheckUserStatusRequest();
request.patientIdentificationID = nationalIDorFile.text;
request.dOB = isHijri == 1
? dob
: "${selectedDate.toLocal()}".split(' ')[0].replaceAll('-', '/');
request.dOB = isHijri == 1 ? dob : dateFormat.format(selectedDate);
request.isHijri = isHijri;
request.patientOutSA = countryCode == '966' ? 0 : 1;
this.authService.checkUserStatus(request).then((result) => {
@ -311,7 +312,12 @@ class _Register extends State<Register> {
Navigator.of(context).push(FadePage(page: ConfirmLogin())),
}
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(
width: double.maxFinite,
height: MediaQuery.of(context).size.height * 0.1,
// height: MediaQuery.of(context).size.height * 0.1,
height: 80.0,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: SecondaryButton(

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

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

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

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

Loading…
Cancel
Save