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

# Conflicts:
#	lib/config/localized_values.dart
#	lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart
#	lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart
#	lib/uitl/translations_delegate_base.dart
merge-requests/445/head
haroon amjad 5 years ago
commit 90843252c3

@ -1508,14 +1508,19 @@ const Map localizedValues = {
"enterComplainNumber": {"en": "Enter the Complain Number", "ar": "أدخل رقم الشكوى"}, "enterComplainNumber": {"en": "Enter the Complain Number", "ar": "أدخل رقم الشكوى"},
"enterfileNumber": {"en": "Enter File Number", "ar": "أدخل رقم الملف"}, "enterfileNumber": {"en": "Enter File Number", "ar": "أدخل رقم الملف"},
"please_select_from_below_options": {"en": "Please select from below options:", "ar": "الرجاء التحديد من الخيارات أدناه:"}, "please_select_from_below_options": {"en": "Please select from below options:", "ar": "الرجاء التحديد من الخيارات أدناه:"},
"selectLanguage": { "en": "Please select any language:", "ar": ":الرجاء تحديد أي لغة" }, "selectLanguage": {"en": "Please select any language:", "ar": ":الرجاء تحديد أي لغة"},
"recAlert": { "en": "How do you want to receive alerts?", "ar": "كيف تريد تلقي التنبيهات؟" }, "recAlert": {"en": "How do you want to receive alerts?", "ar": "كيف تريد تلقي التنبيهات؟"},
"modesBelow": { "en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه" }, "modesBelow": {"en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه"},
"prefferedMode": { "en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه" }, "prefferedMode": {"en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه"},
"permissionsBellow": { "en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه" }, "permissionsBellow": {"en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه"},
"appointmentReminder": { "en": "Would you like to set a reminder for this appointment in your calendar?", "ar": "هل ترغب في اضافة تذكير لهذا الموعد في التقويم؟" }, "appointmentReminder": { "en": "Would you like to set a reminder for this appointment in your calendar?", "ar": "هل ترغب في اضافة تذكير لهذا الموعد في التقويم؟" },
"cancelAppointment": { "en": "Cancel Appt.", "ar": "الغاء الموعد" }, "cancelAppointment": { "en": "Cancel Appt.", "ar": "الغاء الموعد" },
"updateInsurCards": {"en": "Update Insurance Cards", "ar": "تحديث بطاقات التأمين"}, "updateInsurCards": {"en": "Update Insurance Cards", "ar": "تحديث بطاقات التأمين"},
"patientAge": {"en": "y", "ar": "سنة"}, "patientAge": {"en": "y", "ar": "سنة"},
"searchCriteria": { "en": "Select Search Criteria", "ar": "حدد معايير البحث" }, "searchCriteria": { "en": "Select Search Criteria", "ar": "حدد معايير البحث" },
"RequesterInfo": {"en": "Requester Info", "ar": "معلومات مقدم الطلب"},
"PatientInfo": {"en": "Patient Info", "ar": "معلومات المريض"},
"OtherInfo": {"en": "Other Info", "ar": "معلومات اخرى"},
"inPrgress": { "en": "In Progress", "ar": "في تقدم" },
"locked": { "en": "Locked", "ar": "مقفل" },
}; };

@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.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:provider/provider.dart'; import 'package:provider/provider.dart';
@ -28,6 +29,29 @@ class OrdersLogDetailsPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
void showConfirmMessage(CMCViewModel model, GetHHCAllPresOrdersResponseModel order) { void showConfirmMessage(CMCViewModel model, GetHHCAllPresOrdersResponseModel order) {
showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg,
onTap: () {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.updateCmcPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
GifLoaderDialogUtils.hideDialog(context);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getCmcAllPresOrders();
GifLoaderDialogUtils.hideDialog(context);
}
});
},
));
return;
// todo 'sikander' remove useless code
showDialog( showDialog(
context: context, context: context,
child: ConfirmCancelOrderDialog( child: ConfirmCancelOrderDialog(

@ -1,5 +1,8 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'new_e_referral_step_three_page.dart'; import 'new_e_referral_step_three_page.dart';
@ -9,18 +12,15 @@ class StartIndexForNewEReferral extends StatefulWidget {
StartIndexForNewEReferral(); StartIndexForNewEReferral();
@override @override
_StartIndexForNewEReferralState createState() => _StartIndexForNewEReferralState createState() => _StartIndexForNewEReferralState();
_StartIndexForNewEReferralState();
} }
class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral> class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral> with TickerProviderStateMixin {
with TickerProviderStateMixin {
PageController _controller; PageController _controller;
int _currentIndex = 1; int _currentIndex = 0;
int pageSelected = 2; int pageSelected = 2;
CreateEReferralRequestModel createEReferralRequestModel = CreateEReferralRequestModel createEReferralRequestModel = new CreateEReferralRequestModel();
new CreateEReferralRequestModel();
@override @override
void initState() { void initState() {
@ -40,10 +40,55 @@ class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: SafeArea( body: Container(
child: SingleChildScrollView( height: double.infinity,
child: Container( child: Column(
height: MediaQuery.of(context).size.height * 0.78, children: [
Container(
width: double.infinity,
padding: EdgeInsets.only(left: 12,right: 12,top: 12),
child: Row(
children: [
Expanded(
child: showProgress(
title: TranslationBase.of(context).RequesterInfo,
status: _currentIndex == 0
? TranslationBase.of(context).inPrgress
: _currentIndex > 0
? TranslationBase.of(context).completed
: TranslationBase.of(context).locked,
color: _currentIndex == 0 ? CustomColors.orange : CustomColors.green,
),
),
Expanded(
child: showProgress(
title: TranslationBase.of(context).patientInfo,
status: _currentIndex == 1
? TranslationBase.of(context).inPrgress
: _currentIndex > 1
? TranslationBase.of(context).completed
: TranslationBase.of(context).locked,
color: _currentIndex == 1
? CustomColors.orange
: _currentIndex > 1
? CustomColors.green
: CustomColors.grey2,
),
),
showProgress(
title: TranslationBase.of(context).otherInfo,
status: _currentIndex == 2 ? TranslationBase.of(context).inPrgress : TranslationBase.of(context).locked,
color: _currentIndex == 2
? CustomColors.orange
: _currentIndex > 3
? CustomColors.green
: CustomColors.grey2,
isNeedBorder: false,
),
],
),
),
Expanded(
child: PageView( child: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: _controller, controller: _controller,
@ -69,8 +114,65 @@ class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral>
], ],
), ),
), ),
],
), ),
), ),
); );
} }
Widget showProgress({String title, String status, Color color, bool isNeedBorder = true}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
width: 26,
height: 26,
decoration: containerRadius(color, 200),
child: Icon(
Icons.done,
color: Colors.white,
size: 16,
),
),
if (isNeedBorder)
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: mDivider(Colors.grey),
)),
],
),
mHeight(8),
Text(
title,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
letterSpacing: -0.44,
),
),
mHeight(2),
Container(
padding: EdgeInsets.all(5),
decoration: containerRadius(color.withOpacity(0.2), 4),
child: Text(
status,
style: TextStyle(
fontSize: 8,
fontWeight: FontWeight.w600,
letterSpacing: -0.32,
color: color,
),
),
),
],
)
],
);
}
} }

