Merge branch 'diplomatic-quarter-live' into diplomatic-quarter-haroon

dq_and_master
haroon amjad 4 years ago
commit a7dc2fdfd1

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -912,7 +912,7 @@ const Map localizedValues = {
"en": "Please enter the subject", "en": "Please enter the subject",
"ar": "يرجى ادخال الموضوع" "ar": "يرجى ادخال الموضوع"
}, },
"empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الموضوع"}, "empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الرسالة"},
"select-attachment": {"en": "Select Attachment", "ar": "إختر المرفق"}, "select-attachment": {"en": "Select Attachment", "ar": "إختر المرفق"},
"complain-appo": {"en": "Complaint for appointment", "ar": "شكوى على موعد"}, "complain-appo": {"en": "Complaint for appointment", "ar": "شكوى على موعد"},
"complain-without-appo": { "complain-without-appo": {
@ -1202,4 +1202,19 @@ const Map localizedValues = {
"en": "No data available", "en": "No data available",
"ar": " لا يوجد بيانات متاحة " "ar": " لا يوجد بيانات متاحة "
}, },
"noSearchResult": {
"en": "No Search Result",
"ar": "لا توجد نتيجة بحث"
},
"selectFileSouse": {
"en": "Select file souse",
"ar": "حدد الملف"
},
"gallery": {
"en": "Gallery",
"ar": "معرض الصور"
}, "camera": {
"en": "Camera",
"ar": "كاميرا"
},
}; };

