diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 84d2a7c7..4c6cd6f6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -242,7 +242,6 @@ const Map> localizedValues = { 'ar': 'لا يوجد اي نتائج' }, 'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'}, - 'moreThan3Letter': { 'en': 'Medicine Name Should Be More Than 3 letter', 'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف' @@ -250,8 +249,5 @@ const Map> localizedValues = { 'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '}, 'age2': {'en': 'Age: ', 'ar': 'العمر: '}, 'referralPatient': {'en': 'Referral Patient', 'ar': 'المريض المحال '}, - 'replySuccessfully': { - 'en': 'Reply Successfully', - 'ar': 'تم الرد بنجاح' - }, + 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'}, }; diff --git a/lib/landing_page.dart b/lib/landing_page.dart index f67957d3..9461e3a3 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 dfb61d95..faa22ffe 100644 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -76,324 +76,294 @@ class _ReferPatientState extends State { RoundedContainer( margin: 10, showBorder: true, - raduis: 10, - borderColor: Color(0xff707070), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButton( - isExpanded: true, - value: _selectedClinic, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - _selectedDoctor = null; - _selectedClinic = newValue; - var clinicInfo = model - .clinicsList - .where((i) => - i['ClinicDescription'] - .toString() - .contains( - _selectedClinic)) - .toList(); + raduis: 10, + borderColor: Color(0xff707070), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButton( + isExpanded: true, + value: _selectedClinic, + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model.getClinicNameList().map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + _selectedDoctor = null; + _selectedClinic = newValue; + var clinicInfo = model.clinicsList + .where((i) => i['ClinicDescription'] + .toString() + .contains(_selectedClinic)) + .toList(); - clinicId = clinicInfo[0]['ClinicID'] - .toString(); + clinicId = + clinicInfo[0]['ClinicID'].toString(); - model.getDoctorsList(clinicId); - }) - }, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: TextAlign.end, - ), - ); - }).toList(), + model.getDoctorsList(clinicId); + }) + }, + items: model.getClinicNameList().map((item) { + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, ), - ), - ], + ); + }).toList(), ), ), - ), - //--------------------------------------------------------------------// - AppText( - TranslationBase.of(context).doctor, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), + ], + ), + ), + ), + //--------------------------------------------------------------------// + AppText( + TranslationBase.of(context).doctor, + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), - RoundedContainer( - margin: 10, - showBorder: true, - raduis: 10, - borderColor: Color(0xff707070), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButton( - isExpanded: true, - value: _selectedDoctor, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model - .getDoctorNameList() - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - _selectedDoctor = newValue; - doctorsList = - model.doctorsList; + RoundedContainer( + margin: 10, + showBorder: true, + raduis: 10, + borderColor: Color(0xff707070), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButton( + isExpanded: true, + value: _selectedDoctor, + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model.getDoctorNameList().map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + _selectedDoctor = newValue; + doctorsList = model.doctorsList; - var doctorInfo = doctorsList - .where((i) => i['DoctorName'] - .toString() - .contains(_selectedDoctor)) - .toList(); - doctorId = doctorInfo[0]['DoctorID'] - .toString(); - }) - }, - items: model - .getDoctorNameList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: TextAlign.end, - ), - ); - }).toList(), + var doctorInfo = doctorsList + .where((i) => i['DoctorName'] + .toString() + .contains(_selectedDoctor)) + .toList(); + doctorId = + doctorInfo[0]['DoctorID'].toString(); + }) + }, + items: model.getDoctorNameList().map((item) { + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, ), - ), - ], + ); + }).toList(), ), ), - ), //-----------------------------/// - AppText( - TranslationBase.of(context).ext, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: AppTextFormField( - hintText: TranslationBase.of(context).ext, - controller: _extController, - inputFormatter: ONLY_NUMBERS, - textInputType: TextInputType.number, - onChanged: (value) => {}, - ), - ), - AppText( - TranslationBase.of(context).priority, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), + ], + ), + ), + ), //-----------------------------/// + AppText( + TranslationBase.of(context).ext, + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: AppTextFormField( + hintText: TranslationBase.of(context).ext, + controller: _extController, + inputFormatter: ONLY_NUMBERS, + textInputType: TextInputType.number, + onChanged: (value) => {}, + ), + ), + AppText( + TranslationBase.of(context).priority, + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), - priorityBar(context), + priorityBar(context), - AppText( - TranslationBase.of(context).referralFrequency + - getPriority(), - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), + AppText( + TranslationBase.of(context).referralFrequency + + getPriority(), + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), - AppText( - TranslationBase.of(context).referralFrequency, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), - RoundedContainer( - margin: 10, - showBorder: true, - raduis: 10, - borderColor: Color(0xff707070), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButton( - isExpanded: true, - value: _selectedReferralFrequancy, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model - .getReferralNamesList() - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - _selectedReferralFrequancy = newValue; - var freqInfo = model - .referalFrequancyList - .singleWhere((i) => i[ - 'Description'] - .toString() - .contains( - _selectedReferralFrequancy)); - freqId = freqInfo['ParameterCode'] - .toString(); - myFocusNode.requestFocus(); - }) - }, - items: model - .getReferralNamesList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: TextAlign.end, - ), - ); - }).toList(), + AppText( + TranslationBase.of(context).referralFrequency, + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), + RoundedContainer( + margin: 10, + showBorder: true, + raduis: 10, + borderColor: Color(0xff707070), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButton( + isExpanded: true, + value: _selectedReferralFrequancy, + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model + .getReferralNamesList() + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + _selectedReferralFrequancy = newValue; + var freqInfo = model.referalFrequancyList + .singleWhere((i) => i['Description'] + .toString() + .contains( + _selectedReferralFrequancy)); + freqId = + freqInfo['ParameterCode'].toString(); + myFocusNode.requestFocus(); + }) + }, + items: model.getReferralNamesList().map((item) { + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, ), - ), - ], + ); + }).toList(), ), ), - ), - AppText( - TranslationBase.of(context).clinicDetailsandRemarks, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: AppTextFormField( - hintText: TranslationBase.of(context).remarks, - focusNode: myFocusNode, - controller: _remarksController, - inputFormatter: ONLY_LETTERS, - textInputType: TextInputType.text, - onChanged: (value) => {}, + ], + ), + ), + ), + AppText( + TranslationBase.of(context).clinicDetailsandRemarks, + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: AppTextFormField( + hintText: TranslationBase.of(context).remarks, + focusNode: myFocusNode, + controller: _remarksController, + inputFormatter: ONLY_LETTERS, + textInputType: TextInputType.text, + onChanged: (value) => {}, + ), + ), + Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + children: [ + AppText( + TranslationBase.of(context).pleaseFill, + color: Colors.red, + fontWeight: FontWeight.bold, + margin: 10, + visibility: isValid == null ? false : !isValid, ), - ), - Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - children: [ - AppText( - TranslationBase.of(context).pleaseFill, - color: Colors.red, - fontWeight: FontWeight.bold, - margin: 10, - visibility: - isValid == null ? false : !isValid, - ), - // TODO replace AppButton with secondary button and add loading - AppButton( - title: TranslationBase - .of(context) - .send, - color: Color(PRIMARY_COLOR), - onPressed: () => - { - referToDoctor(context, model) - }, - title: TranslationBase.of(context).send, - color: (Hexcolor("#B8382B")), - onPressed: () => {referToDoctor(context)}, - ) - ], - )) - ], + // TODO replace AppButton with secondary button and add loading + AppButton( + title: TranslationBase.of(context).send, + color: Color(PRIMARY_COLOR), + onPressed: () => {referToDoctor(context, model)}, + ) + ], + )) + ], + ), ), - ), - ),); + ), + ); } Widget priorityBar(BuildContext _context) { @@ -436,30 +406,29 @@ class _ReferPatientState extends State { // ? Hexcolor("#B8382B") // : Colors.white,//sideColor, - fontWeight: FontWeight.bold, - ), + 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(), - ), + ), + )), + ), + 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(), ), ); } @@ -488,10 +457,7 @@ class _ReferPatientState extends State { return; } - final routeArgs = ModalRoute - .of(context) - .settings - .arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; try { @@ -508,8 +474,7 @@ class _ReferPatientState extends State { selectedDoctorID: doctorId.toString(), projectID: patient.projectId); // TODO: Add Translation - DrAppToastMsg.showSuccesToast( - 'Reply Successfully'); + DrAppToastMsg.showSuccesToast('Reply Successfully'); Navigator.pop(context); } catch (e) { DrAppToastMsg.showErrorToast(e); diff --git a/pubspec.lock b/pubspec.lock index ae4f6a70..23540004 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "12.0.0" + version: "14.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.40.6" + version: "0.41.1" archive: dependency: transitive description: @@ -70,7 +70,7 @@ packages: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "0.4.4" + version: "0.4.5" build_daemon: dependency: transitive description: @@ -84,7 +84,7 @@ packages: name: build_modules url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" build_resolvers: dependency: transitive description: @@ -98,21 +98,21 @@ packages: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "1.10.7" + version: "1.10.9" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "6.1.2" + version: "6.1.4" build_web_compilers: dependency: "direct dev" description: name: build_web_compilers url: "https://pub.dartlang.org" source: hosted - version: "2.12.2" + version: "2.15.3" built_collection: dependency: transitive description: @@ -161,7 +161,7 @@ packages: name: checked_yaml url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.4" cli_util: dependency: transitive description: @@ -426,7 +426,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -468,7 +468,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -622,7 +622,7 @@ packages: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "0.1.5" + version: "0.1.7" quiver: dependency: transitive description: @@ -725,7 +725,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -767,7 +767,7 @@ packages: name: timing url: "https://pub.dartlang.org" source: hosted - version: "0.1.1+2" + version: "0.1.1+3" typed_data: dependency: transitive description: @@ -860,5 +860,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.11.0-162.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0"