@ -12,12 +12,15 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dial
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.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/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -36,13 +39,14 @@ class NewEReferralStepOnePage extends StatefulWidget {
class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> { class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
TextEditingController _nameTextController = TextEditingController(); TextEditingController _nameTextController = TextEditingController();
TextEditingController _mobileTextController = TextEditingController();
GetAllRelationshipTypeResponseModel _selectedRelation; GetAllRelationshipTypeResponseModel _selectedRelation;
String email; String email;
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
GetAllSharedRecordsByStatusList selectedPatientFamily; GetAllSharedRecordsByStatusList selectedPatientFamily;
AdvanceModel advanceModel = AdvanceModel(); AdvanceModel advanceModel = AdvanceModel();
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
String mobileNo = "";
// todo create a model for Country // todo create a model for Country
// todo use country from the json // todo use country from the json
@ -59,7 +63,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
SMSOTP( SMSOTP(
context, context,
1, 1,
_selectedCountry['code'] + _mobileTextController.text, _selectedCountry['code'] + mobileNo,
(value) { (value) {
submit(model, value); submit(model, value);
}, },
@ -77,74 +81,91 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
onModelReady: (model) => model.getRelationTypes(), onModelReady: (model) => model.getRelationTypes(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Container(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Center( Text(
child: Texts(
TranslationBase.of(context).referralRequesterInformation, TranslationBase.of(context).referralRequesterInformation,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
), ),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
NewTextFields( Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).enterReferralRequesterName, "", _nameTextController, isInputTypeNum: true)),
hintText: TranslationBase.of(context).enterReferralRequesterName,
controller: _nameTextController,
),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
InkWell( PhoneNumberSelectorWidget(onNumberChange: (value) {
onTap: () => confirmSelectCountryTypeDialog(), setState(() {
child: Container( mobileNo = value;
padding: EdgeInsets.all(12), });
width: double.infinity, }, onCountryChange: (value) {
height: 65, setState(() {
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), _selectedCountry = value;
child: Row( });
mainAxisAlignment: MainAxisAlignment.spaceBetween, }),
children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)], SizedBox(
height: 12,
), ),
Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
), ),
), ),
SizedBox( child: InkWell(
height: 12, onTap: () => confirmSelectRelationTypeDialog(model.relationTypes),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectRelationship,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
), ),
MobileNumberTextFiled(
controller: _mobileTextController,
code: _selectedCountry == null ? "11" : _selectedCountry["code"],
), ),
SizedBox( Text(
height: 12, getRelationName(),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
), ),
Center(
child: Texts(
TranslationBase.of(context).requesterRelationship,
textAlign: TextAlign.center,
), ),
],
), ),
SizedBox(
height: 12,
), ),
InkWell( Icon(Icons.arrow_drop_down),
onTap: () => confirmSelectRelationTypeDialog(model.relationTypes), ],
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(getRelationName()), Icon(Icons.arrow_drop_down)],
), ),
), ),
), ),
@ -153,20 +174,24 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
), ),
), ),
), ),
bottomSheet: Container( Card(
color: Theme.of(context).scaffoldBackgroundColor, margin: EdgeInsets.zero,
shape: cardRadius(0),
elevation: 20,
child: Container(
// color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(9),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).next, TranslationBase.of(context).next,
(_nameTextController.text.isEmpty || _selectedRelation == null || _mobileTextController.text.isEmpty) (_nameTextController.text.isEmpty || _selectedRelation == null || mobileNo.isEmpty)
? null ? null
: () async { : () async {
Future.delayed(new Duration(milliseconds: 300)).then((value) async { Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel( SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel(
zipCode: _selectedCountry['code'], zipCode: _selectedCountry['code'],
patientMobileNumber: int.parse(_mobileTextController.text), patientMobileNumber: int.parse(mobileNo),
); );
await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -175,7 +200,13 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
}, },
disabledColor: Colors.grey, disabledColor: Colors.grey,
), ),
))); ),
),
],
),
),
),
);
} }
void submit(EReferralViewModel model, code) async { void submit(EReferralViewModel model, code) async {
@ -195,7 +226,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
Navigator.of(context).pop(); Navigator.of(context).pop();
widget.changePageViewIndex(1); widget.changePageViewIndex(1);
widget.createEReferralRequestModel.requesterName = _nameTextController.text; widget.createEReferralRequestModel.requesterName = _nameTextController.text;
widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1) + _mobileTextController.text; widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1) + mobileNo;
widget.createEReferralRequestModel.requesterRelationship = _selectedRelation.iD; widget.createEReferralRequestModel.requesterRelationship = _selectedRelation.iD;
} }
}); });
@ -216,20 +247,93 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
); );
} }
void confirmSelectCountryTypeDialog() { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
showDialog( {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) {
context: context, return Container(
child: SelectCountryDialog( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
selectedCountry: _selectedCountry, alignment: Alignment.center,
onValueSelected: (value) { decoration: BoxDecoration(
setState(() { borderRadius: BorderRadius.circular(15),
_selectedCountry = value; color: Colors.white,
}); border: Border.all(
}, color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text,
controller: _controller,
maxLines: lines,
onChanged: (value) => {setState(() {})},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
suffixIconConstraints: BoxConstraints(minWidth: 50),
suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
), ),
); );
} }
// void confirmSelectCountryTypeDialog() {
// showDialog(
// context: context,
// child: SelectCountryDialog(
// selectedCountry: _selectedCountry,
// onValueSelected: (value) {
// setState(() {
// _selectedCountry = value;
// });
// },
// ),
// );
// }
String getRelationName() { String getRelationName() {
if (_selectedRelation != null) { if (_selectedRelation != null) {
if (projectViewModel.isArabic) { if (projectViewModel.isArabic) {
@ -237,7 +341,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
} }
return _selectedRelation.textEn; return _selectedRelation.textEn;
} else } else
return TranslationBase.of(context).selectRelationship; return "";
} }
String getCountryName() { String getCountryName() {

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -66,13 +67,11 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
}, },
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.94,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -80,91 +79,49 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Center( Text(
child: Texts(
TranslationBase.of(context).otherInfo, TranslationBase.of(context).otherInfo,
textAlign: TextAlign.center, style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
), ),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Container( Container(
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white, color: Colors.white,
), ),
child: Column( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Expanded(
mainAxisAlignment: MainAxisAlignment.start, child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Text(
padding: const EdgeInsets.symmetric(horizontal: 9),
child: Texts(
TranslationBase.of(context).medicalReport, TranslationBase.of(context).medicalReport,
color: Colors.grey, style: TextStyle(
fontSize: 17, fontSize: 12,
), letterSpacing: -0.48,
), fontWeight: FontWeight.w600,
],
),
InkWell(
onTap: () {
ImageOptions.showImageOptions(
context,
(String image, File file) {
setState(() {
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
medicalReportImages.add(eReferralAttachment);
});
},
);
},
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
height: 50,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(7),
color: Colors.white,
shape: BoxShape.rectangle,
),
child: Center(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(Icons.attach_file),
Texts(
TranslationBase.of(context).selectAttachment,
variant: 'bodyText',
textAlign: TextAlign.center,
),
],
),
),
),
), ),
SizedBox(
height: 12,
), ),
...List.generate( ...List.generate(
medicalReportImages.length, medicalReportImages.length,
(index) => Container( (index) => Container(
margin: EdgeInsets.all(10), padding: EdgeInsets.only(top: 6,bottom: 6),
padding: EdgeInsets.all(8.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Icon(FontAwesomeIcons.paperclip),
SizedBox(
width: 8,
),
Texts( Texts(
medicalReportImages[index].fileName, medicalReportImages[index].fileName,
), ),
@ -177,12 +134,42 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
}); });
}, },
child: Icon( child: Icon(
FontAwesomeIcons.trashAlt, Icons.close,
color: Colors.red[300], color: Colors.red[300],
)) ))
], ],
), ),
)), ),
),
InkWell(
onTap: () {
ImageOptions.showImageOptions(
context,
(String image, File file) {
setState(() {
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
medicalReportImages.add(eReferralAttachment);
});
},
);
},
child: Padding(
padding: EdgeInsets.only(top: 12,bottom: 12),
child: Text(
TranslationBase.of(context).selectAttachment,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
decoration: TextDecoration.underline,
color: CustomColors.accentColor,
),
),
),
),
],
),
),
Icon(Icons.attach_file),
], ],
), ),
), ),
@ -288,66 +275,37 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
Opacity( Opacity(
opacity: isPatientInsured ? 1 : 0, opacity: isPatientInsured ? 1 : 0,
child: Container( child: Container(
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white, color: Colors.white,
), ),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
InkWell( Text(
onTap: () { TranslationBase.of(context).medicalReport,
ImageOptions.showImageOptions(context, (String image, File file) { style: TextStyle(
setState(() { fontSize: 12,
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image); letterSpacing: -0.48,
fontWeight: FontWeight.w600,
insuredPatientImages = [eReferralAttachment];
});
});
},
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
height: 50,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(7),
color: Colors.white,
shape: BoxShape.rectangle,
),
child: Center(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(Icons.attach_file),
Texts(
'selected attachment',
variant: 'bodyText',
textAlign: TextAlign.center,
),
],
),
),
),
), ),
SizedBox(
height: 12,
), ),
...List.generate( ...List.generate(
insuredPatientImages.length, insuredPatientImages.length,
(index) => Container( (index) => Container(
margin: EdgeInsets.all(10), padding: EdgeInsets.only(top: 6,bottom: 6),
padding: EdgeInsets.all(8.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Icon(FontAwesomeIcons.paperclip),
SizedBox(
width: 8,
),
Texts( Texts(
'image ${index + 1}.png', 'image ${index + 1}.png',
), ),
@ -360,23 +318,47 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
}); });
}, },
child: Icon( child: Icon(
FontAwesomeIcons.trashAlt, Icons.close,
color: Colors.red[300], color: Colors.red[300],
))
],
), ),
)), )
], ],
), ),
), ),
), ),
SizedBox( InkWell(
height: 12, onTap: () {
ImageOptions.showImageOptions(context, (String image, File file) {
setState(() {
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
insuredPatientImages = [eReferralAttachment];
});
});
},
child: Padding(
padding: const EdgeInsets.only(top: 12,bottom: 12),
child: Text(
TranslationBase.of(context).selectAttachment,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
decoration: TextDecoration.underline,
color: CustomColors.accentColor,
),
), ),
),
),
],
),
),
Icon(Icons.attach_file),
], ],
), ),
), ),
), ),
],
),
), ),
), ),
bottomSheet: Container( bottomSheet: Container(

@ -7,8 +7,10 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStat
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -19,7 +21,6 @@ import 'package:flutter/material.dart';
import '../dialogs/select_city_dialog.dart'; import '../dialogs/select_city_dialog.dart';
class NewEReferralStepTowPage extends StatefulWidget { class NewEReferralStepTowPage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel; final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex; final Function changePageViewIndex;
@ -33,20 +34,14 @@ class NewEReferralStepTowPage extends StatefulWidget {
class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> { class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
TextEditingController _patientNameTextController = TextEditingController(); TextEditingController _patientNameTextController = TextEditingController();
TextEditingController _patientIdentificationTextController = TextEditingController(); TextEditingController _patientIdentificationTextController = TextEditingController();
TextEditingController _mobileTextController = TextEditingController(); String mobileNo = "";
GetAllCitiesResponseModel _selectedCity ; GetAllCitiesResponseModel _selectedCity;
GetAllSharedRecordsByStatusList selectedPatientFamily; GetAllSharedRecordsByStatusList selectedPatientFamily;
// todo create a model for Country // todo create a model for Country
// todo use country from the json // todo use country from the json
dynamic _selectedCountry = { dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "+966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9};
"name": "Saudi Arabia",
"name_ar": "المملكة العربية السعودية",
"code": "+966",
"countryCode": "SA",
"pattern": "5xxxxxxxx",
"maxLength": 9
};
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; AuthenticatedUser authUser;
@ -61,107 +56,108 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
onModelReady: (model) => model.getAllCities(), onModelReady: (model) => model.getAllCities(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.94,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 30, height: 20,
), ),
Center( Text(
child: Texts(
TranslationBase.of(context).patientInfo, TranslationBase.of(context).patientInfo,
// "Patient information", style: TextStyle(
textAlign: TextAlign.center, fontSize: 16,
), fontWeight: FontWeight.w600,
letterSpacing: -0.64,
), ),
SizedBox(
height: 12,
),
NewTextFields(
hintText: TranslationBase.of(context).enterIdentificationNumber,
controller: _patientIdentificationTextController,
keyboardType:TextInputType.number ,
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
NewTextFields( inputWidget(TranslationBase.of(context).enterIdentificationNumber, "", _patientIdentificationTextController, isInputTypeNum: true),
hintText: TranslationBase.of(context).patientName,
controller: _patientNameTextController,
),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
// InkWell( inputWidget(TranslationBase.of(context).patientName, "", _patientNameTextController, isInputTypeNum: true),
// onTap: () => confirmSelectCountryTypeDialog(),
// child: Container(
// padding: EdgeInsets.all(12),
// width: double.infinity,
// height: 65,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Texts(getCountryName()),
// Icon(Icons.arrow_drop_down)
// ],
// ),
// ),
// ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
// MobileNumberTextFiled( PhoneNumberSelectorWidget(onNumberChange: (value) {
// controller: _mobileTextController, setState(() {
// code: _selectedCountry == null mobileNo = value;
// ? "11" });
// : _selectedCountry["code"], }, onCountryChange: (value) {
// ), setState(() {
PhoneNumberSelectorWidget(onNumberChange: (value) => {_mobileTextController.text = value, validateForm()}, onCountryChange: (value) => _selectedCountry = value), _selectedCountry = value;
});
}),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Center( Text(
child: Texts(
TranslationBase.of(context).patientLocated, TranslationBase.of(context).patientLocated,
textAlign: TextAlign.center, style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
), ),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
InkWell( Container(
onTap: () => confirmSelectCityDialog( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
model.allCities), alignment: Alignment.center,
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(15),
color: Colors.white), color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: () => confirmSelectCityDialog(model.allCities),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getRelationName()), Expanded(
Icon(Icons.arrow_drop_down) child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectCity,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
getRelationName(),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
], ],
), ),
), ),
Icon(Icons.arrow_drop_down),
],
),
), ),
SizedBox(
height: 12,
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -170,32 +166,109 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
), ),
), ),
), ),
), Card(
bottomSheet: Container( margin: EdgeInsets.zero,
color: Theme.of(context).scaffoldBackgroundColor, shape: cardRadius(0),
elevation: 20,
child: Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(9), padding: EdgeInsets.all(12),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).next, TranslationBase.of(context).next,
(_patientNameTextController.text.isEmpty || _patientIdentificationTextController.text.isEmpty|| (_patientNameTextController.text.isEmpty || _patientIdentificationTextController.text.isEmpty || _selectedCity == null || mobileNo.isEmpty)
_selectedCity == null || ? null
_mobileTextController.text.isEmpty) ? null : () { : () {
this.widget.changePageViewIndex(2); this.widget.changePageViewIndex(2);
this.widget.createEReferralRequestModel.identificationNo = int.parse( _patientIdentificationTextController.text); this.widget.createEReferralRequestModel.identificationNo = int.parse(_patientIdentificationTextController.text);
this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text; this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text;
this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text; this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1) + mobileNo;
this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString(); this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString();
this.widget.createEReferralRequestModel.cityName = _selectedCity.description; this.widget.createEReferralRequestModel.cityName = _selectedCity.description;
}, },
disabledColor: Colors.grey, disabledColor: Colors.grey,
), ),
))); ),
)
],
),
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text,
controller: _controller,
maxLines: lines,
onChanged: (value) => {setState(() {})},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
suffixIconConstraints: BoxConstraints(minWidth: 50),
suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
),
);
} }
void confirmSelectCityDialog( void confirmSelectCityDialog(List<GetAllCitiesResponseModel> cities) {
List<GetAllCitiesResponseModel> cities) {
showDialog( showDialog(
context: context, context: context,
child: SelectCityDialog( child: SelectCityDialog(
@ -210,18 +283,6 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
); );
} }
void validateForm() {
// if (util.validateIDBox(nationalIDorFile.text, loginType) == true && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) {
// setState(() {
// isButtonDisabled = false;
// });
// } else {
// setState(() {
// isButtonDisabled = true;
// });
// }
}
void confirmSelectCountryTypeDialog() { void confirmSelectCountryTypeDialog() {
showDialog( showDialog(
context: context, context: context,
@ -252,22 +313,16 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
} }
class MobileNumberTextFiled extends StatelessWidget { class MobileNumberTextFiled extends StatelessWidget {
MobileNumberTextFiled({ const MobileNumberTextFiled({Key key, this.controller, this.code}) : super(key: key);
Key key,
this.controller,
this.code
}) : super(key: key);
final TextEditingController controller; final TextEditingController controller;
String code; final String code;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(15), color: Colors.white),
borderRadius: BorderRadius.circular(15), color: Colors.white),
child: Row(children: <Widget>[ child: Row(children: <Widget>[
Expanded( Expanded(
flex: 1, flex: 1,
@ -281,21 +336,18 @@ class MobileNumberTextFiled extends StatelessWidget {
code.toString(), code.toString(),
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
)), )),
// Expanded( Expanded(
// flex: 4, flex: 4,
// child: Container( child: Container(
// margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
// child: TextField( child: TextField(
// controller: controller, controller: controller,
// keyboardType: TextInputType.phone, keyboardType: TextInputType.phone,
// decoration: InputDecoration( decoration: InputDecoration(border: InputBorder.none, hintText: TranslationBase.of(context).mobileNumber),
// border: InputBorder.none, hintText: TranslationBase.of(context).mobileNumber), ),
// ), ),
// ), )
// )
// PhoneNumberSelectorWidget(onNumberChange: (value) => {controller.text = value, validateForm()}, onCountryChange: (value) => code = value),
]), ]),
); );
} }
} }