@ -21,59 +21,8 @@ class FeedbackViewModel extends BaseViewModel {
FeedbackService _feedbackService = locator<FeedbackService>(); FeedbackService _feedbackService = locator<FeedbackService>();
List<COCItem> get cOCItemList => _feedbackService.cOCItemList; List<COCItem> get cOCItemList => _feedbackService.cOCItemList;
MessageType messageType = MessageType.NON;
MessageType messageTypeDialog = MessageType.NON;
String getSelected(BuildContext context) {
switch (messageType) {
case MessageType.ComplaintOnAnAppointment:
return TranslationBase.of(context).complainAppo;
break;
case MessageType.ComplaintWithoutAppointment:
return TranslationBase.of(context).complainWithoutAppo;
break;
case MessageType.Question:
return TranslationBase.of(context).question;
break;
case MessageType.Compliment:
return TranslationBase.of(context).compliment;
break;
case MessageType.Suggestion:
return TranslationBase.of(context).suggestion;
break;
case MessageType.NON:
return TranslationBase.of(context).notClassified;
break;
}
return TranslationBase.of(context).notClassified;
}
setMessageDialogType(MessageType messageType) {
messageTypeDialog = messageType;
notifyListeners();
}
setMessageType(MessageType messageType) {
this.messageType = messageType;
switch (messageType) {
case MessageType.ComplaintOnAnAppointment:
break;
case MessageType.ComplaintWithoutAppointment:
break;
case MessageType.Question:
break;
case MessageType.Compliment:
break;
case MessageType.Suggestion:
break;
case MessageType.NON:
break;
}
notifyListeners();
}
List<AppointmentHistory> get appointHistoryList => List<AppointmentHistory> get appointHistoryList =>
_feedbackService.appointHistoryList; _feedbackService.appointHistoryList;
@ -93,11 +42,9 @@ class FeedbackViewModel extends BaseViewModel {
if (_feedbackService.hasError) { if (_feedbackService.hasError) {
error = _feedbackService.error; error = _feedbackService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
setMessageType(MessageType.NON);
return false; return false;
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
setMessageType(MessageType.NON);
return true; return true;
} }
} }

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_mode
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; 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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
@ -31,6 +32,41 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
bool isShowListAppointHistory = true; bool isShowListAppointHistory = true;
String message; String message;
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
MessageType messageType = MessageType.NON;
String getSelected(BuildContext context) {
switch (messageType) {
case MessageType.ComplaintOnAnAppointment:
return TranslationBase.of(context).complainAppo;
break;
case MessageType.ComplaintWithoutAppointment:
return TranslationBase.of(context).complainWithoutAppo;
break;
case MessageType.Question:
return TranslationBase.of(context).question;
break;
case MessageType.Compliment:
return TranslationBase.of(context).compliment;
break;
case MessageType.Suggestion:
return TranslationBase.of(context).suggestion;
break;
case MessageType.NON:
return TranslationBase.of(context).notClassified;
break;
}
return TranslationBase.of(context).notClassified;
}
setMessageType(MessageType messageType) {
setState(() {
this.messageType = messageType;
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -55,7 +91,6 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
child: Texts( child: Texts(
TranslationBase.of(context).likeToHear, TranslationBase.of(context).likeToHear,
textAlign: TextAlign.center, textAlign: TextAlign.center,
variant: 'body2Link',
), ),
), ),
InkWell( InkWell(
@ -75,9 +110,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Container( Container(
child: Texts( child: Texts(
model.getSelected(context), getSelected(context),
variant: 'bodyText', variant: 'bodyText',
), ),
margin: EdgeInsets.only(left: 10,right: 10), margin: EdgeInsets.only(left: 10,right: 10),
@ -91,7 +125,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
), ),
), ),
), ),
if (appointHistory != null && model.messageType == if (appointHistory != null && messageType ==
MessageType.ComplaintOnAnAppointment) MessageType.ComplaintOnAnAppointment)
InkWell( InkWell(
onTap: () { onTap: () {
@ -167,12 +201,10 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
), ),
), ),
), ),
if (model.messageType == if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 &&
MessageType.ComplaintOnAnAppointment &&
model.appointHistoryList.length != 0 &&
isShowListAppointHistory) isShowListAppointHistory)
Container( Container(
height: MediaQuery.of(context).size.height * 0.4, height: model.appointHistoryList.length>2?MediaQuery.of(context).size.height * 0.25:MediaQuery.of(context).size.height * 0.15,
child: ListView.builder( child: ListView.builder(
itemCount: model.appointHistoryList.length, itemCount: model.appointHistoryList.length,
itemBuilder: (context, index) => InkWell( itemBuilder: (context, index) => InkWell(
@ -285,7 +317,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
hintColor: Colors.black, hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
validator: (value) { validator: (value) {
if (value == null) if (value.isEmpty)
return TranslationBase.of(context).emptySubject; return TranslationBase.of(context).emptySubject;
else else
return null; return null;
@ -303,7 +335,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
minLines: 13, minLines: 13,
controller: messageController, controller: messageController,
validator: (value) { validator: (value) {
if (value == null) if (value.isEmpty)
return TranslationBase.of(context).emptyMessage; return TranslationBase.of(context).emptyMessage;
else else
return null; return null;
@ -376,7 +408,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
), ),
)), )),
SizedBox( SizedBox(
height: 30, height: 45,
), ),
], ],
), ),
@ -396,14 +428,14 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
onTap: () { onTap: () {
final form = formKey.currentState; final form = formKey.currentState;
if (form.validate()) if (model.messageType != MessageType.NON) if (form.validate()) if (messageType != MessageType.NON)
model model
.sendCOCItem( .sendCOCItem(
title: titleController.text, title: titleController.text,
attachment: images.length > 0 ? images[0] : "", attachment: images.length > 0 ? images[0] : "",
details: messageController.text, details: messageController.text,
cOCTypeName: getCOCName(model), cOCTypeName: getCOCName(),
appointHistory: model.messageType == appointHistory:messageType ==
MessageType.ComplaintOnAnAppointment MessageType.ComplaintOnAnAppointment
? appointHistory ? appointHistory
: null) : null)
@ -414,7 +446,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
messageController.text = ""; messageController.text = "";
images = []; images = [];
}); });
model.setMessageType(MessageType.NON); setMessageType(MessageType.NON);
AppToast.showSuccessToast( AppToast.showSuccessToast(
message: TranslationBase.of(context).yourFeedback); message: TranslationBase.of(context).yourFeedback);
} else { } else {
@ -433,8 +465,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
); );
} }
String getCOCName(FeedbackViewModel model) { String getCOCName() {
switch (model.messageType) { switch (messageType) {
case MessageType.ComplaintOnAnAppointment: case MessageType.ComplaintOnAnAppointment:
return "1"; return "1";
break; break;
@ -462,15 +494,18 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
showDialog( showDialog(
context: context, context: context,
child: FeedbackTypeDialog( child: FeedbackTypeDialog(
messageTypeDialog: messageType,
onValueSelected: (MessageType value) { onValueSelected: (MessageType value) {
if (value == MessageType.ComplaintOnAnAppointment) { if (value == MessageType.ComplaintOnAnAppointment) {
GifLoaderDialogUtils.showMyDialog(context);
model.getPatentAppointmentHistory().then((value) { model.getPatentAppointmentHistory().then((value) {
GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
appointHistory = null; appointHistory = null;
}); });
}); });
} }
model.setMessageType(value); setMessageType(value);
}, },
)); ));
} }
@ -478,14 +513,30 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
class FeedbackTypeDialog extends StatefulWidget { class FeedbackTypeDialog extends StatefulWidget {
final Function(MessageType) onValueSelected; final Function(MessageType) onValueSelected;
final MessageType messageTypeDialog;
const FeedbackTypeDialog({Key key, this.onValueSelected}) : super(key: key); const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog=MessageType.NON}) : super(key: key);
@override @override
State createState() => new FeedbackTypeDialogState(); State createState() => new FeedbackTypeDialogState();
} }
class FeedbackTypeDialogState extends State<FeedbackTypeDialog> { class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
MessageType messageTypeDialog = MessageType.NON;
setMessageDialogType(MessageType messageType) {
setState(() {
messageTypeDialog = messageType;
});
}
@override
void initState() {
messageTypeDialog = widget.messageTypeDialog;
super.initState();
}
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<FeedbackViewModel>( return BaseView<FeedbackViewModel>(
builder: (_, model, widge) => SimpleDialog( builder: (_, model, widge) => SimpleDialog(
@ -507,16 +558,16 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => model.setMessageDialogType( onTap: () => setMessageDialogType(
MessageType.ComplaintOnAnAppointment), MessageType.ComplaintOnAnAppointment),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).complainAppo), title: Texts(TranslationBase.of(context).complainAppo),
leading: Radio( leading: Radio(
value: MessageType.ComplaintOnAnAppointment, value: MessageType.ComplaintOnAnAppointment,
groupValue: model.messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: Theme.of(context).primaryColor,
onChanged: (MessageType value) => onChanged: (MessageType value) =>
model.setMessageDialogType(value), setMessageDialogType(value),
), ),
), ),
), ),
@ -531,16 +582,16 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => model.setMessageDialogType( onTap: () => setMessageDialogType(
MessageType.ComplaintWithoutAppointment), MessageType.ComplaintWithoutAppointment),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).complainWithoutAppo), title: Texts(TranslationBase.of(context).complainWithoutAppo),
leading: Radio( leading: Radio(
value: MessageType.ComplaintWithoutAppointment, value: MessageType.ComplaintWithoutAppointment,
groupValue: model.messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: Theme.of(context).primaryColor,
onChanged: (MessageType value) => onChanged: (MessageType value) =>
model.setMessageDialogType(value), setMessageDialogType(value),
), ),
), ),
), ),
@ -556,15 +607,15 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => onTap: () =>
model.setMessageDialogType(MessageType.Question), setMessageDialogType(MessageType.Question),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).question), title: Texts(TranslationBase.of(context).question),
leading: Radio( leading: Radio(
value: MessageType.Question, value: MessageType.Question,
groupValue: model.messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: Theme.of(context).primaryColor,
onChanged: (MessageType value) => onChanged: (MessageType value) =>
model.setMessageDialogType(value), setMessageDialogType(value),
), ),
), ),
), ),
@ -580,15 +631,15 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => onTap: () =>
model.setMessageDialogType(MessageType.Compliment), setMessageDialogType(MessageType.Compliment),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).compliment), title: Texts(TranslationBase.of(context).compliment),
leading: Radio( leading: Radio(
value: MessageType.Compliment, value: MessageType.Compliment,
groupValue: model.messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: Theme.of(context).primaryColor,
onChanged: (MessageType value) => onChanged: (MessageType value) =>
model.setMessageDialogType(value), setMessageDialogType(value),
), ),
), ),
), ),
@ -604,15 +655,14 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => onTap: () =>
model.setMessageDialogType(MessageType.Suggestion), setMessageDialogType(MessageType.Suggestion),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).suggestion), title: Texts(TranslationBase.of(context).suggestion),
leading: Radio( leading: Radio(
value: MessageType.Suggestion, value: MessageType.Suggestion,
groupValue: model.messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: Theme.of(context).primaryColor,
onChanged: (MessageType value) => onChanged: (MessageType value) => setMessageDialogType(value),
model.setMessageDialogType(value),
), ),
), ),
), ),
@ -660,7 +710,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
widget.onValueSelected(model.messageTypeDialog); widget.onValueSelected(messageTypeDialog);
Navigator.pop(context); Navigator.pop(context);
}, },
child: Padding( child: Padding(

@ -14,7 +14,6 @@ class StatusFeedbackPage extends StatefulWidget {
} }
class _StatusFeedbackPageState extends State<StatusFeedbackPage> { class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<FeedbackViewModel>( return BaseView<FeedbackViewModel>(
@ -23,64 +22,85 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowDecPage: false, isShowDecPage: false,
body: Container( body: model.cOCItemList.isNotEmpty
margin: EdgeInsets.only(top: 8.0,left: 8.0,right: 8.0 ), ? Container(
padding: EdgeInsets.all(15.0), margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
child: ListView.builder( padding: EdgeInsets.all(15.0),
itemCount: model.cOCItemList.length, child: ListView.builder(
itemBuilder: (context, index) => Container( itemCount: model.cOCItemList.length,
decoration: BoxDecoration( itemBuilder: (context, index) => Container(
shape: BoxShape.rectangle, decoration: BoxDecoration(
border: Border.all(color: Colors.white, width: 0.5), shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(5)), border: Border.all(color: Colors.white, width: 0.5),
color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5)),
), color: Colors.white,
margin: EdgeInsets.all(4),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(height: 8,),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Texts('${model.cOCItemList[index].cOCTitle}'),
Texts(
TranslationBase.of(context).number + ' : ${model.cOCItemList[index].itemID}',
variant: 'overline',
),
],
),
), ),
Expanded( margin: EdgeInsets.all(4),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts('${model.cOCItemList[index].status}'), SizedBox(
Texts( height: 8,
'${model.cOCItemList[index].date}',
variant: 'overline',
), ),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Texts(
'${model.cOCItemList[index].cOCTitle}'),
Texts(
TranslationBase.of(context).number +
' : ${model.cOCItemList[index].itemID}',
variant: 'overline',
),
],
),
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Texts(
'${model.cOCItemList[index].status}'),
Texts(
'${model.cOCItemList[index].date}',
variant: 'overline',
),
],
),
),
],
),
Texts('${model.cOCItemList[index].formType}'),
Divider(
height: 4.5,
color: Colors.grey[500],
)
], ],
), ),
), ),
], )),
), )
Texts('${model.cOCItemList[index].formType}'), : Container(
Divider(height: 4.5,color: Colors.grey[500],) child: Center(
child: Column(
children: [
SizedBox(height: MediaQuery.of(context).size.height*0.4,),
Image.asset('assets/images/comments.png',width: 80,height: 80,),
SizedBox(height: 15,),
Texts(TranslationBase.of(context).noSearchResult),
], ],
), ),
), ),
)), ),
),
), ),
); );
} }

