From c581638e004a2e9e0019da8e7a7c0790da343d5f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 13 Dec 2020 14:27:04 +0200 Subject: [PATCH] refer_patient_screen 'not finshed' --- lib/config/localized_values.dart | 1 + lib/landing_page.dart | 4 +- .../profile/refer_patient_screen.dart | 191 ++++++++++-------- lib/util/translations_delegate_base.dart | 2 + lib/widgets/doctor/my_schedule_widget.dart | 59 ++++-- 5 files changed, 155 insertions(+), 102 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 78e85967..03306e37 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -248,4 +248,5 @@ const Map> localizedValues = { }, 'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '}, 'age2': {'en': 'Age: ', 'ar': 'العمر: '}, + 'referralPatient': {'en': 'Referral Patient', 'ar': 'المريض المحال '}, }; diff --git a/lib/landing_page.dart b/lib/landing_page.dart index c79d29d9..f802ddb8 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -40,9 +40,7 @@ class _LandingPageState extends State { appBar: AppBar( elevation: 0, backgroundColor: Hexcolor('#515B5D'), - textTheme: TextTheme( - headline6: - TextStyle(color: Colors.white)), + textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), title: Text(getText(currentTab).toUpperCase()), leading: Builder( builder: (BuildContext context) { diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart index e12a9240..22ed20b5 100644 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -69,7 +69,7 @@ class _ReferPatientState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).myReferralPatient, + appBarTitle: TranslationBase.of(context).referralPatient, body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError @@ -91,7 +91,7 @@ class _ReferPatientState extends State { RoundedContainer( margin: 10, showBorder: true, - raduis: 30, + raduis: 10, borderColor: Color(0xff707070), width: double.infinity, child: Padding( @@ -106,6 +106,7 @@ class _ReferPatientState extends State { Expanded( // add Expanded to have your dropdown button fill remaining space child: DropdownButton( + //hint: Text('Select Clinnic'), isExpanded: true, value: _selectedClinic, iconSize: 40, @@ -176,7 +177,7 @@ class _ReferPatientState extends State { RoundedContainer( margin: 10, showBorder: true, - raduis: 30, + raduis: 10, borderColor: Color(0xff707070), width: double.infinity, child: Padding( @@ -197,21 +198,37 @@ class _ReferPatientState extends State { elevation: 16, selectedItemBuilder: (BuildContext context) { - return patientsProv - .getDoctorNameList() - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], - ); - }).toList(); + return _selectedDoctor == '' + ? [ + Row( + mainAxisSize: + MainAxisSize.max, + children: [ + AppText( + "eeeee", + fontSize: SizeConfig + .textMultiplier * + 2.1, + ), + ], + ) + ] + : patientsProv + .getDoctorNameList() + .map((item) { + return Row( + mainAxisSize: + MainAxisSize.max, + children: [ + AppText( + item, + fontSize: SizeConfig + .textMultiplier * + 2.1, + ), + ], + ); + }).toList(); }, onChanged: (newValue) => { setState(() { @@ -262,13 +279,6 @@ class _ReferPatientState extends State { onChanged: (value) => {}, ), ), - AppText( - TranslationBase.of(context).priority, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), priorityBar(context), @@ -290,7 +300,7 @@ class _ReferPatientState extends State { RoundedContainer( margin: 10, showBorder: true, - raduis: 30, + raduis: 10, borderColor: Color(0xff707070), width: double.infinity, child: Padding( @@ -391,7 +401,7 @@ class _ReferPatientState extends State { ), AppButton( title: TranslationBase.of(context).send, - color: Color(PRIMARY_COLOR), + color: (Hexcolor("#B8382B")), onPressed: () => {referToDoctor(context)}, ) ], @@ -404,67 +414,78 @@ class _ReferPatientState extends State { Widget priorityBar(BuildContext _context) { List _priorities = [ - TranslationBase.of(context).veryUrgent, - TranslationBase.of(context).urgent, - TranslationBase.of(context).routine, + TranslationBase.of(context).veryUrgent.toUpperCase(), + TranslationBase.of(context).urgent.toUpperCase(), + TranslationBase.of(context).routine.toUpperCase(), ]; - return Container( - height: MediaQuery.of(context).size.height * 0.065, - width: SizeConfig.screenWidth * 0.9, - margin: EdgeInsets.only(top: 10), - decoration: BoxDecoration( - color: Color(0Xffffffff), borderRadius: BorderRadius.circular(20)), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _priorities.map((item) { - bool _isActive = _priorities[_activePriority] == item ? true : false; - return Column(mainAxisSize: MainAxisSize.min, children: [ - InkWell( - child: Center( - child: Container( - height: 40, - width: 90, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(50), - color: _isActive ? Hexcolor("#B8382B") : Colors.white, - ), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - // backgroundColor:_isActive - // ? Hexcolor("#B8382B") - // : Colors.white,//sideColor, - - fontWeight: FontWeight.bold, + return Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.061999, + width: SizeConfig.screenWidth * 0.90, + margin: EdgeInsets.only(top: 10), + decoration: BoxDecoration( + color: Color(0Xffffffff), + borderRadius: BorderRadius.circular(10), + border: Border.all(width: 0.3), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _priorities.map((item) { + bool _isActive = + _priorities[_activePriority] == item ? true : false; + return Column(mainAxisSize: MainAxisSize.min, children: [ + InkWell( + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.0559, + width: SizeConfig.screenWidth * 0.297, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8.0), + bottomLeft: Radius.circular(8.0), + topRight: Radius.circular(10.0), + bottomRight: Radius.circular(10.0), ), + color: _isActive ? Hexcolor("#B8382B") : Colors.white, ), - )), - ), - onTap: () { - print(_priorities.indexOf(item)); - setState(() { - _activePriority = _priorities.indexOf(item); - }); - }), - _isActive - ? Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white), - alignment: Alignment.center, - height: 3, - width: 90, - ) - : Container() - ]); - }).toList(), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + // backgroundColor:_isActive + // ? Hexcolor("#B8382B") + // : Colors.white,//sideColor, + + fontWeight: FontWeight.bold, + ), + ), + )), + ), + onTap: () { + print(_priorities.indexOf(item)); + setState(() { + _activePriority = _priorities.indexOf(item); + }); + }), + _isActive + ? Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white), + alignment: Alignment.center, + height: 3, + width: 90, + ) + : Container() + ]); + }).toList(), + ), ), ); } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 1ea3be74..313012fb 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -275,6 +275,8 @@ class TranslationBase { localizedValues['moreThan3Letter'][locale.languageCode]; String get gender2 => localizedValues['gender2'][locale.languageCode]; String get age2 => localizedValues['age2'][locale.languageCode]; + String get referralPatient => + localizedValues['referralPatient'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 68194a31..8011e6dc 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -13,19 +13,27 @@ class MyScheduleWidget extends StatelessWidget { @override Widget build(BuildContext context) { - List workingHours = Helpers.getWorkingHours(workingHoursTable.workingHours); + List workingHours = + Helpers.getWorkingHours(workingHoursTable.workingHours); return CardWithBgWidgetNew( widget: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Column( + children: [Text('${workingHoursTable.date.day}')], + ), Row( children: [ - AppText(workingHoursTable.dayName, - fontSize: 2.5 * SizeConfig.textMultiplier), AppText( - ' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}', - fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,), + workingHoursTable.dayName, + fontSize: 2.5 * SizeConfig.textMultiplier, + ), + AppText( + ' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}', + fontSize: 2.2 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ), ], ), SizedBox( @@ -44,27 +52,50 @@ class MyScheduleWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText('From',fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.bold,), - SizedBox(height: 5,), - AppText(work.from,fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,) + AppText( + 'From', + fontSize: 2.2 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 5, + ), + AppText( + work.from, + fontSize: 2.2 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) ], ), ), - Container(height: SizeConfig.realScreenWidth * 0.1 ,width: 0.8,color: Colors.grey, - margin: EdgeInsets.only(left: 15,right: 15),), + Container( + height: SizeConfig.realScreenWidth * 0.1, + width: 0.8, + color: Colors.grey, + margin: EdgeInsets.only(left: 15, right: 15), + ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText('To',fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.bold,), - SizedBox(height: 5,), - AppText(work.to,fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,) + AppText( + 'To', + fontSize: 2.2 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 5, + ), + AppText( + work.to, + fontSize: 2.2 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) ], ), ), ], ) - ], ), );