@ -10,8 +10,7 @@ class SelectCityDialog extends StatefulWidget {
final Function(GetAllCitiesResponseModel) onValueSelected; final Function(GetAllCitiesResponseModel) onValueSelected;
GetAllCitiesResponseModel selectedCity; GetAllCitiesResponseModel selectedCity;
SelectCityDialog( SelectCityDialog({Key key, this.cities, this.onValueSelected, this.selectedCity});
{Key key, this.cities, this.onValueSelected, this.selectedCity});
@override @override
_SelectCityDialogState createState() => _SelectCityDialogState(); _SelectCityDialogState createState() => _SelectCityDialogState();
@ -26,11 +25,13 @@ class _SelectCityDialogState extends State<SelectCityDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SimpleDialog( return Dialog(
child: Column(
children: [ children: [
Column( Expanded(
child: SingleChildScrollView(
child: Column(
children: [ children: [
Divider(),
...List.generate( ...List.generate(
widget.cities.length, widget.cities.length,
(index) => Column( (index) => Column(
@ -72,6 +73,10 @@ class _SelectCityDialogState extends State<SelectCityDialog> {
], ],
), ),
), ),
],
),
),
),
SizedBox( SizedBox(
height: 5.0, height: 5.0,
), ),
@ -122,8 +127,7 @@ class _SelectCityDialogState extends State<SelectCityDialog> {
], ],
) )
], ],
) ),
],
); );
} }
} }