@ -82,8 +82,7 @@ class _HomePageState extends State<HomePage> {
left: 5, left: 5,
right: 5, right: 5,
child: Container( child: Container(
width: width: MediaQuery.of(context).size.width * 0.8,
MediaQuery.of(context).size.width * 0.8,
child: Container(), child: Container(),
), ),
) )
@ -91,7 +90,7 @@ class _HomePageState extends State<HomePage> {
), ),
), ),
Container(width: double.infinity, height:projectViewModel.isArabic ? 120:110), Container(width: double.infinity, height:projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.3 :110),
], ],
), ),
Positioned( Positioned(
@ -187,7 +186,7 @@ class _HomePageState extends State<HomePage> {
) )
: Container( : Container(
width: double.infinity, width: double.infinity,
height: projectViewModel.isArabic ? 180 : 160, // height: projectViewModel.isArabic ? 180 : 160,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -267,8 +266,7 @@ class _HomePageState extends State<HomePage> {
), ),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context) TranslationBase.of(context).myMedicalFile,
.viewMore,
color: Theme.of(context) color: Theme.of(context)
.primaryColor, .primaryColor,
fontSize: 12, fontSize: 12,
@ -694,7 +692,7 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
), ),
height: 106, height: 112,
imageName: 'ask_doctor_bg.png', imageName: 'ask_doctor_bg.png',
//color: Colors.grey[700], //color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
@ -735,7 +733,7 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
), ),
height: 106, height: 112,
imageName: 'rectangle.png', imageName: 'rectangle.png',
color: Colors.grey[700], color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
@ -744,7 +742,7 @@ class _HomePageState extends State<HomePage> {
), ),
), ),
SizedBox( SizedBox(
height: 120, height: 130,
) )
], ],
), ),

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -10,6 +11,7 @@ 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 'laboratory_result_page.dart'; import 'laboratory_result_page.dart';
@ -18,6 +20,7 @@ class LabsHomePage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/ar/0.png')); imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/ar/0.png'));
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) => model.getLabs(), onModelReady: (model) => model.getLabs(),
@ -91,10 +94,10 @@ class LabsHomePage extends StatelessWidget {
), ),
),isInOutPatient: labOrder.isInOutPatient, ),isInOutPatient: labOrder.isInOutPatient,
name: labOrder.doctorName, name: labOrder.doctorName,
billNo: ' ${labOrder.invoiceNo}',
profileUrl: labOrder.doctorImageURL, profileUrl: labOrder.doctorImageURL,
subName: TranslationBase.of(context).billNo+' ${labOrder.invoiceNo}', subName: labOrder.projectName,
date: DateUtil.getMonthDayYearDateFormatted( date: projectViewModel.isArabic?DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate):DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate),
labOrder.orderDate),
); );
}).toList(), }).toList(),
), ),

