E-Refreal design

merge-update-with-lab-changes
Mirza.Shafique 5 years ago
parent ae85f75e81
commit e1b79ef5c1

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

@ -606,7 +606,6 @@ const Map localizedValues = {
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, "i-am-a": {"en": "I am a ...", "ar": "أنا ..."},
"select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, "select-age": {"en": "Select Your Age", "ar": "حدد العمر"},
"select": {"en": "Select", "ar": "يختار"}, "select": {"en": "Select", "ar": "يختار"},
"i-am": {"en": "I am", "ar": "أنا"}, "i-am": {"en": "I am", "ar": "أنا"},
"years-old": {"en": "years old", "ar": "سنة"}, "years-old": {"en": "years old", "ar": "سنة"},
@ -1508,9 +1507,15 @@ 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": ":الرجاء السماح الأذونات أدناه"},
"RequesterInfo": {"en": "Requester Info", "ar": "معلومات مقدم الطلب"},
"PatientInfo": {"en": "Patient Info", "ar": "معلومات المريض"},
"OtherInfo": {"en": "Other Info", "ar": "معلومات اخرى"},
"inPrgress": { "en": "In Progress", "ar": "في تقدم" },
"locked": { "en": "Locked", "ar": "مقفل" },
}; };

@ -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,37 +40,139 @@ 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: [
child: PageView( Container(
physics: NeverScrollableScrollPhysics(), width: double.infinity,
controller: _controller, padding: EdgeInsets.only(left: 12,right: 12,top: 12),
onPageChanged: (index) { child: Row(
setState(() { children: [
_currentIndex = index; Expanded(
}); child: showProgress(
}, title: TranslationBase.of(context).RequesterInfo,
scrollDirection: Axis.horizontal, status: _currentIndex == 0
children: <Widget>[ ? TranslationBase.of(context).inPrgress
NewEReferralStepOnePage( : _currentIndex > 0
changePageViewIndex: changePageViewIndex, ? TranslationBase.of(context).completed
createEReferralRequestModel: createEReferralRequestModel, : TranslationBase.of(context).locked,
), color: _currentIndex == 0 ? CustomColors.orange : CustomColors.green,
NewEReferralStepTowPage( ),
changePageViewIndex: changePageViewIndex, ),
createEReferralRequestModel: createEReferralRequestModel, Expanded(
), child: showProgress(
NewEReferralStepThreePage( title: TranslationBase.of(context).patientInfo,
changePageViewIndex: changePageViewIndex, status: _currentIndex == 1
createEReferralRequestModel: createEReferralRequestModel, ? 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(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
NewEReferralStepOnePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepTowPage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepThreePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
],
),
),
],
), ),
), ),
); );
} }
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,11 +63,11 @@ 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);
}, },
() => { () => {
Navigator.pop(context), Navigator.pop(context),
}, },
).displayDialog(context); ).displayDialog(context);
@ -74,108 +78,135 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<EReferralViewModel>( return BaseView<EReferralViewModel>(
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,
physics: ScrollPhysics(), body: Container(
child: Container( child: Column(
margin: EdgeInsets.all(12), children: [
child: Center( Expanded(
child: Column( child: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, physics: ScrollPhysics(),
children: [ child: Container(
SizedBox( margin: EdgeInsets.all(12),
height: 20, child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
Center( children: [
child: Texts( SizedBox(
TranslationBase.of(context).referralRequesterInformation, height: 20,
), ),
), Text(
SizedBox( TranslationBase.of(context).referralRequesterInformation,
height: 12, style: TextStyle(
), fontSize: 16,
NewTextFields( fontWeight: FontWeight.w600,
hintText: TranslationBase.of(context).enterReferralRequesterName, letterSpacing: -0.64,
controller: _nameTextController,
),
SizedBox(
height: 12,
),
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(
SizedBox( height: 12,
height: 12,
),
MobileNumberTextFiled(
controller: _mobileTextController,
code: _selectedCountry == null ? "11" : _selectedCountry["code"],
),
SizedBox(
height: 12,
),
Center(
child: Texts(
TranslationBase.of(context).requesterRelationship,
textAlign: TextAlign.center,
), ),
), Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).enterReferralRequesterName, "", _nameTextController, isInputTypeNum: true)),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
InkWell( PhoneNumberSelectorWidget(onNumberChange: (value) {
onTap: () => confirmSelectRelationTypeDialog(model.relationTypes), 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(getRelationName()), 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,
),
),
child: InkWell(
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,
),
),
Text(
getRelationName(),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon(Icons.arrow_drop_down),
],
),
), ),
), ),
), ],
], ),
), ),
), ),
), ),
), Card(
bottomSheet: Container( margin: EdgeInsets.zero,
color: Theme.of(context).scaffoldBackgroundColor, shape: cardRadius(0),
width: double.infinity, elevation: 20,
padding: EdgeInsets.all(9), child: Container(
child: DefaultButton( // color: Theme.of(context).scaffoldBackgroundColor,
TranslationBase.of(context).next, padding: EdgeInsets.all(12),
(_nameTextController.text.isEmpty || _selectedRelation == null || _mobileTextController.text.isEmpty) width: double.infinity,
? null child: DefaultButton(
: () async { TranslationBase.of(context).next,
Future.delayed(new Duration(milliseconds: 300)).then((value) async { (_nameTextController.text.isEmpty || _selectedRelation == null || mobileNo.isEmpty)
GifLoaderDialogUtils.showMyDialog(context); ? null
SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel( : () async {
zipCode: _selectedCountry['code'], Future.delayed(new Duration(milliseconds: 300)).then((value) async {
patientMobileNumber: int.parse(_mobileTextController.text), GifLoaderDialogUtils.showMyDialog(context);
); SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel(
await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); zipCode: _selectedCountry['code'],
GifLoaderDialogUtils.hideDialog(context); patientMobileNumber: int.parse(mobileNo),
showSMSDialog(model); );
}); await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
}, GifLoaderDialogUtils.hideDialog(context);
disabledColor: Colors.grey, showSMSDialog(model);
});
},
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,316 +67,297 @@ 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: Column(
child: FractionallySizedBox( mainAxisAlignment: MainAxisAlignment.start,
widthFactor: 0.94, crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
mainAxisAlignment: MainAxisAlignment.start, SizedBox(
crossAxisAlignment: CrossAxisAlignment.start, height: 20,
children: [ ),
SizedBox( Text(
height: 20, TranslationBase.of(context).otherInfo,
), style: TextStyle(
Center( fontSize: 16,
child: Texts( fontWeight: FontWeight.w600,
TranslationBase.of(context).otherInfo, letterSpacing: -0.64,
textAlign: TextAlign.center, ),
), ),
), SizedBox(
SizedBox( height: 12,
height: 12, ),
), Container(
Container( padding: EdgeInsets.all(12),
padding: EdgeInsets.only(top: 10), decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.circular(12),
borderRadius: BorderRadius.circular(12), color: Colors.white,
color: Colors.white, ),
), child: Row(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Expanded(
mainAxisAlignment: MainAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Padding( children: [
padding: const EdgeInsets.symmetric(horizontal: 9), Text(
child: Texts( TranslationBase.of(context).medicalReport,
TranslationBase.of(context).medicalReport, style: TextStyle(
color: Colors.grey, fontSize: 12,
fontSize: 17, 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( ...List.generate(
height: 12,
),
...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>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Texts(
crossAxisAlignment: CrossAxisAlignment.start, medicalReportImages[index].fileName,
children: <Widget>[
Icon(FontAwesomeIcons.paperclip),
SizedBox(
width: 8,
),
Texts(
medicalReportImages[index].fileName,
),
],
), ),
InkWell(
onTap: () {
setState(() {
medicalReportImages.remove(medicalReportImages[index]);
});
},
child: Icon(
FontAwesomeIcons.trashAlt,
color: Colors.red[300],
))
], ],
), ),
)), InkWell(
], onTap: () {
setState(() {
medicalReportImages.remove(medicalReportImages[index]);
});
},
child: Icon(
Icons.close,
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),
SizedBox( ],
height: 12, ),
), ),
Container( SizedBox(
padding: EdgeInsets.only(top: 10), height: 12,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), ),
child: Column( Container(
children: [ padding: EdgeInsets.only(top: 10),
Container( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
width: double.infinity, child: Column(
decoration: containerRadius(Colors.white, 12), children: [
margin: EdgeInsets.only(left: 20, right: 20), Container(
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), width: double.infinity,
child: Row( decoration: containerRadius(Colors.white, 12),
children: [ margin: EdgeInsets.only(left: 20, right: 20),
Flexible( padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
child: Column( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Flexible(
Text( child: Column(
TranslationBase.of(context).preferredBranch, crossAxisAlignment: CrossAxisAlignment.start,
style: TextStyle( children: [
fontSize: 11, Text(
letterSpacing: -0.44, TranslationBase.of(context).preferredBranch,
fontWeight: FontWeight.w600, style: TextStyle(
), fontSize: 11,
), letterSpacing: -0.44,
Container( fontWeight: FontWeight.w600,
height: 18, ),
child: DropdownButtonHideUnderline( ),
child: DropdownButton<String>( Container(
key: projectDropdownKey, height: 18,
hint: Text(TranslationBase.of(context).selectPreferredBranch), child: DropdownButtonHideUnderline(
value: projectDropdownValue, child: DropdownButton<String>(
iconSize: 0, key: projectDropdownKey,
isExpanded: true, hint: Text(TranslationBase.of(context).selectPreferredBranch),
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black), value: projectDropdownValue,
items: projectsList.map((item) { iconSize: 0,
return new DropdownMenuItem<String>( isExpanded: true,
value: item.mainProjectID.toString() + "," + item.name.toString(), style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
child: new Text(item.name), items: projectsList.map((item) {
); return new DropdownMenuItem<String>(
}).toList(), value: item.mainProjectID.toString() + "," + item.name.toString(),
onChanged: (newValue) { child: new Text(item.name),
setState(() { );
projectDropdownValue = newValue; }).toList(),
print(projectDropdownValue); onChanged: (newValue) {
}); setState(() {
}, projectDropdownValue = newValue;
), print(projectDropdownValue);
), });
},
), ),
], ),
), ),
), ],
Icon(Icons.keyboard_arrow_down), ),
], ),
)), Icon(Icons.keyboard_arrow_down),
], ],
), )),
), ],
SizedBox( ),
height: 12, ),
), SizedBox(
Container( height: 12,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), ),
child: Column( Container(
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Row( Checkbox(
children: [ value: isPatientInsured,
Checkbox( activeColor: Colors.black38,
value: isPatientInsured, onChanged: (bool newValue) {
activeColor: Colors.black38, setState(() {
onChanged: (bool newValue) { isPatientInsured = newValue;
setState(() { });
isPatientInsured = newValue; }),
}); Padding(
}), padding: const EdgeInsets.all(20.0),
Padding( child: Texts(
padding: const EdgeInsets.all(20.0), TranslationBase.of(context).insuredPatientReferral,
child: Texts( fontSize: 17,
TranslationBase.of(context).insuredPatientReferral, ),
fontSize: 17,
),
),
],
), ),
], ],
), ),
], ],
), ),
],
),
),
if (isPatientInsured)
SizedBox(
height: 12,
),
Opacity(
opacity: isPatientInsured ? 1 : 0,
child: Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
), ),
if (isPatientInsured) child: Row(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
height: 12, children: [
), Expanded(
Opacity( child: Column(
opacity: isPatientInsured ? 1 : 0, crossAxisAlignment: CrossAxisAlignment.start,
child: Container( children: [
padding: EdgeInsets.only(top: 10), Text(
decoration: BoxDecoration( TranslationBase.of(context).medicalReport,
borderRadius: BorderRadius.circular(12), style: TextStyle(
color: Colors.white, fontSize: 12,
), letterSpacing: -0.48,
child: Column( fontWeight: FontWeight.w600,
children: [
InkWell(
onTap: () {
ImageOptions.showImageOptions(context, (String image, File file) {
setState(() {
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
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( ...List.generate(
height: 12,
),
...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>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Texts(
crossAxisAlignment: CrossAxisAlignment.start, 'image ${index + 1}.png',
children: <Widget>[
Icon(FontAwesomeIcons.paperclip),
SizedBox(
width: 8,
),
Texts(
'image ${index + 1}.png',
),
],
), ),
InkWell(
onTap: () {
setState(() {
insuredPatientImages.remove(insuredPatientImages[index]);
});
},
child: Icon(
FontAwesomeIcons.trashAlt,
color: Colors.red[300],
))
], ],
), ),
)), InkWell(
], onTap: () {
setState(() {
insuredPatientImages.remove(insuredPatientImages[index]);
});
},
child: Icon(
Icons.close,
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);
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),
), ],
SizedBox(
height: 12,
), ),
], ),
), ),
), ],
), ),
), ),
), ),