@ -84,6 +84,7 @@ class _EReferralPageState extends State<EReferralPage>
Expanded( Expanded(
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: <Widget>[ children: <Widget>[
StartIndexForNewEReferral(), StartIndexForNewEReferral(),

@ -5,16 +5,14 @@ import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/referral_details.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/referral_details.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -22,7 +20,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'New_E_Referral/new_e_referral_step_one_page.dart';
import 'dialogs/select_country_ingo_Dialog.dart'; import 'dialogs/select_country_ingo_Dialog.dart';
import 'dialogs/select_search_criteria_dialog.dart'; import 'dialogs/select_search_criteria_dialog.dart';
@ -36,7 +33,7 @@ class SearchForReferralsPage extends StatefulWidget {
class _SearchForReferralsPageState extends State<SearchForReferralsPage> { class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
TextEditingController _searchTextController = TextEditingController(); TextEditingController _searchTextController = TextEditingController();
TextEditingController _mobileTextController = TextEditingController(); String mobileNo = "";
bool _isSubmitted = false; bool _isSubmitted = false;
dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9}; dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9};
@ -80,55 +77,106 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
InkWell( // InkWell(
// onTap: () => selectSearchCriteriaDialog(),
// child: Container(
// padding: EdgeInsets.all(12),
// width: double.infinity,
// height: 65,
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)],
// ),
// ),
// ),
Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: () => selectSearchCriteriaDialog(projectViewModel), onTap: () => selectSearchCriteriaDialog(projectViewModel),
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: [Texts(getSearchCriteriaName(projectViewModel)), Icon(Icons.arrow_drop_down)], Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectSearchCriteria,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
), ),
), ),
Text(
getSearchCriteriaName(projectViewModel),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
), ),
SizedBox(
height: 12,
), ),
NewTextFields( ],
hintText: selectedCriteria.value == 1 ? TranslationBase.of(context).enterIdentificationNumber : TranslationBase.of(context).referralNumber,
controller: _searchTextController,
onChanged: (_) {
setState(() {});
},
), ),
SizedBox(
height: 12,
), ),
InkWell( Icon(Icons.arrow_drop_down),
onTap: () => confirmSelectCountryTypeDialog(), ],
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)],
), ),
), ),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
MobileNumberTextFiled(
controller: _mobileTextController, inputWidget(selectedCriteria.value == 1 ? "Enter Patient Identification No" : "Enter Referral Number", "", _searchTextController, isInputTypeNum: true),
onChange: (_) {
setState(() {}); SizedBox(
}, height: 12,
code: _selectedCountry == null ? "11" : _selectedCountry["code"],
), ),
PhoneNumberSelectorWidget(onNumberChange: (value) {
setState(() {
mobileNo = value;
});
}, onCountryChange: (value) {
setState(() {
_selectedCountry = value;
});
}),
// InkWell(
// onTap: () => confirmSelectCountryTypeDialog(),
// child: Container(
// padding: EdgeInsets.all(12),
// width: double.infinity,
// height: 65,
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)],
// ),
// ),
// ),
// SizedBox(
// height: 12,
// ),
// MobileNumberTextFiled(
// controller: _mobileTextController,
// onChange: (_) {
// setState(() {});
// },
// code: _selectedCountry == null ? "11" : _selectedCountry["code"],
// ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -200,11 +248,11 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
padding: EdgeInsets.all(14), padding: EdgeInsets.all(14),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).search, TranslationBase.of(context).search,
(_searchTextController.text.isEmpty || _mobileTextController.text.isEmpty) (_searchTextController.text.isEmpty || mobileNo.isEmpty)
? null ? null
: () async { : () async {
SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel( SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel(
patientMobileNumber: _selectedCountry['code'] + _mobileTextController.text, patientMobileNumber: _selectedCountry['code'] + mobileNo,
); );
if (selectedCriteria.value == 1) { if (selectedCriteria.value == 1) {
searchEReferralRequestModel.identificationNo = _searchTextController.text; searchEReferralRequestModel.identificationNo = _searchTextController.text;
@ -259,6 +307,79 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text,
controller: _controller,
maxLines: lines,
onChanged: (value) => {setState(() {})},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
suffixIconConstraints: BoxConstraints(minWidth: 50),
suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
),
);
}
String getSearchCriteriaName(ProjectViewModel projectViewModel) { String getSearchCriteriaName(ProjectViewModel projectViewModel) {
return projectViewModel.isArabic ? selectedCriteria.nameAr : selectedCriteria.name; return projectViewModel.isArabic ? selectedCriteria.nameAr : selectedCriteria.name;
} }

@ -8,8 +8,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.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:provider/provider.dart'; import 'package:provider/provider.dart';
@ -26,6 +25,28 @@ class OrdersLogDetailsPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
void showConfirmMessage(HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) { void showConfirmMessage(HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) {
showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg,
onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
model.setState(ViewState.Busy);
await model.updateHHCPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getHHCAllPresOrders();
// await model.getHHCAllServices();
}
},
),
);
return;
// todo 'sikander' remove useless code
showDialog( showDialog(
context: context, context: context,
child: ConfirmCancelOrderDialog( child: ConfirmCancelOrderDialog(
@ -49,7 +70,8 @@ class OrdersLogDetailsPage extends StatelessWidget {
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: model.hhcAllPresOrders.length > 0 ? ListView.separated( body: model.hhcAllPresOrders.length > 0
? ListView.separated(
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
@ -170,7 +192,8 @@ class OrdersLogDetailsPage extends StatelessWidget {
); );
}, },
separatorBuilder: (context, index) => SizedBox(height: 12), separatorBuilder: (context, index) => SizedBox(height: 12),
itemCount: model.hhcAllPresOrders.length) : getNoDataWidget(context), itemCount: model.hhcAllPresOrders.length)
: getNoDataWidget(context),
); );
} }
} }

