From afb08fcd0a404ab9e69a005a69ae686e5c977e54 Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Thu, 9 Sep 2021 12:21:52 +0300 Subject: [PATCH] Booking Filters Update --- .../components/SearchByClinic.dart | 237 ++++++++++-------- .../medical/balance/confirm_payment_page.dart | 2 +- 2 files changed, 137 insertions(+), 102 deletions(-) diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 3eab535c..dc983581 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -52,6 +52,7 @@ class _SearchByClinicState extends State { final GlobalKey clinicDropdownKey = GlobalKey(); final GlobalKey projectDropdownKey = GlobalKey(); + TextEditingController ageController = new TextEditingController(); ProjectViewModel projectViewModel; String radioValue = null; @@ -65,124 +66,158 @@ class _SearchByClinicState extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - if (radioValue == null) radioValue = TranslationBase.of(context).female; + if (projectViewModel.isLogin) { + if (radioValue == null) { + if (projectViewModel.user.gender == 1) { + radioValue = TranslationBase.of(context).male; + } else { + radioValue = TranslationBase.of(context).female; + } + } + } else if (radioValue == null) { + radioValue = TranslationBase.of(context).female; + } + if (ageController.text.isEmpty) { + ageController.text = projectViewModel.isLogin ? projectViewModel.user.age.toString() : ""; + ageController.selection = TextSelection.fromPosition(TextPosition(offset: ageController.text.length)); + } + return Container( child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: const EdgeInsets.only( - left: 20, - right: 20, - top: 20, - ), - child: Text( - TranslationBase.of(context).doctorFilter, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.64, - ), - ), - ), - mHeight(30), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(left: 20, right: 20), - child: Text( - TranslationBase.of(context).gender, - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - color: Colors.black, - fontWeight: FontWeight.w600, + if (projectViewModel.isLogin) + Column( + children: [ + Padding( + padding: const EdgeInsets.only( + left: 20, + right: 20, + top: 20, + ), + child: Text( + TranslationBase.of(context).doctorFilter, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), ), ), - ), - Container( - padding: EdgeInsets.only(left: 6, right: 6), - child: Row( + mHeight(30), + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Flexible( - child: Row( - children: [ - Radio( - value: TranslationBase.of(context).female, - groupValue: radioValue, - onChanged: (v) { - setState(() { - radioValue = v; - }); - }, + Padding( + padding: const EdgeInsets.only(left: 20, right: 20), + child: Text( + TranslationBase.of(context).gender, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + color: Colors.black, + fontWeight: FontWeight.w600, ), - Text( - TranslationBase.of(context).female, - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - fontWeight: FontWeight.w600, - ), + ), + ), + Container( + padding: EdgeInsets.only(left: 6, right: 6), + child: Row( + children: [ + Flexible( + child: Row( + children: [ + Radio( + value: TranslationBase.of(context).female, + groupValue: radioValue, + onChanged: (v) { + setState(() { + radioValue = v; + }); + }, + ), + Text( + TranslationBase.of(context).female, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + ], + )), + Flexible( + child: Row( + children: [ + Radio( + value: TranslationBase.of(context).male, + groupValue: radioValue, + onChanged: (v) { + setState(() { + radioValue = v; + }); + }, + ), + Text( + TranslationBase.of(context).male, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + ], + )), + ], + ), + ), + ], + ), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.only(left: 20, right: 20), + padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 2), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Age", + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + color: Colors.black, + fontWeight: FontWeight.w600, ), - ], - )), - Flexible( - child: Row( - children: [ - Radio( - value: TranslationBase.of(context).male, - groupValue: radioValue, - onChanged: (v) { - setState(() { - radioValue = v; - }); - }, + ), + TextField( + controller: ageController, + style: TextStyle( + fontSize: 15, + letterSpacing: -0.59, + color: Colors.black, ), - Text( - TranslationBase.of(context).male, - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - fontWeight: FontWeight.w600, + decoration: InputDecoration( + contentPadding: EdgeInsets.zero, + border: OutlineInputBorder( + borderSide: BorderSide.none, ), ), - ], - )), - ], - ), - ), - ], - ), - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - margin: EdgeInsets.only(left: 20, right: 20), - padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Age", - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - color: Colors.black, - fontWeight: FontWeight.w600, - ), - ), - Text( - projectViewModel.isLogin ? projectViewModel.user.age.toString() : "", - style: TextStyle( - fontSize: 15, - letterSpacing: -0.59, - color: Colors.black, + ), + // Text( + // projectViewModel.isLogin ? projectViewModel.user.age.toString() : "", + // style: TextStyle( + // fontSize: 15, + // letterSpacing: -0.59, + // color: Colors.black, + // ), + // ), + ], ), ), ], ), - ), Padding( padding: const EdgeInsets.only(left: 6, right: 6, top: 16), child: Row( diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index f5d14efe..4414266b 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -208,7 +208,7 @@ class ConfirmPaymentPage extends StatelessWidget { transID = Utils.getAdvancePaymentTransID(advanceModel.hospitalsModel.iD, int.parse(advanceModel.fileNumber)); browser.openPaymentBrowser(amount, "Advance Payment", transID, advanceModel.hospitalsModel.iD.toString(), advanceModel.email, paymentMethod, patientInfoAndMobileNumber.patientType, - advanceModel.patientName, advanceModel.fileNumber, authenticatedUser, browser, false); + advanceModel.patientName, advanceModel.fileNumber, authenticatedUser, browser, false,null,null); } onBrowserLoadStart(String url) {