From 9e1aeb857f459ce3aff267ea7775b2416ddd3fbf Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 11:43:38 +0200 Subject: [PATCH 1/4] Patient card --- .../get_clinic_by_project_id_request.dart | 3 - .../out_patient/out_patient_screen.dart | 6 +- .../patients/patient_card/PatientCard.dart | 335 +++-- lib/widgets/shared/user-guid/CusomRow.dart | 1 + pubspec.lock | 1249 +++++++++++++++++ 5 files changed, 1449 insertions(+), 145 deletions(-) create mode 100644 pubspec.lock diff --git a/lib/models/patient/get_clinic_by_project_id_request.dart b/lib/models/patient/get_clinic_by_project_id_request.dart index 09198dc0..47122bf1 100644 --- a/lib/models/patient/get_clinic_by_project_id_request.dart +++ b/lib/models/patient/get_clinic_by_project_id_request.dart @@ -40,7 +40,6 @@ class ClinicByProjectIdRequest { this.languageID = 2, this.stamp = "2020-06-03T11:18:19.979Z", this.iPAdress = "11.11.11.11", - this.versionID = 5.5, this.channel = 9, this.tokenID, this.sessionID = "JBXRsDl37L", @@ -53,7 +52,6 @@ class ClinicByProjectIdRequest { languageID = json['LanguageID']; stamp = json['stamp']; iPAdress = json['IPAdress']; - versionID = json['VersionID']; channel = json['Channel']; tokenID = json['TokenID']; sessionID = json['SessionID']; @@ -68,7 +66,6 @@ class ClinicByProjectIdRequest { data['LanguageID'] = this.languageID; data['stamp'] = this.stamp; data['IPAdress'] = this.iPAdress; - data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['TokenID'] = this.tokenID; data['SessionID'] = this.sessionID; diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index e0e4fb4a..5a6a0083 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -245,9 +245,7 @@ class _OutPatientsScreenState extends State { }, ), ), - SizedBox( - height: 10.0, - ), + Expanded( child: Container( child: model.filterData.isEmpty @@ -269,7 +267,7 @@ class _OutPatientsScreenState extends State { .patientStatusType == 43)) return Padding( - padding: EdgeInsets.all(8.0), + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0), child: PatientCard( patientInfo: model.filterData[index], patientType: patientType, diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 3ae07265..1365871c 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -12,7 +12,6 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../../util/extenstions.dart'; @@ -46,17 +45,20 @@ class PatientCard extends StatelessWidget { String nationalityName = patientInfo.nationalityName != null ? patientInfo.nationalityName.trim() : patientInfo.nationality != null - ? patientInfo.nationality.trim() - : patientInfo.nationalityId != - null - ? patientInfo.nationalityId - : ""; + ? patientInfo.nationality.trim() + : patientInfo.nationalityId != null + ? patientInfo.nationalityId + : ""; return Container( width: SizeConfig.screenWidth * 0.9, margin: EdgeInsets.all(6), - padding: EdgeInsets.only(left: projectViewModel.isArabic?5:0, right: projectViewModel.isArabic?0:5, bottom: 0, top: 0), - decoration:Helpers.getCardBoxDecoration(), + padding: EdgeInsets.only( + left: projectViewModel.isArabic ? 5 : 0, + right: projectViewModel.isArabic ? 0 : 5, + bottom: 0, + top: 0), + decoration: Helpers.getCardBoxDecoration(), child: CardWithBgWidget( padding: 0, marginLeft: (!isMyPatient && isInpatient) ? 0 : 10, @@ -96,8 +98,11 @@ class PatientCard extends StatelessWidget { patientInfo.patientStatusType == 43 ? Row( children: [ - PatientStatus(label:TranslationBase.of(context) - .arrivedP,color:AppGlobal.appGreenColor,), + PatientStatus( + label: TranslationBase.of(context) + .arrivedP, + color: AppGlobal.appGreenColor, + ), SizedBox( width: 8, ), @@ -111,18 +116,25 @@ class PatientCard extends StatelessWidget { SizedBox( width: 8, ), - PatientStatus(label:patientInfo.status == 2 - ? 'Confirmed' - : 'Booked',color: patientInfo.status == 2 - ? AppGlobal.appGreenColor - : Colors.grey,), + PatientStatus( + label: patientInfo.status == 2 + ? 'Confirmed' + : 'Booked', + color: patientInfo.status == 2 + ? AppGlobal.appGreenColor + : Colors.grey, + ), ], ) : patientInfo.patientStatusType == 42 ? Row( children: [ - PatientStatus(label:TranslationBase.of(context) - .notArrived,color:Colors.red[800],), + PatientStatus( + label: + TranslationBase.of(context) + .notArrived, + color: Colors.red[800], + ), SizedBox( width: 8, ), @@ -136,10 +148,14 @@ class PatientCard extends StatelessWidget { SizedBox( width: 8, ), - PatientStatus(label:patientInfo.status == 2 ? 'Confirmed' - : 'Booked',color:patientInfo.status == 2 - ? AppGlobal.appGreenColor - : Colors.grey,) + PatientStatus( + label: patientInfo.status == 2 + ? 'Confirmed' + : 'Booked', + color: patientInfo.status == 2 + ? AppGlobal.appGreenColor + : Colors.grey, + ) ], ) : !isFromSearch && @@ -148,8 +164,12 @@ class PatientCard extends StatelessWidget { null ? Row( children: [ - PatientStatus(label:TranslationBase.of(context) - .notArrived,color:Colors.red[800],), + PatientStatus( + label: TranslationBase.of( + context) + .notArrived, + color: Colors.red[800], + ), SizedBox( width: 8, ), @@ -163,13 +183,17 @@ class PatientCard extends StatelessWidget { SizedBox( width: 8, ), - - PatientStatus(label:patientInfo.status == 2 - ? 'Booked' - : 'Confirmed',color: - patientInfo.status == 2 - ? Colors.grey - : AppGlobal.appGreenColor,) + PatientStatus( + label: + patientInfo.status == 2 + ? 'Booked' + : 'Confirmed', + color: + patientInfo.status == 2 + ? Colors.grey + : AppGlobal + .appGreenColor, + ) ], ) : SizedBox(), @@ -182,29 +206,55 @@ class PatientCard extends StatelessWidget { fontWeight: FontWeight.w400, ) : patientInfo.arrivedOn != null - ? AppText( - AppDateUtils.getDayMonthYearDate( - AppDateUtils - .convertStringToDate( - patientInfo.arrivedOn, - )) + - " " + + ? Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + AppText( + AppDateUtils + .getDayMonthYearDateFormatted( + AppDateUtils + .convertStringToDate( + patientInfo.arrivedOn, + ), + isMonthShort: true, + ), + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + fontSize: 15, + ), + AppText( "${AppDateUtils.getStartTime(patientInfo.startTime)}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + fontSize: 15, + ), + ], ) : (patientInfo.appointmentDate != null && patientInfo .appointmentDate.isNotEmpty) - ? AppText( - "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( - patientInfo.appointmentDate, - ))} ${AppDateUtils.getStartTime(patientInfo.startTime)}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + ? Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + AppText( + "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( + patientInfo + .appointmentDate, + ), isMonthShort: true)}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + fontSize: 15, + ), + AppText( + " ${AppDateUtils.getStartTime(patientInfo.startTime)}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + fontSize: 15, + ), + ], ) : SizedBox() ], @@ -216,7 +266,9 @@ class PatientCard extends StatelessWidget { SizedBox( width: 12, ), - PatientStatus(label:'My Patient',), + PatientStatus( + label: 'My Patient', + ), ], ), Padding( @@ -229,8 +281,7 @@ class PatientCard extends StatelessWidget { flex: 2, child: Row( crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( isFromLiveCare @@ -259,7 +310,6 @@ class PatientCard extends StatelessWidget { DoctorApp.female_1, color: Colors.pink, size: 18, - ), if (isFromLiveCare) ShowTimer( @@ -311,99 +361,105 @@ class PatientCard extends StatelessWidget { ) ], )), - SizedBox(height: 10,), + SizedBox( + height: 10, + ), Row( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.only(left: 12.0,top: 5), - child: Container( - width: 60, - height: 60, - child: Image.asset( - patientInfo.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, + Padding( + padding: EdgeInsets.only(left: 12.0, top: 5), + child: Container( + width: 60, + height: 60, + child: Image.asset( + patientInfo.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, ), - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Row( - children: [ Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - // SizedBox(height: 10,), - CustomRow( - label: - TranslationBase.of(context).fileNumber, - value: patientInfo.patientId.toString(), - ), - CustomRow( - label: - TranslationBase.of(context).age + " : ", - value: - "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", - ), - if (isInpatient) - CustomRow( - label: patientInfo.admissionDate == null - ? "" - : TranslationBase.of(context) - .admissionDate + + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // SizedBox(height: 10,), + CustomRow( + label: TranslationBase.of(context) + .fileNumber, + value: patientInfo.patientId.toString(), + ), + CustomRow( + label: TranslationBase.of(context).age + + " : ", + value: + "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", + ), + if (isInpatient) + CustomRow( + label: + patientInfo.admissionDate == null + ? "" + : TranslationBase.of(context) + .admissionDate + + " : ", + value: patientInfo.admissionDate == + null + ? "" + : "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate.toString()), isMonthShort: true)}", + ), + if (patientInfo.admissionDate != null) + CustomRow( + label: TranslationBase.of(context) + .numOfDays + " : ", - value: patientInfo.admissionDate == null - ? "" - : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", - ), - if (patientInfo.admissionDate != null) - CustomRow( - label: TranslationBase.of(context) - .numOfDays + - " : ", - value: - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", - ), - if (patientInfo.admissionDate != null) - CustomRow( - label: TranslationBase.of(context) - .clinicName + - " : ", - value: "${patientInfo.clinicDescription}", - ), - if (patientInfo.admissionDate != null) - CustomRow( - label: - TranslationBase.of(context).roomNo + + value: + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + ), + if (patientInfo.admissionDate != null) + CustomRow( + label: TranslationBase.of(context) + .clinicName + " : ", - value: "${patientInfo.roomId}", - ), - if (isFromLiveCare) - Column( - children: [ + value: + "${patientInfo.clinicDescription}", + ), + if (patientInfo.admissionDate != null) CustomRow( label: TranslationBase.of(context) - .clinic + + .roomNo + " : ", - value: patientInfo.clinicName, + value: "${patientInfo.roomId}", ), - ], - ), - ]), - ), - Icon( - Icons.arrow_forward, - size: 24, - ), - ], - )) - ]), + if (isFromLiveCare) + Column( + children: [ + CustomRow( + label: TranslationBase.of(context) + .clinic + + " : ", + value: patientInfo.clinicName, + ), + ], + ), + ]), + ), + Icon( + Icons.arrow_forward, + size: 24, + ), + ], + )) + ]), isFromLiveCare ? Row( mainAxisAlignment: MainAxisAlignment.end, @@ -459,16 +515,19 @@ class PatientCard extends StatelessWidget { } class PatientStatus extends StatelessWidget { - PatientStatus({ - Key key, this.label, this.color, + PatientStatus({ + Key key, + this.label, + this.color, }) : super(key: key); - final String label;final Color color; + final String label; + final Color color; @override Widget build(BuildContext context) { return AppText( label, - color: color??AppGlobal.appGreenColor, + color: color ?? AppGlobal.appGreenColor, fontWeight: FontWeight.w600, fontFamily: 'Poppins', fontSize: 10, diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index e08f625e..0c364474 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -37,6 +37,7 @@ class CustomRow extends StatelessWidget { fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.9, color: Color(0xFF2B353E), fontWeight: FontWeight.w700, + letterSpacing: -0.48, isCopyable: isCopyable, ), ], diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 00000000..3f1537d3 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,1249 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "12.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "0.40.7" + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.13" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.0-nullsafety.1" + autocomplete_textfield: + dependency: "direct main" + description: + name: autocomplete_textfield + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.3" + badges: + dependency: "direct main" + description: + name: badges + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + barcode_scan_fix: + dependency: "direct main" + description: + name: barcode_scan_fix + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + bazel_worker: + dependency: transitive + description: + name: bazel_worker + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.25" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.2" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.5" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.7" + build_modules: + dependency: transitive + description: + name: build_modules + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.4" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.3" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1+1" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.7" + build_web_compilers: + dependency: "direct dev" + description: + name: build_web_compilers + url: "https://pub.dartlang.org" + source: hosted + version: "2.12.2" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "4.3.2" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "7.1.0" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.3" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + charts_common: + dependency: transitive + description: + name: charts_common + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0" + charts_flutter: + dependency: "direct main" + description: + name: charts_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + chewie: + dependency: transitive + description: + name: chewie + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.10" + chewie_audio: + dependency: transitive + description: + name: chewie_audio + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0+1" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "3.7.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0-nullsafety.3" + connectivity: + dependency: "direct main" + description: + name: connectivity + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.9+5" + connectivity_for_web: + dependency: transitive + description: + name: connectivity_for_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.1+4" + connectivity_macos: + dependency: transitive + description: + name: connectivity_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0+7" + connectivity_platform_interface: + dependency: transitive + description: + name: connectivity_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.6" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + css_colors: + dependency: transitive + description: + name: css_colors + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.2" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.10" + date_time_picker: + dependency: "direct main" + description: + name: date_time_picker + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" + device_info: + dependency: "direct main" + description: + name: device_info + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.2+10" + device_info_platform_interface: + dependency: transitive + description: + name: device_info_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + dropdown_search: + dependency: "direct main" + description: + name: dropdown_search + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.9" + equatable: + dependency: transitive + description: + name: equatable + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.6" + eva_icons_flutter: + dependency: "direct main" + description: + name: eva_icons_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + expandable: + dependency: "direct main" + description: + name: expandable + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.4" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "5.2.1" + firebase: + dependency: transitive + description: + name: firebase + url: "https://pub.dartlang.org" + source: hosted + version: "7.3.3" + firebase_analytics: + dependency: "direct main" + description: + name: firebase_analytics + url: "https://pub.dartlang.org" + source: hosted + version: "6.3.0" + firebase_analytics_platform_interface: + dependency: transitive + description: + name: firebase_analytics_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + firebase_analytics_web: + dependency: transitive + description: + name: firebase_analytics_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1" + firebase_core: + dependency: transitive + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.3" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1+1" + firebase_messaging: + dependency: "direct main" + description: + name: firebase_messaging + url: "https://pub.dartlang.org" + source: hosted + version: "7.0.3" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.11" + fl_chart: + dependency: "direct main" + description: + name: fl_chart + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.3" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_blurhash: + dependency: transitive + description: + name: flutter_blurhash + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + flutter_device_type: + dependency: "direct main" + description: + name: flutter_device_type + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + flutter_flexible_toast: + dependency: "direct main" + description: + name: flutter_flexible_toast + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4" + flutter_gifimage: + dependency: "direct main" + description: + name: flutter_gifimage + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + flutter_html: + dependency: "direct main" + description: + name: flutter_html + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + flutter_inappwebview: + dependency: transitive + description: + name: flutter_inappwebview + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0+4" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_page_indicator: + dependency: transitive + description: + name: flutter_page_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.3" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.11" + flutter_staggered_grid_view: + dependency: "direct main" + description: + name: flutter_staggered_grid_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.4" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + url: "https://pub.dartlang.org" + source: hosted + version: "0.18.1" + flutter_swiper: + dependency: "direct main" + description: + name: flutter_swiper + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + font_awesome_flutter: + dependency: "direct main" + description: + name: font_awesome_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "8.12.0" + get_it: + dependency: "direct main" + description: + name: get_it + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.4" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + hexcolor: + dependency: "direct main" + description: + name: hexcolor + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.6" + hijri: + dependency: transitive + description: + name: hijri + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + hijri_picker: + dependency: "direct main" + description: + name: hijri_picker + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + html: + dependency: "direct main" + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+4" + html_editor_enhanced: + dependency: "direct main" + description: + name: html_editor_enhanced + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + http: + dependency: "direct main" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.2" + http_interceptor: + dependency: "direct main" + description: + name: http_interceptor + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.19" + imei_plugin: + dependency: "direct main" + description: + name: imei_plugin + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + intl: + dependency: "direct main" + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.1" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.2" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.1" + local_auth: + dependency: "direct main" + description: + name: local_auth + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3+4" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "0.11.4" + maps_launcher: + dependency: "direct main" + description: + name: maps_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.2+2" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10-nullsafety.1" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.7" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4" + node_interop: + dependency: transitive + description: + name: node_interop + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + node_io: + dependency: transitive + description: + name: node_io + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + octo_image: + dependency: transitive + description: + name: octo_image + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + open_iconic_flutter: + dependency: transitive + description: + name: open_iconic_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.3" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.1" + path_drawing: + dependency: transitive + description: + name: path_drawing + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1+1" + path_parsing: + dependency: transitive + description: + name: path_parsing + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4" + path_provider: + dependency: transitive + description: + name: path_provider + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.28" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+2" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4+8" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4+3" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.2" + percent_indicator: + dependency: "direct main" + description: + name: percent_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.9+1" + permission_handler: + dependency: "direct main" + description: + name: permission_handler + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.0+2" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.0" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.13" + progress_hud_v2: + dependency: "direct main" + description: + name: progress_hud_v2 + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + protobuf: + dependency: transitive + description: + name: protobuf + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.4" + provider: + dependency: "direct main" + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "4.3.3" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.8" + quiver: + dependency: "direct main" + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + rxdart: + dependency: transitive + description: + name: rxdart + url: "https://pub.dartlang.org" + source: hosted + version: "0.25.0" + scratch_space: + dependency: transitive + description: + name: scratch_space + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4+3" + screen: + dependency: transitive + description: + name: screen + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.5" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.12+4" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2+4" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+11" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2+7" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2+3" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.9" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.4+1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_maps: + dependency: transitive + description: + name: source_maps + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.9" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.2" + speech_to_text: + dependency: "direct main" + description: + path: speech_to_text + relative: true + source: path + version: "0.0.0" + sqflite: + dependency: transitive + description: + name: sqflite + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.2+4" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3+3" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0-nullsafety.1" + sticky_headers: + dependency: "direct main" + description: + name: sticky_headers + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.8+1" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0+2" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.19-nullsafety.2" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1+3" + transformer_page_view: + dependency: transitive + description: + name: transformer_page_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.6" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "5.7.10" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+4" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+9" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.9" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5+3" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+3" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.2" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.3" + video_player: + dependency: transitive + description: + name: video_player + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.12+5" + video_player_platform_interface: + dependency: transitive + description: + name: video_player_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + video_player_web: + dependency: transitive + description: + name: video_player_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4+1" + wakelock: + dependency: transitive + description: + name: wakelock + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4+2" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.7+15" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + webview_flutter: + dependency: transitive + description: + name: webview_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.24" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.4+1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "4.5.1" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" +sdks: + dart: ">=2.10.2 <2.11.0" + flutter: ">=1.22.2 <2.0.0" From 5f2e0be78ce1723bc17db1411605ea16237af8e2 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 13:09:21 +0200 Subject: [PATCH 2/4] first step from home page. --- lib/config/config.dart | 3 +- .../home/dashboard_referral_patient.dart | 158 ++++++++++++ lib/screens/home/dashboard_swipe_widget.dart | 151 +----------- lib/screens/home/home_screen.dart | 22 +- lib/screens/home/label.dart | 43 ++++ .../subjective/history/priority_bar.dart | 2 +- lib/util/helpers.dart | 16 ++ lib/widgets/dashboard/out_patient_stack.dart | 233 +++++++++++++++--- lib/widgets/dashboard/row_count.dart | 9 +- 9 files changed, 449 insertions(+), 188 deletions(-) create mode 100644 lib/screens/home/dashboard_referral_patient.dart create mode 100644 lib/screens/home/label.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 4c5374ae..03c74f52 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -455,6 +455,7 @@ const TIMER_MIN = 10; class AppGlobal { static var CONTEX; - static Color appPrimaryColor = Color(0xFFB9382C); + static Color appRedColor = Color(0xFFD02127); static Color appGreenColor = Color(0xFF359846); + static Color appTextColor = Color(0xFF2B353E); } diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart new file mode 100644 index 00000000..6a0bcf4b --- /dev/null +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -0,0 +1,158 @@ +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; +import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/material.dart'; + +import 'label.dart'; + +class DashboardReferralPatient extends StatelessWidget { + final List dashboardItemList; + final double height; + final DashboardViewModel model; + + const DashboardReferralPatient({Key key, this.dashboardItemList, this.height, this.model}) : super(key: key); + @override + Widget build(BuildContext context) { + return RoundedContainer( + raduis: 16, + showBorder: false, + borderColor: Colors.white, + shadowWidth: 0.2, + shadowSpreadRadius: 3, + shadowDy: 1, + margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + flex: 1, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(8), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * + (SizeConfig.isHeightVeryShort? + 3 + : SizeConfig.isHeightShort? + 2 + : 2)), + Label( + firstLine: TranslationBase.of(context).patients, + secondLine: TranslationBase.of(context).referral, + color: Color(0xFF2B353E), + secondLineFontSize: SizeConfig.getHeightMultiplier(height: height) * + (SizeConfig.isHeightVeryShort? + 5 + : SizeConfig.isHeightShort? + 7 + : 12), + ), + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * + (SizeConfig.isHeightVeryShort? + 5 + : SizeConfig.isHeightShort? + 10 + : 5)) + ], + ), + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RowCounts( + dashboardItemList[2].summaryoptions[0].kPIParameter, + dashboardItemList[2].summaryoptions[0].value, + Colors.black, + height: height, + ), + RowCounts( + dashboardItemList[2].summaryoptions[1].kPIParameter, + dashboardItemList[2].summaryoptions[1].value, + Colors.grey, + height: height, + ), + RowCounts( + dashboardItemList[2].summaryoptions[2].kPIParameter, + dashboardItemList[2].summaryoptions[2].value, + Colors.red, + height: height, + ), + ], + ), + ) + ], + )), + ), + Expanded( + flex: 3, + child: Stack(children: [ + Container(padding: EdgeInsets.all(0), child: GaugeChart(_createReferralData(dashboardItemList))), + Positioned( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + AppText( + model.getPatientCount(dashboardItemList[2]).toString(), + fontSize: SizeConfig.textMultiplier * 3.0, + fontWeight: FontWeight.bold, + ) + ], + ), + top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40), + left: 0, + right: 0) + ]), + ), + ], + )), + ])); + } + + static List> _createReferralData(List dashboardItemList) { + final data = [ + new GaugeSegment(dashboardItemList[2].summaryoptions[0].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[0].value), charts.MaterialPalette.black), + new GaugeSegment(dashboardItemList[2].summaryoptions[1].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[1].value), charts.MaterialPalette.gray.shadeDefault), + new GaugeSegment(dashboardItemList[2].summaryoptions[2].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[2].value), charts.MaterialPalette.red.shadeDefault), + ]; + + return [ + new charts.Series( + id: 'Segments', + domainFn: (GaugeSegment segment, _) => segment.segment, + measureFn: (GaugeSegment segment, _) => segment.size, + data: data, + colorFn: (GaugeSegment segment, _) => segment.color, + ) + ]; + } + + static int getValue(value) { + return value == 0 ? 1 : value; + } +} diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 66261292..bcd7864c 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -12,6 +12,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:charts_flutter/flutter.dart' as charts; +import 'dashboard_referral_patient.dart'; + class DashboardSwipeWidget extends StatefulWidget { final List dashboardItemList; final DashboardViewModel model; @@ -28,8 +30,11 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { + double height = SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 40 : SizeConfig.isHeightLarge?33:31); + return Container( - height: MediaQuery.of(context).size.height * 0.35, + height: height, // height: 230, child: Swiper( onIndexChanged: (index) { @@ -41,7 +46,7 @@ class _DashboardSwipeWidgetState extends State { } }, itemBuilder: (BuildContext context, int index) { - return getSwipeWidget(widget.dashboardItemList, index); + return getSwipeWidget(widget.dashboardItemList, index, height); }, itemCount: 3, // itemHeight: 300, @@ -84,146 +89,14 @@ class _DashboardSwipeWidgetState extends State { ); } - Widget getSwipeWidget(List dashboardItemList, int index) { + Widget getSwipeWidget(List dashboardItemList, int index,double height ) { if (index == 1) - return RoundedContainer( - raduis: 16, - showBorder: false, - borderColor: Colors.white, - shadowWidth: 0.1, - shadowSpreadRadius: 2, - shadowDy: 1, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: GetOutPatientStack(dashboardItemList[1]))); + return GetOutPatientStack(dashboardItemList[1]); if (index == 0) - return RoundedContainer( - raduis: 16, - showBorder: false, - borderColor: Colors.white, - shadowWidth: 0.1, - shadowSpreadRadius: 2, - shadowDy: 1, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: GetOutPatientStack(dashboardItemList[0]))); + return GetOutPatientStack(dashboardItemList[0]); if (index == 2) - return RoundedContainer( - raduis: 16, - showBorder: false, - borderColor: Colors.white, - shadowWidth: 0.1, - shadowSpreadRadius: 2, - shadowDy: 1, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - flex: 1, - child: Row( - children: [ - Expanded( - flex: 4, - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(8), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .patients, - fontSize: 12, - fontWeight: FontWeight.bold, - fontHeight: 0.5, - ), - AppText( - TranslationBase.of(context) - .referral, - fontSize: 22, - fontWeight: FontWeight.bold, - ), - ], - )), - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[0] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[0] - .value, - Colors.black), - ), - Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[1] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[1] - .value, - Colors.grey), - ), - Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[2] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[2] - .value, - Colors.red), - ), - ], - ), - ) - ], - )), - ), - Expanded( - flex: 3, - child: Stack(children: [ - Container( - child: GaugeChart( - _createReferralData(widget.dashboardItemList))), - Positioned( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - AppText( - widget.model - .getPatientCount(dashboardItemList[2]) - .toString(), - fontSize: SizeConfig.textMultiplier * 3.0, - fontWeight: FontWeight.bold, - ) - ], - ), - top: MediaQuery.of(context).size.height * 0.13, - left: 0, - right: 0) - ]), - ), - ], - )), - ])); + return DashboardReferralPatient(dashboardItemList: widget.dashboardItemList,height: height,model: widget.model,); + return Container(); } diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 62988caa..281c70e9 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; @@ -102,7 +103,8 @@ class _HomeScreenState extends State { DropdownButtonHideUnderline( child: DropdownButton( dropdownColor: Colors.white, - iconEnabledColor: Colors.black, + iconEnabledColor: AppGlobal.appTextColor, + icon: Icon(Icons.keyboard_arrow_down), isExpanded: true, value: clinicId == null ? projectsProvider @@ -127,13 +129,13 @@ class _HomeScreenState extends State { children: [ Container( padding: - EdgeInsets.all(2), + EdgeInsets.all(0), margin: EdgeInsets.all(2), decoration: new BoxDecoration( color: - Colors.red[800], + AppGlobal.appRedColor, borderRadius: BorderRadius .circular( @@ -152,11 +154,13 @@ class _HomeScreenState extends State { .toString(), color: Colors.white, + letterSpacing: -0.72, + fontWeight: FontWeight.w600, fontSize: projectsProvider .isArabic ? 10 - : 11, + : 12, textAlign: TextAlign .center, @@ -165,8 +169,9 @@ class _HomeScreenState extends State { ], ), AppText(item.clinicName, - fontSize: 12, - color: Colors.black, + fontSize: 14, + letterSpacing: -0.96, + color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, textAlign: TextAlign.end), @@ -194,6 +199,11 @@ class _HomeScreenState extends State { return DropdownMenuItem( child: AppText( item.clinicName, + fontSize: 14, + letterSpacing: -0.96, + color: AppGlobal.appTextColor, + fontWeight: + FontWeight.bold, textAlign: TextAlign.left, ), value: item.clinicID, diff --git a/lib/screens/home/label.dart b/lib/screens/home/label.dart new file mode 100644 index 00000000..0d316652 --- /dev/null +++ b/lib/screens/home/label.dart @@ -0,0 +1,43 @@ +// ignore: must_be_immutable +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class Label extends StatelessWidget { + Label({ + Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, + }) : super(key: key); + final String firstLine; + final String secondLine; + Color color; + final double secondLineFontSize; + final double firstLineFontSize; + + @override + Widget build(BuildContext context) { + + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + firstLine, + fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , + // fontWeight: FontWeight.bold, + color: color, + fontHeight: .5, + letterSpacing: -0.72, + fontWeight: FontWeight.w600, + ), + AppText( + secondLine, + color: color, + fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40), + fontWeight: FontWeight.bold, + letterSpacing: -1.44, + + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart index 305b0c65..57698f56 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart @@ -76,7 +76,7 @@ class _PriorityBarState extends State { ), ), if(_isActive) - Container(width: 120,height: 4,color: AppGlobal.appPrimaryColor,) + Container(width: 120,height: 4,color: AppGlobal.appRedColor,) ], ), ), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 17e75ba9..86a09468 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -313,4 +313,20 @@ class Helpers { ? 8 : 6); } + + static getLabelFromKPI(String kpi) { + if (kpi.indexOf("(") > -1 && kpi.indexOf(")") > -1) + return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")")); + else + return ''; + } + + static getNameFromKPI(String kpi) { + if (kpi.indexOf("(") > -1) + return kpi.substring(0, kpi.indexOf("(")); + else + return kpi; + } + + } diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index fe05d69d..d7042eb7 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,4 +1,6 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -9,42 +11,151 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { + + double barHeight = + SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : SizeConfig.isHeightLarge?20:17); + value.summaryoptions.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + value.summaryoptions .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); var list = new List(); value.summaryoptions.forEach((result) => - {list.add(getStack(result, value.summaryoptions.first.value,context))}); - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - height: 30, - child: AppText( - value.kPIName, - medium: true, - fontSize: 14, - ), + {list.add(getStack(result, value.summaryoptions.first.value,context,barHeight))}); + return Container( + margin: EdgeInsets.only(bottom: 20, top: 10, left: 5, right: 5), + decoration: BoxDecoration( + + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + bottomLeft: Radius.circular(20), + bottomRight: Radius.circular(20) ), - Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) - ], + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 0, + blurRadius: 9, + offset: Offset(0, 0), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.all(5.0), + child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5), + child: Label( + firstLine: Helpers.getLabelFromKPI(value.kPIName), + secondLine: Helpers.getNameFromKPI(value.kPIName), + color: Color(0xFF2B353E), + firstLineFontSize: + SizeConfig.getHeightMultiplier(height: barHeight) * + (SizeConfig.isHeightVeryShort + ? 10 + : SizeConfig.isHeightShort + ? 10 + : 8.5), + secondLineFontSize: + SizeConfig.getHeightMultiplier(height: barHeight) * + (SizeConfig.isHeightVeryShort + ? 15 + : SizeConfig.isHeightShort + ? 15 + : 14.5), + ), + ), + Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) + ], + ) + + ), ); } - getStack(Summaryoptions value, max,context) { + // getStack(Summaryoptions value, max,context) { + // return Expanded( + // child: Container( + // margin: EdgeInsets.symmetric(horizontal: 2), + // decoration: BoxDecoration( + // gradient: LinearGradient( + // begin: Alignment.topLeft, + // end: Alignment( + // 0.0, 1.0), // 10% of the width, so there are ten blinds. + // colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow + // tileMode: TileMode.mirror, // repeats the gradient over the canvas + // ), + // borderRadius: BorderRadius.circular(8), + // // color: Colors.red[50], + // ), + // child: Stack(children: [ + // Positioned( + // bottom: 0, + // left: 0, + // right: 0, + // child: Container( + // child: SizedBox(), + // padding: EdgeInsets.all(10), + // height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24 )* value.value) / max : 0, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(8), + // color: Color(0x63D02127), + // ), + // ), + // ), + // Container( + // height: (MediaQuery.of(context).size.height * 0.24 ), + // margin: EdgeInsets.only(left: 5, top: 5), + // padding: EdgeInsets.all(10), + // child: RotatedBox( + // quarterTurns: 3, + // child: Center( + // child: Align( + // child: FittedBox( + // child: Row( + // children: [ + // AppText( + // value.kPIParameter, + // fontSize: 10, + // textAlign: TextAlign.center, + // color: Color(0xFF2B353E), + // fontWeight: FontWeight.w700, + // ), + // AppText( + // ' (' + value.value.toString() + ') ', + // fontSize: 12, + // textAlign: TextAlign.center, + // color: Color(0xFF2B353E), + // fontWeight: FontWeight.bold, + // ), + // ], + // ), + // )), + // ), + // )) + // ]), + // ), + // ); + // } + + + getStack(Summaryoptions value, max, context, barHeight) { return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, - end: Alignment( - 0.0, 1.0), // 10% of the width, so there are ten blinds. + end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds. colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow tileMode: TileMode.mirror, // repeats the gradient over the canvas ), - borderRadius: BorderRadius.circular(8), + borderRadius: BorderRadius.circular(4), // color: Colors.red[50], ), child: Stack(children: [ @@ -55,15 +166,15 @@ class GetOutPatientStack extends StatelessWidget { child: Container( child: SizedBox(), padding: EdgeInsets.all(10), - height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24 )* value.value) / max : 0, + height: max != 0 ? ((barHeight) * value.value) / max : 0, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), + borderRadius: BorderRadius.circular(4), color: Color(0x63D02127), ), ), ), Container( - height: (MediaQuery.of(context).size.height * 0.24 ), + height: barHeight, margin: EdgeInsets.only(left: 5, top: 5), padding: EdgeInsets.all(10), child: RotatedBox( @@ -71,29 +182,73 @@ class GetOutPatientStack extends StatelessWidget { child: Center( child: Align( child: FittedBox( - child: Row( - children: [ - AppText( - value.kPIParameter, - fontSize: 10, - textAlign: TextAlign.center, - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - AppText( - ' (' + value.value.toString() + ') ', - fontSize: 12, - textAlign: TextAlign.center, - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, + child: Row( + children: [ + AppText( + value.kPIParameter, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + textAlign: TextAlign.center, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, + letterSpacing: -0.3, + ), + AppText( + ' (' + value.value.toString() + ') ', + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + textAlign: TextAlign.center, + color: Color(0xFF2B353E), + letterSpacing: -0.3, + fontWeight: FontWeight.bold, + ), + ], ), - ], - ), - )), + )), ), )) ]), ), ); } + +} + + +// ignore: must_be_immutable +class Label extends StatelessWidget { + Label({ + Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, + }) : super(key: key); + final String firstLine; + final String secondLine; + Color color; + final double secondLineFontSize; + final double firstLineFontSize; + + @override + Widget build(BuildContext context) { + + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + firstLine, + fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , + // fontWeight: FontWeight.bold, + color: color, + fontHeight: .5, + letterSpacing: -0.72, + fontWeight: FontWeight.w600, + ), + AppText( + secondLine, + color: color, + fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40), + fontWeight: FontWeight.bold, + letterSpacing: -1.44, + + ), + ], + ); + } } diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index a22932f4..bf39ed27 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -5,11 +6,15 @@ class RowCounts extends StatelessWidget { final name; final int count; final Color c; - RowCounts(this.name, this.count, this.c); + final double height; + + + RowCounts(this.name, this.count, this.c, {this.height}); @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.only(top: 5, bottom: 5), + padding: EdgeInsets.only(top:SizeConfig.getHeightMultiplier(height:height )* 0.2 , bottom: SizeConfig.getHeightMultiplier(height:height )* 0.2), + child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ From fedb4533c7f0d0b0a439bb082b7fae015e29f2d7 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 14:00:17 +0200 Subject: [PATCH 3/4] second step from home page. --- .../home/dashboard_referral_patient.dart | 220 +++++++++--------- .../home/dashboard_slider-item-widget.dart | 31 ++- lib/screens/home/home_screen.dart | 24 +- lib/widgets/dashboard/activity_button.dart | 57 +++-- lib/widgets/dashboard/out_patient_stack.dart | 64 ----- 5 files changed, 176 insertions(+), 220 deletions(-) diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 6a0bcf4b..e616f1ca 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -19,116 +19,128 @@ class DashboardReferralPatient extends StatelessWidget { const DashboardReferralPatient({Key key, this.dashboardItemList, this.height, this.model}) : super(key: key); @override Widget build(BuildContext context) { - return RoundedContainer( - raduis: 16, - showBorder: false, - borderColor: Colors.white, - shadowWidth: 0.2, - shadowSpreadRadius: 3, - shadowDy: 1, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - flex: 1, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(8), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * - (SizeConfig.isHeightVeryShort? - 3 - : SizeConfig.isHeightShort? - 2 - : 2)), - Label( - firstLine: TranslationBase.of(context).patients, - secondLine: TranslationBase.of(context).referral, - color: Color(0xFF2B353E), - secondLineFontSize: SizeConfig.getHeightMultiplier(height: height) * + return Container( + margin: EdgeInsets.only(bottom: 20, top: 10, left: 5, right: 5), + decoration: BoxDecoration( + + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + bottomLeft: Radius.circular(20), + bottomRight: Radius.circular(20) + ), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 0, + blurRadius: 9, + offset: Offset(0, 0), // changes position of shadow + ), + ], + ), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + flex: 1, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(8), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * + (SizeConfig.isHeightVeryShort? + 3 + : SizeConfig.isHeightShort? + 2 + : 2)), + Label( + firstLine: TranslationBase.of(context).patients, + secondLine: TranslationBase.of(context).referral, + color: Color(0xFF2B353E), + secondLineFontSize: SizeConfig.getHeightMultiplier(height: height) * + (SizeConfig.isHeightVeryShort? + 5 + : SizeConfig.isHeightShort? + 7 + : 12), + ), + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightVeryShort? 5 : SizeConfig.isHeightShort? - 7 - : 12), - ), - SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * - (SizeConfig.isHeightVeryShort? - 5 - : SizeConfig.isHeightShort? - 10 - : 5)) - ], - ), + 10 + : 5)) + ], ), - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - RowCounts( - dashboardItemList[2].summaryoptions[0].kPIParameter, - dashboardItemList[2].summaryoptions[0].value, - Colors.black, - height: height, - ), - RowCounts( - dashboardItemList[2].summaryoptions[1].kPIParameter, - dashboardItemList[2].summaryoptions[1].value, - Colors.grey, - height: height, - ), - RowCounts( - dashboardItemList[2].summaryoptions[2].kPIParameter, - dashboardItemList[2].summaryoptions[2].value, - Colors.red, - height: height, - ), - ], - ), + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RowCounts( + dashboardItemList[2].summaryoptions[0].kPIParameter, + dashboardItemList[2].summaryoptions[0].value, + Colors.black, + height: height, + ), + RowCounts( + dashboardItemList[2].summaryoptions[1].kPIParameter, + dashboardItemList[2].summaryoptions[1].value, + Colors.grey, + height: height, + ), + RowCounts( + dashboardItemList[2].summaryoptions[2].kPIParameter, + dashboardItemList[2].summaryoptions[2].value, + Colors.red, + height: height, + ), + ], + ), + ) + ], + )), + ), + Expanded( + flex: 3, + child: Stack(children: [ + Container(padding: EdgeInsets.all(0), child: GaugeChart(_createReferralData(dashboardItemList))), + Positioned( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + AppText( + model.getPatientCount(dashboardItemList[2]).toString(), + fontSize: SizeConfig.textMultiplier * 3.0, + fontWeight: FontWeight.bold, ) ], - )), - ), - Expanded( - flex: 3, - child: Stack(children: [ - Container(padding: EdgeInsets.all(0), child: GaugeChart(_createReferralData(dashboardItemList))), - Positioned( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - AppText( - model.getPatientCount(dashboardItemList[2]).toString(), - fontSize: SizeConfig.textMultiplier * 3.0, - fontWeight: FontWeight.bold, - ) - ], - ), - top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40), - left: 0, - right: 0) - ]), - ), - ], - )), - ])); + ), + top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40), + left: 0, + right: 0) + ]), + ), + ], + )), + ]), + ); } static List> _createReferralData(List dashboardItemList) { diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 4b7c4f46..9005b816 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -1,9 +1,12 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; +import 'label.dart'; + class DashboardSliderItemWidget extends StatelessWidget { final DashboardModel item; @@ -11,27 +14,37 @@ class DashboardSliderItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return Column( + return Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - item.kPIName, - fontSize: SizeConfig.textMultiplier * 2.2, - fontWeight: FontWeight.bold, + Container( + margin: EdgeInsets.symmetric(horizontal: SizeConfig.widthMultiplier *1), + + child: Label( + firstLine: Helpers.getLabelFromKPI(item.kPIName), + secondLine: Helpers.getNameFromKPI(item.kPIName), + ), ), ], ), new Container( - height: 110, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 16 + : SizeConfig.isHeightShort + ? 14 + : SizeConfig.isHeightLarge + ? 15 + : 13), child: ListView( scrollDirection: Axis.horizontal, - children: - List.generate(item.summaryoptions.length, (int index) { - return GetActivityButton(item.summaryoptions[index]); + children: List.generate(item.summaryoptions.length, (int index) { + return GetActivityCard(item.summaryoptions[index]); }))) ], ); + } } diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 281c70e9..508bfe88 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -34,6 +34,7 @@ import 'package:sticky_headers/sticky_headers/widget.dart'; import '../../routes.dart'; import '../../widgets/shared/app_texts_widget.dart'; +import 'label.dart'; class HomeScreen extends StatefulWidget { HomeScreen({Key key, this.title}) : super(key: key); @@ -284,24 +285,11 @@ class _HomeScreenState extends State { SizedBox( height: 10, ), - Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).patients, - fontSize: 12, - fontWeight: FontWeight.bold, - fontHeight: .5, - ), - AppText( - TranslationBase.of(context).services, - fontSize: 22, - fontWeight: FontWeight.bold, - ), - ], - )), + + Label( + firstLine: TranslationBase.of(context).patients, + secondLine: TranslationBase.of(context).services, + ), SizedBox( height: 10, ), diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index ff9db962..5e3cda68 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -1,42 +1,49 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -class GetActivityButton extends StatelessWidget { +class GetActivityCard extends StatelessWidget { final value; - GetActivityButton(this.value); + GetActivityCard(this.value); @override Widget build(BuildContext context) { + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:SizeConfig.isHeightLarge?15:13); return Container( - width: MediaQuery.of(context).size.height * 0.125, - padding: EdgeInsets.all(5), - margin: EdgeInsets.all(5), + width: width, + padding: EdgeInsets.symmetric(horizontal: SizeConfig.heightMultiplier * .4, vertical: SizeConfig.heightMultiplier * .2), + margin: EdgeInsets.all(SizeConfig.widthMultiplier *1), decoration: BoxDecoration( color: Colors.white, + border: Border.all(width: 1, color: Color(0xFFEFEFEF)), borderRadius: BorderRadius.circular(15), ), child: Padding( - padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - value.value.toString(), - fontSize: 27, - fontWeight: FontWeight.bold, - color: Color(0xFF2B353E), - ), - AppText( - value.kPIParameter, - textOverflow: TextOverflow.clip, - fontSize: 10, - color: Color(0xFF2B353E), - textAlign: TextAlign.start, - fontWeight: FontWeight.w700, - ), - ], + padding: const EdgeInsets.fromLTRB(8,8, 8, 4), + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + value.value.toString(), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 25, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + letterSpacing: -0.93, + ), + AppText( + value.kPIParameter, + textOverflow: TextOverflow.clip, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9), + color: Color(0xFF2B353E), + textAlign: TextAlign.start, + fontWeight: FontWeight.w700, + letterSpacing: -0.33, + ), + ], + ), ), ), ); diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index d7042eb7..fb67d954 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -78,70 +78,6 @@ class GetOutPatientStack extends StatelessWidget { ); } - // getStack(Summaryoptions value, max,context) { - // return Expanded( - // child: Container( - // margin: EdgeInsets.symmetric(horizontal: 2), - // decoration: BoxDecoration( - // gradient: LinearGradient( - // begin: Alignment.topLeft, - // end: Alignment( - // 0.0, 1.0), // 10% of the width, so there are ten blinds. - // colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow - // tileMode: TileMode.mirror, // repeats the gradient over the canvas - // ), - // borderRadius: BorderRadius.circular(8), - // // color: Colors.red[50], - // ), - // child: Stack(children: [ - // Positioned( - // bottom: 0, - // left: 0, - // right: 0, - // child: Container( - // child: SizedBox(), - // padding: EdgeInsets.all(10), - // height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24 )* value.value) / max : 0, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(8), - // color: Color(0x63D02127), - // ), - // ), - // ), - // Container( - // height: (MediaQuery.of(context).size.height * 0.24 ), - // margin: EdgeInsets.only(left: 5, top: 5), - // padding: EdgeInsets.all(10), - // child: RotatedBox( - // quarterTurns: 3, - // child: Center( - // child: Align( - // child: FittedBox( - // child: Row( - // children: [ - // AppText( - // value.kPIParameter, - // fontSize: 10, - // textAlign: TextAlign.center, - // color: Color(0xFF2B353E), - // fontWeight: FontWeight.w700, - // ), - // AppText( - // ' (' + value.value.toString() + ') ', - // fontSize: 12, - // textAlign: TextAlign.center, - // color: Color(0xFF2B353E), - // fontWeight: FontWeight.bold, - // ), - // ], - // ), - // )), - // ), - // )) - // ]), - // ), - // ); - // } getStack(Summaryoptions value, max, context, barHeight) { From ecffe99f1902e54e0db94592b97f1309c805c781 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 14:28:57 +0200 Subject: [PATCH 4/4] small fixes --- lib/screens/home/home_page_card.dart | 35 +++++------ lib/screens/home/home_patient_card.dart | 70 ++++++++++++---------- lib/screens/home/home_screen.dart | 8 +-- lib/widgets/dashboard/activity_button.dart | 7 ++- 4 files changed, 61 insertions(+), 59 deletions(-) diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 503bbe60..df4ae48f 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -4,36 +4,34 @@ import 'package:hexcolor/hexcolor.dart'; class HomePageCard extends StatelessWidget { const HomePageCard( {this.hasBorder = false, - this.imageName, - @required this.child, - this.onTap, - Key key, - this.color, - this.opacity = 0.4, - this.margin}) + this.imageName, + this.child, + this.onTap, + Key key, + this.color, + this.opacity = 0.4, + this.margin, this.width}) : super(key: key); final bool hasBorder; final String imageName; final Widget child; - final Function onTap; + final GestureTapCallback onTap; final Color color; final double opacity; + final double width; final EdgeInsets margin; @override Widget build(BuildContext context) { return InkWell( onTap: onTap, child: Container( - width: 120, - height: MediaQuery.of(context).orientation == Orientation.portrait - ? 100 - : 200, + width: width, margin: this.margin, decoration: BoxDecoration( color: !hasBorder ? color != null - ? color - : HexColor('#050705').withOpacity(opacity) + ? color + : HexColor('#050705').withOpacity(opacity) : Colors.white, borderRadius: BorderRadius.circular(17.0), border: hasBorder @@ -41,11 +39,10 @@ class HomePageCard extends StatelessWidget { : Border.all(width: 0.0, color: Colors.transparent), image: imageName != null ? DecorationImage( - image: AssetImage('assets/images/dashboard/$imageName'), - fit: BoxFit.cover, - colorFilter: new ColorFilter.mode( - Colors.black.withOpacity(0.2), BlendMode.dstIn), - ) + image: AssetImage('assets/images/dashboard/$imageName'), + fit: BoxFit.cover, + colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn), + ) : null, ), child: child, diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index a0d0bce7..06ef380f 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -10,25 +10,28 @@ class HomePatientCard extends StatelessWidget { final Color backgroundIconColor; final String text; final Color textColor; - final Function onTap; + final VoidCallback onTap; final double iconSize; HomePatientCard({ - @required this.backgroundColor, - @required this.backgroundIconColor, - this.cardIcon, + this.backgroundColor, + this.backgroundIconColor, + this.cardIcon, this.cardIconImage, - @required this.text, - @required this.textColor, - @required this.onTap, - this.iconSize = 30, + this.text, + this.textColor, + this.onTap, + this.iconSize = 30, }); @override Widget build(BuildContext context) { + double width = SizeConfig.heightMultiplier* + (SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightLarge?15:13); return HomePageCard( color: backgroundColor, - margin: EdgeInsets.all(4), + width: width, + margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121), child: Container( padding: EdgeInsets.all(8), child: Column( @@ -43,21 +46,21 @@ class HomePatientCard extends StatelessWidget { color: Colors.transparent, child: cardIcon != null ? Icon( - cardIcon, - size: iconSize * 2, - color: backgroundIconColor, - ) + cardIcon, + size: iconSize * 2, + color: backgroundIconColor, + ) : IconButton( - icon: Image.asset( - 'assets/images/patient_register.png', - width: iconSize * 2, - height: iconSize * 2, - fit: BoxFit.fill, - ), - iconSize: iconSize * 2, - color: backgroundIconColor, - onPressed: () => null, - ), + icon: Image.asset( + 'assets/images/patient_register.png', + width: iconSize * 2, + height: iconSize * 2, + fit: BoxFit.fill, + ), + iconSize: iconSize * 2, + color: backgroundIconColor, + onPressed: () => null, + ), ), Container( child: Column( @@ -66,15 +69,16 @@ class HomePatientCard extends StatelessWidget { children: [ cardIcon != null ? Icon( - cardIcon, - size: iconSize, - color: textColor, - ) + cardIcon, + size: + SizeConfig.getWidthMultiplier(width: width) * 30, + color: textColor, + ) : Image.asset( - cardIconImage, - height: iconSize, - width: iconSize, - ), + cardIconImage, + height: iconSize, + width: iconSize, + ), SizedBox( height: 4, ), @@ -90,7 +94,9 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, - fontSize: SizeConfig.textMultiplier * 1.6, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth(width: width) * + (SizeConfig.isHeightVeryShort ? 11 : 10), ), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 508bfe88..f5b62368 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -290,9 +290,7 @@ class _HomeScreenState extends State { firstLine: TranslationBase.of(context).patients, secondLine: TranslationBase.of(context).services, ), - SizedBox( - height: 10, - ), + Container( height: 120, child: ListView( @@ -322,9 +320,9 @@ class _HomeScreenState extends State { colorIndex = 0; List backgroundColors = List(3); - backgroundColors[0] = Color(0xffD02127); + backgroundColors[0] = AppGlobal.appRedColor; backgroundColors[1] = Colors.grey[300]; - backgroundColors[2] = Color(0xff2B353E); + backgroundColors[2] = Color(0xFF2B353E); List backgroundIconColors = List(3); backgroundIconColors[0] = Colors.white12; backgroundIconColors[1] = Colors.white38; diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index 5e3cda68..f00acef4 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -30,16 +31,16 @@ class GetActivityCard extends StatelessWidget { value.value.toString(), fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 25, fontWeight: FontWeight.bold, - color: Color(0xFF2B353E), + color: AppGlobal.appTextColor, letterSpacing: -0.93, ), AppText( value.kPIParameter, textOverflow: TextOverflow.clip, fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9), - color: Color(0xFF2B353E), + color: AppGlobal.appTextColor, textAlign: TextAlign.start, - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w600, letterSpacing: -0.33, ), ],