@ -499,41 +499,41 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
return; return;
// todo 'sikander' remove useless code // todo 'sikander' remove useless code
showDialog( // showDialog(
context: context, // context: context,
child: FeedbackTypeDialog( // child: FeedbackTypeDialog(
messageTypeDialog: messageType, // messageTypeDialog: messageType,
onValueSelected: (MessageType value) { // onValueSelected: (MessageType value) {
if (value == MessageType.ComplaintOnAnAppointment) { // if (value == MessageType.ComplaintOnAnAppointment) {
appoList.clear(); // appoList.clear();
GifLoaderDialogUtils.showMyDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) { // service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) {
GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
setState(() { // setState(() {
if (res['MessageStatus'] == 1) { // if (res['MessageStatus'] == 1) {
if (res['AppoimentAllHistoryResultList'].length != 0) { // if (res['AppoimentAllHistoryResultList'].length != 0) {
res['AppoimentAllHistoryResultList'].forEach((v) { // res['AppoimentAllHistoryResultList'].forEach((v) {
appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); // appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
}); // });
setState(() { // setState(() {
appointHistory = null; // appointHistory = null;
isShowListAppointHistory = true; // isShowListAppointHistory = true;
}); // });
} else {} // } else {}
} else {} // } else {}
}); // });
}).catchError((err) { // }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
// print(err); // // print(err);
// AppToast.showErrorToast(message: err); // // AppToast.showErrorToast(message: err);
// Navigator.of(context).pop(); // // Navigator.of(context).pop();
}); // });
} else { // } else {
isShowListAppointHistory = false; // isShowListAppointHistory = false;
} // }
setMessageType(value); // setMessageType(value);
}, // },
)); // ));
} }
openSpeechReco() async { openSpeechReco() async {
@ -587,238 +587,238 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (!mounted) return; if (!mounted) return;
} }
} }
// todo 'sikander' remove useless code
class FeedbackTypeDialog extends StatefulWidget { // class FeedbackTypeDialog extends StatefulWidget {
final Function(MessageType) onValueSelected; // final Function(MessageType) onValueSelected;
final MessageType messageTypeDialog; // final MessageType messageTypeDialog;
//
const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) : 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; // MessageType messageTypeDialog = MessageType.NON;
//
setMessageDialogType(MessageType messageType) { // setMessageDialogType(MessageType messageType) {
setState(() { // setState(() {
messageTypeDialog = messageType; // messageTypeDialog = messageType;
}); // });
} // }
//
@override // @override
void initState() { // void initState() {
messageTypeDialog = widget.messageTypeDialog; // messageTypeDialog = widget.messageTypeDialog;
//
super.initState(); // super.initState();
} // }
//
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return BaseView<FeedbackViewModel>( // return BaseView<FeedbackViewModel>(
builder: (_, model, widge) => SimpleDialog( // builder: (_, model, widge) => SimpleDialog(
title: Text( // title: Text(
TranslationBase.of(context).messageType, // TranslationBase.of(context).messageType,
textAlign: TextAlign.center, // textAlign: TextAlign.center,
), // ),
children: <Widget>[ // children: <Widget>[
Container( // Container(
// padding: const EdgeInsets.all(10.0), // // padding: const EdgeInsets.all(10.0),
child: Column( // child: Column(
children: <Widget>[ // children: <Widget>[
Divider( // Divider(
height: 2.5, // height: 2.5,
color: Colors.grey[500], // color: Colors.grey[500],
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () => setMessageDialogType(MessageType.NON), // onTap: () => setMessageDialogType(MessageType.NON),
child: ListTile( // child: ListTile(
title: Texts(TranslationBase.of(context).notClassified), // title: Texts(TranslationBase.of(context).notClassified),
leading: Radio( // leading: Radio(
value: MessageType.NON, // value: MessageType.NON,
groupValue: messageTypeDialog, // groupValue: messageTypeDialog,
activeColor: CustomColors.accentColor, // activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), // onChanged: (MessageType value) => setMessageDialogType(value),
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () => setMessageDialogType(MessageType.ComplaintOnAnAppointment), // onTap: () => setMessageDialogType(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: messageTypeDialog, // groupValue: messageTypeDialog,
activeColor: CustomColors.accentColor, // activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), // onChanged: (MessageType value) => setMessageDialogType(value),
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () => setMessageDialogType(MessageType.ComplaintWithoutAppointment), // onTap: () => setMessageDialogType(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: messageTypeDialog, // groupValue: messageTypeDialog,
activeColor: CustomColors.accentColor, // activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), // onChanged: (MessageType value) => setMessageDialogType(value),
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () => setMessageDialogType(MessageType.Question), // onTap: () => 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: messageTypeDialog, // groupValue: messageTypeDialog,
activeColor: CustomColors.accentColor, // activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), // onChanged: (MessageType value) => setMessageDialogType(value),
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () => setMessageDialogType(MessageType.Compliment), // onTap: () => 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: messageTypeDialog, // groupValue: messageTypeDialog,
activeColor: CustomColors.accentColor, // activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), // onChanged: (MessageType value) => setMessageDialogType(value),
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () => setMessageDialogType(MessageType.Suggestion), // onTap: () => 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: messageTypeDialog, // groupValue: messageTypeDialog,
activeColor: CustomColors.accentColor, // activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), // onChanged: (MessageType value) => setMessageDialogType(value),
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Divider( // Divider(
height: 2.5, // height: 2.5,
color: Colors.grey[500], // color: Colors.grey[500],
), // ),
SizedBox( // SizedBox(
height: 5, // height: 5,
), // ),
Row( // Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
Navigator.pop(context); // Navigator.pop(context);
}, // },
child: Padding( // child: Padding(
padding: EdgeInsets.all(8.0), // padding: EdgeInsets.all(8.0),
child: Container( // child: Container(
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).cancel, // TranslationBase.of(context).cancel,
color: CustomColors.accentColor, // color: CustomColors.accentColor,
), // ),
), // ),
), // ),
), // ),
), // ),
), // ),
Container( // Container(
width: 1, // width: 1,
height: 30, // height: 30,
color: Colors.grey[500], // color: Colors.grey[500],
), // ),
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
widget.onValueSelected(messageTypeDialog); // widget.onValueSelected(messageTypeDialog);
Navigator.pop(context); // Navigator.pop(context);
}, // },
child: Padding( // child: Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).ok, // TranslationBase.of(context).ok,
fontWeight: FontWeight.w400, // fontWeight: FontWeight.w400,
)), // )),
), // ),
)), // )),
], // ],
) // )
], // ],
), // ),
), // ),
], // ],
), // ),
); // );
} // }
} // }