@ -7,18 +7,20 @@ 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';
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:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; 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;
@ -32,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;
@ -57,143 +53,222 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<EReferralViewModel>( return BaseView<EReferralViewModel>(
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,
physics: ScrollPhysics(), body: Column(
child: Container( children: [
margin: EdgeInsets.all(12), Expanded(
child: Center( child: SingleChildScrollView(
child: FractionallySizedBox( physics: ScrollPhysics(),
widthFactor: 0.94, child: Container(
child: Column( margin: EdgeInsets.all(12),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
SizedBox( children: [
height: 30, SizedBox(
), height: 20,
Center( ),
child: Texts( Text(
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(
height: 12,
),
NewTextFields(
hintText: TranslationBase.of(context).patientName,
controller: _patientNameTextController,
),
SizedBox(
height: 12,
), ),
InkWell( ),
onTap: () => confirmSelectCountryTypeDialog(), SizedBox(
child: Container( height: 12,
padding: EdgeInsets.all(12), ),
width: double.infinity, inputWidget(TranslationBase.of(context).enterIdentificationNumber, "", _patientIdentificationTextController, isInputTypeNum: true),
height: 65, SizedBox(
decoration: BoxDecoration( height: 12,
borderRadius: BorderRadius.circular(12), ),
color: Colors.white), inputWidget(TranslationBase.of(context).patientName, "", _patientNameTextController, isInputTypeNum: true),
child: Row( SizedBox(
mainAxisAlignment: MainAxisAlignment.spaceBetween, height: 12,
children: [ ),
Texts(getCountryName()), PhoneNumberSelectorWidget(onNumberChange: (value) {
Icon(Icons.arrow_drop_down) setState(() {
], mobileNo = value;
), });
), }, onCountryChange: (value) {
), setState(() {
SizedBox( _selectedCountry = value;
height: 12, });
), }),
MobileNumberTextFiled( SizedBox(
controller: _mobileTextController, height: 12,
code: _selectedCountry == null ),
? "11" Text(
: _selectedCountry["code"], TranslationBase.of(context).patientLocated,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
), ),
SizedBox( ),
height: 12, SizedBox(
), height: 12,
Center( ),
child: Texts( Container(
TranslationBase.of(context).patientLocated, padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
textAlign: TextAlign.center, 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: () => confirmSelectCityDialog(model.allCities),
), child: Row(
InkWell( children: [
onTap: () => confirmSelectCityDialog( Expanded(
model.allCities), child: Column(
child: Container( crossAxisAlignment: CrossAxisAlignment.start,
padding: EdgeInsets.all(12), children: [
width: double.infinity, Text(
height: 65, TranslationBase.of(context).selectCity,
decoration: BoxDecoration( style: TextStyle(
borderRadius: BorderRadius.circular(12), fontSize: 11,
color: Colors.white), fontWeight: FontWeight.w600,
child: Row( color: Color(0xff2B353E),
mainAxisAlignment: MainAxisAlignment.spaceBetween, letterSpacing: -0.44,
children: [ ),
Texts(getRelationName()), ),
Icon(Icons.arrow_drop_down) 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(
), height: 12,
),
SizedBox( ],
height: 12,
),
],
),
), ),
), ),
), ),
), ),
bottomSheet: Container( Card(
color: Theme.of(context).scaffoldBackgroundColor, margin: EdgeInsets.zero,
width: double.infinity, shape: cardRadius(0),
padding: EdgeInsets.all(9), elevation: 20,
child: DefaultButton( child: Container(
TranslationBase.of(context).next, width: double.infinity,
(_patientNameTextController.text.isEmpty || _patientIdentificationTextController.text.isEmpty|| padding: EdgeInsets.all(12),
_selectedCity == null || child: DefaultButton(
_mobileTextController.text.isEmpty) ? null : () { TranslationBase.of(context).next,
this.widget.changePageViewIndex(2); (_patientNameTextController.text.isEmpty || _patientIdentificationTextController.text.isEmpty || _selectedCity == null || mobileNo.isEmpty)
this.widget.createEReferralRequestModel.identificationNo = int.parse( _patientIdentificationTextController.text); ? null
this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text; : () {
this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text; this.widget.changePageViewIndex(2);
this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString(); this.widget.createEReferralRequestModel.identificationNo = int.parse(_patientIdentificationTextController.text);
this.widget.createEReferralRequestModel.cityName = _selectedCity.description; this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text;
}, this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1) + mobileNo;
disabledColor: Colors.grey, this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString();
this.widget.createEReferralRequestModel.cityName = _selectedCity.description;
},
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(
@ -238,12 +313,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
} }
class MobileNumberTextFiled extends StatelessWidget { class MobileNumberTextFiled extends StatelessWidget {
const 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;
final String code; final String code;
@ -252,8 +322,7 @@ class MobileNumberTextFiled extends StatelessWidget {
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,
@ -274,8 +343,7 @@ class MobileNumberTextFiled extends StatelessWidget {
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),
), ),
), ),
) )

@ -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,104 +25,109 @@ class _SelectCityDialogState extends State<SelectCityDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SimpleDialog( return Dialog(
children: [ child: Column(
Column( children: [
children: [ Expanded(
Divider(), child: SingleChildScrollView(
...List.generate( child: Column(
widget.cities.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( ...List.generate(
height: 2, widget.cities.length,
), (index) => Column(
Row( crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
Expanded( SizedBox(
flex: 1, height: 2,
child: InkWell(
onTap: () {
setState(() {
widget.selectedCity = widget.cities[index];
});
},
child: ListTile(
title: Text(widget.cities[index].description),
leading: Radio(
value: widget.cities[index],
groupValue: widget.selectedCity,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
widget.selectedCity = value;
});
},
),
),
), ),
) Row(
], children: <Widget>[
), Expanded(
SizedBox( flex: 1,
height: 5.0, child: InkWell(
onTap: () {
setState(() {
widget.selectedCity = widget.cities[index];
});
},
child: ListTile(
title: Text(widget.cities[index].description),
leading: Radio(
value: widget.cities[index],
groupValue: widget.selectedCity,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
widget.selectedCity = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
), ),
], ],
), ),
), ),
SizedBox( ),
height: 5.0, SizedBox(
), height: 5.0,
Row( ),
// mainAxisAlignment: MainAxisAlignment.spaceBetween, Row(
children: <Widget>[ // mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expanded( children: <Widget>[
flex: 1, Expanded(
child: InkWell( flex: 1,
onTap: () { child: InkWell(
Navigator.pop(context); onTap: () {
}, Navigator.pop(context);
child: Padding( },
padding: const EdgeInsets.all(8.0), child: Padding(
child: Container( padding: const EdgeInsets.all(8.0),
child: Center( child: Container(
child: Texts( child: Center(
TranslationBase.of(context).cancel.toUpperCase(), child: Texts(
color: Colors.red, TranslationBase.of(context).cancel.toUpperCase(),
), color: Colors.red,
), ),
), ),
), ),
), ),
), ),
Container( ),
width: 1, Container(
height: 30, width: 1,
color: Colors.grey[500], height: 30,
), color: Colors.grey[500],
Expanded( ),
flex: 1, Expanded(
child: InkWell( flex: 1,
onTap: () { child: InkWell(
widget.onValueSelected(widget.selectedCity); onTap: () {
Navigator.pop(context); widget.onValueSelected(widget.selectedCity);
}, Navigator.pop(context);
child: Padding( },
padding: const EdgeInsets.all(8.0), child: Padding(
child: Center( padding: const EdgeInsets.all(8.0),
child: Texts( child: Center(
TranslationBase.of(context).ok, child: Texts(
fontWeight: FontWeight.w400, TranslationBase.of(context).ok,
)), fontWeight: FontWeight.w400,
), )),
), ),
), ),
], ),
) ],
], )
) ],
], ),
); );
} }
} }

@ -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(),

@ -15,6 +15,7 @@ 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/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';
@ -36,7 +37,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 +81,106 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
InkWell( // InkWell(
onTap: () => selectSearchCriteriaDialog(), // onTap: () => selectSearchCriteriaDialog(),
child: Container( // child: Container(
padding: EdgeInsets.all(12), // padding: EdgeInsets.all(12),
width: double.infinity, // width: double.infinity,
height: 65, // height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), // decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)], // 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(
SizedBox( onTap: () => selectSearchCriteriaDialog(),
height: 12,
),
NewTextFields(
hintText: selectedCriteria.value == 1 ? "Enter Patient Identification No" : "Enter Referral Number",
controller: _searchTextController,
onChanged: (_) {
setState(() {});
},
),
SizedBox(
height: 12,
),
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( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: [Texts(getCountryName()), 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(),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
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 +252,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;
@ -258,6 +310,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() { String getSearchCriteriaName() {
return selectedCriteria.name; return selectedCriteria.name;
} }

@ -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);
} }

@ -2385,6 +2385,12 @@ class TranslationBase {
String get selectSearchCriteria => localizedValues["selectSearchCriteria"][locale.languageCode]; String get selectSearchCriteria => localizedValues["selectSearchCriteria"][locale.languageCode];
String get enterComplainNumber => localizedValues["enterComplainNumber"][locale.languageCode]; String get enterComplainNumber => localizedValues["enterComplainNumber"][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();

Loading…
Cancel
Save