From ae5c9170a713bbf3fee8f76418b8eff5540d1803 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 13 Dec 2021 16:31:05 +0200 Subject: [PATCH 1/9] fix patient gird --- lib/screens/home/home_page_card.dart | 5 - .../profile_gird_for_other.dart | 60 +- .../profile_gird_for_search.dart | 62 +- pubspec.lock | 1249 ----------------- 4 files changed, 62 insertions(+), 1314 deletions(-) delete mode 100644 pubspec.lock diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 7a0d5167..39a99e65 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -31,11 +31,6 @@ class HomePageCard extends StatelessWidget { width: width, margin: this.margin, decoration: BoxDecoration( - // color: !hasBorder - // ? color != null - // ? color - // : HexColor('#050705').withOpacity(opacity) - // : Colors.white, gradient: gradient, borderRadius: BorderRadius.circular(20.0), border: hasBorder diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index dbdaf4a8..0c3da34b 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -88,38 +88,38 @@ class ProfileGridForOther extends StatelessWidget { ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null), ]; + return Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + child: GridView( + shrinkWrap: true, - return Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), - child: StaggeredGridView.countBuilder( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 8, - mainAxisSpacing: 8, - crossAxisCount: 3, - itemCount: cardsList.length, - staggeredTileBuilder: (int index) => StaggeredTile.fit(1), - itemBuilder: (BuildContext context, int index) => PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: cardsList[index].nameLine1, - nameLine2: cardsList[index].nameLine2, - route: cardsList[index].route, - icon: cardsList[index].icon, - isInPatient: cardsList[index].isInPatient, - isDischargedPatient: cardsList[index].isDischargedPatient, - isDisable: cardsList[index].isDisable, - onTap: cardsList[index].onTap, - isLoading: cardsList[index].isLoading, - isFromLiveCare: isFromLiveCare), - ), + physics: BouncingScrollPhysics(), + // if you want IOS bouncing effect, otherwise remove this line + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisSpacing: 10, + mainAxisSpacing: 8, + crossAxisCount: 3, ), - ], + //change the number as you want + children: cardsList.map((item) { + return PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: item.nameLine1, + nameLine2: item.nameLine2, + route: item.route, + icon: item.icon, + isInPatient: item.isInPatient, + isDischargedPatient: item.isDischargedPatient, + isDisable: item.isDisable, + onTap: item.onTap, + isLoading: item.isLoading, + ); + }).toList(), + ), ); } } diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index b1438e70..cc738b17 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -66,37 +66,39 @@ class ProfileGridForSearch extends StatelessWidget { isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), ]; - return Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), - child: StaggeredGridView.countBuilder( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 8, - mainAxisSpacing: 8, - crossAxisCount: 3, - itemCount: cardsList.length, - staggeredTileBuilder: (int index) => StaggeredTile.fit(1), - itemBuilder: (BuildContext context, int index) => PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: cardsList[index].nameLine1, - nameLine2: cardsList[index].nameLine2, - route: cardsList[index].route, - icon: cardsList[index].icon, - isInPatient: cardsList[index].isInPatient, - isDischargedPatient: cardsList[index].isDischargedPatient, - isDisable: cardsList[index].isDisable, - onTap: cardsList[index].onTap, - isLoading: cardsList[index].isLoading, - ), - ), + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + child: GridView( + shrinkWrap: true, + + physics: BouncingScrollPhysics(), + // if you want IOS bouncing effect, otherwise remove this line + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisSpacing: 10, + mainAxisSpacing: 8, + crossAxisCount: 3, ), - ], + //change the number as you want + children: cardsList.map((item) { + return PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: item.nameLine1, + nameLine2: item.nameLine2, + route: item.route, + icon: item.icon, + isInPatient: item.isInPatient, + isDischargedPatient: item.isDischargedPatient, + isDisable: item.isDisable, + onTap: item.onTap, + isLoading: item.isLoading, + ); + }).toList(), + ), ); } } diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 6fcaaa5a..00000000 --- a/pubspec.lock +++ /dev/null @@ -1,1249 +0,0 @@ -# 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: "direct main" - 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.3-nullsafety.1" - 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.4" - 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.2" - 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-213.1.beta" - flutter: ">=1.22.2 <2.0.0" From 34b44849723b673829291a30be3e06631961919b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 08:30:32 +0200 Subject: [PATCH 2/9] fix tabs --- lib/config/config.dart | 4 ++-- lib/screens/doctor/doctor_replay/doctor_reply_screen.dart | 2 ++ lib/screens/patients/In_patient/in_patient_screen.dart | 2 ++ lib/screens/patients/out_patient/out_patient_screen.dart | 4 +--- .../patients/profile/referral/patient_referral_screen.dart | 1 + 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 09a3fcf8..03c74f52 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart index 4905da58..d30457b4 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -81,6 +81,8 @@ class _DoctorReplyScreenState extends State preferredSize: Size.fromHeight( MediaQuery.of(context).size.height * 0.070), child: Container( + color: Helpers.getBgTabColor(), + child: TabBar( isScrollable: false, controller: _tabController, diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index 5be1c1c5..ebb3118a 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -127,6 +127,8 @@ class _InPatientScreenState extends State color: Colors.white), child: Container( margin: EdgeInsets.only(top: 9), + color: Helpers.getBgTabColor(), + child: TabBar( isScrollable: false, controller: _tabController, diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index ab320f07..59601ea7 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -107,9 +107,7 @@ class _OutPatientsScreenState extends State { Container( // color: Colors.red, height: Helpers.getTabHeight(context), - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), + color: Helpers.getBgTabColor(), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index bb9db904..4dab4270 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -60,6 +60,7 @@ class _PatientReferralScreen extends State child: Center( child: Container( height: Helpers.getTabHeight(context), + color: Helpers.getBgTabColor(), child: Center( child: TabBar( isScrollable: false, From 56fbc4783581cc481a080771b28028720625fd07 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 08:56:40 +0200 Subject: [PATCH 3/9] fix home page --- assets/images/svgs/female avatar.svg | 57 +++++++++++++++ assets/images/svgs/female.svg | 3 + assets/images/svgs/inpatient.svg | 4 ++ assets/images/svgs/male avatar.svg | 56 +++++++++++++++ assets/images/svgs/male.svg | 3 + assets/images/svgs/menu.svg | 19 +++++ assets/images/svgs/no data.svg | 69 +++++++++++++++++++ lib/landing_page.dart | 3 +- lib/screens/home/home_screen.dart | 33 ++++++--- lib/util/helpers.dart | 38 ++++++++++ .../shared/bottom_navigation_item.dart | 2 +- pubspec.yaml | 1 + 12 files changed, 276 insertions(+), 12 deletions(-) create mode 100644 assets/images/svgs/female avatar.svg create mode 100644 assets/images/svgs/female.svg create mode 100644 assets/images/svgs/inpatient.svg create mode 100644 assets/images/svgs/male avatar.svg create mode 100644 assets/images/svgs/male.svg create mode 100644 assets/images/svgs/menu.svg create mode 100644 assets/images/svgs/no data.svg diff --git a/assets/images/svgs/female avatar.svg b/assets/images/svgs/female avatar.svg new file mode 100644 index 00000000..1cf831e1 --- /dev/null +++ b/assets/images/svgs/female avatar.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/svgs/female.svg b/assets/images/svgs/female.svg new file mode 100644 index 00000000..307729c2 --- /dev/null +++ b/assets/images/svgs/female.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/inpatient.svg b/assets/images/svgs/inpatient.svg new file mode 100644 index 00000000..0f6b79bb --- /dev/null +++ b/assets/images/svgs/inpatient.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/svgs/male avatar.svg b/assets/images/svgs/male avatar.svg new file mode 100644 index 00000000..ff177416 --- /dev/null +++ b/assets/images/svgs/male avatar.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/svgs/male.svg b/assets/images/svgs/male.svg new file mode 100644 index 00000000..80cd0c7f --- /dev/null +++ b/assets/images/svgs/male.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/menu.svg b/assets/images/svgs/menu.svg new file mode 100644 index 00000000..6808f518 --- /dev/null +++ b/assets/images/svgs/menu.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/svgs/no data.svg b/assets/images/svgs/no data.svg new file mode 100644 index 00000000..c54f0430 --- /dev/null +++ b/assets/images/svgs/no data.svg @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 69cae394..cd9507fd 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; class LandingPage extends StatefulWidget { @override @@ -53,7 +54,7 @@ class _LandingPageState extends State { leading: Builder( builder: (BuildContext context) { return IconButton( - icon: Image.asset('assets/images/menu.png', + icon: SvgPicture.asset('assets/images/svgs/menu.svg', height: 50, width: 50), iconSize: 15, color: Color(0xff2B353E), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 4e577bb9..5cf849e8 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_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'; @@ -20,6 +21,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_ref import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterPatientPage.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -29,6 +31,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import 'package:sticky_headers/sticky_headers/widget.dart'; @@ -40,7 +43,6 @@ class HomeScreen extends StatefulWidget { HomeScreen({Key key, this.title}) : super(key: key); final String title; - final String iconURL = 'assets/images/dashboard_icon/'; @override _HomeScreenState createState() => _HomeScreenState(); @@ -83,12 +85,16 @@ class _HomeScreenState extends State { color: Colors.grey[100], padding: EdgeInsets.only(top: 10), child: Stack(children: [ - IconButton( - icon: Image.asset('assets/images/menu.png', - height: 50, width: 50), - iconSize: 18, - color: Colors.black, - onPressed: () => Scaffold.of(context).openDrawer(), + Container( + width: 40, + margin: EdgeInsets.only(left: projectsProvider.isArabic? 0:32, right: projectsProvider.isArabic? 23:0), + child: IconButton( + icon: SvgPicture.asset('assets/images/svgs/menu.svg', + height: 25, width: 10), + iconSize: 15, + color: Colors.black, + onPressed: () => Scaffold.of(context).openDrawer(), + ), ), Column(children: [ ProfileWelcomeWidget( @@ -169,7 +175,7 @@ class _HomeScreenState extends State { )), ], ), - AppText(item.clinicName, + AppText(Helpers.convertToTitleCase(item.clinicName), fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, @@ -199,7 +205,7 @@ class _HomeScreenState extends State { .map((item) { return DropdownMenuItem( child: AppText( - item.clinicName, + Helpers.convertToTitleCase(item.clinicName), fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, @@ -292,7 +298,14 @@ class _HomeScreenState extends State { ), Container( - height: 120, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 16 + : SizeConfig.isHeightShort + ? 14 + : SizeConfig.isHeightLarge + ? 15 + : 13), child: ListView( scrollDirection: Axis.horizontal, children: [ diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 0d7cd088..6a3ca933 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:html/parser.dart'; +import 'package:intl/intl.dart'; import '../UpdatePage.dart'; import '../config/size_config.dart'; @@ -235,6 +236,9 @@ class Helpers { return parsedString; } + + + static InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, {Icon suffixIcon, Color dropDownColor}) { @@ -349,6 +353,10 @@ class Helpers { ); } + static getBgTabColor(){ + return Color(0xFFEAEAEA); + } + static getTabText({String title, bool isActive = false,}){ return AppText( title, @@ -389,4 +397,34 @@ class Helpers { } + + static String convertToTitleCase(String text) { + if (text == null) { + return null; + } + + if (text.length <= 1) { + return text.toUpperCase(); + } + + // Split string into multiple words + final List words = text.split(' '); + + // Capitalize first letter of each words + final capitalizedWords = words.map((word) { + if (word.trim().isNotEmpty) { + final String firstLetter = word.trim().substring(0, 1).toUpperCase(); + final String remainingLetters = word.trim().substring(1).toLowerCase(); + + return '$firstLetter$remainingLetters'; + } + return ''; + }); + + // Join/Merge all words back to one String + return capitalizedWords.join(' '); + } + } + + diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 6d7efa95..8924d719 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -81,7 +81,7 @@ class BottomNavigationItem extends StatelessWidget { child: AppText(name ?? "", textAlign: TextAlign.center, fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * 2, + SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, letterSpacing: -0.24, color: AppGlobal.appTextColor, fontWeight: FontWeight.w600) //#989898, diff --git a/pubspec.yaml b/pubspec.yaml index 0f2d55e8..1e5125de 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -130,6 +130,7 @@ flutter: - assets/images/ - assets/images/dashboard/ - assets/images/login/ + - assets/images/svgs/ - assets/images/svgs/verification/ - assets/images/svgs/profile_screen/ - assets/images/svgs/bottom_nav/ From 3e1ac71a480cb32dea9fa362f073b7ac041ffad9 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 10:06:24 +0200 Subject: [PATCH 4/9] fix some design issues --- lib/config/config.dart | 4 +- .../patient_profile_screen.dart | 4 +- .../patients/patient_card/PatientCard.dart | 151 ++++++++++-------- .../shared/buttons/app_buttons_widget.dart | 4 +- lib/widgets/shared/errors/error_message.dart | 3 +- 5 files changed, 92 insertions(+), 74 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 03c74f52..09a3fcf8 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index b2261f4c..a62fae57 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -251,7 +251,7 @@ class _PatientProfileScreenState extends State radius: 30, hPadding: 20, fontWeight: FontWeight.normal, - fontSize: 1.6, + fontSize: 12, icon: SvgPicture.asset( "assets/images/svgs/profile_screen/create episode.svg", color: Colors.white, @@ -283,7 +283,7 @@ class _PatientProfileScreenState extends State radius: 30, hPadding: 20, fontWeight: FontWeight.normal, - fontSize: 1.6, + fontSize: 12, icon: SvgPicture.asset( "assets/images/svgs/profile_screen/modify episode.svg", color: Colors.white, diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 00e43d71..4c13d1f6 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -62,7 +62,7 @@ class PatientCard extends StatelessWidget { decoration: Helpers.getCardBoxDecoration(), child: CardWithBgWidget( padding: 0, - marginLeft: (!isMyPatient && isInpatient) ||isFromLiveCare ? 0 : 10, + marginLeft: (!isMyPatient && isInpatient) || isFromLiveCare ? 0 : 10, marginSymmetric: isFromSearch ? 10 : 0.0, hasBorder: false, bgColor: isFromLiveCare @@ -95,6 +95,7 @@ class PatientCard extends StatelessWidget { padding: EdgeInsets.only(left: 12.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ patientInfo.patientStatusType == 43 ? Row( @@ -210,6 +211,8 @@ class PatientCard extends StatelessWidget { ? Column( crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( AppDateUtils @@ -221,14 +224,16 @@ class PatientCard extends StatelessWidget { isMonthShort: true, ), fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + fontWeight: FontWeight.w600, + fontSize: 11, + letterSpacing: -0.64, ), AppText( "${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + fontWeight: FontWeight.w600, + fontSize: 11, + letterSpacing: -0.64, ), ], ) @@ -239,6 +244,8 @@ class PatientCard extends StatelessWidget { ? Column( crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( @@ -246,14 +253,16 @@ class PatientCard extends StatelessWidget { .appointmentDate, ), isMonthShort: true)}", fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + fontWeight: FontWeight.w600, + fontSize: 11, + letterSpacing: -0.64, ), AppText( " ${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + fontWeight: FontWeight.w600, + fontSize: 11, + letterSpacing: -0.64, ), ], ) @@ -301,66 +310,66 @@ class PatientCard extends StatelessWidget { textOverflow: TextOverflow.ellipsis, ), if (patientInfo.gender == 1) - Icon( - DoctorApp.male_2, - color: Colors.blue, - size: 18, - ) + Container( + padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2), + child: SvgPicture.asset("assets/images/svgs/male.svg"),) else - Icon( - DoctorApp.female_1, - color: Colors.pink, - size: 18, - ), + Container( + padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2), + child: SvgPicture.asset("assets/images/svgs/female.svg"),), if (isFromLiveCare) ShowTimer( patientInfo: patientInfo, ), ]), ), - if(nationalityName.isNotEmpty) - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - child: Container( - padding: EdgeInsets.only(top: 8), - alignment: Alignment.centerRight, - child: AppText( - nationalityName.truncate(14), - fontWeight: FontWeight.w600, - fontSize: 10, - color: Color(0xFF2E303A), - textOverflow: TextOverflow.ellipsis, + if (nationalityName.isNotEmpty) + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(top: 5), + alignment: Alignment.centerRight, + child: AppText( + nationalityName.truncate(14), + fontWeight: FontWeight.w600, + fontSize: 10, + color: Color(0xFF2E303A), + textOverflow: TextOverflow.ellipsis, + ), ), ), - ), - patientInfo.nationality != null || - patientInfo.nationalityId != null - ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), - child: CachedNetworkImage( - imageUrl: patientInfo - .nationalityFlagURL != - null - ? patientInfo.nationalityFlagURL - : '', - height: 16, - width: 22, - errorWidget: - (context, url, error) => - AppText( - 'No Image', - fontSize: 10, - ), - )) - : SizedBox() - ], - ), - ) + patientInfo.nationality != null || + patientInfo.nationalityId != null + ? Container( + padding: EdgeInsets.only(top: 5), + child: ClipRRect( + borderRadius: + BorderRadius.circular(20.0), + child: CachedNetworkImage( + imageUrl: patientInfo + .nationalityFlagURL != + null + ? patientInfo + .nationalityFlagURL + : '', + height: 16, + width: 22, + errorWidget: + (context, url, error) => + AppText( + 'No Image', + fontSize: 10, + ), + )), + ) + : SizedBox() + ], + ), + ) ], )), SizedBox( @@ -374,10 +383,11 @@ class PatientCard extends StatelessWidget { child: Container( width: 60, height: 60, - child: Image.asset( + //TODO Elham* create widget for this to make it use every where + child: SvgPicture.asset( patientInfo.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + ? 'assets/images/svgs/male avatar.svg' + : 'assets/images/svgs/female avatar.svg', fit: BoxFit.cover, ), ), @@ -479,9 +489,11 @@ class PatientCard extends StatelessWidget { : !isInpatient && !isFromSearch ? Row( mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - padding: EdgeInsets.all(4), + padding: EdgeInsets.only( + left: 13, right: 13, bottom: 13), child: SvgPicture.asset( patientInfo.appointmentType == 'Regular' && @@ -498,11 +510,16 @@ class PatientCard extends StatelessWidget { : (isInpatient == true) ? Row( mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Container( - padding: EdgeInsets.all(4), - child: Image.asset( - 'assets/images/inpatient.png', + padding: EdgeInsets.only( + left: 13, + right: 13, + bottom: 13), + child: SvgPicture.asset( + 'assets/images/svgs/inpatient.svg', height: 25, width: 35, )), diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index cc9559e3..bb43dc8c 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -32,7 +32,7 @@ class AppButton extends StatefulWidget { this.iconData, this.icon, this.color, - this.fontSize = 2, + this.fontSize = 16, this.padding = 13, this.loading = false, this.disabled = false, @@ -107,7 +107,7 @@ class _AppButtonState extends State { child: AppText( widget.title, color: widget.fontColor, - fontSize: 16.0, + fontSize: widget.fontSize, fontWeight: FontWeight.w600, letterSpacing: -0.48, ), diff --git a/lib/widgets/shared/errors/error_message.dart b/lib/widgets/shared/errors/error_message.dart index 21e04e6c..2930ae84 100644 --- a/lib/widgets/shared/errors/error_message.dart +++ b/lib/widgets/shared/errors/error_message.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import '../app_texts_widget.dart'; @@ -18,7 +19,7 @@ class ErrorMessage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox(height: 100,), - Image.asset('assets/images/no-data.png'), + SvgPicture.asset('assets/images/svgs/no data.svg'), Center( child: Center( child: Padding( From 4dcc20b68112dc29aa2e2a2fd3b9886199e84740 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 10:35:15 +0200 Subject: [PATCH 5/9] fix issues related to card --- lib/config/config.dart | 4 +- .../patients/patient_card/PatientCard.dart | 173 +++++++++++------- 2 files changed, 109 insertions(+), 68 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 09a3fcf8..03c74f52 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 4c13d1f6..49d2eb7a 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -208,64 +208,31 @@ class PatientCard extends StatelessWidget { fontWeight: FontWeight.w400, ) : patientInfo.arrivedOn != null - ? Column( - crossAxisAlignment: - CrossAxisAlignment.end, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - AppDateUtils - .getDayMonthYearDateFormatted( - AppDateUtils - .convertStringToDate( - patientInfo.arrivedOn, - ), - isMonthShort: true, - ), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 11, - letterSpacing: -0.64, - ), - AppText( - "${AppDateUtils.getStartTime(patientInfo.startTime)}", + ? Container( + padding: EdgeInsets.only(right: 9), + + child: AppText( + "${AppDateUtils.getStartTime(patientInfo.startTime)}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 11, + letterSpacing: -0.64, + ), + ) + : (patientInfo.appointmentDate != + null && + patientInfo + .appointmentDate.isNotEmpty) + ? Container( + padding: EdgeInsets.only(right: 9), + child: AppText( + " ${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 11, letterSpacing: -0.64, ), - ], - ) - : (patientInfo.appointmentDate != - null && - patientInfo - .appointmentDate.isNotEmpty) - ? Column( - crossAxisAlignment: - CrossAxisAlignment.end, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( - patientInfo - .appointmentDate, - ), isMonthShort: true)}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 11, - letterSpacing: -0.64, - ), - AppText( - " ${AppDateUtils.getStartTime(patientInfo.startTime)}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 11, - letterSpacing: -0.64, - ), - ], - ) + ) : SizedBox() ], )) @@ -311,12 +278,18 @@ class PatientCard extends StatelessWidget { ), if (patientInfo.gender == 1) Container( - padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2), - child: SvgPicture.asset("assets/images/svgs/male.svg"),) + padding: EdgeInsets.symmetric( + horizontal: 4, vertical: 2), + child: SvgPicture.asset( + "assets/images/svgs/male.svg"), + ) else Container( - padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2), - child: SvgPicture.asset("assets/images/svgs/female.svg"),), + padding: EdgeInsets.symmetric( + horizontal: 4, vertical: 2), + child: SvgPicture.asset( + "assets/images/svgs/female.svg"), + ), if (isFromLiveCare) ShowTimer( patientInfo: patientInfo, @@ -345,7 +318,8 @@ class PatientCard extends StatelessWidget { patientInfo.nationality != null || patientInfo.nationalityId != null ? Container( - padding: EdgeInsets.only(top: 5), + padding: EdgeInsets.only( + right: 7, top: 5), child: ClipRRect( borderRadius: BorderRadius.circular(20.0), @@ -416,6 +390,69 @@ class PatientCard extends StatelessWidget { value: "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", ), + + patientInfo.arrivedOn != null + ? Column( + crossAxisAlignment: + CrossAxisAlignment.end, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + // AppText( + // AppDateUtils + // .getDayMonthYearDateFormatted( + // AppDateUtils + // .convertStringToDate( + // patientInfo.arrivedOn, + // ), + // isMonthShort: true, + // ), + // fontFamily: 'Poppins', + // fontWeight: FontWeight.w600, + // fontSize: 11, + // letterSpacing: -0.64, + // ), + + CustomRow( + label: TranslationBase.of( + context) + .arrivedP + + " : ", + value: AppDateUtils + .getDayMonthYearDateFormatted( + AppDateUtils + .convertStringToDate( + patientInfo.arrivedOn, + ), + isMonthShort: true, + ), + ), + ], + ) + : (patientInfo.appointmentDate != + null && + patientInfo.appointmentDate + .isNotEmpty) + ? Column( + crossAxisAlignment: + CrossAxisAlignment.end, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + CustomRow( + label: TranslationBase.of( + context) + .appointmentDate + + " : ", + value: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( + patientInfo + .appointmentDate, + ), isMonthShort: true)}", + ), + ], + ) + : SizedBox(), + if (isInpatient) CustomRow( label: @@ -465,9 +502,12 @@ class PatientCard extends StatelessWidget { ), ]), ), - Icon( - Icons.arrow_forward, - size: 24, + Padding( + padding: const EdgeInsets.only(right: 8), + child: Icon( + Icons.arrow_forward, + size: 24, + ), ), ], )) @@ -477,7 +517,8 @@ class PatientCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ Container( - padding: EdgeInsets.all(4), + padding: EdgeInsets.only( + left: 9, right: 9, bottom: 9), child: SvgPicture.asset( 'assets/images/svgs/profile_screen/livecare.svg', height: 20, @@ -493,7 +534,7 @@ class PatientCard extends StatelessWidget { children: [ Container( padding: EdgeInsets.only( - left: 13, right: 13, bottom: 13), + left: 9, right: 9, bottom: 9), child: SvgPicture.asset( patientInfo.appointmentType == 'Regular' && @@ -515,9 +556,9 @@ class PatientCard extends StatelessWidget { children: [ Container( padding: EdgeInsets.only( - left: 13, - right: 13, - bottom: 13), + left: 9, + right: 9, + bottom: 9), child: SvgPicture.asset( 'assets/images/svgs/inpatient.svg', height: 25, From 3431c353e9443c345e4756695d8859b62f4b1574 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 12:14:13 +0200 Subject: [PATCH 6/9] fix issues in design --- .../auth/verification_methods_screen.dart | 797 ++++++++++-------- lib/widgets/shared/card_with_bg_widget.dart | 2 +- 2 files changed, 434 insertions(+), 365 deletions(-) diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index fc85db8f..e1f2f49b 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -15,37 +15,32 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../config/size_config.dart'; -import '../../landing_page.dart'; -import '../../root_page.dart'; -import '../../routes.dart'; import '../../util/dr_app_shared_pref.dart'; import '../../util/helpers.dart'; import '../../widgets/auth/verification_methods_list.dart'; -import 'login_screen.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); +///TODO Elham* check if this still in user or not class VerificationMethodsScreen extends StatefulWidget { - - final password; - - VerificationMethodsScreen({this.password, }); + VerificationMethodsScreen({ + this.password, + }); @override - _VerificationMethodsScreenState createState() => _VerificationMethodsScreenState(); + _VerificationMethodsScreenState createState() => + _VerificationMethodsScreenState(); } class _VerificationMethodsScreenState extends State { - ProjectViewModel projectsProvider; bool isMoreOption = false; bool onlySMSBox = false; @@ -58,367 +53,440 @@ class _VerificationMethodsScreenState extends State { projectsProvider = Provider.of(context); authenticationViewModel = Provider.of(context); - - return AppScaffold( isShowAppBar: false, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - // baseViewModel: model, body: SingleChildScrollView( child: Center( child: FractionallySizedBox( - child: Container( - margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - height: SizeConfig.realScreenHeight * .95, - width: SizeConfig.realScreenWidth, - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - SizedBox( - height: 80, - ), - if(authenticationViewModel.isFromLogin) + widthFactor: 0.9, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 6 : 4), + ), + if (authenticationViewModel.isFromLogin) InkWell( - onTap: (){ - authenticationViewModel.setUnverified(false,isFromLogin: false); - authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); + onTap: () { + authenticationViewModel.setUnverified(false, + isFromLogin: false); + authenticationViewModel + .setAppStatus(APP_STATUS.UNAUTHENTICATED); }, - child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),) - - ), - Container( - - child: Column( - children: [ - SizedBox( - height: 20, - ), - authenticationViewModel.user != null && isMoreOption == false - ? Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - AppText( - TranslationBase.of(context).welcomeBack, - fontSize:12, - fontWeight: FontWeight.w700, - color: Color(0xFF2B353E), - ), - AppText( - Helpers.capitalize(authenticationViewModel.user.doctorName), - fontSize: 24, - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 20, - ), - AppText( - TranslationBase.of(context).accountInfo , - fontSize: 16, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w600, - ), - SizedBox( - height: 20, - ), - Container( - padding: EdgeInsets.all(15), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10), - ), - border: Border.all( - color: HexColor('#707070'), - width: 0.1), + child: Icon( + Icons.arrow_back_ios, + color: AppGlobal.appTextColor, + )), + Column( + children: [ + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 3 : 4), + ), + authenticationViewModel.user != null && + isMoreOption == false + ? Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).welcomeBack, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + fontWeight: FontWeight.w600, + color: AppGlobal.appTextColor, + letterSpacing: -0.72, ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - children: [ - - Text( - TranslationBase.of(context) - .lastLoginAt, - overflow: - TextOverflow.ellipsis, - style: TextStyle( - fontFamily: 'Poppins', - fontSize: 16, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700,), - + AppText( + Helpers.convertToTitleCase( + authenticationViewModel.user.doctorName), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 6, + color: AppGlobal.appTextColor, + fontWeight: FontWeight.bold, + letterSpacing: -1.44, + ), + SizedBox( + height: SizeConfig.heightMultiplier * 4, + ), + AppText( + TranslationBase.of(context).accountInfo, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + SizedBox( + height: SizeConfig.heightMultiplier * 4), + Container( + padding: EdgeInsets.all(15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10), + ), + border: Border.all( + color: HexColor('#707070'), width: 0.1), + ), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: SizeConfig.realScreenWidth * .5, + padding: EdgeInsets.all(0), + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context) + .lastLoginAt, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontFamily: 'Poppins', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w600, + letterSpacing: -0.4), + ), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.55, + child: RichText( + text: TextSpan( + text: TranslationBase.of( + context) + .verifyWith + + ':', + style: TextStyle( + color: + Color(0xFF575757), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600, + letterSpacing: -0.4), + children: [ + TextSpan( + text: authenticationViewModel + .getType( + authenticationViewModel + .user + .logInTypeID, + context), + style: TextStyle( + color: AppGlobal + .appTextColor, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + letterSpacing: + -0.48), + ) + ]), + ), + ), + ], + crossAxisAlignment: + CrossAxisAlignment.start, + ), ), - Row( + Column( + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( - TranslationBase - .of(context) - .verifyWith, - fontSize: 14, - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - ), - AppText( - authenticationViewModel.getType( - authenticationViewModel.user - .logInTypeID, - context), - fontSize: 14, - color: Color(0xFF2B353E), - + authenticationViewModel + .user.editedOn != + null + ? AppDateUtils + .getDayMonthYearDateFormatted( + AppDateUtils + .convertStringToDate( + authenticationViewModel + .user + .editedOn), + isMonthShort: true) + : authenticationViewModel + .user.createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .convertStringToDate( + authenticationViewModel + .user + .createdOn), + isMonthShort: true) + : '--', + textAlign: TextAlign.right, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4.5, + color: Color(0xFF2E303A), fontWeight: FontWeight.w700, + letterSpacing: -0.48, ), + AppText( + authenticationViewModel + .user.editedOn != + null + ? AppDateUtils.getHour(AppDateUtils + .convertStringToDate( + authenticationViewModel + .user.editedOn)) + : authenticationViewModel + .user.createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .convertStringToDate( + authenticationViewModel + .user + .createdOn)) + : '--', + textAlign: TextAlign.right, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: Color(0xFF575757), + ) ], + crossAxisAlignment: + CrossAxisAlignment.end, ) ], - crossAxisAlignment: CrossAxisAlignment.start,), - Column(children: [ - AppText( - authenticationViewModel.user.editedOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) - : '--', - textAlign: - TextAlign.right, - fontSize: 13, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - ), - AppText( - authenticationViewModel.user.editedOn != - null - ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != - null - ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) - : '--', - textAlign: - TextAlign.right, - fontSize: 14, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ) - ], - crossAxisAlignment: CrossAxisAlignment.start, - - ) + ), + ), + SizedBox( + height: SizeConfig.heightMultiplier * 3, + ), + Row( + children: [ + //todo add translation + AppText( + "Please Verify", + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4.5, + color: AppGlobal.appTextColor, + fontWeight: FontWeight.w600, + letterSpacing: -.64, + ), ], ), - ), - SizedBox( - height: 20, - ), - Row( - children: [ - AppText( - "Please Verify", - fontSize: 16, - color: Color(0xFF2B353E), - - fontWeight: FontWeight.w700, - ), - ], - ) - ], - ) - : Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, + SizedBox( + height: SizeConfig.heightMultiplier * 2, + ), + ], + ) + : Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ - this.onlySMSBox == false - ? Container( - margin: EdgeInsets.only(bottom: 20, top: 30), - child: AppText( - TranslationBase.of(context) - .verifyLoginWith, - fontSize: 18, - color: Color(0xFF2E303A), - fontWeight: FontWeight.bold, - textAlign: TextAlign.left, - ), - ) - : AppText( - TranslationBase.of(context) - .verifyFingerprint2, - fontSize: - SizeConfig.textMultiplier * 2.5, - textAlign: TextAlign.start, - ), - ]), - authenticationViewModel.user != null && isMoreOption == false - ? Column( + this.onlySMSBox == false + ? Container( + margin: EdgeInsets.only( + bottom: 20, top: 30), + child: AppText( + TranslationBase.of(context) + .verifyLoginWith, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + textAlign: TextAlign.left, + ), + ) + : AppText( + TranslationBase.of(context) + .verifyFingerprint2, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + textAlign: TextAlign.start, + ), + ]), + authenticationViewModel.user != null && + isMoreOption == false + ? Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: InkWell( - onTap: () => - { - // TODO check this logic it seem it will create bug to us - authenticateUser( - AuthMethodTypes - .Fingerprint, true) - }, + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () => { + // TODO check this logic it seem it will create bug to us + authenticateUser( + AuthMethodTypes + .Fingerprint, + true) + }, + child: VerificationMethodsList( + authenticationViewModel: + authenticationViewModel, + authMethodType: + SelectedAuthMethodTypesService + .getMethodsTypeService( + authenticationViewModel + .user + .logInTypeID), + authenticateUser: + (AuthMethodTypes + authMethodType, + isActive) => + authenticateUser( + authMethodType, + isActive), + )), + ), + Expanded( child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: SelectedAuthMethodTypesService - .getMethodsTypeService( - authenticationViewModel.user - .logInTypeID), - authenticateUser: - (AuthMethodTypes - authMethodType, - isActive) => + authenticationViewModel: + authenticationViewModel, + authMethodType: + AuthMethodTypes.MoreOptions, + onShowMore: () { + setState(() { + isMoreOption = true; + }); + }, + )) + ]), + ]) + : Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + onlySMSBox == false + ? Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: VerificationMethodsList( + authenticationViewModel: + authenticationViewModel, + authMethodType: + AuthMethodTypes.Fingerprint, + authenticateUser: (AuthMethodTypes + authMethodType, + isActive) => authenticateUser( - authMethodType, - isActive), + authMethodType, isActive), )), - ), + Expanded( + child: VerificationMethodsList( + authenticationViewModel: + authenticationViewModel, + authMethodType: + AuthMethodTypes.FaceID, + authenticateUser: (AuthMethodTypes + authMethodType, + isActive) => + authenticateUser( + authMethodType, isActive), + )) + ], + ) + : SizedBox(), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ Expanded( child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: - AuthMethodTypes.MoreOptions, - onShowMore: () { - setState(() { - isMoreOption = true; - }); - }, - )) - ]), - ]) - : Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - onlySMSBox == false - ? Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: - AuthMethodTypes.Fingerprint, - authenticateUser: - (AuthMethodTypes - authMethodType, - isActive) => - authenticateUser( - authMethodType, - isActive), - )), - Expanded( - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: - AuthMethodTypes.FaceID, - authenticateUser: - (AuthMethodTypes - authMethodType, - isActive) => - authenticateUser( - authMethodType, - isActive), - )) - ], - ) - : SizedBox(), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: AuthMethodTypes - .SMS, - authenticateUser: - ( - AuthMethodTypes authMethodType, - isActive) => - authenticateUser( - authMethodType, isActive), - )), - Expanded( - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: - AuthMethodTypes.WhatsApp, - authenticateUser: - ( - AuthMethodTypes authMethodType, - isActive) => - authenticateUser( - authMethodType, isActive), - )) - ], - ), - ]), + authenticationViewModel: + authenticationViewModel, + authMethodType: AuthMethodTypes.SMS, + authenticateUser: + (AuthMethodTypes authMethodType, + isActive) => + authenticateUser( + authMethodType, isActive), + )), + Expanded( + child: VerificationMethodsList( + authenticationViewModel: + authenticationViewModel, + authMethodType: + AuthMethodTypes.WhatsApp, + authenticateUser: + (AuthMethodTypes authMethodType, + isActive) => + authenticateUser( + authMethodType, isActive), + )) + ], + ), + ]), - // ) - ], - ), - ), - ], - ), + // ) + ], + ), + ], ), ), ), ), ), - bottomSheet: authenticationViewModel.user == null ? SizedBox(height: 0,) : Container( - height: 90, - width: double.infinity, - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - SecondaryButton( - label: TranslationBase - .of(context) - .useAnotherAccount, - color: Color(0xFFD02127), - //fontWeight: FontWeight.w700, - onTap: () { - authenticationViewModel.deleteUser(); - authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); - }, + bottomSheet: authenticationViewModel.user == null + ? SizedBox( + height: 0, + ) + : Container( + height: 90, + width: double.infinity, + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SecondaryButton( + label: + TranslationBase.of(context).useAnotherAccount ?? '', + color: Color(0xFFD02127), + //fontWeight: FontWeight.w700, + onTap: () { + authenticationViewModel.deleteUser(); + authenticationViewModel + .setAppStatus(APP_STATUS.UNAUTHENTICATED); + }, + ), + SizedBox( + height: 25, + ) + ], + ), ), - - SizedBox(height: 25,) - ], + ), ), - ), - ),), ); } @@ -428,13 +496,13 @@ class _VerificationMethodsScreenState extends State { authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.showMyDialog(context); - - await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType:authMethodType, password: authenticationViewModel.userInfo.password ); + await authenticationViewModel.sendActivationCodeForDoctorApp( + authMethodType: authMethodType, + password: authenticationViewModel.userInfo.password); if (authenticationViewModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast(authenticationViewModel.error); GifLoaderDialogUtils.hideDialog(context); } else { - GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType); } @@ -455,12 +523,14 @@ class _VerificationMethodsScreenState extends State { GifLoaderDialogUtils.hideDialog(context); Helpers.showErrorToast(authenticationViewModel.error); } else { - await sharedPref.setString(TOKEN, - authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); + await sharedPref.setString( + TOKEN, + authenticationViewModel + .activationCodeVerificationScreenRes.logInTokenID); if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); - this.startSMSService(authMethodType,isSilentLogin: true); + this.startSMSService(authMethodType, isSilentLogin: true); } else { checkActivationCode(isSilentLogin: true); } @@ -473,7 +543,7 @@ class _VerificationMethodsScreenState extends State { fingerPrintBefore = authMethodType; } this.selectedOption = - fingerPrintBefore != null ? fingerPrintBefore : authMethodType; + fingerPrintBefore != null ? fingerPrintBefore : authMethodType; switch (authMethodType) { case AuthMethodTypes.SMS: @@ -503,11 +573,13 @@ class _VerificationMethodsScreenState extends State { } } - startSMSService(AuthMethodTypes type,{isSilentLogin: false}) { + startSMSService(AuthMethodTypes type, {isSilentLogin: false}) { new SMSOTP( context, type, - authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile, + authenticationViewModel.loggedUser != null + ? authenticationViewModel.loggedUser.mobileNumber + : authenticationViewModel.user.mobile, (value) { showDialog( context: context, @@ -515,25 +587,26 @@ class _VerificationMethodsScreenState extends State { return AppLoaderWidget(); }); - this.checkActivationCode(value: value,isSilentLogin: isSilentLogin); + this.checkActivationCode(value: value, isSilentLogin: isSilentLogin); }, - () => - { + () => { print('Faild..'), }, ).displayDialog(context); } - loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, - isActive) async { + + loginWithFingerPrintOrFaceID( + AuthMethodTypes authMethodTypes, isActive) async { if (isActive) { await authenticationViewModel.showIOSAuthMessages(); if (!mounted) return; if (authenticationViewModel.user != null && (SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user.logInTypeID) == - AuthMethodTypes.Fingerprint || + authenticationViewModel.user.logInTypeID) == + AuthMethodTypes.Fingerprint || SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) { + authenticationViewModel.user.logInTypeID) == + AuthMethodTypes.FaceID)) { this.sendActivationCode(authMethodTypes); } else { setState(() { @@ -543,22 +616,19 @@ class _VerificationMethodsScreenState extends State { } } - checkActivationCode({String value,bool isSilentLogin = false}) async { - await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value,isSilentLogin: isSilentLogin); + checkActivationCode({String value, bool isSilentLogin = false}) async { + await authenticationViewModel.checkActivationCodeForDoctorApp( + activationCode: value, isSilentLogin: isSilentLogin); if (authenticationViewModel.state == ViewState.ErrorLocal) { Navigator.pop(context); Helpers.showErrorToast(authenticationViewModel.error); } else { await authenticationViewModel.onCheckActivationCodeSuccess(); - if(value !=null){ - if(Navigator.canPop(context)) - Navigator.pop(context); - } - if(Navigator.canPop(context)) - Navigator.pop(context); - navigateToLandingPage(); - - + if (value != null) { + if (Navigator.canPop(context)) Navigator.pop(context); + } + if (Navigator.canPop(context)) Navigator.pop(context); + navigateToLandingPage(); } } @@ -569,5 +639,4 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel.setAppStatus(APP_STATUS.AUTHENTICATED); } } - } diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index 8dd7ba65..d7513975 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -71,7 +71,7 @@ class CardWithBgWidget extends StatelessWidget { ), Container( padding: EdgeInsets.all(padding), - margin: EdgeInsets.only(left: marginLeft), + margin: EdgeInsets.only(left: !projectProvider.isArabic?marginLeft:0, right:projectProvider.isArabic?marginLeft:0 ), child: widget) ], ), From 5d20480e9b725748c72a131c6e92cf01e0cc3cc5 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 13:28:37 +0200 Subject: [PATCH 7/9] fix issues in home design --- lib/landing_page.dart | 19 +++++++---- lib/screens/home/home_screen.dart | 1 + lib/util/helpers.dart | 54 +++++++++++++++++-------------- 3 files changed, 44 insertions(+), 30 deletions(-) diff --git a/lib/landing_page.dart b/lib/landing_page.dart index cd9507fd..fcdb1eff 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; import 'package:doctor_app_flutter/screens/home/home_screen.dart'; @@ -11,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget. import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; class LandingPage extends StatefulWidget { @override @@ -36,6 +38,7 @@ class _LandingPageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( appBar: currentTab != 0 ? AppBar( @@ -53,12 +56,16 @@ class _LandingPageState extends State { : SizedBox(), leading: Builder( builder: (BuildContext context) { - return IconButton( - icon: SvgPicture.asset('assets/images/svgs/menu.svg', - height: 50, width: 50), - iconSize: 15, - color: Color(0xff2B353E), - onPressed: () => Scaffold.of(context).openDrawer(), + return Container( + width: 40, + margin: EdgeInsets.only(left: projectViewModel.isArabic? 0:20, right: projectViewModel.isArabic? 20:0), + child: IconButton( + icon: SvgPicture.asset('assets/images/svgs/menu.svg', + height: 25, width: 10), + iconSize: 15, + color: Color(0xff2B353E), + onPressed: () => Scaffold.of(context).openDrawer(), + ), ); }, ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 5cf849e8..a0b03656 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -85,6 +85,7 @@ class _HomeScreenState extends State { color: Colors.grey[100], padding: EdgeInsets.only(top: 10), child: Stack(children: [ + //TODO Elham* make it componet Container( width: 40, margin: EdgeInsets.only(left: projectsProvider.isArabic? 0:32, right: projectsProvider.isArabic? 23:0), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 6a3ca933..cdf45732 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -236,9 +236,6 @@ class Helpers { return parsedString; } - - - static InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, {Icon suffixIcon, Color dropDownColor}) { @@ -334,30 +331,46 @@ class Helpers { } static getBoxTabsBoxDecoration( - { - bool isFirst = false, + {bool isFirst = false, bool isMiddle = false, bool isLast = false, bool isActive = false, - double radius = 6.0 - }) { - return BoxDecoration( + double radius = 6.0}) { + return BoxDecoration( color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), shape: BoxShape.rectangle, borderRadius: BorderRadius.only( - topRight: Radius.circular(isActive?isFirst || isMiddle?radius:0:0), - bottomRight: Radius.circular(isActive?isFirst || isMiddle?radius:0:0), - topLeft: Radius.circular(isActive?isLast|| isMiddle?radius:0:0), - bottomLeft: Radius.circular(isActive?isLast || isMiddle?radius:0:0) - ), + topRight: Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0), + topLeft: Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0), + bottomRight: Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0), + bottomLeft: Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0)), ); } - static getBgTabColor(){ + static getBgTabColor() { return Color(0xFFEAEAEA); } - static getTabText({String title, bool isActive = false,}){ + static getTabText({ + String title, + bool isActive = false, + }) { return AppText( title, fontSize: SizeConfig.textMultiplier * 1.8, @@ -365,16 +378,14 @@ class Helpers { letterSpacing: -0.48, fontWeight: FontWeight.w600, ); - } - - static getTabHeight(BuildContext context){ + static getTabHeight(BuildContext context) { final screenSize = MediaQuery.of(context).size; return screenSize.height * 0.07; } - static getTabCounter({bool isActive: false,int counter}){ + static getTabCounter({bool isActive: false, int counter}) { return Container( margin: EdgeInsets.all(4), width: 15, @@ -396,8 +407,6 @@ class Helpers { ); } - - static String convertToTitleCase(String text) { if (text == null) { return null; @@ -424,7 +433,4 @@ class Helpers { // Join/Merge all words back to one String return capitalizedWords.join(' '); } - } - - From 74540f054a64be38e49a71b582900f98786aa768 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 13:39:04 +0200 Subject: [PATCH 8/9] fix sms pop up --- lib/widgets/auth/sms-popup.dart | 517 ++++++++++++++++++-------------- 1 file changed, 296 insertions(+), 221 deletions(-) diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 0c374e58..4e99d316 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -1,6 +1,5 @@ import 'dart:async'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/auth_method_types.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -9,6 +8,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; + class SMSOTP { final AuthMethodTypes type; final mobileNo; @@ -48,231 +48,307 @@ class SMSOTP { String displayTime = ''; bool isClosed = false; displayDialog(BuildContext context) async { + double dialogWidth = MediaQuery.of(context).size.width * 0.90; + double dialogInputWidth = (dialogWidth / 4) - + (SizeConfig.isWidthLarge + ? SizeConfig.getWidthMultiplier(width: dialogWidth) * 4.5 + : 20); + double dialogHeight = SizeConfig.isHeightVeryShort + ? MediaQuery.of(context).size.height * 0.50 + : MediaQuery.of(context).size.height * 0.40; return showDialog( - context: context, - barrierColor: Colors.black.withOpacity(0.7), - builder: (context) { - projectProvider = Provider.of(context); - return AlertDialog( - contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 0.0, 24.0), - content: StatefulBuilder(builder: (context, setState) { - if (displayTime == '') { - startTimer(setState); - } - return Container( - color: Colors.white, - height: MediaQuery.of(context).size.height * 0.50, - width: MediaQuery.of(context).size.width * 0.84, - child: Center( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(13), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - type == AuthMethodTypes.SMS - ? Padding( - child: Icon( - DoctorApp.verify_sms_1, - size: 50, - ), - padding: EdgeInsets.only(bottom: 20), - ) - : Padding( - child: Icon( - DoctorApp.verify_whtsapp, - size: 50, - ), - padding: EdgeInsets.only(bottom: 20), - ), + context: context, + builder: (ctx) => Center( + child: Container( + color: Colors.white, + height: dialogHeight, + width: dialogWidth, + child: Material( + color: Colors.white, + child: SingleChildScrollView( + child: Center( + child: Container( + color: Colors.white, + child: StatefulBuilder(builder: (context, setState) { + if (displayTime == '') { + startTimer(setState); + } + + return Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: SizeConfig.getHeightMultiplier( + height: dialogHeight) * + 2, + ), Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Padding( - padding: EdgeInsets.only( - left: 10, right: 10, bottom: 20), - child: IconButton( - icon: Icon(Icons.close), - iconSize: 40, - onPressed: () { - this.isClosed = true; - Navigator.pop(context); - this.onFailure(); - }, - )) - ], - ) - ])), - Padding( - padding: EdgeInsets.only(top: 5, right: 5), - child: AppText( - TranslationBase.of(context).verificationMessage + - ' XXXXXX' + - mobileNo - .toString() - .substring(mobileNo.toString().length - 3), - textAlign: TextAlign.start, - fontWeight: FontWeight.bold, - fontSize: 14, - maxLines: 2, - )), - Form( - key: verifyAccountForm, - child: Padding( - padding: EdgeInsets.only(top: 20), - child: Directionality( - textDirection: TextDirection.ltr, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: SizeConfig.realScreenWidth * 0.16, - margin: EdgeInsets.all(5), - child: TextFormField( - textInputAction: TextInputAction.next, - style: buildTextStyle(), - autofocus: true, - maxLength: 1, - controller: digit1, - textAlign: TextAlign.center, - keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), - onSaved: (val) {}, - validator: validateCodeDigit, - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD2); - }, - onChanged: (val) { - if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD2); - verifyAccountFormValue['digit1'] = - val.trim(); - checkValue(); - } - }, - ), - ), - Container( - width: SizeConfig.realScreenWidth * 0.16, - margin: EdgeInsets.all(5), - child: TextFormField( - focusNode: focusD2, - textInputAction: TextInputAction.next, - maxLength: 1, - controller: digit2, - textAlign: TextAlign.center, - style: buildTextStyle(), - keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), - onSaved: (val) {}, - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD3); - }, - onChanged: (val) { - if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD3); - verifyAccountFormValue['digit2'] = - val.trim(); - checkValue(); - } - }, - validator: validateCodeDigit), + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Icon( + type == AuthMethodTypes.SMS + ? DoctorApp.verify_sms_1 + : DoctorApp.verify_whtsapp, + size: SizeConfig.getHeightMultiplier( + height: dialogHeight) * + 9, + color: Color(0xFF2B353E), + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + IconButton( + icon: Icon(Icons.close), + color: Color(0xFF2B353E), + iconSize: + SizeConfig.getHeightMultiplier( + height: dialogHeight) * + 15, + onPressed: () { + this.isClosed = true; + Navigator.pop(context); + this.onFailure(); + }, + ) + ], + ) + ]), + SizedBox( + height: SizeConfig.getHeightMultiplier( + height: dialogHeight) * + (SizeConfig.isHeightVeryShort ? 10 : 5), + ), + Padding( + padding: EdgeInsets.only(top: 5, right: 5), + child: AppText( + TranslationBase.of(context) + .verificationMessage + + ' XXXXXX' + + mobileNo.toString().substring( + mobileNo.toString().length - 3), + textAlign: TextAlign.start, + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth( + width: dialogWidth) * + 3.5, //14, + maxLines: 2, + )), + Form( + key: verifyAccountForm, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.getHeightMultiplier( + height: dialogHeight) * + 2), + child: Directionality( + textDirection: TextDirection.ltr, + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Container( + width: dialogInputWidth, + height: + SizeConfig.getHeightMultiplier( + height: dialogHeight) * + 30, + margin: EdgeInsets.symmetric( + vertical: 2, horizontal: 5), + child: TextFormField( + textInputAction: + TextInputAction.next, + style: buildTextStyle(), + autofocus: true, + maxLength: 1, + controller: digit1, + textAlign: TextAlign.center, + keyboardType: + TextInputType.number, + decoration: + buildInputDecoration(context), + onSaved: (val) {}, + validator: validateCodeDigit, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD2); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD2); + verifyAccountFormValue[ + 'digit1'] = val.trim(); + checkValue(); + } + }, + ), + ), + Container( + width: dialogInputWidth, + height: + SizeConfig.getHeightMultiplier( + height: dialogHeight) * + 30, + margin: EdgeInsets.symmetric( + vertical: 2, horizontal: 5), + child: TextFormField( + focusNode: focusD2, + textInputAction: + TextInputAction.next, + maxLength: 1, + controller: digit2, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: + TextInputType.number, + decoration: + buildInputDecoration( + context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD3); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD3); + verifyAccountFormValue[ + 'digit2'] = val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit), + ), + Container( + margin: EdgeInsets.symmetric( + vertical: 2, horizontal: 5), + width: dialogInputWidth, + height: SizeConfig + .getHeightMultiplier( + height: + dialogHeight) * + 30, + child: TextFormField( + focusNode: focusD3, + textInputAction: + TextInputAction.next, + maxLength: 1, + controller: digit3, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: + TextInputType.number, + decoration: + buildInputDecoration( + context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus( + focusD4); + verifyAccountFormValue[ + 'digit3'] = + val.trim(); + checkValue(); + } + }, + validator: + validateCodeDigit)), + Container( + margin: EdgeInsets.symmetric( + vertical: 2, horizontal: 5), + width: dialogInputWidth, + height: SizeConfig + .getHeightMultiplier( + height: + dialogHeight) * + 30, + child: TextFormField( + focusNode: focusD4, + maxLength: 1, + textAlign: TextAlign.center, + style: buildTextStyle(), + controller: digit4, + keyboardType: + TextInputType.number, + decoration: + buildInputDecoration( + context), + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + verifyAccountFormValue[ + 'digit4'] = + val.trim(); + checkValue(); + } + }, + validator: + validateCodeDigit)), + ], + )), ), - Container( - margin: EdgeInsets.all(5), - width: SizeConfig.realScreenWidth * 0.16, - child: TextFormField( - focusNode: focusD3, - textInputAction: TextInputAction.next, - maxLength: 1, - controller: digit3, - textAlign: TextAlign.center, - style: buildTextStyle(), - keyboardType: TextInputType.number, - decoration: - buildInputDecoration(context), - onSaved: (val) {}, - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD4); - }, - onChanged: (val) { - if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD4); - verifyAccountFormValue['digit3'] = - val.trim(); - checkValue(); - } - }, - validator: validateCodeDigit)), - Container( - margin: EdgeInsets.all(5), - width: SizeConfig.realScreenWidth * 0.16, - child: TextFormField( - focusNode: focusD4, - maxLength: 1, - textAlign: TextAlign.center, - style: buildTextStyle(), - controller: digit4, - keyboardType: TextInputType.number, - decoration: - buildInputDecoration(context), - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD4); - }, - onChanged: (val) { - if (val.length == 1) { - verifyAccountFormValue['digit4'] = - val.trim(); - checkValue(); - } - }, - validator: validateCodeDigit)), - ], - )), - ), - ), - Padding( - padding: const EdgeInsets.all(12.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).validationMessage + - ' ', - fontWeight: FontWeight.w600, - fontSize: 14, - ), - AppText( - displayTime, - color: Colors.red, - textAlign: TextAlign.start, - fontWeight: FontWeight.bold, - fontSize: 14, - ) - ]), - ) - ], - ))), - ); - }), - ); - }); + ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .validationMessage + + ' ', + textAlign: TextAlign.start, + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth( + width: dialogWidth) * + 3.5, + ), + AppText( + displayTime, + color: Colors.red, + textAlign: TextAlign.start, + fontWeight: FontWeight.bold, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth( + width: dialogWidth) * + 3.5, + ) + ]) + ], + ), + ), + ); + })), + ), + ), + ), + ), + ), + ); } TextStyle buildTextStyle() { return TextStyle( - fontSize: SizeConfig.textMultiplier * 3, + fontSize: SizeConfig.textMultiplier * 2.5, ); } @@ -316,7 +392,6 @@ class SMSOTP { digit3.text.toString() + digit4.text.toString()); this.isClosed = true; - } } @@ -341,7 +416,7 @@ class SMSOTP { displayTime = this.getSecondsAsDigitalClock(this.remainingTime); }); - Future.delayed(Duration(seconds: 1), () { + Future.delayed(Duration(seconds: 1), () { if (this.remainingTime > 0) { if (isClosed == false) { startTimer(setState); From a578d92cb7a080ce2b874a362aa1adde7de01b71 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 15:25:50 +0200 Subject: [PATCH 9/9] fix the arabic issues --- .../doctor_replay/doctor_reply_screen.dart | 8 ++++-- .../In_patient/in_patient_screen.dart | 15 ++++++---- .../out_patient/out_patient_screen.dart | 14 ++++++---- .../referral/patient_referral_screen.dart | 10 +++++-- lib/util/helpers.dart | 28 +++++++++++++++---- 5 files changed, 53 insertions(+), 22 deletions(-) diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart index d30457b4..7957d4bd 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_repaly_chat.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -14,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'all_doctor_questions.dart'; import 'not_replaied_Doctor_Questions.dart'; @@ -139,11 +141,13 @@ class _DoctorReplyScreenState extends State Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1, bool isFirst = false, bool isMiddle = false, - bool isLast = false,context}) { + bool isLast = false,context, }) { + ProjectViewModel projectViewModel= Provider.of(context); + return Center( child: Container( height: Helpers.getTabHeight(context), - decoration: Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast), + decoration: Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast, projectViewModel: projectViewModel), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index ebb3118a..cadab9be 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -63,7 +63,6 @@ class _InPatientScreenState extends State Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; PatientSearchRequestModel requestModel = PatientSearchRequestModel(); - ProjectViewModel projectsProvider = Provider.of(context); return BaseView( onModelReady: (model) async { @@ -142,13 +141,13 @@ class _InPatientScreenState extends State // unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget(screenSize, _activeTab == 0, - TranslationBase.of(context).inPatientAll, + TranslationBase.of(context).inPatientAll,context: context, counter: model.inPatientList.length, isFirst: true), tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).myInPatientTitle, - counter: model.myIinPatientList.length, isMiddle: true), + counter: model.myIinPatientList.length, isMiddle: true, context: context,), tabWidget(screenSize, _activeTab == 2, - TranslationBase.of(context).discharged, isLast:true), + TranslationBase.of(context).discharged, isLast:true, context: context,), ], ), ), @@ -201,11 +200,15 @@ class _InPatientScreenState extends State {int counter = -1, bool isFirst = false, bool isMiddle = false, - bool isLast = false,}) { + bool isLast = false,BuildContext context}) { + + ProjectViewModel projectsProvider = Provider.of(context); + + return Center( child: Container( height: Helpers.getTabHeight(context), - decoration:Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast), + decoration:Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast,projectViewModel: projectsProvider), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 59601ea7..a43a4582 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -147,19 +147,21 @@ class _OutPatientsScreenState extends State { isFirst: _times.indexOf(item) == 0, isLast: _times.indexOf(item) == _times.length - 1, - isMiddle: _times.indexOf(item) != 0 && _times.indexOf(item) != _times.length - 1 - - ), + isMiddle: _times.indexOf(item) != 0 && + _times.indexOf(item) != _times.length - 1, + projectViewModel: projectsProvider), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Helpers.getTabText(title: item, isActive: _isActive), + Helpers.getTabText( + title: item, isActive: _isActive), _isActive && _activeLocation != 0 && model.state == ViewState.Idle - ? Helpers.getTabCounter(isActive:_isActive,counter: model.filterData.length) - + ? Helpers.getTabCounter( + isActive: _isActive, + counter: model.filterData.length) : Container(), ], ), diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 4dab4270..59e58198 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -1,6 +1,7 @@ import 'dart:ui'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -10,6 +11,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import '../../ReferralDischargedPatientPage.dart'; import 'my-referral-inpatient-screen.dart'; @@ -45,6 +47,8 @@ class _PatientReferralScreen extends State @override Widget build(BuildContext context) { + ProjectViewModel projectsProvider = Provider.of(context); + return AppScaffold( isShowAppBar: true, appBar: PatientSearchHeader( @@ -75,7 +79,7 @@ class _PatientReferralScreen extends State tabs: [ Container( decoration: Helpers.getBoxTabsBoxDecoration( - isActive: index == 0, isFirst: true), + isActive: index == 0, isFirst: true, projectViewModel:projectsProvider ), child: Center( child: Helpers.getTabText(title:TranslationBase.of(context).myReferredPatient, isActive:index == 0 ) ), @@ -83,7 +87,7 @@ class _PatientReferralScreen extends State Center( child: Container( decoration:Helpers.getBoxTabsBoxDecoration( - isActive: index == 1, isMiddle: true), + isActive: index == 1, isMiddle: true, projectViewModel:projectsProvider ), child: Center( child:Helpers.getTabText(title:TranslationBase.of(context).referral, isActive:index == 1 ) ), @@ -92,7 +96,7 @@ class _PatientReferralScreen extends State Center( child: Container( decoration:Helpers.getBoxTabsBoxDecoration( - isActive: index == 2, isLast: true), + isActive: index == 2, isLast: true, projectViewModel:projectsProvider ), child: Center( child: Helpers.getTabText(title:TranslationBase.of(context).discharged, isActive:index == 2 ), ), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index cdf45732..42816f9f 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -335,27 +335,45 @@ class Helpers { bool isMiddle = false, bool isLast = false, bool isActive = false, - double radius = 6.0}) { + double radius = 6.0, ProjectViewModel projectViewModel}) { return BoxDecoration( color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), shape: BoxShape.rectangle, borderRadius: BorderRadius.only( - topRight: Radius.circular(isActive + topRight: projectViewModel.isArabic?Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0):Radius.circular(isActive ? isFirst || isMiddle ? radius : 0 : 0), - topLeft: Radius.circular(isActive + + + topLeft: projectViewModel.isArabic? Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0):Radius.circular(isActive ? isLast || isMiddle ? radius : 0 : 0), - bottomRight: Radius.circular(isActive + bottomRight: projectViewModel.isArabic? Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0): Radius.circular(isActive ? isFirst || isMiddle ? radius : 0 : 0), - bottomLeft: Radius.circular(isActive + bottomLeft:projectViewModel.isArabic? Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0): Radius.circular(isActive ? isLast || isMiddle ? radius : 0