@ -8,8 +8,10 @@ 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/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -35,12 +37,15 @@ class _AddWeightPageState extends State<AddWeightPage> {
TextEditingController _weightValueController = TextEditingController(); TextEditingController _weightValueController = TextEditingController();
DateTime dayWeightDate = DateTime.now(); DateTime dayWeightDate = DateTime.now();
DateTime timeWeightDate = DateTime.now(); DateTime timeWeightDate = DateTime.now();
int weightUnit = 1; int weightUnit = 0;
final List<String> measureUnitEnList = [ final List<String> measureUnitEnList = [
'Kg',
'Pound', 'Pound',
'Kg',
];
final List<String> measureUnitArList = [
"باوند",
"كيلو جرام",
]; ];
final List<String> measureUnitArList = ["كيلو جرام", "باوند"];
String measureTimeSelectedType; String measureTimeSelectedType;
bool isButtonDisabled = true; bool isButtonDisabled = true;
@ -52,9 +57,6 @@ class _AddWeightPageState extends State<AddWeightPage> {
timeWeightDate = widget.dayWeightDate; timeWeightDate = widget.dayWeightDate;
measureTimeSelectedType = widget.measureTimeSelectedType; measureTimeSelectedType = widget.measureTimeSelectedType;
weightUnit = widget.weightUnit; weightUnit = widget.weightUnit;
// if (measureUnitEnList.contains(widget.measureTimeSelectedType))
// weightUnit = measureUnitEnList.indexOf(widget.measureTimeSelectedType);
// else if (measureUnitArList.contains(widget.measureTimeSelectedType)) weightUnit = measureUnitArList.indexOf(widget.measureTimeSelectedType);
_weightValueController.text = widget.weightValue; _weightValueController.text = widget.weightValue;
validateForm(); validateForm();
} }
@ -69,15 +71,13 @@ class _AddWeightPageState extends State<AddWeightPage> {
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: SingleChildScrollView( body: Column(
children: [
Expanded(
child: ListView(
padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.all(15),
child: Column(
children: [ children: [
SizedBox(
height: 15,
),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).weightAdd, hintText: TranslationBase.of(context).weightAdd,
controller: _weightValueController, controller: _weightValueController,
@ -86,12 +86,27 @@ class _AddWeightPageState extends State<AddWeightPage> {
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 14, fontSize: 14,
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureUnitArList : measureUnitEnList); List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel(projectViewModel.isArabic ? measureUnitArList[0] : measureUnitEnList[0], 0),
RadioSelectionDialogModel(projectViewModel.isArabic ? measureUnitArList[1] : measureUnitEnList[1], 1),
];
showDialog(
context: context,
child: RadioSelectionDialog(
listData: list,
selectedIndex: weightUnit,
onValueSelected: (index) {
weightUnit = index;
measureTimeSelectedType = list[index].title;
setState(() {});
validateForm();
},
),
);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
@ -110,9 +125,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showDatePicker( DatePicker.showDatePicker(
@ -143,9 +156,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showTimePicker( DatePicker.showTimePicker(
@ -185,6 +196,28 @@ class _AddWeightPageState extends State<AddWeightPage> {
color: Colors.red[900], color: Colors.red[900],
), ),
onTap: () { onTap: () {
showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).removeMeasure,
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
widget.model.deleteWeightResult(lineItemNo: widget.lineItemNo).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
},
),
);
return;
// todo 'sikander' remove useless code
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: TranslationBase.of(context).removeMeasure, confirmMessage: TranslationBase.of(context).removeMeasure,
@ -209,19 +242,20 @@ class _AddWeightPageState extends State<AddWeightPage> {
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
}) })
], ],
)) ),
)
: Container() : Container()
], ],
), ),
), ),
), Container(
bottomSheet: Container( color: Colors.white,
color: Theme.of(context).scaffoldBackgroundColor, padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: Padding(
padding: const EdgeInsets.all(20.0),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).save.toUpperCase(), TranslationBase.of(context).save.toUpperCase(),
isButtonDisabled ? null : () async { isButtonDisabled
? null
: () async {
if (_weightValueController.text.isNotEmpty) { if (_weightValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (widget.isUpdate) { if (widget.isUpdate) {
@ -229,7 +263,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
.updateWeightResult( .updateWeightResult(
weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(), weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit + 1, weightUnit: weightUnit,
lineItemNo: widget.lineItemNo) lineItemNo: widget.lineItemNo)
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -256,8 +290,10 @@ class _AddWeightPageState extends State<AddWeightPage> {
}, },
disabledColor: Colors.grey, disabledColor: Colors.grey,
), ),
)
],
), ),
)); );
} }
String getDate() { String getDate() {

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -40,13 +41,10 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
TextEditingController _bloodDiastolicValueController = TextEditingController(); TextEditingController _bloodDiastolicValueController = TextEditingController();
DateTime bloodSugarDate = DateTime.now(); DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now();
int measuredArm = 1; int measuredArm = 0;
bool isButtonDisabled = true; bool isButtonDisabled = true;
final List<String> measureTimeEnList = ['Right Arm', 'Left Arm']; final List<String> measureTimeEnList = ['Left Arm', 'Right Arm'];
final List<String> measureTimeArList = [ final List<String> measureTimeArList = ['الذراع الأيسر', 'الذراع الأيمن'];
'الذراع الأيمن',
'الذراع الأيسر',
];
String measureTimeSelectedType = 'Left Arm'; String measureTimeSelectedType = 'Left Arm';
@override @override
@ -56,7 +54,9 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
bloodSugarDate = widget.bloodSugarDate; bloodSugarDate = widget.bloodSugarDate;
bloodSugarDate = widget.bloodSugarDate; bloodSugarDate = widget.bloodSugarDate;
measureTimeSelectedType = widget.measureTimeSelectedType; measureTimeSelectedType = widget.measureTimeSelectedType;
measuredArm = widget.measuredArm - 1; measuredArm = widget.measuredArm;
if (measuredArm > 1) measuredArm = measuredArm - 1;
_bloodSystolicValueController.text = widget.bloodSystolicValue; _bloodSystolicValueController.text = widget.bloodSystolicValue;
_bloodDiastolicValueController.text = widget.bloodDiastolicValue; _bloodDiastolicValueController.text = widget.bloodDiastolicValue;
validateForm(); validateForm();
@ -72,15 +72,13 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: SingleChildScrollView( body: Column(
children: [
Expanded(
child: ListView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( padding: EdgeInsets.all(21),
margin: EdgeInsets.all(15),
child: Column(
children: [ children: [
SizedBox(
height: 15,
),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).systolicAdd, hintText: TranslationBase.of(context).systolicAdd,
controller: _bloodSystolicValueController, controller: _bloodSystolicValueController,
@ -90,9 +88,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 14, fontSize: 14,
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).diastolicAdd, hintText: TranslationBase.of(context).diastolicAdd,
controller: _bloodDiastolicValueController, controller: _bloodDiastolicValueController,
@ -102,11 +98,29 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 14, fontSize: 14,
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel(projectViewModel.isArabic ? measureTimeArList[0] : measureTimeEnList[0], 0),
RadioSelectionDialogModel(projectViewModel.isArabic ? measureTimeArList[1] : measureTimeEnList[1], 1),
];
showDialog(
context: context,
child: RadioSelectionDialog(
listData: list,
selectedIndex: measuredArm,
onValueSelected: (index) {
measuredArm = index;
measureTimeSelectedType = list[index].title;
setState(() {});
validateForm();
},
),
);
return;
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList); confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
}, },
child: Container( child: Container(
@ -126,9 +140,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showDatePicker(context, showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) { DatePicker.showDatePicker(context, showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) {
@ -153,9 +165,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) { DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) {
@ -220,14 +230,14 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
], ],
), ),
), ),
), Container(
bottomSheet: Container( color: Colors.white,
color: Theme.of(context).scaffoldBackgroundColor, padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: Padding(
padding: const EdgeInsets.all(20.0),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).save, TranslationBase.of(context).save,
isButtonDisabled ? null : () async { isButtonDisabled
? null
: () async {
if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) { if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.model widget.model
@ -236,7 +246,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diastolicPressure: _bloodDiastolicValueController.text.toString(), diastolicPressure: _bloodDiastolicValueController.text.toString(),
systolicePressure: _bloodSystolicValueController.text.toString(), systolicePressure: _bloodSystolicValueController.text.toString(),
measuredArm: (measuredArm + 1), measuredArm: (measuredArm),
lineItemNo: widget.lineItemNo) lineItemNo: widget.lineItemNo)
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -253,8 +263,10 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
}, },
disabledColor: Colors.grey, disabledColor: Colors.grey,
), ),
)
],
), ),
)); );
} }
String getDate() { String getDate() {

@ -44,12 +44,9 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage> with Sing
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<BloodPressureViewMode>( return BaseView<BloodPressureViewMode>(
onModelReady: (model) => model.getBloodPressure(), onModelReady: (model) => model.getBloodPressure(),
builder: (_, model, w) => builder: (_, model, w) => AppScaffold(
AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase appBarTitle: TranslationBase.of(context).bloodPressure,
.of(context)
.bloodPressure,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
baseViewModel: model, baseViewModel: model,
@ -82,10 +79,7 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage> with Sing
floatingActionButton: Stack(children: [ floatingActionButton: Stack(children: [
Positioned( Positioned(
bottom: 60, bottom: 60,
right: projectViewModel.isArabic ? MediaQuery right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * .85 : 0,
.of(context)
.size
.width * .85 : 0,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -100,9 +94,7 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage> with Sing
child: Container( child: Container(
width: 50, width: 50,
height: 50, height: 50,
decoration: BoxDecoration(shape: BoxShape.circle, color: Theme decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor),
.of(context)
.primaryColor),
child: Center( child: Center(
child: Icon( child: Icon(
Icons.add, Icons.add,
@ -116,9 +108,7 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage> with Sing
child: Padding( child: Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: DefaultButton( child: DefaultButton(
TranslationBase TranslationBase.of(context).sendEmail,
.of(context)
.sendEmail,
() { () {
showDialog( showDialog(
context: context, context: context,
@ -132,9 +122,7 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage> with Sing
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
} else { } else {
AppToast.showSuccessToast( AppToast.showSuccessToast(
message: TranslationBase message: TranslationBase.of(context).emailSentSuccessfully,
.of(context)
.emailSentSuccessfully,
); );
} }
}).catchError((e) { }).catchError((e) {

@ -26,7 +26,8 @@ class AddBloodSugarPage extends StatefulWidget {
final String measuredSelectedType; final String measuredSelectedType;
final BloodSugarViewMode bloodSugarViewMode; final BloodSugarViewMode bloodSugarViewMode;
AddBloodSugarPage({Key key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode, this.measuredSelectedType}) AddBloodSugarPage(
{Key key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode, this.measuredSelectedType})
: super(key: key); : super(key: key);
@override @override

@ -17,4 +17,5 @@ class CustomColors {
static const Color appBackgroudGreyColor = Color(0xFFF7F7F7); static const Color appBackgroudGreyColor = Color(0xFFF7F7F7);
static const Color appBackgroudGrey2Color = Color(0xFFF8F8F8); static const Color appBackgroudGrey2Color = Color(0xFFF8F8F8);
static const Color green = Color(0xFF359846); static const Color green = Color(0xFF359846);
static const Color orange = Color(0xFFCC9B14);
} }

@ -1,7 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:diplomaticquarterapp/config/localized_values.dart'; import 'package:diplomaticquarterapp/config/localized_values.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart';
import 'package:flutter/foundation.dart' show SynchronousFuture; import 'package:flutter/foundation.dart' show SynchronousFuture;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -111,6 +110,7 @@ class TranslationBase {
String get appointmentCalendar => localizedValues['appointmentCalendar'][locale.languageCode]; String get appointmentCalendar => localizedValues['appointmentCalendar'][locale.languageCode];
String get appointmentReminder => localizedValues['appointmentReminder'][locale.languageCode]; String get appointmentReminder => localizedValues['appointmentReminder'][locale.languageCode];
String get prescriptionReminder => localizedValues['prescriptionReminder'][locale.languageCode]; String get prescriptionReminder => localizedValues['prescriptionReminder'][locale.languageCode];
String get pleaseSelectFromBelowOptions => localizedValues['please_select_from_below_options'][locale.languageCode]; String get pleaseSelectFromBelowOptions => localizedValues['please_select_from_below_options'][locale.languageCode];
@ -2374,8 +2374,11 @@ class TranslationBase {
String get recAlert => localizedValues["recAlert"][locale.languageCode]; String get recAlert => localizedValues["recAlert"][locale.languageCode];
String get modesBelow => localizedValues["modesBelow"][locale.languageCode]; String get modesBelow => localizedValues["modesBelow"][locale.languageCode];
String get prefferedMode => localizedValues["prefferedMode"][locale.languageCode]; String get prefferedMode => localizedValues["prefferedMode"][locale.languageCode];
String get permissionsBellow => localizedValues["permissionsBellow"][locale.languageCode]; String get permissionsBellow => localizedValues["permissionsBellow"][locale.languageCode];
String get invoiceDetails => localizedValues["invoiceDetails"][locale.languageCode]; String get invoiceDetails => localizedValues["invoiceDetails"][locale.languageCode];
String get appoDetails => localizedValues["appoDetails"][locale.languageCode]; String get appoDetails => localizedValues["appoDetails"][locale.languageCode];
@ -2394,6 +2397,15 @@ class TranslationBase {
String get searchCriteria => localizedValues["searchCriteria"][locale.languageCode]; String get searchCriteria => localizedValues["searchCriteria"][locale.languageCode];
String get RequesterInfo => localizedValues["RequesterInfo"][locale.languageCode];
String get PatientInfo => localizedValues["PatientInfo"][locale.languageCode];
String get OtherInfo => localizedValues["OtherInfo"][locale.languageCode];
String get inPrgress => localizedValues["inPrgress"][locale.languageCode];
String get locked => localizedValues["locked"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -50,6 +50,7 @@ import 'gif_loader_dialog_utils.dart';
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
class Utils { class Utils {
// static ProgressDialog pr; // static ProgressDialog pr;
@ -518,6 +519,8 @@ class Utils {
return medical; return medical;
} }
static List<Widget> myMedicalListHomePage({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) { static List<Widget> myMedicalListHomePage({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) {
List<Widget> medical = List(); List<Widget> medical = List();

@ -225,31 +225,33 @@ class SMSOTP {
}); });
} }
static void showLoadingDialog(BuildContext context, bool _loading) async {
_context = context; // todo 'sikander' remove useless code
//setSignature(); // static void showLoadingDialog(BuildContext context, bool _loading) async {
if (_loading == false) { // _context = context;
Navigator.of(context).pop(); // //setSignature();
return; // if (_loading == false) {
} // Navigator.of(context).pop();
_loading = true; // return;
await showDialog( // }
context: _context, // _loading = true;
barrierDismissible: false, // await showDialog(
builder: (BuildContext context) { // context: _context,
return SimpleDialog( // barrierDismissible: false,
elevation: 0.0, // builder: (BuildContext context) {
backgroundColor: Colors.transparent, // return SimpleDialog(
children: <Widget>[ // elevation: 0.0,
Center( // backgroundColor: Colors.transparent,
child: CircularProgressIndicator( // children: <Widget>[
valueColor: AlwaysStoppedAnimation<Color>(Colors.black), // Center(
), // child: CircularProgressIndicator(
) // valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
], // ),
); // )
}); // ],
} // );
// });
// }
static void hideSMSBox(context) { static void hideSMSBox(context) {
Navigator.pop(context); Navigator.pop(context);

Loading…
Cancel
Save