@ -33,9 +33,17 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Texts(TranslationBase.of(context).orderStatus +' : ${prescriptionsOrder.descriptionN}'), Container(
width: double.infinity,
decoration: BoxDecoration(
color: prescriptionsOrder.status==3 ?Colors.red:prescriptionsOrder.status==2? Colors.green: Colors.grey,
borderRadius: BorderRadius.circular(5)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).orderStatus +' : ${prescriptionsOrder.descriptionN}',color: Colors.white,),
)),
SizedBox( SizedBox(
height: 5, height: 15,
), ),
Table( Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
@ -60,17 +68,17 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
]), ]),
TableRow(children: [ TableRow(children: [
Container( Container(
height: 50, height: 70,
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: Texts('${prescriptionsOrder.iD}'), child: Texts('${prescriptionsOrder.iD}'),
), ),
), ),
Container( Container(
height: 50, height: 70,
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: Texts('${prescriptionsOrder.createdOn}'), child: Texts('${prescriptionsOrder.createdOn.year}-${prescriptionsOrder.createdOn.day}-${prescriptionsOrder.createdOn.day} ${prescriptionsOrder.createdOn.hour}:${prescriptionsOrder.createdOn.minute}'),
), ),
), ),
]) ])

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_details_page.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -7,6 +8,7 @@ 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';
class PrescriptionsHistoryPage extends StatelessWidget { class PrescriptionsHistoryPage extends StatelessWidget {
final PrescriptionsViewModel prescriptionsViewModel; final PrescriptionsViewModel prescriptionsViewModel;
@ -15,6 +17,8 @@ class PrescriptionsHistoryPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
baseViewModel: prescriptionsViewModel, baseViewModel: prescriptionsViewModel,
body: ListView.builder( body: ListView.builder(
@ -41,9 +45,7 @@ class PrescriptionsHistoryPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts( Texts(
DateUtil.getDayMonthYearHourMinuteDateFormatted( DateUtil.getDayMonthYearHourMinuteDateFormatted(prescriptionsViewModel.prescriptionsHistory[index].createdOn),
prescriptionsViewModel
.prescriptionsHistory[index].createdOn),
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
), ),
SizedBox( SizedBox(

@ -33,7 +33,7 @@ class RadiologyDetailsPage extends StatelessWidget {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Text( Texts(
'${finalRadiology.reportData}', '${finalRadiology.reportData}',
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -11,11 +12,13 @@ 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';
class RadiologyHomePage extends StatelessWidget { class RadiologyHomePage extends StatelessWidget {
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/0.png')); imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/0.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/1.png')); imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/1.png'));
return BaseView<RadiologyViewModel>( return BaseView<RadiologyViewModel>(
@ -93,9 +96,9 @@ class RadiologyHomePage extends StatelessWidget {
isInOutPatient: radiology.isInOutPatient, isInOutPatient: radiology.isInOutPatient,
name: radiology.doctorName, name: radiology.doctorName,
profileUrl: radiology.doctorImageURL, profileUrl: radiology.doctorImageURL,
subName: '${radiology.projectName} \n${TranslationBase.of(context).billNo} ${radiology.invoiceNo}', billNo: '${radiology.invoiceNo}',
date: DateUtil.getMonthDayYearDateFormatted( subName: '${radiology.projectName}',
radiology.orderDate), date: projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(radiology.orderDate):DateUtil.getMonthDayYearDateFormatted(radiology.orderDate),
), ),
); );
}).toList(), }).toList(),

@ -146,7 +146,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
child: Container( child: Container(
key: ValueKey<int>(rating), key: ValueKey<int>(rating),
child: IconButton( child: IconButton(
iconSize: 55.0, iconSize: 45.0,
onPressed: () { onPressed: () {
setState(() { setState(() {
rating = index + 1; rating = index + 1;

@ -138,7 +138,7 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
child: Container( child: Container(
key: ValueKey<int>(rating), key: ValueKey<int>(rating),
child: IconButton( child: IconButton(
iconSize: 55.0, iconSize: 45.0,
onPressed: () { onPressed: () {
setState(() { setState(() {
rating = index + 1; rating = index + 1;

@ -253,6 +253,18 @@ class DateUtil {
else else
return ""; return "";
} }
/// get data formatted like Apr 26,2020
/// [dateTime] convert DateTime to data formatted Arabic
static String getMonthDayYearDateFormattedAr(DateTime dateTime) {
if (dateTime != null)
return getMonthArabic(dateTime.month) +
" " +
dateTime.day.toString() +
", " +
dateTime.year.toString();
else
return "";
}
/// get data formatted like Thursday, Apr 26,2020 /// get data formatted like Thursday, Apr 26,2020
/// [dateTime] convert DateTime to date formatted /// [dateTime] convert DateTime to date formatted

@ -1028,6 +1028,10 @@ class TranslationBase {
String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode];
String get noSearchResult => localizedValues['noSearchResult'][locale.languageCode];
String get selectFileSouse => localizedValues['selectFileSouse'][locale.languageCode];
String get gallery => localizedValues['gallery'][locale.languageCode];
String get camera => localizedValues['camera'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,6 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:feather_icons_flutter/feather_icons_flutter.dart'; import 'package:feather_icons_flutter/feather_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -15,10 +16,10 @@ class ImageOptions {
return _BottomSheet( return _BottomSheet(
children: <Widget>[ children: <Widget>[
_BottomSheetItem( _BottomSheetItem(
title: "Select file souse", title: TranslationBase.of(context).selectFileSouse,
), ),
_BottomSheetItem( _BottomSheetItem(
title: "Gallery", title: TranslationBase.of(context).gallery,
icon: FeatherIcons.image, icon: FeatherIcons.image,
onTap: () async { onTap: () async {
File _image = File _image =
@ -32,7 +33,7 @@ class ImageOptions {
}, },
), ),
_BottomSheetItem( _BottomSheetItem(
title: "Camera", title: TranslationBase.of(context).camera,
icon: FeatherIcons.camera, icon: FeatherIcons.camera,
onTap: () async { onTap: () async {
File _image = File _image =
@ -46,8 +47,10 @@ class ImageOptions {
}, },
), ),
_BottomSheetItem( _BottomSheetItem(
title: "Cancel", title: TranslationBase.of(context).cancel,
onTap: (){}, onTap: (){
},
) )
], ],
); );

@ -54,7 +54,7 @@ class DoctorCard extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Container( Container(
width:projectViewModel.isArabic? 27:20, width:projectViewModel.isArabic? 27:20,
height: date == null ? projectViewModel.isArabic? 170 :100 : 150, height: date == null ? projectViewModel.isArabic? 185 :100 : 180,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !isInOutPatient color: !isInOutPatient
? Colors.red[900] ? Colors.red[900]
@ -113,18 +113,18 @@ class DoctorCard extends StatelessWidget {
), ),
Texts( Texts(
subName, subName,
variant: 'caption3',
), ),
if (billNo != null) if (billNo != null)
Row( Row(
children: <Widget>[ children: <Widget>[
Texts( Texts(
'Bill No: ', '${TranslationBase.of(context).billNo}: ',
variant: 'caption3',
), ),
Texts( Texts(
billNo, billNo,
variant: 'caption3',
) )
], ],
), ),

@ -70,10 +70,9 @@ class _NotAutPageState extends State<NotAutPage> {
Row( Row(
children: [ children: [
Container( Container(
width: 30, width: 40,
height: 30, height: 40,
decoration: BoxDecoration( decoration: BoxDecoration(
// shape: BoxShape.circle,
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
color: Theme.of(context).primaryColor), color: Theme.of(context).primaryColor),
child: Center( child: Center(

Loading…
Cancel
Save