From 0747dfb1e00e5e659ff0ae10bd8be9cda2bf2594 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 6 Jun 2021 15:31:23 +0300 Subject: [PATCH 01/18] Migrate to flutter 2 --- lib/client/base_app_client.dart | 4 +- .../viewModel/authentication_view_model.dart | 4 +- lib/core/viewModel/dashboard_view_model.dart | 11 +- lib/root_page.dart | 11 +- .../AddVerifyMedicalReport.dart | 12 +- .../profile/vital_sign/LineChartCurved.dart | 8 +- .../shared/app_expandable_notifier_new.dart | 2 +- .../shared/text_fields/html_rich_editor.dart | 94 ++-- pubspec.lock | 450 +++++++++++------- pubspec.yaml | 60 +-- speech_to_text/example/pubspec.lock | 42 +- speech_to_text/pubspec.lock | 174 ++++--- speech_to_text/pubspec.yaml | 10 +- 13 files changed, 478 insertions(+), 404 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 10181bf4..7713eb3a 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -93,7 +93,7 @@ class BaseAppClient { var asd = json.encode(body); var asd2; if (await Helpers.checkConnection()) { - final response = await http.post(url, + final response = await http.post(Uri.parse(url), body: json.encode(body), headers: { 'Content-Type': 'application/json', @@ -219,7 +219,7 @@ class BaseAppClient { print("Body : ${json.encode(body)}"); if (await Helpers.checkConnection()) { - final response = await http.post(url.trim(), + final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final int statusCode = response.statusCode; print("statusCode :$statusCode"); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 58df9331..a5028266 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -65,7 +65,7 @@ class AuthenticationViewModel extends BaseViewModel { UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); List _availableBiometrics; - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; bool isLogin = false; bool unverified = false; @@ -357,7 +357,7 @@ class AuthenticationViewModel extends BaseViewModel { getDeviceInfoFromFirebase() async { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - _firebaseMessaging.requestNotificationPermissions(); + await _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); } try { diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index bbbef0b6..6f34f034 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -12,7 +12,7 @@ import 'authentication_view_model.dart'; import 'base_view_model.dart'; class DashboardViewModel extends BaseViewModel { - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; DashboardService _dashboardService = locator(); List get dashboardItemsList => @@ -28,13 +28,8 @@ class DashboardViewModel extends BaseViewModel { await projectsProvider.getDoctorClinicsList(); // _firebaseMessaging.setAutoInitEnabled(true); - _firebaseMessaging.requestNotificationPermissions( - const IosNotificationSettings( - sound: true, badge: true, alert: true, provisional: true)); - _firebaseMessaging.onIosSettingsRegistered - .listen((IosNotificationSettings settings) { - print("Settings registered: $settings"); - }); + _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); + _firebaseMessaging.getToken().then((String token) async { if (token != '') { diff --git a/lib/root_page.dart b/lib/root_page.dart index 35a3fa44..6b5eb09d 100644 --- a/lib/root_page.dart +++ b/lib/root_page.dart @@ -1,8 +1,6 @@ -import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -22,7 +20,9 @@ class RootPage extends StatelessWidget { ); break; case APP_STATUS.UNVERIFIED: - return VerificationMethodsScreen(password: null,); + return VerificationMethodsScreen( + password: null, + ); break; case APP_STATUS.UNAUTHENTICATED: return LoginScreen(); @@ -30,6 +30,11 @@ class RootPage extends StatelessWidget { case APP_STATUS.AUTHENTICATED: return LandingPage(); break; + default: + return Scaffold( + body: AppLoaderWidget(), + ); + break; } } diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index a3fa91e9..3eb3660d 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -21,6 +21,7 @@ class AddVerifyMedicalReport extends StatefulWidget { } class _AddVerifyMedicalReportState extends State { + HtmlEditorController _controller = HtmlEditorController(); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -55,12 +56,9 @@ class _AddVerifyMedicalReportState extends State { children: [ if (model.medicalReportTemplate.length > 0) HtmlRichEditor( - initialText: model - .medicalReportTemplate[0] - .templateTextHtml, - height: - MediaQuery.of(context).size.height * - 0.75, + initialText: model.medicalReportTemplate[0].templateTextHtml, + height: MediaQuery.of(context).size.height * 0.75, + controller: _controller, ), ], ), @@ -87,7 +85,7 @@ class _AddVerifyMedicalReportState extends State { fontWeight: FontWeight.w700, onPressed: () async { String txtOfMedicalReport = - await HtmlEditor.getText(); + await _controller.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart index 564c8c2c..7c766158 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -1,9 +1,9 @@ -import 'package:date_time_picker/date_time_picker.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; class LineChartCurved extends StatelessWidget { final String title; @@ -12,8 +12,8 @@ class LineChartCurved extends StatelessWidget { LineChartCurved({this.title, this.timeSeries, this.indexes}); - List xAxixs = List(); - List yAxixs = List(); + List xAxixs = []; + List yAxixs = []; // DateFormat format = DateFormat("yyyy-MM-dd"); DateFormat yearFormat = DateFormat("yyyy/MMM"); @@ -233,7 +233,7 @@ class LineChartCurved extends StatelessWidget { } List getData(context) { - List spots = List(); + List spots = []; isDatesSameYear = true; int previousDateYear = 0; for (int index = 0; index < timeSeries.length; index++) { diff --git a/lib/widgets/shared/app_expandable_notifier_new.dart b/lib/widgets/shared/app_expandable_notifier_new.dart index 848f5265..1e825b6c 100644 --- a/lib/widgets/shared/app_expandable_notifier_new.dart +++ b/lib/widgets/shared/app_expandable_notifier_new.dart @@ -58,7 +58,7 @@ class _AppExpandableNotifier extends State { scrollOnExpand: true, scrollOnCollapse: false, child: ExpandablePanel( - hasIcon: false, + // hasIcon: false, theme: const ExpandableThemeData( headerAlignment: ExpandablePanelHeaderAlignment.center, tapBodyToCollapse: true, diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart index 71359604..41cd0573 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -12,7 +12,16 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; import '../speech-text-popup.dart'; class HtmlRichEditor extends StatefulWidget { - HtmlRichEditor({ + final String hint; + final String initialText; + final double height; + final BoxDecoration decoration; + final bool darkMode; + final bool showBottomToolbar; + final List toolbar; + final HtmlEditorController controller; + + HtmlRichEditor({ key, this.hint = "Your text here...", this.initialText, @@ -21,15 +30,8 @@ class HtmlRichEditor extends StatefulWidget { this.darkMode = false, this.showBottomToolbar = false, this.toolbar, + @required this.controller, }) : super(key: key); - final String hint; - final String initialText; - final double height; - final BoxDecoration decoration; - final bool darkMode; - final bool showBottomToolbar; - final List toolbar; - @override _HtmlRichEditorState createState() => _HtmlRichEditorState(); @@ -40,7 +42,6 @@ class _HtmlRichEditorState extends State { stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); - @override void initState() { @@ -55,8 +56,6 @@ class _HtmlRichEditorState extends State { super.initState(); } - - @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -64,40 +63,35 @@ class _HtmlRichEditorState extends State { return Stack( children: [ HtmlEditor( - hint: widget.hint, - height: widget.height, - initialText: widget.initialText, - showBottomToolbar: widget.showBottomToolbar, - darkMode: widget.darkMode, - decoration: widget.decoration ?? - BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.all( - Radius.circular(30.0), - ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), - toolbar: widget.toolbar ?? - const [ - // Style(), - Font(buttons: [ - FontButtons.bold, - FontButtons.italic, - FontButtons.underline, - ]), - // ColorBar(buttons: [ColorButtons.color]), - Paragraph(buttons: [ - ParagraphButtons.ul, - ParagraphButtons.ol, - ParagraphButtons.paragraph - ]), - // Insert(buttons: [InsertButtons.link, InsertButtons.picture, InsertButtons.video, InsertButtons.table]), - // Misc(buttons: [MiscButtons.fullscreen, MiscButtons.codeview, MiscButtons.help]) - ], - ), + controller: widget.controller, + htmlToolbarOptions: HtmlToolbarOptions(defaultToolbarButtons: [ + StyleButtons(), + FontSettingButtons(), + FontButtons(), + // ColorButtons(), + ListButtons(), + ParagraphButtons(), + // InsertButtons(), + // OtherButtons(), + ]), + htmlEditorOptions: HtmlEditorOptions( + hint: widget.hint, + initialText: widget.initialText, + darkMode: widget.darkMode, + ), + otherOptions: OtherOptions( + height: widget.height, + decoration: widget.decoration ?? + BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.all( + Radius.circular(30.0), + ), + border: Border.all(color: Colors.grey[200], width: 0.5), + ), + )), Positioned( - top: - 50, //MediaQuery.of(context).size.height * 0, + top: 50, //MediaQuery.of(context).size.height * 0, right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, @@ -107,8 +101,7 @@ class _HtmlRichEditorState extends State { icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ], @@ -117,7 +110,6 @@ class _HtmlRichEditorState extends State { ); } - onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; @@ -150,15 +142,15 @@ class _HtmlRichEditorState extends State { ].request(); } - void resultListener(result)async { + void resultListener(result) async { recognizedWord = result.recognizedWords; event.setValue({"searchText": recognizedWord}); - String txt = await HtmlEditor.getText(); + String txt = await widget.controller.getText(); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - HtmlEditor.setText(txt+recognizedWord); + widget.controller.setText(txt + recognizedWord); }); } else { print(result.finalResult); diff --git a/pubspec.lock b/pubspec.lock index 77df9848..2ff9dca7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,35 +7,35 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "12.0.0" + version: "22.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.40.6" + version: "1.7.1" archive: dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted - version: "2.0.13" + version: "3.1.2" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.6.0" + version: "2.1.1" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.6.1" autocomplete_textfield: dependency: "direct main" description: @@ -56,355 +56,376 @@ packages: name: bazel_worker url: "https://pub.dartlang.org" source: hosted - version: "0.1.25" + version: "1.0.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" build: dependency: transitive description: name: build url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" + version: "2.0.2" build_config: dependency: transitive description: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "0.4.5" + version: "1.0.0" build_daemon: dependency: transitive description: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "2.1.7" + version: "3.0.0" build_modules: dependency: transitive description: name: build_modules url: "https://pub.dartlang.org" source: hosted - version: "3.0.4" + version: "4.0.0" build_resolvers: dependency: transitive description: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "1.5.3" + version: "2.0.3" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "1.11.1" + version: "2.0.4" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "6.1.7" + version: "7.0.0" build_web_compilers: dependency: "direct dev" description: name: build_web_compilers url: "https://pub.dartlang.org" source: hosted - version: "2.12.2" + version: "3.0.0" built_collection: dependency: transitive description: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "4.3.2" + version: "5.0.0" built_value: dependency: transitive description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "7.1.0" + version: "8.0.6" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" charts_common: dependency: transitive description: name: charts_common url: "https://pub.dartlang.org" source: hosted - version: "0.9.0" + version: "0.10.0" charts_flutter: dependency: "direct main" description: name: charts_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.9.0" + version: "0.10.0" checked_yaml: dependency: transitive description: name: checked_yaml url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" chewie: dependency: transitive description: name: chewie url: "https://pub.dartlang.org" source: hosted - version: "0.9.10" + version: "1.2.0" chewie_audio: dependency: transitive description: name: chewie_audio url: "https://pub.dartlang.org" source: hosted - version: "1.0.0+1" + version: "1.2.0" cli_util: dependency: transitive description: name: cli_util url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.3.0" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" code_builder: dependency: transitive description: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "3.7.0" + version: "4.0.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" connectivity: dependency: "direct main" description: name: connectivity url: "https://pub.dartlang.org" source: hosted - version: "0.4.9+5" + version: "3.0.6" connectivity_for_web: dependency: transitive description: name: connectivity_for_web url: "https://pub.dartlang.org" source: hosted - version: "0.3.1+4" + version: "0.4.0" connectivity_macos: dependency: transitive description: name: connectivity_macos url: "https://pub.dartlang.org" source: hosted - version: "0.1.0+7" + version: "0.2.0" connectivity_platform_interface: dependency: transitive description: name: connectivity_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.6" + version: "2.0.1" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "3.0.0" 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" + version: "3.0.1" csslib: dependency: transitive description: name: csslib url: "https://pub.dartlang.org" source: hosted - version: "0.16.2" + version: "0.17.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "1.0.3" dart_style: dependency: transitive description: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "1.3.10" + version: "2.0.1" date_time_picker: dependency: "direct main" description: name: date_time_picker url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "2.0.0" device_info: dependency: "direct main" description: name: device_info url: "https://pub.dartlang.org" source: hosted - version: "0.4.2+10" + version: "2.0.2" device_info_platform_interface: dependency: transitive description: name: device_info_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.1" dropdown_search: dependency: "direct main" description: name: dropdown_search url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.6.1" equatable: dependency: transitive description: name: equatable url: "https://pub.dartlang.org" source: hosted - version: "1.2.6" + version: "2.0.2" eva_icons_flutter: dependency: "direct main" description: name: eva_icons_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "3.0.0" expandable: dependency: "direct main" description: name: expandable url: "https://pub.dartlang.org" source: hosted - version: "4.1.4" + version: "5.0.1" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" ffi: dependency: transitive description: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "1.1.2" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "5.2.1" + version: "6.1.1" + file_picker: + dependency: transitive + description: + name: file_picker + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2+2" firebase_core: dependency: transitive description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "0.5.3" + version: "1.2.1" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "4.0.1" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "0.2.1+1" + version: "1.1.0" firebase_messaging: dependency: "direct main" description: name: firebase_messaging url: "https://pub.dartlang.org" source: hosted - version: "7.0.3" + version: "10.0.1" + firebase_messaging_platform_interface: + dependency: transitive + description: + name: firebase_messaging_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + firebase_messaging_web: + dependency: transitive + description: + name: firebase_messaging_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" fixnum: dependency: transitive description: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "0.10.11" + version: "1.0.0" fl_chart: dependency: "direct main" description: name: fl_chart url: "https://pub.dartlang.org" source: hosted - version: "0.12.3" + version: "0.36.1" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_colorpicker: + dependency: transitive + description: + name: flutter_colorpicker + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" flutter_device_type: dependency: "direct main" description: name: flutter_device_type url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.4.0" flutter_flexible_toast: dependency: "direct main" description: @@ -425,19 +446,54 @@ packages: name: flutter_html url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "2.1.0" flutter_inappwebview: dependency: transitive description: name: flutter_inappwebview url: "https://pub.dartlang.org" source: hosted - version: "4.0.0+4" + version: "5.3.2" + flutter_keyboard_visibility: + dependency: transitive + description: + name: flutter_keyboard_visibility + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.2" + flutter_keyboard_visibility_platform_interface: + dependency: transitive + description: + name: flutter_keyboard_visibility_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_web: + dependency: transitive + description: + name: flutter_keyboard_visibility_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_layout_grid: + dependency: transitive + description: + name: flutter_layout_grid + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" flutter_localizations: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_math_fork: + dependency: transitive + description: + name: flutter_math_fork + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.3" flutter_page_indicator: dependency: transitive description: @@ -451,21 +507,21 @@ packages: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "1.0.11" + version: "2.0.2" flutter_staggered_grid_view: dependency: "direct main" description: name: flutter_staggered_grid_view url: "https://pub.dartlang.org" source: hosted - version: "0.3.4" + version: "0.4.0" flutter_svg: dependency: transitive description: name: flutter_svg url: "https://pub.dartlang.org" source: hosted - version: "0.18.1" + version: "0.22.0" flutter_swiper: dependency: "direct main" description: @@ -489,77 +545,84 @@ packages: name: font_awesome_flutter url: "https://pub.dartlang.org" source: hosted - version: "8.12.0" + version: "9.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" get_it: dependency: "direct main" description: name: get_it url: "https://pub.dartlang.org" source: hosted - version: "4.0.4" + version: "7.1.3" glob: dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "2.0.1" graphs: dependency: transitive description: name: graphs url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "2.0.0" hexcolor: dependency: "direct main" description: name: hexcolor url: "https://pub.dartlang.org" source: hosted - version: "1.0.6" + version: "2.0.4" html: dependency: "direct main" description: name: html url: "https://pub.dartlang.org" source: hosted - version: "0.14.0+4" + version: "0.15.0" html_editor_enhanced: dependency: "direct main" description: name: html_editor_enhanced url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "2.1.1" http: dependency: "direct main" description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.12.2" + version: "0.13.3" http_interceptor: dependency: "direct main" description: name: http_interceptor url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.4.1" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "3.0.1" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "3.1.4" + version: "4.0.0" imei_plugin: dependency: "direct main" description: @@ -567,216 +630,223 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + infinite_listview: + dependency: transitive + description: + name: infinite_listview + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" intl: dependency: "direct main" description: name: intl url: "https://pub.dartlang.org" source: hosted - version: "0.16.1" + version: "0.17.0" io: dependency: transitive description: name: io url: "https://pub.dartlang.org" source: hosted - version: "0.3.5" + version: "1.0.0" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.3" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "3.1.1" + version: "4.0.1" local_auth: dependency: "direct main" description: name: local_auth url: "https://pub.dartlang.org" source: hosted - version: "0.6.3+4" + version: "1.1.6" logging: dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.4" + version: "1.0.1" maps_launcher: dependency: "direct main" description: name: maps_launcher url: "https://pub.dartlang.org" source: hosted - version: "1.2.2+2" + version: "2.0.0" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" mime: dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted - version: "0.9.7" + version: "1.0.0" 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: + version: "1.0.0" + numberpicker: dependency: transitive description: - name: node_io + name: numberpicker url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" - open_iconic_flutter: + version: "2.1.1" + numerus: dependency: transitive description: - name: open_iconic_flutter + name: numerus url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "1.1.1" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "2.0.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" path_drawing: dependency: transitive description: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.4.1+1" + version: "0.5.1" path_parsing: dependency: transitive description: name: path_parsing url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.2.1" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+2" + version: "2.0.0" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.4+3" + version: "2.0.1" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.11.0" percent_indicator: dependency: "direct main" description: name: percent_indicator url: "https://pub.dartlang.org" source: hosted - version: "2.1.9+1" + version: "3.0.1" permission_handler: dependency: "direct main" description: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "5.1.0+2" + version: "8.0.1" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.5.1" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "4.1.0" platform: dependency: transitive description: name: platform url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "3.0.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "2.0.0" + pointer_interceptor: + dependency: transitive + description: + name: pointer_interceptor + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0+1" pool: dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.5.0" process: dependency: transitive description: name: process url: "https://pub.dartlang.org" source: hosted - version: "3.0.13" + version: "4.2.1" progress_hud_v2: dependency: "direct main" description: @@ -790,105 +860,98 @@ packages: name: protobuf url: "https://pub.dartlang.org" source: hosted - version: "1.1.3" + version: "2.0.0" provider: dependency: "direct main" description: name: provider url: "https://pub.dartlang.org" source: hosted - version: "4.3.3" + version: "5.0.0" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.4" + version: "2.0.0" pubspec_parse: dependency: transitive description: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "0.1.8" + version: "1.0.0" quiver: dependency: transitive description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "3.0.1" 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" + version: "1.0.0" shared_preferences: dependency: "direct main" description: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "0.5.12+4" + version: "2.0.6" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.2+4" + version: "2.0.0" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+11" + version: "2.0.0" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.2+7" + version: "2.0.0" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.2+3" + version: "2.0.0" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "0.7.9" + version: "1.1.4" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "0.2.4+1" + version: "1.0.1" sky_engine: dependency: transitive description: flutter @@ -900,14 +963,14 @@ packages: name: source_maps url: "https://pub.dartlang.org" source: hosted - version: "0.10.9" + version: "0.10.10" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.1" speech_to_text: dependency: "direct main" description: @@ -921,56 +984,56 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" sticky_headers: dependency: "direct main" description: name: sticky_headers url: "https://pub.dartlang.org" source: hosted - version: "0.1.8+1" + version: "0.2.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.3.0" timing: dependency: transitive description: name: timing url: "https://pub.dartlang.org" source: hosted - version: "0.1.1+3" + version: "1.0.0" transformer_page_view: dependency: transitive description: @@ -978,146 +1041,181 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.6" + tuple: + dependency: transitive + description: + name: tuple + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" url_launcher: dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "5.7.10" + version: "6.0.6" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+4" + version: "2.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+9" + version: "2.0.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.9" + version: "2.0.3" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.5+3" + version: "2.0.1" 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" + version: "2.0.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" video_player: dependency: transitive description: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "0.10.12+5" + version: "2.1.5" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "4.1.0" video_player_web: dependency: transitive description: name: video_player_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.4+1" + version: "2.0.1" + visibility_detector: + dependency: transitive + description: + name: visibility_detector + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" wakelock: dependency: transitive description: name: wakelock url: "https://pub.dartlang.org" source: hosted - version: "0.1.4+2" + version: "0.5.2" + wakelock_macos: + dependency: transitive + description: + name: wakelock_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0+1" + wakelock_platform_interface: + dependency: transitive + description: + name: wakelock_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1+1" + wakelock_web: + dependency: transitive + description: + name: wakelock_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0+1" + wakelock_windows: + dependency: transitive + description: + name: wakelock_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "0.9.7+15" + version: "1.0.0" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "2.1.0" webview_flutter: dependency: transitive description: name: webview_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.3.24" + version: "2.0.8" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "1.7.4+1" + version: "2.1.3" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.1.2" + version: "0.2.0" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted - version: "4.5.1" + version: "5.1.2" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "3.1.0" sdks: - dart: ">=2.10.0 <2.11.0" - flutter: ">=1.22.0 <2.0.0" + dart: ">=2.13.0 <3.0.0" + flutter: ">=2.2.0" diff --git a/pubspec.yaml b/pubspec.yaml index 973e8800..ac0e78c3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,67 +24,67 @@ environment: dependencies: flutter: sdk: flutter - hexcolor: ^1.0.1 + hexcolor: ^2.0.4 flutter_localizations: sdk: flutter - flutter_device_type: ^0.2.0 - intl: ^0.16.0 - http: ^0.12.0+4 - provider: ^4.0.5+1 - shared_preferences: ^0.5.6+3 - imei_plugin: ^1.1.6 + flutter_device_type: ^0.4.0 + intl: ^0.17.0 + http: ^0.13.0 + provider: ^5.0.0 + shared_preferences: ^2.0.6 + imei_plugin: ^1.2.0 flutter_flexible_toast: ^0.1.4 - local_auth: ^0.6.1+3 - http_interceptor: ^0.2.0 + local_auth: ^1.1.6 + http_interceptor: ^0.4.1 progress_hud_v2: ^2.0.0 - connectivity: ^0.4.8+2 - maps_launcher: ^1.2.0 - url_launcher: ^5.4.5 - charts_flutter: ^0.9.0 + connectivity: ^3.0.6 + maps_launcher: ^2.0.0 + url_launcher: ^6.0.6 + charts_flutter: ^0.10.0 flutter_swiper: ^1.1.6 #Icons - eva_icons_flutter: ^2.0.0 - font_awesome_flutter: ^8.11.0 - dropdown_search: ^0.4.8 - flutter_staggered_grid_view: ^0.3.2 + eva_icons_flutter: ^3.0.0 + font_awesome_flutter: ^9.0.0 + dropdown_search: ^0.6.1 + flutter_staggered_grid_view: ^0.4.0 - expandable: ^4.1.4 + expandable: ^5.0.1 # Qr code Scanner barcode_scan_fix: ^1.0.2 # permissions - permission_handler: ^5.0.0+hotfix.3 - device_info: ^0.4.2+4 + permission_handler: ^8.0.1 + device_info: ^2.0.2 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.2 + cupertino_icons: ^1.0.3 # SVG #flutter_svg: ^0.17.4 - percent_indicator: ^2.1.1 + percent_indicator: ^3.0.1 #Dependency Injection - get_it: ^4.0.2 + get_it: ^7.1.3 #chart - fl_chart: ^0.12.1 + fl_chart: ^0.36.1 # Firebase - firebase_messaging: ^7.0.3 + firebase_messaging: ^10.0.1 #GIF image flutter_gifimage: ^1.0.1 #Autocomplete TextField autocomplete_textfield: ^1.7.3 - date_time_picker: ^1.1.1 + date_time_picker: ^2.0.0 # Html - html: ^0.14.0+4 + html: ^0.15.0 # Flutter Html View - flutter_html: 1.0.2 - sticky_headers: "^0.1.8" + flutter_html: ^2.1.0 + sticky_headers: ^0.2.0 #speech to text speech_to_text: @@ -93,7 +93,7 @@ dependencies: # Html Editor Enhanced - html_editor_enhanced: ^1.3.0 + html_editor_enhanced: ^2.1.1 dev_dependencies: flutter_test: diff --git a/speech_to_text/example/pubspec.lock b/speech_to_text/example/pubspec.lock index 6809f75f..1538589c 100644 --- a/speech_to_text/example/pubspec.lock +++ b/speech_to_text/example/pubspec.lock @@ -7,42 +7,42 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.6.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" flutter: dependency: "direct main" description: flutter @@ -73,21 +73,21 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "4.0.1" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" nested: dependency: transitive description: @@ -101,7 +101,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" permission_handler: dependency: "direct main" description: @@ -141,7 +141,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.1" speech_to_text: dependency: "direct dev" description: @@ -155,49 +155,49 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.3.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" sdks: - dart: ">=2.10.0-110 <2.11.0" - flutter: ">=1.16.0 <2.0.0" + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.16.0" diff --git a/speech_to_text/pubspec.lock b/speech_to_text/pubspec.lock index efc63cc7..95b0d050 100644 --- a/speech_to_text/pubspec.lock +++ b/speech_to_text/pubspec.lock @@ -7,175 +7,182 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "22.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.39.13" + version: "1.7.1" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.6.0" + version: "2.1.1" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.6.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" build: dependency: transitive description: name: build url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "2.0.2" build_config: dependency: transitive description: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "1.0.0" build_daemon: dependency: transitive description: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "3.0.0" build_resolvers: dependency: transitive description: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "1.3.10" + version: "2.0.3" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "1.10.0" + version: "2.0.4" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "5.2.0" + version: "7.0.0" built_collection: dependency: transitive description: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "4.3.2" + version: "5.0.0" built_value: dependency: transitive description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "7.1.0" + version: "8.0.6" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" checked_yaml: dependency: transitive description: name: checked_yaml url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "2.0.1" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" clock: dependency: "direct main" description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" code_builder: dependency: transitive description: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "3.4.0" + version: "4.0.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "3.0.0" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.1" + version: "3.0.1" dart_style: dependency: transitive description: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "1.3.6" + version: "2.0.1" fake_async: dependency: "direct dev" description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.1" fixnum: dependency: transitive description: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "0.10.11" + version: "1.0.0" flutter: dependency: "direct main" description: flutter @@ -186,174 +193,153 @@ packages: description: flutter source: sdk version: "0.0.0" - glob: + frontend_server_client: dependency: transitive description: - name: glob + name: frontend_server_client url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" - graphs: + version: "2.1.0" + glob: dependency: transitive description: - name: graphs + name: glob url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" - html: + version: "2.0.1" + graphs: dependency: transitive description: - name: html + name: graphs url: "https://pub.dartlang.org" source: hosted - version: "0.14.0+3" + version: "2.0.0" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "3.0.1" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "3.1.4" + version: "4.0.0" io: dependency: transitive description: name: io url: "https://pub.dartlang.org" source: hosted - version: "0.3.4" + version: "1.0.0" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3" json_annotation: dependency: "direct main" description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "4.0.1" json_serializable: dependency: "direct dev" description: name: json_serializable url: "https://pub.dartlang.org" source: hosted - version: "3.3.0" + version: "4.1.3" logging: dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.4" + version: "1.0.1" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" mime: dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted - version: "0.9.6+3" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - node_io: - dependency: transitive - description: - name: node_io - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" + version: "1.0.0" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "2.0.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.9.0" + version: "1.11.0" pool: dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.5.0" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.4" + version: "2.0.0" pubspec_parse: dependency: transitive description: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "0.1.5" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" + version: "1.0.0" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "0.7.7" + version: "1.1.4" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "0.2.3" + version: "1.0.1" sky_engine: dependency: transitive description: flutter @@ -365,98 +351,98 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "0.9.6" + version: "1.0.1" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.1" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.3.0" timing: dependency: transitive description: name: timing url: "https://pub.dartlang.org" source: hosted - version: "0.1.1+2" + version: "1.0.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "0.9.7+15" + version: "1.0.0" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "2.1.0" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "3.1.0" sdks: - dart: ">=2.10.0-110 <2.11.0" + dart: ">=2.12.0 <3.0.0" flutter: ">=1.10.0" diff --git a/speech_to_text/pubspec.yaml b/speech_to_text/pubspec.yaml index 34b3da29..a40fe1ec 100644 --- a/speech_to_text/pubspec.yaml +++ b/speech_to_text/pubspec.yaml @@ -10,15 +10,15 @@ environment: dependencies: flutter: sdk: flutter - json_annotation: ^3.0.0 - clock: ^1.0.1 + json_annotation: ^4.0.1 + clock: ^1.1.0 dev_dependencies: flutter_test: sdk: flutter - build_runner: ^1.0.0 - json_serializable: ^3.0.0 - fake_async: ^1.0.1 + build_runner: ^2.0.4 + json_serializable: ^4.1.3 + fake_async: ^1.2.0 flutter: plugin: From d784310c8247d32721973dfcf6f573b08fb9bde5 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 6 Jun 2021 18:02:23 +0300 Subject: [PATCH 02/18] Migrate models to flutter 2 --- lib/client/base_app_client.dart | 40 ++- lib/config/size_config.dart | 22 +- .../admissionRequest/admission-request.dart | 94 +++---- .../model/admissionRequest/clinic-model.dart | 21 +- .../model/admissionRequest/ward-model.dart | 8 +- .../model/auth/activation_Code_req_model.dart | 21 +- ...on_code_for_verification_screen_model.dart | 27 +- ...on_code_for_doctor_app_response_model.dart | 110 ++++---- .../check_activation_code_request_model.dart | 29 +- lib/core/model/auth/imei_details.dart | 59 ++-- lib/core/model/auth/insert_imei_model.dart | 66 ++--- .../new_login_information_response_model.dart | 46 ++-- ...on_code_for_doctor_app_response_model.dart | 8 +- .../get_hospitals_request_model.dart | 18 +- .../get_hospitals_response_model.dart | 6 +- .../model/insurance/insurance_approval.dart | 66 ++--- .../insurance_approval_in_patient_model.dart | 118 ++++---- lib/core/model/labs/LabOrderResult.dart | 30 +- lib/core/model/labs/lab_result.dart | 71 +++-- lib/core/model/labs/patient_lab_orders.dart | 72 ++--- .../labs/patient_lab_special_result.dart | 10 +- .../labs/request_patient_lab_orders.dart | 26 +- .../request_patient_lab_special_result.dart | 36 +-- .../labs/request_send_lab_report_email.dart | 98 +++---- ...dingPatientERForDoctorAppRequestModel.dart | 6 +- .../medical_report/medical_file_model.dart | 258 +++++++++--------- .../medical_file_request_model.dart | 6 +- .../patient-admission-request-service.dart | 1 + lib/models/doctor/doctor_profile_model.dart | 2 +- pubspec.yaml | 2 +- 30 files changed, 690 insertions(+), 687 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 7713eb3a..f083258d 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -18,9 +18,9 @@ Helpers helpers = new Helpers(); class BaseAppClient { //TODO change the post fun to nun static when you change all service post(String endPoint, - {Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, + {required Map body, + required Function(dynamic response, int statusCode) onSuccess, + required Function(String error, int statusCode) onFailure, bool isAllowAny = false,bool isLiveCare = false}) async { String url; if(isLiveCare) @@ -30,22 +30,20 @@ class BaseAppClient { bool callLog = true; try { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); - if (profile != null) { - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) - body['DoctorID'] = doctorProfile?.doctorID; - if (body['DoctorID'] == "") body['DoctorID'] = null; - if (body['EditedBy'] == null) - body['EditedBy'] = doctorProfile?.doctorID; - if (body['ProjectID'] == null) { - body['ProjectID'] = doctorProfile?.projectID; - } - - if (body['ClinicID'] == null) - body['ClinicID'] = doctorProfile?.clinicID; + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + if (body['DoctorID'] == null) + body['DoctorID'] = doctorProfile?.doctorID; + if (body['DoctorID'] == "") body['DoctorID'] = null; + if (body['EditedBy'] == null) + body['EditedBy'] = doctorProfile?.doctorID; + if (body['ProjectID'] == null) { + body['ProjectID'] = doctorProfile?.projectID; } + + if (body['ClinicID'] == null) + body['ClinicID'] = doctorProfile?.clinicID; if (body['DoctorID'] == '') { body['DoctorID'] = null; } @@ -140,10 +138,10 @@ class BaseAppClient { } postPatient(String endPoint, - {Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - @required PatiantInformtion patient, + {required Map body, + required Function(dynamic response, int statusCode) onSuccess, + required Function(String error, int statusCode) onFailure, + required PatiantInformtion patient, bool isExternal = false}) async { String url = BASE_URL + endPoint; diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 6b996b3f..06dc3cda 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -5,14 +5,14 @@ class SizeConfig { static double _blockWidth = 0; static double _blockHeight = 0; - static double realScreenWidth; - static double realScreenHeight; - static double screenWidth; - static double screenHeight; - static double textMultiplier; - static double imageSizeMultiplier; - static double heightMultiplier; - static double widthMultiplier; + static double ? realScreenWidth; + static double ? realScreenHeight; + static double ? screenWidth; + static double ? screenHeight; + static double ? textMultiplier; + static double ? imageSizeMultiplier; + static double ? heightMultiplier; + static double ? widthMultiplier; static bool isPortrait = true; static bool isMobilePortrait = false; @@ -28,7 +28,7 @@ class SizeConfig { } if (orientation == Orientation.portrait) { isPortrait = true; - if (realScreenWidth < 450) { + if (realScreenWidth! < 450) { isMobilePortrait = true; } // textMultiplier = _blockHeight; @@ -43,8 +43,8 @@ class SizeConfig { screenHeight = realScreenWidth; screenWidth = realScreenHeight; } - _blockWidth = screenWidth / 100; - _blockHeight = screenHeight / 100; + _blockWidth = (screenWidth! / 100); + _blockHeight = (screenHeight! / 100)!; textMultiplier = _blockHeight; imageSizeMultiplier = _blockWidth; diff --git a/lib/core/model/admissionRequest/admission-request.dart b/lib/core/model/admissionRequest/admission-request.dart index 1ab5a990..5cf56e8e 100644 --- a/lib/core/model/admissionRequest/admission-request.dart +++ b/lib/core/model/admissionRequest/admission-request.dart @@ -1,48 +1,48 @@ class AdmissionRequest { - int patientMRN; - int admitToClinic; - bool isPregnant; - int pregnancyWeeks; - int pregnancyType; - int noOfBabies; - int mrpDoctorID; - String admissionDate; - int expectedDays; - int admissionType; - int admissionLocationID; - int roomCategoryID; - int wardID; - bool isSickLeaveRequired; - String sickLeaveComments; - bool isTransport; - String transportComments; - bool isPhysioAppointmentNeeded; - String physioAppointmentComments; - bool isOPDFollowupAppointmentNeeded; - String opdFollowUpComments; - bool isDietType; - int dietType; - String dietRemarks; - bool isPhysicalActivityModification; - String physicalActivityModificationComments; - int orStatus; - String mainLineOfTreatment; - int estimatedCost; - String elementsForImprovement; - bool isPackagePatient; - String complications; - String otherDepartmentInterventions; - String otherProcedures; - String pastMedicalHistory; - String pastSurgicalHistory; - List admissionRequestDiagnoses; - List admissionRequestProcedures; - int appointmentNo; - int episodeID; - int admissionRequestNo; + late int patientMRN; + late int? admitToClinic; + late bool? isPregnant; + late int pregnancyWeeks; + late int pregnancyType; + late int noOfBabies; + late int? mrpDoctorID; + late String? admissionDate; + late int? expectedDays; + late int? admissionType; + late int admissionLocationID; + late int roomCategoryID; + late int? wardID; + late bool? isSickLeaveRequired; + late String sickLeaveComments; + late bool isTransport; + late String transportComments; + late bool isPhysioAppointmentNeeded; + late String physioAppointmentComments; + late bool isOPDFollowupAppointmentNeeded; + late String opdFollowUpComments; + late bool? isDietType; + late int? dietType; + late String? dietRemarks; + late bool isPhysicalActivityModification; + late String physicalActivityModificationComments; + late int orStatus; + late String? mainLineOfTreatment; + late int? estimatedCost; + late String? elementsForImprovement; + late bool isPackagePatient; + late String complications; + late String otherDepartmentInterventions; + late String otherProcedures; + late String pastMedicalHistory; + late String pastSurgicalHistory; + late List? admissionRequestDiagnoses; + late List? admissionRequestProcedures; + late int? appointmentNo; + late int? episodeID; + late int? admissionRequestNo; AdmissionRequest( - {this.patientMRN, + {required this.patientMRN, this.admitToClinic, this.isPregnant, this.pregnancyWeeks = 0, @@ -123,17 +123,17 @@ class AdmissionRequest { pastMedicalHistory = json['pastMedicalHistory']; pastSurgicalHistory = json['pastSurgicalHistory']; if (json['admissionRequestDiagnoses'] != null) { - admissionRequestDiagnoses = new List(); + admissionRequestDiagnoses = []; json['admissionRequestDiagnoses'].forEach((v) { - admissionRequestDiagnoses.add(v); + admissionRequestDiagnoses!.add(v); // admissionRequestDiagnoses // .add(new AdmissionRequestDiagnoses.fromJson(v)); }); } if (json['admissionRequestProcedures'] != null) { - admissionRequestProcedures = new List(); + admissionRequestProcedures = []; json['admissionRequestProcedures'].forEach((v) { - admissionRequestProcedures.add(v); + admissionRequestProcedures!.add(v); // admissionRequestProcedures // .add(new AdmissionRequestProcedures.fromJson(v)); }); @@ -190,7 +190,7 @@ class AdmissionRequest { } if (this.admissionRequestProcedures != null) { data['admissionRequestProcedures'] = - this.admissionRequestProcedures.map((v) => v.toJson()).toList(); + this.admissionRequestProcedures!.map((v) => v.toJson()).toList(); } data['appointmentNo'] = this.appointmentNo; data['episodeID'] = this.episodeID; diff --git a/lib/core/model/admissionRequest/clinic-model.dart b/lib/core/model/admissionRequest/clinic-model.dart index 05d34645..e5a03264 100644 --- a/lib/core/model/admissionRequest/clinic-model.dart +++ b/lib/core/model/admissionRequest/clinic-model.dart @@ -1,16 +1,16 @@ class Clinic { - int clinicGroupID; - String clinicGroupName; - int clinicID; - String clinicNameArabic; - String clinicNameEnglish; + late int? clinicGroupID; + late String? clinicGroupName; + late int? clinicID; + late String? clinicNameArabic; + late String? clinicNameEnglish; Clinic( {this.clinicGroupID, - this.clinicGroupName, - this.clinicID, - this.clinicNameArabic, - this.clinicNameEnglish}); + this.clinicGroupName, + this.clinicID, + this.clinicNameArabic, + this.clinicNameEnglish}); Clinic.fromJson(Map json) { clinicGroupID = json['clinicGroupID']; @@ -29,5 +29,4 @@ class Clinic { data['clinicNameEnglish'] = this.clinicNameEnglish; return data; } - -} \ No newline at end of file +} diff --git a/lib/core/model/admissionRequest/ward-model.dart b/lib/core/model/admissionRequest/ward-model.dart index 606758d3..8f7b9fe5 100644 --- a/lib/core/model/admissionRequest/ward-model.dart +++ b/lib/core/model/admissionRequest/ward-model.dart @@ -1,9 +1,9 @@ class WardModel{ - String description; - String descriptionN; - int floorID; - bool isActive; + late String ? description; + late String ? descriptionN; + late int ? floorID; + late bool ? isActive; WardModel( {this.description, this.descriptionN, this.floorID, this.isActive}); diff --git a/lib/core/model/auth/activation_Code_req_model.dart b/lib/core/model/auth/activation_Code_req_model.dart index 1a9510e8..1ef02c02 100644 --- a/lib/core/model/auth/activation_Code_req_model.dart +++ b/lib/core/model/auth/activation_Code_req_model.dart @@ -1,14 +1,15 @@ class ActivationCodeModel { - String mobileNumber; - String zipCode; - int channel; - int languageID; - double versionID; - int memberID; - String password; - int facilityId; - String generalid; - String otpSendType; + late String? mobileNumber; + late String? zipCode; + late int? channel; + late int? languageID; + late double? versionID; + late int? memberID; + late String? password; + late int? facilityId; + late String? generalid; + late String? otpSendType; + ActivationCodeModel( {this.mobileNumber, this.zipCode, diff --git a/lib/core/model/auth/activation_code_for_verification_screen_model.dart b/lib/core/model/auth/activation_code_for_verification_screen_model.dart index 28cc58db..f7aba9f0 100644 --- a/lib/core/model/auth/activation_code_for_verification_screen_model.dart +++ b/lib/core/model/auth/activation_code_for_verification_screen_model.dart @@ -1,17 +1,18 @@ class ActivationCodeForVerificationScreenModel { - int oTPSendType; - String mobileNumber; - String zipCode; - int channel; - int languageID; - double versionID; - int memberID; - int facilityId; - String generalid; - int isMobileFingerPrint; - String vidaAuthTokenID; - String vidaRefreshTokenID; - String iMEI; + late int? oTPSendType; + late String? mobileNumber; + late String? zipCode; + late int? channel; + late int? languageID; + late double? versionID; + late int? memberID; + late int? facilityId; + late String? generalid; + late int? isMobileFingerPrint; + late String? vidaAuthTokenID; + late String? vidaRefreshTokenID; + late String? iMEI; + ActivationCodeForVerificationScreenModel( {this.oTPSendType, this.mobileNumber, diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart index c5ff29e6..0d9e5149 100644 --- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; class CheckActivationCodeForDoctorAppResponseModel { - String authenticationTokenID; - List listDoctorsClinic; - List listDoctorProfile; - MemberInformation memberInformation; + late String? authenticationTokenID; + late List? listDoctorsClinic; + late List? listDoctorProfile; + late MemberInformation? memberInformation; CheckActivationCodeForDoctorAppResponseModel( {this.authenticationTokenID, @@ -15,16 +15,16 @@ class CheckActivationCodeForDoctorAppResponseModel { Map json) { authenticationTokenID = json['AuthenticationTokenID']; if (json['List_DoctorsClinic'] != null) { - listDoctorsClinic = new List(); + listDoctorsClinic = []; json['List_DoctorsClinic'].forEach((v) { - listDoctorsClinic.add(new ListDoctorsClinic.fromJson(v)); + listDoctorsClinic!.add(new ListDoctorsClinic.fromJson(v)); }); } if (json['List_DoctorProfile'] != null) { - listDoctorProfile = new List(); + listDoctorProfile = []; json['List_DoctorProfile'].forEach((v) { - listDoctorProfile.add(new DoctorProfileModel.fromJson(v)); + listDoctorProfile!.add(new DoctorProfileModel.fromJson(v)); }); } @@ -38,34 +38,35 @@ class CheckActivationCodeForDoctorAppResponseModel { data['AuthenticationTokenID'] = this.authenticationTokenID; if (this.listDoctorsClinic != null) { data['List_DoctorsClinic'] = - this.listDoctorsClinic.map((v) => v.toJson()).toList(); + this.listDoctorsClinic!.map((v) => v.toJson()).toList(); } if (this.listDoctorProfile != null) { data['List_DoctorProfile'] = - this.listDoctorProfile.map((v) => v.toJson()).toList(); + this.listDoctorProfile!.map((v) => v.toJson()).toList(); } if (this.memberInformation != null) { - data['memberInformation'] = this.memberInformation.toJson(); + data['memberInformation'] = this.memberInformation!.toJson(); } return data; } } class ListDoctorsClinic { - Null setupID; - int projectID; - int doctorID; - int clinicID; - bool isActive; - String clinicName; - - ListDoctorsClinic({this.setupID, - this.projectID, - this.doctorID, - this.clinicID, - this.isActive, - this.clinicName}); + late dynamic setupID; + late int? projectID; + late int? doctorID; + late int? clinicID; + late bool? isActive; + late String? clinicName; + + ListDoctorsClinic( + {this.setupID, + this.projectID, + this.doctorID, + this.clinicID, + this.isActive, + this.clinicName}); ListDoctorsClinic.fromJson(Map json) { setupID = json['SetupID']; @@ -89,31 +90,32 @@ class ListDoctorsClinic { } class MemberInformation { - List clinics; - int doctorId; - String email; - int employeeId; - int memberId; - Null memberName; - Null memberNameArabic; - String preferredLanguage; - List roles; - - MemberInformation({this.clinics, - this.doctorId, - this.email, - this.employeeId, - this.memberId, - this.memberName, - this.memberNameArabic, - this.preferredLanguage, - this.roles}); + late List? clinics; + late int? doctorId; + late String? email; + late int? employeeId; + late int? memberId; + late dynamic memberName; + late dynamic memberNameArabic; + late String? preferredLanguage; + late List? roles; + + MemberInformation( + {this.clinics, + this.doctorId, + this.email, + this.employeeId, + this.memberId, + this.memberName, + this.memberNameArabic, + this.preferredLanguage, + this.roles}); MemberInformation.fromJson(Map json) { if (json['clinics'] != null) { - clinics = new List(); + clinics = []; json['clinics'].forEach((v) { - clinics.add(new Clinics.fromJson(v)); + clinics!.add(new Clinics.fromJson(v)); }); } doctorId = json['doctorId']; @@ -124,9 +126,9 @@ class MemberInformation { memberNameArabic = json['memberNameArabic']; preferredLanguage = json['preferredLanguage']; if (json['roles'] != null) { - roles = new List(); + roles = []; json['roles'].forEach((v) { - roles.add(new Roles.fromJson(v)); + roles!.add(new Roles.fromJson(v)); }); } } @@ -134,7 +136,7 @@ class MemberInformation { Map toJson() { final Map data = new Map(); if (this.clinics != null) { - data['clinics'] = this.clinics.map((v) => v.toJson()).toList(); + data['clinics'] = this.clinics!.map((v) => v.toJson()).toList(); } data['doctorId'] = this.doctorId; data['email'] = this.email; @@ -144,16 +146,16 @@ class MemberInformation { data['memberNameArabic'] = this.memberNameArabic; data['preferredLanguage'] = this.preferredLanguage; if (this.roles != null) { - data['roles'] = this.roles.map((v) => v.toJson()).toList(); + data['roles'] = this.roles!.map((v) => v.toJson()).toList(); } return data; } } class Clinics { - bool defaultClinic; - int id; - String name; + late bool? defaultClinic; + late int? id; + late String? name; Clinics({this.defaultClinic, this.id, this.name}); @@ -173,8 +175,8 @@ class Clinics { } class Roles { - String name; - int roleId; + late String? name; + late int? roleId; Roles({this.name, this.roleId}); diff --git a/lib/core/model/auth/check_activation_code_request_model.dart b/lib/core/model/auth/check_activation_code_request_model.dart index 9bb3d4f6..187c989c 100644 --- a/lib/core/model/auth/check_activation_code_request_model.dart +++ b/lib/core/model/auth/check_activation_code_request_model.dart @@ -1,18 +1,19 @@ class CheckActivationCodeRequestModel { - String mobileNumber; - String zipCode; - int doctorID; - String iPAdress; - int channel; - int languageID; - int projectID; - double versionID; - String generalid; - String logInTokenID; - String activationCode; - String vidaAuthTokenID; - String vidaRefreshTokenID; - int oTPSendType; + late String? mobileNumber; + late String? zipCode; + late int? doctorID; + late String? iPAdress; + late int? channel; + late int? languageID; + late int? projectID; + late double? versionID; + late String? generalid; + late String? logInTokenID; + late String? activationCode; + late String? vidaAuthTokenID; + late String? vidaRefreshTokenID; + late int? oTPSendType; + CheckActivationCodeRequestModel( {this.mobileNumber, this.zipCode, diff --git a/lib/core/model/auth/imei_details.dart b/lib/core/model/auth/imei_details.dart index eb37e736..95ff1e74 100644 --- a/lib/core/model/auth/imei_details.dart +++ b/lib/core/model/auth/imei_details.dart @@ -1,33 +1,34 @@ class GetIMEIDetailsModel { - int iD; - String iMEI; - int logInTypeID; - bool outSA; - String mobile; - dynamic identificationNo; - int doctorID; - String doctorName; - String doctorNameN; - int clinicID; - String clinicDescription; - dynamic clinicDescriptionN; - int projectID; - String projectName; - String genderDescription; - dynamic genderDescriptionN; - String titleDescription; - dynamic titleDescriptionN; - dynamic zipCode; - String createdOn; - dynamic createdBy; - String editedOn; - dynamic editedBy; - bool biometricEnabled; - dynamic preferredLanguage; - bool isActive; - String vidaAuthTokenID; - String vidaRefreshTokenID; - String password; + late int? iD; + late String? iMEI; + late int? logInTypeID; + late bool? outSA; + late String? mobile; + late dynamic identificationNo; + late int? doctorID; + late String? doctorName; + late String? doctorNameN; + late int? clinicID; + late String? clinicDescription; + late dynamic clinicDescriptionN; + late int? projectID; + late String? projectName; + late String? genderDescription; + late dynamic genderDescriptionN; + late String? titleDescription; + late dynamic titleDescriptionN; + late dynamic zipCode; + late String? createdOn; + late dynamic createdBy; + late String? editedOn; + late dynamic editedBy; + late bool? biometricEnabled; + late dynamic preferredLanguage; + late bool? isActive; + late String? vidaAuthTokenID; + late String? vidaRefreshTokenID; + late String? password; + GetIMEIDetailsModel( {this.iD, this.iMEI, diff --git a/lib/core/model/auth/insert_imei_model.dart b/lib/core/model/auth/insert_imei_model.dart index 25e22b7a..5e54b127 100644 --- a/lib/core/model/auth/insert_imei_model.dart +++ b/lib/core/model/auth/insert_imei_model.dart @@ -1,37 +1,37 @@ class InsertIMEIDetailsModel { - String iMEI; - int logInTypeID; - dynamic outSA; - String mobile; - dynamic identificationNo; - int doctorID; - String doctorName; - String doctorNameN; - int clinicID; - String clinicDescription; - Null clinicDescriptionN; - String projectName; - String genderDescription; - Null genderDescriptionN; - String titleDescription; - Null titleDescriptionN; - bool bioMetricEnabled; - Null preferredLanguage; - bool isActive; - int editedBy; - int projectID; - String tokenID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String sessionID; - bool isLoginForDoctorApp; - int patientOutSA; - String vidaAuthTokenID; - String vidaRefreshTokenID; - dynamic password; + late String? iMEI; + late int ?logInTypeID; + late dynamic outSA; + late String? mobile; + late dynamic identificationNo; + late int ?doctorID; + late String? doctorName; + late String ?doctorNameN; + late int ?clinicID; + late String ?clinicDescription; + late dynamic clinicDescriptionN; + late String ?projectName; + late String ?genderDescription; + late dynamic genderDescriptionN; + late String ?titleDescription; + late dynamic titleDescriptionN; + late bool ?bioMetricEnabled; + late dynamic preferredLanguage; + late bool ?isActive; + late int ?editedBy; + late int ?projectID; + late String ?tokenID; + late int ?languageID; + late String ?stamp; + late String ?iPAdress; + late double ?versionID; + late int ?channel; + late String ?sessionID; + late bool ?isLoginForDoctorApp; + late int ?patientOutSA; + late String ?vidaAuthTokenID; + late String ?vidaRefreshTokenID; + late dynamic password; InsertIMEIDetailsModel( {this.iMEI, this.logInTypeID, diff --git a/lib/core/model/auth/new_login_information_response_model.dart b/lib/core/model/auth/new_login_information_response_model.dart index 117060e4..c834580b 100644 --- a/lib/core/model/auth/new_login_information_response_model.dart +++ b/lib/core/model/auth/new_login_information_response_model.dart @@ -1,13 +1,13 @@ class NewLoginInformationModel { - int doctorID; - List listMemberInformation; - String logInTokenID; - String mobileNumber; - Null sELECTDeviceIMEIbyIMEIList; - int userID; - String zipCode; - bool isActiveCode; - bool isSMSSent; + late int? doctorID; + late List? listMemberInformation; + late String ?logInTokenID; + late String ?mobileNumber; + late dynamic sELECTDeviceIMEIbyIMEIList; + late int ?userID; + late String ?zipCode; + late bool ?isActiveCode; + late bool ?isSMSSent; NewLoginInformationModel( {this.doctorID, @@ -23,9 +23,9 @@ class NewLoginInformationModel { NewLoginInformationModel.fromJson(Map json) { doctorID = json['DoctorID']; if (json['List_MemberInformation'] != null) { - listMemberInformation = new List(); + listMemberInformation = []; json['List_MemberInformation'].forEach((v) { - listMemberInformation.add(new ListMemberInformation.fromJson(v)); + listMemberInformation!.add(new ListMemberInformation.fromJson(v)); }); } logInTokenID = json['LogInTokenID']; @@ -42,7 +42,7 @@ class NewLoginInformationModel { data['DoctorID'] = this.doctorID; if (this.listMemberInformation != null) { data['List_MemberInformation'] = - this.listMemberInformation.map((v) => v.toJson()).toList(); + this.listMemberInformation!.map((v) => v.toJson()).toList(); } data['LogInTokenID'] = this.logInTokenID; data['MobileNumber'] = this.mobileNumber; @@ -56,17 +56,17 @@ class NewLoginInformationModel { } class ListMemberInformation { - Null setupID; - int memberID; - String memberName; - Null memberNameN; - String preferredLang; - String pIN; - String saltHash; - int referenceID; - int employeeID; - int roleID; - int projectid; + late dynamic setupID; + late int ? memberID; + late String ? memberName; + late dynamic memberNameN; + late String ? preferredLang; + late String ? pIN; + late String ? saltHash; + late int ? referenceID; + late int ? employeeID; + late int ? roleID; + late int ? projectid; ListMemberInformation( {this.setupID, diff --git a/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart index ceaf4c65..db971954 100644 --- a/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart @@ -1,8 +1,8 @@ class SendActivationCodeForDoctorAppResponseModel { - String logInTokenID; - String verificationCode; - String vidaAuthTokenID; - String vidaRefreshTokenID; + String? logInTokenID; + String? verificationCode; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; SendActivationCodeForDoctorAppResponseModel( {this.logInTokenID, diff --git a/lib/core/model/hospitals/get_hospitals_request_model.dart b/lib/core/model/hospitals/get_hospitals_request_model.dart index 8a5f1bc1..550f8ca8 100644 --- a/lib/core/model/hospitals/get_hospitals_request_model.dart +++ b/lib/core/model/hospitals/get_hospitals_request_model.dart @@ -1,13 +1,13 @@ class GetHospitalsRequestModel { - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - String memberID; + int ?languageID; + String? stamp; + String? iPAdress; + double? versionID; + int ?channel; + String? tokenID; + String? sessionID; + bool ?isLoginForDoctorApp; + String ?memberID; GetHospitalsRequestModel( {this.languageID, diff --git a/lib/core/model/hospitals/get_hospitals_response_model.dart b/lib/core/model/hospitals/get_hospitals_response_model.dart index edbc3fe5..1109b58b 100644 --- a/lib/core/model/hospitals/get_hospitals_response_model.dart +++ b/lib/core/model/hospitals/get_hospitals_response_model.dart @@ -1,7 +1,7 @@ class GetHospitalsResponseModel { - String facilityGroupId; - int facilityId; - String facilityName; + String? facilityGroupId; + int ?facilityId; + String ?facilityName; GetHospitalsResponseModel( {this.facilityGroupId, this.facilityId, this.facilityName}); diff --git a/lib/core/model/insurance/insurance_approval.dart b/lib/core/model/insurance/insurance_approval.dart index a3717c42..69e88a2e 100644 --- a/lib/core/model/insurance/insurance_approval.dart +++ b/lib/core/model/insurance/insurance_approval.dart @@ -1,11 +1,11 @@ class ApporvalDetails { - int approvalNo; + int? approvalNo; - String procedureName; + String? procedureName; //String procedureNameN; - String status; + String ?status; - String isInvoicedDesc; + String ?isInvoicedDesc; ApporvalDetails( {this.approvalNo, this.procedureName, this.status, this.isInvoicedDesc}); @@ -35,35 +35,35 @@ class ApporvalDetails { } class InsuranceApprovalModel { - List apporvalDetails; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - int eXuldAPPNO; - int projectID; - String doctorName; - String clinicName; - String patientDescription; - int approvalNo; - String approvalStatusDescption; - int unUsedCount; - String doctorImage; - String projectName; + List ?apporvalDetails; + double ?versionID; + int ? channel; + int ? languageID; + String ? iPAdress; + String ? generalid; + int ? patientOutSA; + String ? sessionID; + bool ? isDentalAllowedBackend; + int ? deviceTypeID; + int ? patientID; + String ? tokenID; + int ? patientTypeID; + int ? patientType; + int ? eXuldAPPNO; + int ? projectID; + String ? doctorName; + String ? clinicName; + String ? patientDescription; + int ? approvalNo; + String ?approvalStatusDescption; + int ? unUsedCount; + String ? doctorImage; + String ? projectName; //String companyName; - String expiryDate; - String rceiptOn; - int appointmentNo; + String ? expiryDate; + String ? rceiptOn; + int ?appointmentNo; InsuranceApprovalModel( {this.versionID, @@ -126,9 +126,9 @@ class InsuranceApprovalModel { doctorImage = json['DoctorImageURL']; clinicName = json['ClinicName']; if (json['ApporvalDetails'] != null) { - apporvalDetails = new List(); + apporvalDetails =[]; json['ApporvalDetails'].forEach((v) { - apporvalDetails.add(new ApporvalDetails.fromJson(v)); + apporvalDetails!.add(new ApporvalDetails.fromJson(v)); }); } appointmentNo = json['AppointmentNo']; diff --git a/lib/core/model/insurance/insurance_approval_in_patient_model.dart b/lib/core/model/insurance/insurance_approval_in_patient_model.dart index f185a8bf..722d34c7 100644 --- a/lib/core/model/insurance/insurance_approval_in_patient_model.dart +++ b/lib/core/model/insurance/insurance_approval_in_patient_model.dart @@ -1,36 +1,36 @@ class InsuranceApprovalInPatientModel { - String setupID; - int projectID; - int approvalNo; - int status; - String approvalDate; - int patientType; - int patientID; - int companyID; - bool subCategoryID; - int doctorID; - int clinicID; - int approvalType; - int inpatientApprovalSubType; + String? setupID; + int? projectID; + int? approvalNo; + int? status; + String? approvalDate; + int? patientType; + int? patientID; + int? companyID; + bool? subCategoryID; + int? doctorID; + int? clinicID; + int? approvalType; + int? inpatientApprovalSubType; dynamic isApprovalOnGross; - String companyApprovalNo; + String? companyApprovalNo; dynamic progNoteOrderNo; - String submitOn; - String receiptOn; - String expiryDate; - int admissionNo; - int admissionRequestNo; - String approvalStatusDescption; + String? submitOn; + String? receiptOn; + String? expiryDate; + int? admissionNo; + int? admissionRequestNo; + String? approvalStatusDescption; dynamic approvalStatusDescptionN; dynamic remarks; - List apporvalDetails; - String clinicName; + List? apporvalDetails; + String? clinicName; dynamic companyName; - String doctorName; - String projectName; - int totaUnUsedCount; - int unUsedCount; - String doctorImage; + String? doctorName; + String? projectName; + int? totaUnUsedCount; + int? unUsedCount; + String? doctorImage; InsuranceApprovalInPatientModel( {this.setupID, @@ -93,9 +93,9 @@ class InsuranceApprovalInPatientModel { approvalStatusDescptionN = json['ApprovalStatusDescptionN']; remarks = json['Remarks']; if (json['ApporvalDetails'] != null) { - apporvalDetails = new List(); + apporvalDetails = []; json['ApporvalDetails'].forEach((v) { - apporvalDetails.add(new ApporvalDetails.fromJson(v)); + apporvalDetails!.add(new ApporvalDetails.fromJson(v)); }); } clinicName = json['ClinicName']; @@ -135,7 +135,7 @@ class InsuranceApprovalInPatientModel { data['Remarks'] = this.remarks; if (this.apporvalDetails != null) { data['ApporvalDetails'] = - this.apporvalDetails.map((v) => v.toJson()).toList(); + this.apporvalDetails!.map((v) => v.toJson()).toList(); } data['ClinicName'] = this.clinicName; data['CompanyName'] = this.companyName; @@ -148,35 +148,35 @@ class InsuranceApprovalInPatientModel { } class ApporvalDetails { - Null setupID; - Null projectID; - int approvalNo; - Null lineItemNo; - Null orderType; - Null procedureID; - Null toothNo; - Null price; - Null approvedAmount; - Null unapprovedPatientShare; - Null waivedAmount; - Null discountType; - Null discountValue; - Null shareType; - Null patientShareTypeValue; - Null companyShareTypeValue; - Null patientShare; - Null companyShare; - Null deductableAmount; - String disapprovedRemarks; - Null progNoteOrderNo; - Null progNoteLineItemNo; - Null invoiceTransactionType; - Null invoiceNo; - String procedureName; - String procedureNameN; - String status; - Null isInvoiced; - String isInvoicedDesc; + dynamic setupID; + dynamic projectID; + int? approvalNo; + dynamic lineItemNo; + dynamic orderType; + dynamic procedureID; + dynamic toothNo; + dynamic price; + dynamic approvedAmount; + dynamic unapprovedPatientShare; + dynamic waivedAmount; + dynamic discountType; + dynamic discountValue; + dynamic shareType; + dynamic patientShareTypeValue; + dynamic companyShareTypeValue; + dynamic patientShare; + dynamic companyShare; + dynamic deductableAmount; + String? disapprovedRemarks; + dynamic progNoteOrderNo; + dynamic progNoteLineItemNo; + dynamic invoiceTransactionType; + dynamic invoiceNo; + String? procedureName; + String? procedureNameN; + String? status; + dynamic isInvoiced; + String? isInvoicedDesc; ApporvalDetails( {this.setupID, diff --git a/lib/core/model/labs/LabOrderResult.dart b/lib/core/model/labs/LabOrderResult.dart index ecb4ae65..7fc4432f 100644 --- a/lib/core/model/labs/LabOrderResult.dart +++ b/lib/core/model/labs/LabOrderResult.dart @@ -1,23 +1,23 @@ class LabOrderResult { - String description; + String? description; dynamic femaleInterpretativeData; - int gender; - int lineItemNo; + int ?gender; + int? lineItemNo; dynamic maleInterpretativeData; dynamic notes; - String packageID; - int patientID; - String projectID; - String referanceRange; - String resultValue; - String sampleCollectedOn; - String sampleReceivedOn; - String setupID; + String ?packageID; + int ?patientID; + String ? projectID; + String ? referanceRange; + String ? resultValue; + String ? sampleCollectedOn; + String ? sampleReceivedOn; + String ? setupID; dynamic superVerifiedOn; - String testCode; - String uOM; - String verifiedOn; - String verifiedOnDateTime; + String? testCode; + String? uOM; + String? verifiedOn; + String? verifiedOnDateTime; LabOrderResult( {this.description, diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index 1c09696b..9a8cfe82 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -1,44 +1,44 @@ class LabResult { - String description; + String? description; dynamic femaleInterpretativeData; - int gender; - int lineItemNo; + int? gender; + int? lineItemNo; dynamic maleInterpretativeData; - String notes; - String packageID; - int patientID; - String projectID; - String referanceRange; - String resultValue; - String sampleCollectedOn; - String sampleReceivedOn; - String setupID; + String? notes; + String? packageID; + int? patientID; + String? projectID; + String? referanceRange; + String? resultValue; + String? sampleCollectedOn; + String? sampleReceivedOn; + String? setupID; dynamic superVerifiedOn; - String testCode; - String uOM; - String verifiedOn; + String? testCode; + String? uOM; + String? verifiedOn; dynamic verifiedOnDateTime; LabResult( {this.description, - this.femaleInterpretativeData, - this.gender, - this.lineItemNo, - this.maleInterpretativeData, - this.notes, - this.packageID, - this.patientID, - this.projectID, - this.referanceRange, - this.resultValue, - this.sampleCollectedOn, - this.sampleReceivedOn, - this.setupID, - this.superVerifiedOn, - this.testCode, - this.uOM, - this.verifiedOn, - this.verifiedOnDateTime}); + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); LabResult.fromJson(Map json) { description = json['Description']; @@ -87,12 +87,11 @@ class LabResult { } } - class LabResultList { String filterName = ""; - List patientLabResultList = List(); + List patientLabResultList = []; - LabResultList({this.filterName, LabResult lab}) { + LabResultList({required this.filterName, required LabResult lab}) { patientLabResultList.add(lab); } } diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index af60f86f..08f81f16 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -1,40 +1,40 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PatientLabOrders { - int actualDoctorRate; - String clinicDescription; - String clinicDescriptionEnglish; - Null clinicDescriptionN; - int clinicID; - int doctorID; - String doctorImageURL; - String doctorName; - String doctorNameEnglish; - Null doctorNameN; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - String invoiceNo; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isRead; - String nationalityFlagURL; - int noOfPatientsRate; - DateTime orderDate; - String orderNo; - String patientID; - String projectID; - String projectName; - Null projectNameN; - String qR; - String setupID; - List speciality; - bool isLiveCareAppointment; + int ?actualDoctorRate; + String ?clinicDescription; + String ?clinicDescriptionEnglish; + dynamic clinicDescriptionN; + int ?clinicID; + int ?doctorID; + String? doctorImageURL; + String ?doctorName; + String ?doctorNameEnglish; + dynamic doctorNameN; + int ?doctorRate; + String ?doctorTitle; + int ?gender; + String ?genderDescription; + String ?invoiceNo; + bool ?isActiveDoctorProfile; + bool ?isDoctorAllowVedioCall; + bool ?isExecludeDoctor; + bool ?isInOutPatient; + String ?isInOutPatientDescription; + String ?isInOutPatientDescriptionN; + bool ?isRead; + String ?nationalityFlagURL; + int ?noOfPatientsRate; + DateTime? orderDate; + String ?orderNo; + String ?patientID; + String ?projectID; + String ?projectName; + dynamic projectNameN; + String ?qR; + String ?setupID; + List ?speciality; + bool ?isLiveCareAppointment; PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -149,10 +149,10 @@ class PatientLabOrders { class PatientLabOrdersList { String filterName = ""; - List patientLabOrdersList = List(); + List patientLabOrdersList = []; PatientLabOrdersList( - {this.filterName, PatientLabOrders patientDoctorAppointment}) { + {required this.filterName, required PatientLabOrders patientDoctorAppointment}) { patientLabOrdersList.add(patientDoctorAppointment); } } diff --git a/lib/core/model/labs/patient_lab_special_result.dart b/lib/core/model/labs/patient_lab_special_result.dart index 2fbcb832..f86dd56f 100644 --- a/lib/core/model/labs/patient_lab_special_result.dart +++ b/lib/core/model/labs/patient_lab_special_result.dart @@ -1,9 +1,9 @@ class PatientLabSpecialResult { - String invoiceNo; - String moduleID; - String resultData; - String resultDataHTML; - Null resultDataTxt; + String ?invoiceNo; + String ?moduleID; + String ? resultData; + String ? resultDataHTML; + dynamic resultDataTxt; PatientLabSpecialResult( {this.invoiceNo, diff --git a/lib/core/model/labs/request_patient_lab_orders.dart b/lib/core/model/labs/request_patient_lab_orders.dart index ce9263ef..4f746277 100644 --- a/lib/core/model/labs/request_patient_lab_orders.dart +++ b/lib/core/model/labs/request_patient_lab_orders.dart @@ -1,17 +1,17 @@ class RequestPatientLabOrders { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; + double? versionID; + int ?channel; + int ?languageID; + String? iPAdress; + String ?generalid; + int? patientOutSA; + String? sessionID; + bool ?isDentalAllowedBackend; + int ?deviceTypeID; + int ?patientID; + String ?tokenID; + int ?patientTypeID; + int ?patientType; RequestPatientLabOrders( {this.versionID, diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart index b48cf0e1..100f92b5 100644 --- a/lib/core/model/labs/request_patient_lab_special_result.dart +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -1,22 +1,22 @@ class RequestPatientLabSpecialResult { - String invoiceNo; - String orderNo; - String setupID; - String projectID; - int clinicID; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; + String? invoiceNo; + String? orderNo; + String? setupID; + String? projectID; + int ?clinicID; + double? versionID; + int ?channel; + int ?languageID; + String? iPAdress; + String ?generalid; + int ?patientOutSA; + String ?sessionID; + bool ?isDentalAllowedBackend; + int ?deviceTypeID; + int ?patientID; + String? tokenID; + int ?patientTypeID; + int ?patientType; RequestPatientLabSpecialResult( {this.invoiceNo, diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index 118da906..66f5e2a0 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -1,56 +1,56 @@ class RequestSendLabReportEmail { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - String to; - String dateofBirth; - String patientIditificationNum; - String patientMobileNumber; - String patientName; - String setupID; - String projectName; - String clinicName; - String doctorName; - String projectID; - String invoiceNo; - String orderDate; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; + String? to; + String? dateofBirth; + String? patientIditificationNum; + String? patientMobileNumber; + String? patientName; + String? setupID; + String? projectName; + String? clinicName; + String? doctorName; + String? projectID; + String? invoiceNo; + String? orderDate; RequestSendLabReportEmail( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.to, - this.dateofBirth, - this.patientIditificationNum, - this.patientMobileNumber, - this.patientName, - this.setupID, - this.projectName, - this.clinicName, - this.doctorName, - this.projectID, - this.invoiceNo, - this.orderDate}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.to, + this.dateofBirth, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.setupID, + this.projectName, + this.clinicName, + this.doctorName, + this.projectID, + this.invoiceNo, + this.orderDate}); RequestSendLabReportEmail.fromJson(Map json) { versionID = json['VersionID']; diff --git a/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart b/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart index dc1f25b3..a99c9649 100644 --- a/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart +++ b/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart @@ -1,7 +1,7 @@ class PendingPatientERForDoctorAppRequestModel { - bool outSA; - int doctorID; - String sErServiceID; + bool ? outSA; + int ? doctorID; + String ? sErServiceID; PendingPatientERForDoctorAppRequestModel( {this.outSA, this.doctorID, this.sErServiceID}); diff --git a/lib/core/model/medical_report/medical_file_model.dart b/lib/core/model/medical_report/medical_file_model.dart index deebb2af..53737499 100644 --- a/lib/core/model/medical_report/medical_file_model.dart +++ b/lib/core/model/medical_report/medical_file_model.dart @@ -1,14 +1,14 @@ class MedicalFileModel { - List entityList; + List? entityList; dynamic statusMessage; MedicalFileModel({this.entityList, this.statusMessage}); MedicalFileModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } statusMessage = json['statusMessage']; @@ -17,7 +17,7 @@ class MedicalFileModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['statusMessage'] = this.statusMessage; return data; @@ -25,15 +25,15 @@ class MedicalFileModel { } class EntityList { - List timelines; + List? timelines; EntityList({this.timelines}); EntityList.fromJson(Map json) { if (json['Timelines'] != null) { - timelines = new List(); + timelines = []; json['Timelines'].forEach((v) { - timelines.add(new Timelines.fromJson(v)); + timelines!.add(new Timelines.fromJson(v)); }); } } @@ -41,25 +41,25 @@ class EntityList { Map toJson() { final Map data = new Map(); if (this.timelines != null) { - data['Timelines'] = this.timelines.map((v) => v.toJson()).toList(); + data['Timelines'] = this.timelines!.map((v) => v.toJson()).toList(); } return data; } } class Timelines { - int clinicId; - String clinicName; - String date; - int doctorId; - String doctorImage; - String doctorName; - int encounterNumber; - String encounterType; - int projectID; - String projectName; - String setupID; - List timeLineEvents; + int? clinicId; + String? clinicName; + String? date; + int? doctorId; + String? doctorImage; + String? doctorName; + int? encounterNumber; + String? encounterType; + int? projectID; + String? projectName; + String? setupID; + List? timeLineEvents; Timelines( {this.clinicId, @@ -88,9 +88,9 @@ class Timelines { projectName = json['ProjectName']; setupID = json['SetupID']; if (json['TimeLineEvents'] != null) { - timeLineEvents = new List(); + timeLineEvents = []; json['TimeLineEvents'].forEach((v) { - timeLineEvents.add(new TimeLineEvents.fromJson(v)); + timeLineEvents!.add(new TimeLineEvents.fromJson(v)); }); } } @@ -110,25 +110,25 @@ class Timelines { data['SetupID'] = this.setupID; if (this.timeLineEvents != null) { data['TimeLineEvents'] = - this.timeLineEvents.map((v) => v.toJson()).toList(); + this.timeLineEvents!.map((v) => v.toJson()).toList(); } return data; } } class TimeLineEvents { - List admissions; - String colorClass; - List consulations; + List? admissions; + String? colorClass; + List? consulations; TimeLineEvents({this.admissions, this.colorClass, this.consulations}); TimeLineEvents.fromJson(Map json) { colorClass = json['ColorClass']; if (json['Consulations'] != null) { - consulations = new List(); + consulations = []; json['Consulations'].forEach((v) { - consulations.add(new Consulations.fromJson(v)); + consulations!.add(new Consulations.fromJson(v)); }); } } @@ -138,38 +138,38 @@ class TimeLineEvents { data['ColorClass'] = this.colorClass; if (this.consulations != null) { - data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); + data['Consulations'] = this.consulations!.map((v) => v.toJson()).toList(); } return data; } } class Consulations { - int admissionNo; - String appointmentDate; - int appointmentNo; - String appointmentType; - String clinicID; - String clinicName; - int doctorID; - String doctorName; - String endTime; - String episodeDate; - int episodeID; - int patientID; - int projectID; - String projectName; - String remarks; - String setupID; - String startTime; - String visitFor; - String visitType; - String dispalyName; - List lstAssessments; - List lstPhysicalExam; - List lstProcedure; - List lstMedicalHistory; - List lstCheifComplaint; + int? admissionNo; + String? appointmentDate; + int? appointmentNo; + String? appointmentType; + String? clinicID; + String? clinicName; + int? doctorID; + String? doctorName; + String? endTime; + String? episodeDate; + int? episodeID; + int? patientID; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? startTime; + String? visitFor; + String? visitType; + String? dispalyName; + List? lstAssessments; + List? lstPhysicalExam; + List? lstProcedure; + List? lstMedicalHistory; + List? lstCheifComplaint; Consulations( {this.admissionNo, @@ -220,33 +220,33 @@ class Consulations { visitType = json['VisitType']; dispalyName = json['dispalyName']; if (json['lstAssessments'] != null) { - lstAssessments = new List(); + lstAssessments = []; json['lstAssessments'].forEach((v) { - lstAssessments.add(new LstAssessments.fromJson(v)); + lstAssessments!.add(new LstAssessments.fromJson(v)); }); } if (json['lstCheifComplaint'] != null) { - lstCheifComplaint = new List(); + lstCheifComplaint = []; json['lstCheifComplaint'].forEach((v) { - lstCheifComplaint.add(new LstCheifComplaint.fromJson(v)); + lstCheifComplaint!.add(new LstCheifComplaint.fromJson(v)); }); } if (json['lstPhysicalExam'] != null) { - lstPhysicalExam = new List(); + lstPhysicalExam = []; json['lstPhysicalExam'].forEach((v) { - lstPhysicalExam.add(new LstPhysicalExam.fromJson(v)); + lstPhysicalExam!.add(new LstPhysicalExam.fromJson(v)); }); } if (json['lstProcedure'] != null) { - lstProcedure = new List(); + lstProcedure = []; json['lstProcedure'].forEach((v) { - lstProcedure.add(new LstProcedure.fromJson(v)); + lstProcedure!.add(new LstProcedure.fromJson(v)); }); } if (json['lstMedicalHistory'] != null) { - lstMedicalHistory = new List(); + lstMedicalHistory = []; json['lstMedicalHistory'].forEach((v) { - lstMedicalHistory.add(new LstMedicalHistory.fromJson(v)); + lstMedicalHistory!.add(new LstMedicalHistory.fromJson(v)); }); } } @@ -275,40 +275,40 @@ class Consulations { data['dispalyName'] = this.dispalyName; if (this.lstAssessments != null) { data['lstAssessments'] = - this.lstAssessments.map((v) => v.toJson()).toList(); + this.lstAssessments!.map((v) => v.toJson()).toList(); } if (this.lstCheifComplaint != null) { data['lstCheifComplaint'] = - this.lstCheifComplaint.map((v) => v.toJson()).toList(); + this.lstCheifComplaint!.map((v) => v.toJson()).toList(); } if (this.lstPhysicalExam != null) { data['lstPhysicalExam'] = - this.lstPhysicalExam.map((v) => v.toJson()).toList(); + this.lstPhysicalExam!.map((v) => v.toJson()).toList(); } if (this.lstProcedure != null) { - data['lstProcedure'] = this.lstProcedure.map((v) => v.toJson()).toList(); + data['lstProcedure'] = this.lstProcedure!.map((v) => v.toJson()).toList(); } if (this.lstMedicalHistory != null) { data['lstMedicalHistory'] = - this.lstMedicalHistory.map((v) => v.toJson()).toList(); + this.lstMedicalHistory!.map((v) => v.toJson()).toList(); } return data; } } class LstCheifComplaint { - int appointmentNo; - String cCDate; - String chiefComplaint; - String currentMedication; - int episodeID; - String hOPI; - int patientID; - String patientType; - int projectID; - String projectName; - String setupID; - String dispalyName; + int? appointmentNo; + String? cCDate; + String? chiefComplaint; + String? currentMedication; + int? episodeID; + String? hOPI; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? setupID; + String? dispalyName; LstCheifComplaint( {this.appointmentNo, @@ -358,19 +358,19 @@ class LstCheifComplaint { } class LstAssessments { - int appointmentNo; - String condition; - String description; - int episodeID; - String iCD10; - int patientID; - String patientType; - int projectID; - String projectName; - String remarks; - String setupID; - String type; - String dispalyName; + int? appointmentNo; + String? condition; + String? description; + int? episodeID; + String? iCD10; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? type; + String? dispalyName; LstAssessments( {this.appointmentNo, @@ -423,19 +423,19 @@ class LstAssessments { } class LstPhysicalExam { - String abnormal; - int appointmentNo; - int episodeID; - String examDesc; - String examID; - String examType; - int patientID; - String patientType; - int projectID; - String projectName; - String remarks; - String setupID; - String dispalyName; + String? abnormal; + int? appointmentNo; + int? episodeID; + String? examDesc; + String? examID; + String? examType; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? dispalyName; LstPhysicalExam( {this.abnormal, @@ -488,17 +488,17 @@ class LstPhysicalExam { } class LstProcedure { - int appointmentNo; - int episodeID; - String orderDate; - int patientID; - String patientType; - String procName; - String procedureId; - int projectID; - String projectName; - String setupID; - String dispalyName; + int? appointmentNo; + int? episodeID; + String? orderDate; + int? patientID; + String? patientType; + String? procName; + String? procedureId; + int? projectID; + String? projectName; + String? setupID; + String? dispalyName; LstProcedure( {this.appointmentNo, @@ -545,17 +545,17 @@ class LstProcedure { } class LstMedicalHistory { - int appointmentNo; - String checked; - int episodeID; - String history; - int patientID; - String patientType; - int projectID; - String projectName; - String remarks; - String setupID; - String dispalyName; + int? appointmentNo; + String? checked; + int? episodeID; + String? history; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? dispalyName; LstMedicalHistory( {this.appointmentNo, diff --git a/lib/core/model/medical_report/medical_file_request_model.dart b/lib/core/model/medical_report/medical_file_request_model.dart index 8703141a..01a2abf2 100644 --- a/lib/core/model/medical_report/medical_file_request_model.dart +++ b/lib/core/model/medical_report/medical_file_request_model.dart @@ -1,7 +1,7 @@ class MedicalFileRequestModel { - int patientMRN; - String vidaAuthTokenID; - String iPAdress; + int ?patientMRN; + String ?vidaAuthTokenID; + String ?iPAdress; MedicalFileRequestModel({this.patientMRN, this.vidaAuthTokenID,this.iPAdress}); diff --git a/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart b/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart index c97f8426..bc952162 100644 --- a/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart +++ b/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart @@ -222,6 +222,7 @@ class AdmissionRequestService extends LookupService { POST_ADMISSION_REQUEST, onSuccess: (dynamic response, int statusCode) { print(response["admissionResponse"]["success"]); + AdmissionRequest admissionRequest = AdmissionRequest.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/models/doctor/doctor_profile_model.dart b/lib/models/doctor/doctor_profile_model.dart index c2f5b0dd..7c7f6e37 100644 --- a/lib/models/doctor/doctor_profile_model.dart +++ b/lib/models/doctor/doctor_profile_model.dart @@ -84,7 +84,7 @@ class DoctorProfileModel { this.qR, this.serviceID}); - DoctorProfileModel.fromJson(Map json) { + DoctorProfileModel.fromJson(Map json) { doctorID = json['DoctorID']; doctorName = json['DoctorName']; doctorNameN = json['DoctorNameN']; diff --git a/pubspec.yaml b/pubspec.yaml index ac0e78c3..ce9d34be 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,7 +14,7 @@ description: A new Flutter project. version: 1.2.2+2 environment: - sdk: ">=2.8.0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" #dependency_overrides: From 931e21ed5ea75036d9bad362be82121ca2891392 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Jun 2021 10:08:10 +0300 Subject: [PATCH 03/18] Migrate models to flutter 2 --- .../model/Prescriptions/Prescriptions.dart | 85 ++++++------- .../in_patient_prescription_model.dart | 2 +- .../Prescriptions/perscription_pharmacy.dart | 46 +++---- .../post_prescrition_req_model.dart | 42 +++---- .../prescription_in_patient.dart | 68 +++++------ .../Prescriptions/prescription_model.dart | 8 +- .../Prescriptions/prescription_report.dart | 84 ++++++------- .../prescription_report_enh.dart | 66 +++++------ .../Prescriptions/prescription_req_model.dart | 2 +- .../Prescriptions/prescriptions_order.dart | 92 +++++++------- ...t_get_list_pharmacy_for_prescriptions.dart | 30 ++--- .../request_prescription_report.dart | 44 +++---- .../request_prescription_report_enh.dart | 44 +++---- .../model/calculate_box_request_model.dart | 10 +- lib/core/model/hospitals_model.dart | 32 ++--- lib/core/model/note/CreateNoteModel.dart | 38 +++--- lib/core/model/note/note_model.dart | 40 +++---- lib/core/model/note/update_note_model.dart | 66 +++++------ .../patient_muse/PatientMuseResultsModel.dart | 24 ++-- .../PatientSearchRequestModel.dart | 24 ++-- lib/core/model/procedure/ControlsModel.dart | 4 +- .../Procedure_template_request_model.dart | 60 +++++----- .../model/procedure/categories_procedure.dart | 50 ++++---- .../get_ordered_procedure_model.dart | 72 +++++------ .../get_ordered_procedure_request_model.dart | 4 +- .../model/procedure/get_procedure_model.dart | 44 +++---- .../procedure/get_procedure_req_model.dart | 12 +- .../procedure/post_procedure_req_model.dart | 28 ++--- .../procedure_category_list_model.dart | 14 +-- .../procedure/procedure_templateModel.dart | 18 +-- .../procedure_template_details_model.dart | 58 ++++----- ...cedure_template_details_request_model.dart | 62 +++++----- .../procedure/procedure_valadate_model.dart | 14 +-- .../procedure_valadate_request_model.dart | 10 +- .../update_procedure_request_model.dart | 28 ++--- lib/core/model/radiology/final_radiology.dart | 24 ++-- .../request_patient_rad_orders_details.dart | 46 +++---- .../request_send_rad_report_email.dart | 58 ++++----- .../referral/DischargeReferralPatient.dart | 90 +++++++------- .../referral/MyReferralPatientModel.dart | 112 +++++++++--------- lib/core/model/referral/ReferralRequest.dart | 54 ++++----- .../get_medication_response_model.dart | 18 +-- .../search_drug/item_by_medicine_model.dart | 42 +++---- .../item_by_medicine_request_model.dart | 4 +- .../model/search_drug/search_drug_model.dart | 10 +- .../search_drug_request_model.dart | 2 +- .../sick_leave/sick_leave_patient_model.dart | 76 ++++++------ .../sick_leave_patient_request_model.dart | 30 ++--- lib/core/service/base/base_service.dart | 28 ++--- lib/core/service/home/dasboard_service.dart | 2 +- 50 files changed, 959 insertions(+), 962 deletions(-) diff --git a/lib/core/model/Prescriptions/Prescriptions.dart b/lib/core/model/Prescriptions/Prescriptions.dart index c47a813a..881f318a 100644 --- a/lib/core/model/Prescriptions/Prescriptions.dart +++ b/lib/core/model/Prescriptions/Prescriptions.dart @@ -1,40 +1,40 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class Prescriptions { - String setupID; - int projectID; - int patientID; - int appointmentNo; - String appointmentDate; - String doctorName; - String clinicDescription; - String name; - int episodeID; - int actualDoctorRate; - int admission; - int clinicID; - String companyName; - String despensedStatus; - DateTime dischargeDate; - int dischargeNo; - int doctorID; - String doctorImageURL; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - bool isLiveCareAppointment; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isInsurancePatient; - String nationalityFlagURL; - int noOfPatientsRate; - String qR; - List speciality; + String? setupID; + int? projectID; + int? patientID; + int? appointmentNo; + String? appointmentDate; + String? doctorName; + String? clinicDescription; + String? name; + int? episodeID; + int? actualDoctorRate; + int? admission; + int? clinicID; + String? companyName; + String? despensedStatus; + DateTime? dischargeDate; + int? dischargeNo; + int? doctorID; + String? doctorImageURL; + int? doctorRate; + String? doctorTitle; + int? gender; + String? genderDescription; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; + bool? isLiveCareAppointment; + String? isInOutPatientDescription; + String? isInOutPatientDescriptionN; + bool? isInsurancePatient; + String? nationalityFlagURL; + int? noOfPatientsRate; + String? qR; + List? speciality; Prescriptions( {this.setupID, @@ -69,9 +69,10 @@ class Prescriptions { this.nationalityFlagURL, this.noOfPatientsRate, this.qR, - this.speciality,this.isLiveCareAppointment}); + this.speciality, + this.isLiveCareAppointment}); - Prescriptions.fromJson(Map json) { + Prescriptions.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -105,11 +106,11 @@ class Prescriptions { noOfPatientsRate = json['NoOfPatientsRate']; qR = json['QR']; isLiveCareAppointment = json['IsLiveCareAppointment']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; @@ -149,10 +150,10 @@ class Prescriptions { } class PrescriptionsList { - String filterName = ""; - List prescriptionsList = List(); + String? filterName = ""; + List prescriptionsList =[]; - PrescriptionsList({this.filterName, Prescriptions prescriptions}) { + PrescriptionsList({this.filterName, required Prescriptions prescriptions}) { prescriptionsList.add(prescriptions); } } diff --git a/lib/core/model/Prescriptions/in_patient_prescription_model.dart b/lib/core/model/Prescriptions/in_patient_prescription_model.dart index f6e88bf7..3f67e659 100644 --- a/lib/core/model/Prescriptions/in_patient_prescription_model.dart +++ b/lib/core/model/Prescriptions/in_patient_prescription_model.dart @@ -1,5 +1,5 @@ class InPatientPrescriptionRequestModel { - String vidaAuthTokenID; + String? vidaAuthTokenID; dynamic patientMRN; dynamic appNo; dynamic admissionNo; diff --git a/lib/core/model/Prescriptions/perscription_pharmacy.dart b/lib/core/model/Prescriptions/perscription_pharmacy.dart index 3adaef7e..c6b013d3 100644 --- a/lib/core/model/Prescriptions/perscription_pharmacy.dart +++ b/lib/core/model/Prescriptions/perscription_pharmacy.dart @@ -1,28 +1,28 @@ class PharmacyPrescriptions { - String expiryDate; + String? expiryDate; dynamic sellingPrice; - int quantity; - int itemID; - int locationID; - int projectID; - String setupID; - String locationDescription; - Null locationDescriptionN; - String itemDescription; - Null itemDescriptionN; - String alias; - int locationTypeID; - int barcode; - Null companybarcode; - int cityID; - String cityName; - int distanceInKilometers; - String latitude; - int locationType; - String longitude; - String phoneNumber; - String projectImageURL; - Null sortOrder; + int?quantity; + int?itemID; + int?locationID; + int?projectID; + String ?setupID; + String ?locationDescription; + dynamic locationDescriptionN; + String ? itemDescription; + dynamic itemDescriptionN; + String ? alias; + int ? locationTypeID; + int ? barcode; + dynamic companybarcode; + int ? cityID; + String? cityName; + int ? distanceInKilometers; + String? latitude; + int ?locationType; + String? longitude; + String ?phoneNumber; + String ? projectImageURL; + dynamic sortOrder; PharmacyPrescriptions( {this.expiryDate, diff --git a/lib/core/model/Prescriptions/post_prescrition_req_model.dart b/lib/core/model/Prescriptions/post_prescrition_req_model.dart index 06a524ed..9609a0df 100644 --- a/lib/core/model/Prescriptions/post_prescrition_req_model.dart +++ b/lib/core/model/Prescriptions/post_prescrition_req_model.dart @@ -1,10 +1,10 @@ class PostPrescriptionReqModel { - String vidaAuthTokenID; - int clinicID; - int episodeID; - int appointmentNo; - int patientMRN; - List prescriptionRequestModel; + String ?vidaAuthTokenID; + int? clinicID; + int? episodeID; + int? appointmentNo; + int? patientMRN; + List ?prescriptionRequestModel; PostPrescriptionReqModel( {this.vidaAuthTokenID, @@ -21,9 +21,9 @@ class PostPrescriptionReqModel { appointmentNo = json['AppointmentNo']; patientMRN = json['PatientMRN']; if (json['prescriptionRequestModel'] != null) { - prescriptionRequestModel = new List(); + prescriptionRequestModel =[]; json['prescriptionRequestModel'].forEach((v) { - prescriptionRequestModel.add(new PrescriptionRequestModel.fromJson(v)); + prescriptionRequestModel!.add(new PrescriptionRequestModel.fromJson(v)); }); } } @@ -37,25 +37,25 @@ class PostPrescriptionReqModel { data['PatientMRN'] = this.patientMRN; if (this.prescriptionRequestModel != null) { data['prescriptionRequestModel'] = - this.prescriptionRequestModel.map((v) => v.toJson()).toList(); + this.prescriptionRequestModel!.map((v) => v.toJson()).toList(); } return data; } } class PrescriptionRequestModel { - int itemId; - String doseStartDate; - int duration; - double dose; - int doseUnitId; - int route; - int frequency; - int doseTime; - bool covered; - bool approvalRequired; - String remarks; - String icdcode10Id; + int ? itemId; + String? doseStartDate; + int ?duration; + double? dose; + int ?doseUnitId; + int ?route; + int ?frequency; + int ?doseTime; + bool ?covered; + bool ?approvalRequired; + String ?remarks; + String ?icdcode10Id; PrescriptionRequestModel({ this.itemId, diff --git a/lib/core/model/Prescriptions/prescription_in_patient.dart b/lib/core/model/Prescriptions/prescription_in_patient.dart index c66bc8a4..f32556bc 100644 --- a/lib/core/model/Prescriptions/prescription_in_patient.dart +++ b/lib/core/model/Prescriptions/prescription_in_patient.dart @@ -1,50 +1,50 @@ class PrescriotionInPatient { - int admissionNo; - int authorizedBy; + int ?admissionNo; + int ?authorizedBy; dynamic bedNo; - String comments; - int createdBy; - String createdByName; + String? comments; + int ?createdBy; + String ?createdByName; dynamic createdByNameN; - String createdOn; - String direction; - int directionID; + String ?createdOn; + String ?direction; + int ?directionID; dynamic directionN; - String dose; - int editedBy; + String ?dose; + int ?editedBy; dynamic iVDiluentLine; - int iVDiluentType; + int ?iVDiluentType; dynamic iVDiluentVolume; dynamic iVRate; dynamic iVStability; - String itemDescription; - int itemID; - int lineItemNo; - int locationId; - int noOfDoses; - int orderNo; - int patientID; - String pharmacyRemarks; - String prescriptionDatetime; - int prescriptionNo; - String processedBy; - int projectID; - int refillID; - String refillType; + String? itemDescription; + int? itemID; + int? lineItemNo; + int? locationId; + int? noOfDoses; + int? orderNo; + int? patientID; + String ?pharmacyRemarks; + String ?prescriptionDatetime; + int ?prescriptionNo; + String? processedBy; + int ?projectID; + int ?refillID; + String ?refillType; dynamic refillTypeN; - int reviewedPharmacist; + int ?reviewedPharmacist; dynamic roomId; - String route; - int routeId; + String ?route; + int ?routeId; dynamic routeN; dynamic setupID; - String startDatetime; - int status; - String statusDescription; + String ?startDatetime; + int ?status; + String ?statusDescription; dynamic statusDescriptionN; - String stopDatetime; - int unitofMeasurement; - String unitofMeasurementDescription; + String ?stopDatetime; + int ?unitofMeasurement; + String? unitofMeasurementDescription; dynamic unitofMeasurementDescriptionN; PrescriotionInPatient( diff --git a/lib/core/model/Prescriptions/prescription_model.dart b/lib/core/model/Prescriptions/prescription_model.dart index 92574c66..89959394 100644 --- a/lib/core/model/Prescriptions/prescription_model.dart +++ b/lib/core/model/Prescriptions/prescription_model.dart @@ -1,5 +1,5 @@ class PrescriptionModel { - List entityList; + List? entityList; dynamic rowcount; dynamic statusMessage; @@ -7,9 +7,9 @@ class PrescriptionModel { PrescriptionModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -19,7 +19,7 @@ class PrescriptionModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; diff --git a/lib/core/model/Prescriptions/prescription_report.dart b/lib/core/model/Prescriptions/prescription_report.dart index d2427004..e3a6eec8 100644 --- a/lib/core/model/Prescriptions/prescription_report.dart +++ b/lib/core/model/Prescriptions/prescription_report.dart @@ -1,48 +1,48 @@ class PrescriptionReport { - String address; - int appointmentNo; - String clinic; - String companyName; - int days; - String doctorName; + String ? address; + int ? appointmentNo; + String? clinic; + String ?companyName; + int ?days; + String ?doctorName; var doseDailyQuantity; - String frequency; - int frequencyNumber; - String image; - String imageExtension; - String imageSRCUrl; - String imageString; - String imageThumbUrl; - String isCovered; - String itemDescription; - int itemID; - String orderDate; - int patientID; - String patientName; - String phoneOffice1; - String prescriptionQR; - int prescriptionTimes; - String productImage; - String productImageBase64; - String productImageString; - int projectID; - String projectName; - String remarks; - String route; - String sKU; - int scaleOffset; - String startDate; + String? frequency; + int ?frequencyNumber; + String? image; + String? imageExtension; + String? imageSRCUrl; + String? imageString; + String? imageThumbUrl; + String? isCovered; + String? itemDescription; + int? itemID; + String? orderDate; + int ?patientID; + String ?patientName; + String ?phoneOffice1; + String ?prescriptionQR; + int ?prescriptionTimes; + String? productImage; + String? productImageBase64; + String? productImageString; + int? projectID; + String?projectName; + String?remarks; + String?route; + String?sKU; + int ?scaleOffset; + String? startDate; - String patientAge; - String patientGender; - String phoneOffice; - int doseTimingID; - int frequencyID; - int routeID; - String name; - String itemDescriptionN; - String routeN; - String frequencyN; + String ? patientAge; + String ? patientGender; + String ? phoneOffice; + int ?doseTimingID; + int ?frequencyID; + int ?routeID; + String ? name; + String ? itemDescriptionN; + String ? routeN; + String ? frequencyN; PrescriptionReport({ this.address, diff --git a/lib/core/model/Prescriptions/prescription_report_enh.dart b/lib/core/model/Prescriptions/prescription_report_enh.dart index 203eaaff..a51cdc7b 100644 --- a/lib/core/model/Prescriptions/prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/prescription_report_enh.dart @@ -1,37 +1,37 @@ class PrescriptionReportEnh { - String address; - int appointmentNo; - String clinic; - Null companyName; - int days; - String doctorName; - int doseDailyQuantity; - String frequency; - int frequencyNumber; - Null image; - Null imageExtension; - String imageSRCUrl; - Null imageString; - String imageThumbUrl; - String isCovered; - String itemDescription; - int itemID; - String orderDate; - int patientID; - String patientName; - String phoneOffice1; - Null prescriptionQR; - int prescriptionTimes; - Null productImage; - Null productImageBase64; - String productImageString; - int projectID; - String projectName; - String remarks; - String route; - String sKU; - int scaleOffset; - String startDate; + String ? address; + int ? appointmentNo; + String ? clinic; + dynamic companyName; + int ? days; + String ? doctorName; + int ? doseDailyQuantity; + String ? frequency; + int ? frequencyNumber; + dynamic image; + dynamic imageExtension; + String ? imageSRCUrl; + dynamic imageString ; + String ? imageThumbUrl; + String ? isCovered; + String ? itemDescription; + int ? itemID; + String ? orderDate; + int ? patientID; + String ? patientName; + String ? phoneOffice1; + dynamic prescriptionQR; + int ? prescriptionTimes; + dynamic productImage; + dynamic productImageBase64; + String ? productImageString; + int ? projectID; + String ? projectName; + String ? remarks; + String ? route; + String ? sKU; + int ? scaleOffset; + String ? startDate; PrescriptionReportEnh( {this.address, diff --git a/lib/core/model/Prescriptions/prescription_req_model.dart b/lib/core/model/Prescriptions/prescription_req_model.dart index a45878d8..1177431d 100644 --- a/lib/core/model/Prescriptions/prescription_req_model.dart +++ b/lib/core/model/Prescriptions/prescription_req_model.dart @@ -1,5 +1,5 @@ class PrescriptionReqModel { - String vidaAuthTokenID; + String ?vidaAuthTokenID; dynamic patientMRN; dynamic appNo; dynamic admissionNo; diff --git a/lib/core/model/Prescriptions/prescriptions_order.dart b/lib/core/model/Prescriptions/prescriptions_order.dart index f51420ec..afe38aa1 100644 --- a/lib/core/model/Prescriptions/prescriptions_order.dart +++ b/lib/core/model/Prescriptions/prescriptions_order.dart @@ -1,32 +1,32 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionsOrder { - int iD; + int? iD; dynamic patientID; - bool patientOutSA; - bool isOutPatient; - int projectID; - int nearestProjectID; - double longitude; - double latitude; + bool? patientOutSA; + bool? isOutPatient; + int? projectID; + int? nearestProjectID; + double? longitude; + double? latitude; dynamic appointmentNo; dynamic dischargeID; - int lineItemNo; - int status; + int? lineItemNo; + int? status; dynamic description; dynamic descriptionN; - DateTime createdOn; - int serviceID; - int createdBy; - DateTime editedOn; - int editedBy; - int channel; + DateTime? createdOn; + int? serviceID; + int? createdBy; + DateTime? editedOn; + int? editedBy; + int? channel; dynamic clientRequestID; - bool returnedToQueue; + bool? returnedToQueue; dynamic pickupDateTime; dynamic pickupLocationName; dynamic dropoffLocationName; - int realRRTHaveTransactions; + int? realRRTHaveTransactions; dynamic nearestProjectDescription; dynamic nearestProjectDescriptionN; dynamic projectDescription; @@ -34,35 +34,35 @@ class PrescriptionsOrder { PrescriptionsOrder( {this.iD, - this.patientID, - this.patientOutSA, - this.isOutPatient, - this.projectID, - this.nearestProjectID, - this.longitude, - this.latitude, - this.appointmentNo, - this.dischargeID, - this.lineItemNo, - this.status, - this.description, - this.descriptionN, - this.createdOn, - this.serviceID, - this.createdBy, - this.editedOn, - this.editedBy, - this.channel, - this.clientRequestID, - this.returnedToQueue, - this.pickupDateTime, - this.pickupLocationName, - this.dropoffLocationName, - this.realRRTHaveTransactions, - this.nearestProjectDescription, - this.nearestProjectDescriptionN, - this.projectDescription, - this.projectDescriptionN}); + this.patientID, + this.patientOutSA, + this.isOutPatient, + this.projectID, + this.nearestProjectID, + this.longitude, + this.latitude, + this.appointmentNo, + this.dischargeID, + this.lineItemNo, + this.status, + this.description, + this.descriptionN, + this.createdOn, + this.serviceID, + this.createdBy, + this.editedOn, + this.editedBy, + this.channel, + this.clientRequestID, + this.returnedToQueue, + this.pickupDateTime, + this.pickupLocationName, + this.dropoffLocationName, + this.realRRTHaveTransactions, + this.nearestProjectDescription, + this.nearestProjectDescriptionN, + this.projectDescription, + this.projectDescriptionN}); PrescriptionsOrder.fromJson(Map json) { iD = json['ID']; diff --git a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart index 739bb838..af8a3da8 100644 --- a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart +++ b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart @@ -1,16 +1,16 @@ class RequestGetListPharmacyForPrescriptions { - int latitude; - int longitude; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int itemID; + int ? latitude; + int ? longitude; + double ?versionID; + int ? channel; + int ? languageID; + String ? iPAdress; + String ? generalid; + int ? patientOutSA; + String ? sessionID; + bool ?isDentalAllowedBackend; + int ? deviceTypeID; + int ? itemID; RequestGetListPharmacyForPrescriptions( {this.latitude, @@ -26,7 +26,7 @@ class RequestGetListPharmacyForPrescriptions { this.deviceTypeID, this.itemID}); - RequestGetListPharmacyForPrescriptions.fromJson(Map json) { + RequestGetListPharmacyForPrescriptions.fromJson(Map json) { latitude = json['Latitude']; longitude = json['Longitude']; versionID = json['VersionID']; @@ -41,8 +41,8 @@ class RequestGetListPharmacyForPrescriptions { itemID = json['ItemID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Latitude'] = this.latitude; data['Longitude'] = this.longitude; data['VersionID'] = this.versionID; diff --git a/lib/core/model/Prescriptions/request_prescription_report.dart b/lib/core/model/Prescriptions/request_prescription_report.dart index c8323740..8eeefb7a 100644 --- a/lib/core/model/Prescriptions/request_prescription_report.dart +++ b/lib/core/model/Prescriptions/request_prescription_report.dart @@ -1,23 +1,23 @@ class RequestPrescriptionReport { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - int appointmentNo; - String setupID; - int episodeID; - int clinicID; - int projectID; - int dischargeNo; + double ?versionID; + int ? channel; + int ? languageID; + String ? iPAdress; + String ? generalid; + int ? patientOutSA; + String ? sessionID; + bool ?isDentalAllowedBackend; + int ? deviceTypeID; + int ? patientID; + String ? tokenID; + int ? patientTypeID; + int ? patientType; + int ? appointmentNo; + String ? setupID; + int ? episodeID; + int ? clinicID; + int ? projectID; + int ? dischargeNo; RequestPrescriptionReport( {this.versionID, @@ -40,7 +40,7 @@ class RequestPrescriptionReport { this.projectID, this.dischargeNo}); - RequestPrescriptionReport.fromJson(Map json) { + RequestPrescriptionReport.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; @@ -62,8 +62,8 @@ class RequestPrescriptionReport { dischargeNo = json['DischargeNo']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/model/Prescriptions/request_prescription_report_enh.dart b/lib/core/model/Prescriptions/request_prescription_report_enh.dart index 4905fc2a..9ed39b47 100644 --- a/lib/core/model/Prescriptions/request_prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/request_prescription_report_enh.dart @@ -1,23 +1,23 @@ class RequestPrescriptionReportEnh { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - int appointmentNo; - String setupID; - int dischargeNo; - int episodeID; - int clinicID; - int projectID; + double ?versionID; + int ? channel; + int ? languageID; + String ? iPAdress; + String ? generalid; + int ? patientOutSA; + String ? sessionID; + bool? isDentalAllowedBackend; + int ? deviceTypeID; + int ? patientID; + String ? tokenID; + int ? patientTypeID; + int ? patientType; + int ? appointmentNo; + String ? setupID; + int ? dischargeNo; + int ? episodeID; + int ? clinicID; + int ? projectID; RequestPrescriptionReportEnh( {this.versionID, @@ -39,7 +39,7 @@ class RequestPrescriptionReportEnh { this.clinicID, this.projectID,this.dischargeNo}); - RequestPrescriptionReportEnh.fromJson(Map json) { + RequestPrescriptionReportEnh.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; @@ -60,8 +60,8 @@ class RequestPrescriptionReportEnh { projectID = json['ProjectID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/model/calculate_box_request_model.dart b/lib/core/model/calculate_box_request_model.dart index 80281854..24e75bb7 100644 --- a/lib/core/model/calculate_box_request_model.dart +++ b/lib/core/model/calculate_box_request_model.dart @@ -1,9 +1,9 @@ class CalculateBoxQuantityRequestModel { - int itemCode; - double strength; - int frequency; - int duration; - String vidaAuthTokenID; + int? itemCode; + double? strength; + int? frequency; + int? duration; + String? vidaAuthTokenID; CalculateBoxQuantityRequestModel( {this.itemCode, diff --git a/lib/core/model/hospitals_model.dart b/lib/core/model/hospitals_model.dart index b09807d6..f2c89cfb 100644 --- a/lib/core/model/hospitals_model.dart +++ b/lib/core/model/hospitals_model.dart @@ -1,20 +1,20 @@ class HospitalsModel { - String desciption; + String? desciption; dynamic desciptionN; - int iD; - String legalName; - String legalNameN; - String name; + int? iD; + String? legalName; + String? legalNameN; + String? name; dynamic nameN; - String phoneNumber; - String setupID; - int distanceInKilometers; - bool isActive; - String latitude; - String longitude; - int mainProjectID; + String? phoneNumber; + String? setupID; + int? distanceInKilometers; + bool ?isActive; + String? latitude; + String? longitude; + int? mainProjectID; dynamic projectOutSA; - bool usingInDoctorApp; + bool ?usingInDoctorApp; HospitalsModel({this.desciption, this.desciptionN, @@ -33,7 +33,7 @@ class HospitalsModel { this.projectOutSA, this.usingInDoctorApp}); - HospitalsModel.fromJson(Map json) { + HospitalsModel.fromJson(Map json) { desciption = json['Desciption']; desciptionN = json['DesciptionN']; iD = json['ID']; @@ -52,8 +52,8 @@ class HospitalsModel { usingInDoctorApp = json['UsingInDoctorApp']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Desciption'] = this.desciption; data['DesciptionN'] = this.desciptionN; data['ID'] = this.iD; diff --git a/lib/core/model/note/CreateNoteModel.dart b/lib/core/model/note/CreateNoteModel.dart index ce076705..5d1709ca 100644 --- a/lib/core/model/note/CreateNoteModel.dart +++ b/lib/core/model/note/CreateNoteModel.dart @@ -1,23 +1,23 @@ class CreateNoteModel { - int visitType; - int admissionNo; - int projectID; - int patientTypeID; - int patientID; - int clinicID; - String notes; - int createdBy; - int editedBy; - String nursingRemarks; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? visitType; + int? admissionNo; + int? projectID; + int? patientTypeID; + int? patientID; + int? clinicID; + String? notes; + int ?createdBy; + int ?editedBy; + String ?nursingRemarks; + int ?languageID; + String? stamp; + String ?iPAdress; + double ?versionID; + int ?channel; + String ?tokenID; + String? sessionID; + bool ?isLoginForDoctorApp; + bool ?patientOutSA; CreateNoteModel( {this.visitType, diff --git a/lib/core/model/note/note_model.dart b/lib/core/model/note/note_model.dart index 797f9b6d..713de924 100644 --- a/lib/core/model/note/note_model.dart +++ b/lib/core/model/note/note_model.dart @@ -1,24 +1,24 @@ class NoteModel { - String setupID; - int projectID; - int patientID; - int patientType; - String admissionNo; - int lineItemNo; - int visitType; - String notes; - String assessmentDate; - String visitTime; - int status; - String nursingRemarks; - String createdOn; - String editedOn; - int createdBy; - int admissionClinicID; - String admissionClinicName; - Null doctorClinicName; - String doctorName; - String visitTypeDesc; + String? setupID; + int ?projectID; + int ?patientID; + int ?patientType; + String ?admissionNo; + int ?lineItemNo; + int ?visitType; + String ?notes; + String ?assessmentDate; + String ?visitTime; + int ?status; + String ?nursingRemarks; + String ?createdOn; + String ?editedOn; + int ?createdBy; + int ?admissionClinicID; + String ?admissionClinicName; + dynamic doctorClinicName; + String ?doctorName; + String ?visitTypeDesc; NoteModel( {this.setupID, diff --git a/lib/core/model/note/update_note_model.dart b/lib/core/model/note/update_note_model.dart index 20fd4b86..a3189e39 100644 --- a/lib/core/model/note/update_note_model.dart +++ b/lib/core/model/note/update_note_model.dart @@ -1,40 +1,40 @@ class UpdateNoteReqModel { - int projectID; - int createdBy; - int admissionNo; - int lineItemNo; - String notes; - bool verifiedNote; - bool cancelledNote; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? projectID; + int? createdBy; + int? admissionNo; + int? lineItemNo; + String? notes; + bool? verifiedNote; + bool? cancelledNote; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; UpdateNoteReqModel( {this.projectID, - this.createdBy, - this.admissionNo, - this.lineItemNo, - this.notes, - this.verifiedNote, - this.cancelledNote, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA, - this.patientTypeID}); + this.createdBy, + this.admissionNo, + this.lineItemNo, + this.notes, + this.verifiedNote, + this.cancelledNote, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA, + this.patientTypeID}); UpdateNoteReqModel.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/core/model/patient_muse/PatientMuseResultsModel.dart b/lib/core/model/patient_muse/PatientMuseResultsModel.dart index 401fd1a7..970d48cb 100644 --- a/lib/core/model/patient_muse/PatientMuseResultsModel.dart +++ b/lib/core/model/patient_muse/PatientMuseResultsModel.dart @@ -1,19 +1,19 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PatientMuseResultsModel { - int rowID; - String setupID; - int projectID; - String orderNo; - int lineItemNo; - int patientType; - int patientID; - String procedureID; + int ?rowID; + String? setupID; + int ?projectID; + String? orderNo; + int? lineItemNo; + int? patientType; + int? patientID; + String ?procedureID; dynamic reportData; - String imageURL; - String createdBy; - String createdOn; - DateTime createdOnDateTime; + String? imageURL; + String? createdBy; + String? createdOn; + DateTime? createdOnDateTime; PatientMuseResultsModel( {this.rowID, diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index 437c5885..3a722c96 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -1,16 +1,16 @@ class PatientSearchRequestModel { - int doctorID; - String firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int searchType; - String mobileNo; - String identificationNo; + int ?doctorID; + String?firstName; + String?middleName; + String?lastName; + String?patientMobileNumber; + String?patientIdentificationID; + int ?patientID; + String? from; + String ?to; + int ?searchType; + String? mobileNo; + String? identificationNo; PatientSearchRequestModel( {this.doctorID =0, diff --git a/lib/core/model/procedure/ControlsModel.dart b/lib/core/model/procedure/ControlsModel.dart index b3e8ae9c..e14c7768 100644 --- a/lib/core/model/procedure/ControlsModel.dart +++ b/lib/core/model/procedure/ControlsModel.dart @@ -1,6 +1,6 @@ class Controls { - String code; - String controlValue; + String ?code; + String ?controlValue; Controls({this.code, this.controlValue}); diff --git a/lib/core/model/procedure/Procedure_template_request_model.dart b/lib/core/model/procedure/Procedure_template_request_model.dart index 698178e3..a734382b 100644 --- a/lib/core/model/procedure/Procedure_template_request_model.dart +++ b/lib/core/model/procedure/Procedure_template_request_model.dart @@ -1,31 +1,31 @@ class ProcedureTempleteRequestModel { - int doctorID; - String firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int searchType; - String mobileNo; - String identificationNo; - int editedBy; - int projectID; - int clinicID; - String tokenID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - String vidaAuthTokenID; - String vidaRefreshTokenID; - int deviceTypeID; + int? doctorID; + String? firstName; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; + int? patientID; + String? from; + String? to; + int? searchType; + String? mobileNo; + String? identificationNo; + int? editedBy; + int? projectID; + int? clinicID; + String? tokenID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; + int? deviceTypeID; ProcedureTempleteRequestModel( {this.doctorID, @@ -56,7 +56,7 @@ class ProcedureTempleteRequestModel { this.vidaRefreshTokenID, this.deviceTypeID}); - ProcedureTempleteRequestModel.fromJson(Map json) { + ProcedureTempleteRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; firstName = json['FirstName']; middleName = json['MiddleName']; @@ -86,8 +86,8 @@ class ProcedureTempleteRequestModel { deviceTypeID = json['DeviceTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorID'] = this.doctorID; data['FirstName'] = this.firstName; data['MiddleName'] = this.middleName; diff --git a/lib/core/model/procedure/categories_procedure.dart b/lib/core/model/procedure/categories_procedure.dart index 9e6f847f..e4df9963 100644 --- a/lib/core/model/procedure/categories_procedure.dart +++ b/lib/core/model/procedure/categories_procedure.dart @@ -1,26 +1,26 @@ class CategoriseProcedureModel { - List entityList; - int rowcount; + List ?entityList; + int ?rowcount; dynamic statusMessage; CategoriseProcedureModel( - {this.entityList, this.rowcount, this.statusMessage}); + {this.entityList, this.rowcount, this.statusMessage}); - CategoriseProcedureModel.fromJson(Map json) { + CategoriseProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; statusMessage = json['statusMessage']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,20 +29,20 @@ class CategoriseProcedureModel { } class EntityList { - bool allowedClinic; - String category; - String categoryID; - String genderValidation; - String group; - String orderedValidation; + bool ?allowedClinic; + String ? category; + String ? categoryID; + String ? genderValidation; + String ? group; + String ? orderedValidation; dynamic price; - String procedureId; - String procedureName; - String specialPermission; - String subGroup; - String template; - String remarks; - String type; + String ? procedureId; + String ? procedureName; + String ? specialPermission; + String ? subGroup; + String ? template; + String ? remarks; + String ? type; EntityList( {this.allowedClinic, @@ -60,7 +60,7 @@ class EntityList { this.remarks, this.type}); - EntityList.fromJson(Map json) { + EntityList.fromJson(Map json) { allowedClinic = json['allowedClinic']; category = json['category']; categoryID = json['categoryID']; @@ -75,8 +75,8 @@ class EntityList { template = json['template']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['allowedClinic'] = this.allowedClinic; data['category'] = this.category; data['categoryID'] = this.categoryID; diff --git a/lib/core/model/procedure/get_ordered_procedure_model.dart b/lib/core/model/procedure/get_ordered_procedure_model.dart index c3c7718f..5b0d4695 100644 --- a/lib/core/model/procedure/get_ordered_procedure_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_model.dart @@ -1,26 +1,26 @@ class GetOrderedProcedureModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; GetOrderedProcedureModel( {this.entityList, this.rowcount, this.statusMessage}); - GetOrderedProcedureModel.fromJson(Map json) { + GetOrderedProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; statusMessage = json['statusMessage']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,31 +29,31 @@ class GetOrderedProcedureModel { } class EntityList { - String achiCode; - String appointmentDate; - int appointmentNo; - int categoryID; - String clinicDescription; - String cptCode; - int createdBy; - String createdOn; - String doctorName; - bool isApprovalCreated; - bool isApprovalRequired; - bool isCovered; - bool isInvoiced; - bool isReferralInvoiced; - bool isUncoveredByDoctor; - int lineItemNo; - String orderDate; - int orderNo; - int orderType; - String procedureId; - String procedureName; - String remarks; - String status; - String template; - int doctorID; + String? achiCode; + String? appointmentDate; + int? appointmentNo; + int? categoryID; + String? clinicDescription; + String? cptCode; + int? createdBy; + String? createdOn; + String? doctorName; + bool? isApprovalCreated; + bool? isApprovalRequired; + bool? isCovered; + bool? isInvoiced; + bool? isReferralInvoiced; + bool? isUncoveredByDoctor; + int? lineItemNo; + String? orderDate; + int? orderNo; + int? orderType; + String? procedureId; + String? procedureName; + String? remarks; + String? status; + String? template; + int? doctorID; EntityList( {this.achiCode, @@ -82,7 +82,7 @@ class EntityList { this.template, this.doctorID}); - EntityList.fromJson(Map json) { + EntityList.fromJson(Map json) { achiCode = json['achiCode']; doctorID = json['doctorID']; appointmentDate = json['appointmentDate']; @@ -110,8 +110,8 @@ class EntityList { template = json['template']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['achiCode'] = this.achiCode; data['doctorID'] = this.doctorID; data['appointmentDate'] = this.appointmentDate; diff --git a/lib/core/model/procedure/get_ordered_procedure_request_model.dart b/lib/core/model/procedure/get_ordered_procedure_request_model.dart index dfbd444c..64f1cb2b 100644 --- a/lib/core/model/procedure/get_ordered_procedure_request_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_request_model.dart @@ -1,6 +1,6 @@ class GetOrderedProcedureRequestModel { - String vidaAuthTokenID; - int patientMRN; + String? vidaAuthTokenID; + int? patientMRN; GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN}); diff --git a/lib/core/model/procedure/get_procedure_model.dart b/lib/core/model/procedure/get_procedure_model.dart index 5c83b49b..516c8e42 100644 --- a/lib/core/model/procedure/get_procedure_model.dart +++ b/lib/core/model/procedure/get_procedure_model.dart @@ -1,25 +1,25 @@ class GetProcedureModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; GetProcedureModel({this.entityList, this.rowcount, this.statusMessage}); - GetProcedureModel.fromJson(Map json) { + GetProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; statusMessage = json['statusMessage']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -28,18 +28,18 @@ class GetProcedureModel { } class EntityList { - bool allowedClinic; - String category; - String categoryID; - String genderValidation; - String group; - String orderedValidation; + bool? allowedClinic; + String? category; + String? categoryID; + String? genderValidation; + String? group; + String? orderedValidation; dynamic price; - String procedureId; - String procedureName; - String specialPermission; - String subGroup; - String template; + String? procedureId; + String? procedureName; + String? specialPermission; + String? subGroup; + String? template; EntityList( {this.allowedClinic, @@ -55,7 +55,7 @@ class EntityList { this.subGroup, this.template}); - EntityList.fromJson(Map json) { + EntityList.fromJson(Map json) { allowedClinic = json['allowedClinic']; category = json['category']; categoryID = json['categoryID']; @@ -70,8 +70,8 @@ class EntityList { template = json['template']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['allowedClinic'] = this.allowedClinic; data['category'] = this.category; data['categoryID'] = this.categoryID; diff --git a/lib/core/model/procedure/get_procedure_req_model.dart b/lib/core/model/procedure/get_procedure_req_model.dart index 6202a520..832fbadb 100644 --- a/lib/core/model/procedure/get_procedure_req_model.dart +++ b/lib/core/model/procedure/get_procedure_req_model.dart @@ -1,11 +1,11 @@ class GetProcedureReqModel { - int clinicId; - int patientMRN; - int pageSize; - int pageIndex; - List search; + int? clinicId; + int? patientMRN; + int? pageSize; + int? pageIndex; + List ?search; dynamic category; - String vidaAuthTokenID; + String ?vidaAuthTokenID; GetProcedureReqModel( {this.clinicId, diff --git a/lib/core/model/procedure/post_procedure_req_model.dart b/lib/core/model/procedure/post_procedure_req_model.dart index b12563f8..44ef9775 100644 --- a/lib/core/model/procedure/post_procedure_req_model.dart +++ b/lib/core/model/procedure/post_procedure_req_model.dart @@ -1,11 +1,11 @@ import 'ControlsModel.dart'; class PostProcedureReqModel { - int patientMRN; - int appointmentNo; - int episodeID; - List procedures; - String vidaAuthTokenID; + int? patientMRN; + int? appointmentNo; + int? episodeID; + List ?procedures; + String ?vidaAuthTokenID; PostProcedureReqModel( {this.patientMRN, @@ -19,9 +19,9 @@ class PostProcedureReqModel { appointmentNo = json['AppointmentNo']; episodeID = json['EpisodeID']; if (json['Procedures'] != null) { - procedures = new List(); + procedures = []; json['Procedures'].forEach((v) { - procedures.add(new Procedures.fromJson(v)); + procedures!.add(new Procedures.fromJson(v)); }); } vidaAuthTokenID = json['VidaAuthTokenID']; @@ -33,7 +33,7 @@ class PostProcedureReqModel { data['AppointmentNo'] = this.appointmentNo; data['EpisodeID'] = this.episodeID; if (this.procedures != null) { - data['Procedures'] = this.procedures.map((v) => v.toJson()).toList(); + data['Procedures'] = this.procedures!.map((v) => v.toJson()).toList(); } data['VidaAuthTokenID'] = this.vidaAuthTokenID; return data; @@ -41,9 +41,9 @@ class PostProcedureReqModel { } class Procedures { - String procedure; - String category; - List controls; + String ?procedure; + String ?category; + List ?controls; Procedures({this.procedure, this.category, this.controls}); @@ -51,9 +51,9 @@ class Procedures { procedure = json['Procedure']; category = json['Category']; if (json['Controls'] != null) { - controls = new List(); + controls = []; json['Controls'].forEach((v) { - controls.add(new Controls.fromJson(v)); + controls!.add(new Controls.fromJson(v)); }); } } @@ -63,7 +63,7 @@ class Procedures { data['Procedure'] = this.procedure; data['Category'] = this.category; if (this.controls != null) { - data['Controls'] = this.controls.map((v) => v.toJson()).toList(); + data['Controls'] = this.controls!.map((v) => v.toJson()).toList(); } return data; } diff --git a/lib/core/model/procedure/procedure_category_list_model.dart b/lib/core/model/procedure/procedure_category_list_model.dart index 849e84e5..50048080 100644 --- a/lib/core/model/procedure/procedure_category_list_model.dart +++ b/lib/core/model/procedure/procedure_category_list_model.dart @@ -1,6 +1,6 @@ class ProcedureCategoryListModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; ProcedureCategoryListModel( @@ -8,9 +8,9 @@ class ProcedureCategoryListModel { ProcedureCategoryListModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -20,7 +20,7 @@ class ProcedureCategoryListModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,8 +29,8 @@ class ProcedureCategoryListModel { } class EntityList { - int categoryId; - String categoryName; + int? categoryId; + String? categoryName; EntityList({this.categoryId, this.categoryName}); diff --git a/lib/core/model/procedure/procedure_templateModel.dart b/lib/core/model/procedure/procedure_templateModel.dart index 3b12d646..38a05693 100644 --- a/lib/core/model/procedure/procedure_templateModel.dart +++ b/lib/core/model/procedure/procedure_templateModel.dart @@ -1,13 +1,13 @@ class ProcedureTempleteModel { - String setupID; - int projectID; - int clinicID; - int doctorID; - int templateID; - String templateName; - bool isActive; - int createdBy; - String createdOn; + String? setupID; + int? projectID; + int? clinicID; + int? doctorID; + int? templateID; + String? templateName; + bool? isActive; + int? createdBy; + String? createdOn; dynamic editedBy; dynamic editedOn; diff --git a/lib/core/model/procedure/procedure_template_details_model.dart b/lib/core/model/procedure/procedure_template_details_model.dart index 1fc797ae..13316fa8 100644 --- a/lib/core/model/procedure/procedure_template_details_model.dart +++ b/lib/core/model/procedure/procedure_template_details_model.dart @@ -1,29 +1,29 @@ class ProcedureTempleteDetailsModel { - String setupID; - int projectID; - int clinicID; - int doctorID; - int templateID; - String templateName; - String procedureID; - bool isActive; - int createdBy; - String createdOn; + String? setupID; + int? projectID; + int? clinicID; + int? doctorID; + int? templateID; + String? templateName; + String? procedureID; + bool ?isActive; + int? createdBy; + String? createdOn; dynamic editedBy; dynamic editedOn; - String procedureName; - String procedureNameN; - String alias; - String aliasN; - String categoryID; - String subGroupID; - String categoryDescription; - String categoryDescriptionN; - String categoryAlias; + String? procedureName; + String? procedureNameN; + String? alias; + String? aliasN; + String? categoryID; + String? subGroupID; + String? categoryDescription; + String? categoryDescriptionN; + String? categoryAlias; dynamic riskCategoryID; - String type = "1"; - String remarks; - int selectedType = 0; + String? type = "1"; + String? remarks; + int? selectedType = 0; ProcedureTempleteDetailsModel( {this.setupID, @@ -52,7 +52,7 @@ class ProcedureTempleteDetailsModel { this.type = "1", this.selectedType = 0}); - ProcedureTempleteDetailsModel.fromJson(Map json) { + ProcedureTempleteDetailsModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; clinicID = json['ClinicID']; @@ -77,8 +77,8 @@ class ProcedureTempleteDetailsModel { categoryAlias = json['CategoryAlias']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['ClinicID'] = this.clinicID; @@ -105,12 +105,12 @@ class ProcedureTempleteDetailsModel { } } class ProcedureTempleteDetailsModelList { - List procedureTemplate = List(); - String templateName; - int templateId; + List procedureTemplate =[]; + String? templateName; + int? templateId; ProcedureTempleteDetailsModelList( - {this.templateName, this.templateId, ProcedureTempleteDetailsModel template}) { + {this.templateName, this.templateId, required ProcedureTempleteDetailsModel template}) { procedureTemplate.add(template); } } diff --git a/lib/core/model/procedure/procedure_template_details_request_model.dart b/lib/core/model/procedure/procedure_template_details_request_model.dart index 6df6fc73..7d48e1c8 100644 --- a/lib/core/model/procedure/procedure_template_details_request_model.dart +++ b/lib/core/model/procedure/procedure_template_details_request_model.dart @@ -1,32 +1,32 @@ class ProcedureTempleteDetailsRequestModel { - int doctorID; - String firstName; - int templateID; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int searchType; - String mobileNo; - String identificationNo; - int editedBy; - int projectID; - int clinicID; - String tokenID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - String vidaAuthTokenID; - String vidaRefreshTokenID; - int deviceTypeID; + int? doctorID; + String? firstName; + int? templateID; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; + int? patientID; + String? from; + String? to; + int? searchType; + String? mobileNo; + String? identificationNo; + int? editedBy; + int? projectID; + int? clinicID; + String? tokenID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; + int? deviceTypeID; ProcedureTempleteDetailsRequestModel( {this.doctorID, @@ -58,7 +58,7 @@ class ProcedureTempleteDetailsRequestModel { this.vidaRefreshTokenID, this.deviceTypeID}); - ProcedureTempleteDetailsRequestModel.fromJson(Map json) { + ProcedureTempleteDetailsRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; firstName = json['FirstName']; templateID = json['TemplateID']; @@ -89,8 +89,8 @@ class ProcedureTempleteDetailsRequestModel { deviceTypeID = json['DeviceTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorID'] = this.doctorID; data['FirstName'] = this.firstName; data['TemplateID'] = this.templateID; diff --git a/lib/core/model/procedure/procedure_valadate_model.dart b/lib/core/model/procedure/procedure_valadate_model.dart index 3a3e23cf..431d369a 100644 --- a/lib/core/model/procedure/procedure_valadate_model.dart +++ b/lib/core/model/procedure/procedure_valadate_model.dart @@ -1,6 +1,6 @@ class ProcedureValadteModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; dynamic success; @@ -9,9 +9,9 @@ class ProcedureValadteModel { ProcedureValadteModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -22,7 +22,7 @@ class ProcedureValadteModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -32,8 +32,8 @@ class ProcedureValadteModel { } class EntityList { - String procedureId; - List warringMessages; + String? procedureId; + List? warringMessages; EntityList({this.procedureId, this.warringMessages}); diff --git a/lib/core/model/procedure/procedure_valadate_request_model.dart b/lib/core/model/procedure/procedure_valadate_request_model.dart index 0b872b93..581ff41f 100644 --- a/lib/core/model/procedure/procedure_valadate_request_model.dart +++ b/lib/core/model/procedure/procedure_valadate_request_model.dart @@ -1,9 +1,9 @@ class ProcedureValadteRequestModel { - String vidaAuthTokenID; - int patientMRN; - int appointmentNo; - int episodeID; - List procedure; + String? vidaAuthTokenID; + int? patientMRN; + int? appointmentNo; + int? episodeID; + List? procedure; ProcedureValadteRequestModel( {this.vidaAuthTokenID, diff --git a/lib/core/model/procedure/update_procedure_request_model.dart b/lib/core/model/procedure/update_procedure_request_model.dart index aee39879..a6b92d16 100644 --- a/lib/core/model/procedure/update_procedure_request_model.dart +++ b/lib/core/model/procedure/update_procedure_request_model.dart @@ -1,13 +1,13 @@ import 'ControlsModel.dart'; class UpdateProcedureRequestModel { - int orderNo; - int patientMRN; - int appointmentNo; - int episodeID; - int lineItemNo; - ProcedureDetail procedureDetail; - String vidaAuthTokenID; + int? orderNo; + int? patientMRN; + int? appointmentNo; + int? episodeID; + int? lineItemNo; + ProcedureDetail? procedureDetail; + String? vidaAuthTokenID; UpdateProcedureRequestModel( {this.orderNo, @@ -38,7 +38,7 @@ class UpdateProcedureRequestModel { data['EpisodeID'] = this.episodeID; data['LineItemNo'] = this.lineItemNo; if (this.procedureDetail != null) { - data['procedureDetail'] = this.procedureDetail.toJson(); + data['procedureDetail'] = this.procedureDetail!.toJson(); } data['VidaAuthTokenID'] = this.vidaAuthTokenID; return data; @@ -46,9 +46,9 @@ class UpdateProcedureRequestModel { } class ProcedureDetail { - String procedure; - String category; - List controls; + String? procedure; + String? category; + List? controls; ProcedureDetail({this.procedure, this.category, this.controls}); @@ -56,9 +56,9 @@ class ProcedureDetail { procedure = json['Procedure']; category = json['Category']; if (json['Controls'] != null) { - controls = new List(); + controls = []; json['Controls'].forEach((v) { - controls.add(new Controls.fromJson(v)); + controls!.add(new Controls.fromJson(v)); }); } } @@ -68,7 +68,7 @@ class ProcedureDetail { data['Procedure'] = this.procedure; data['Category'] = this.category; if (this.controls != null) { - data['Controls'] = this.controls.map((v) => v.toJson()).toList(); + data['Controls'] = this.controls!.map((v) => v.toJson()).toList(); } return data; } diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index e09f269a..4c16151c 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -8,17 +8,17 @@ class FinalRadiology { dynamic invoiceNo; dynamic doctorID; dynamic clinicID; - DateTime orderDate; - DateTime reportDate; + DateTime? orderDate; + DateTime ?reportDate; dynamic reportData; dynamic imageURL; dynamic procedureID; dynamic appodynamicmentNo; dynamic dIAPacsURL; - bool isRead; + bool? isRead; dynamic readOn; var admissionNo; - bool isInOutPatient; + bool ?isInOutPatient; dynamic actualDoctorRate; dynamic clinicDescription; dynamic dIAPACSURL; @@ -28,8 +28,8 @@ class FinalRadiology { dynamic doctorTitle; dynamic gender; dynamic genderDescription; - bool isActiveDoctorProfile; - bool isExecludeDoctor; + bool? isActiveDoctorProfile; + bool ?isExecludeDoctor; dynamic isInOutPatientDescription; dynamic isInOutPatientDescriptionN; dynamic nationalityFlagURL; @@ -39,10 +39,10 @@ class FinalRadiology { dynamic qR; dynamic reportDataHTML; dynamic reportDataTextdynamic; - List speciality; - bool isCVI; - bool isRadMedicalReport; - bool isLiveCareAppodynamicment; + List? speciality; + bool ?isCVI; + bool ?isRadMedicalReport; + bool ?isLiveCareAppodynamicment; FinalRadiology( {this.setupID, @@ -186,9 +186,9 @@ class FinalRadiology { class FinalRadiologyList { dynamic filterName = ""; - List finalRadiologyList = List(); + List finalRadiologyList = []; - FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) { + FinalRadiologyList({this.filterName, required FinalRadiology finalRadiology}) { finalRadiologyList.add(finalRadiology); } } diff --git a/lib/core/model/radiology/request_patient_rad_orders_details.dart b/lib/core/model/radiology/request_patient_rad_orders_details.dart index 9e3458d5..b42bc723 100644 --- a/lib/core/model/radiology/request_patient_rad_orders_details.dart +++ b/lib/core/model/radiology/request_patient_rad_orders_details.dart @@ -1,24 +1,24 @@ class RequestPatientRadOrdersDetails { - int projectID; - int orderNo; - int invoiceNo; - String setupID; - String procedureID; - bool isMedicalReport; - bool isCVI; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; + int? projectID; + int? orderNo; + int? invoiceNo; + String? setupID; + String? procedureID; + bool? isMedicalReport; + bool? isCVI; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; RequestPatientRadOrdersDetails( {this.projectID, @@ -42,7 +42,7 @@ class RequestPatientRadOrdersDetails { this.patientTypeID, this.patientType}); - RequestPatientRadOrdersDetails.fromJson(Map json) { + RequestPatientRadOrdersDetails.fromJson(Map json) { projectID = json['ProjectID']; orderNo = json['OrderNo']; invoiceNo = json['InvoiceNo']; @@ -65,8 +65,8 @@ class RequestPatientRadOrdersDetails { patientType = json['PatientType']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.projectID; data['OrderNo'] = this.orderNo; data['InvoiceNo'] = this.invoiceNo; diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart index 6d68653d..3b9e961a 100644 --- a/lib/core/model/radiology/request_send_rad_report_email.dart +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -1,30 +1,30 @@ class RequestSendRadReportEmail { - int channel; - String clinicName; - String dateofBirth; - int deviceTypeID; - String doctorName; - String generalid; - int invoiceNo; - String iPAdress; - bool isDentalAllowedBackend; - int languageID; - String orderDate; - int patientID; - String patientIditificationNum; - String patientMobileNumber; - String patientName; - int patientOutSA; - int patientType; - int patientTypeID; - int projectID; - String projectName; - String radResult; - String sessionID; - String setupID; - String to; - String tokenID; - double versionID; + int? channel; + String? clinicName; + String? dateofBirth; + int? deviceTypeID; + String? doctorName; + String? generalid; + int? invoiceNo; + String? iPAdress; + bool ?isDentalAllowedBackend; + int? languageID; + String? orderDate; + int? patientID; + String? patientIditificationNum; + String? patientMobileNumber; + String? patientName; + int? patientOutSA; + int? patientType; + int? patientTypeID; + int? projectID; + String? projectName; + String? radResult; + String? sessionID; + String? setupID; + String? to; + String? tokenID; + double? versionID; RequestSendRadReportEmail( {this.channel, @@ -54,7 +54,7 @@ class RequestSendRadReportEmail { this.tokenID, this.versionID}); - RequestSendRadReportEmail.fromJson(Map json) { + RequestSendRadReportEmail.fromJson(Map json) { channel = json['Channel']; clinicName = json['ClinicName']; dateofBirth = json['DateofBirth']; @@ -83,8 +83,8 @@ class RequestSendRadReportEmail { versionID = json['VersionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Channel'] = this.channel; data['ClinicName'] = this.clinicName; data['DateofBirth'] = this.dateofBirth; diff --git a/lib/core/model/referral/DischargeReferralPatient.dart b/lib/core/model/referral/DischargeReferralPatient.dart index dff63bfc..d104ccae 100644 --- a/lib/core/model/referral/DischargeReferralPatient.dart +++ b/lib/core/model/referral/DischargeReferralPatient.dart @@ -2,56 +2,56 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class DischargeReferralPatient { dynamic rowID; - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; dynamic doctorNameN; - String firstName; - String middleName; - String lastName; + String? firstName; + String? middleName; + String? lastName; dynamic firstNameN; dynamic middleNameN; dynamic lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; dynamic nursingStationID; dynamic description; - String nationalityName; + String? nationalityName; dynamic nationalityNameN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - DateTime referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - String mAXResponseTime; - String dischargeDate; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + DateTime ?referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + String? mAXResponseTime; + String? dischargeDate; dynamic clinicID; - String age; - String clinicDescription; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referringDoctorName; + String? age; + String? clinicDescription; + String? frequencyDescription; + String? genderDescription; + bool?isDoctorLate; + bool? isDoctorResponse; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referringDoctorName; DischargeReferralPatient( {this.rowID, @@ -106,7 +106,7 @@ class DischargeReferralPatient { this.referringClinicDescription, this.referringDoctorName}); - DischargeReferralPatient.fromJson(Map json) { + DischargeReferralPatient.fromJson(Map json) { rowID = json['RowID']; projectID = json['ProjectID']; lineItemNo = json['LineItemNo']; @@ -160,8 +160,8 @@ class DischargeReferralPatient { referringDoctorName = json['ReferringDoctorName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RowID'] = this.rowID; data['ProjectID'] = this.projectID; data['LineItemNo'] = this.lineItemNo; diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index 797109dd..87757148 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -2,65 +2,65 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class MyReferralPatientModel { dynamic rowID; - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; dynamic doctorNameN; - String firstName; - String middleName; - String lastName; + String? firstName; + String? middleName; + String? lastName; dynamic firstNameN; dynamic middleNameN; dynamic lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; dynamic nursingStationID; dynamic description; - String nationalityName; + String? nationalityName; dynamic nationalityNameN; - String clinicDescription; - String clinicDescriptionN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - DateTime referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - String mAXResponseTime; - int episodeID; - int appointmentNo; - String appointmentDate; - int appointmentType; - int patientMRN; - String createdOn; - int clinicID; - String nationalityID; - String age; - String doctorImageURL; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nationalityFlagURL; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referringDoctorName; + String? clinicDescription; + String? clinicDescriptionN; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + DateTime ?referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + String? mAXResponseTime; + int? episodeID; + int? appointmentNo; + String? appointmentDate; + int? appointmentType; + int? patientMRN; + String? createdOn; + int? clinicID; + String? nationalityID; + String? age; + String? doctorImageURL; + String? frequencyDescription; + String? genderDescription; + bool? isDoctorLate; + bool? isDoctorResponse; + String? nationalityFlagURL; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referringDoctorName; MyReferralPatientModel( {this.rowID, @@ -124,7 +124,7 @@ class MyReferralPatientModel { this.referringClinicDescription, this.referringDoctorName}); - MyReferralPatientModel.fromJson(Map json) { + MyReferralPatientModel.fromJson(Map json) { rowID = json['RowID']; projectID = json['ProjectID']; lineItemNo = json['LineItemNo']; @@ -187,8 +187,8 @@ class MyReferralPatientModel { referringDoctorName = json['ReferringDoctorName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RowID'] = this.rowID; data['ProjectID'] = this.projectID; data['LineItemNo'] = this.lineItemNo; @@ -253,6 +253,6 @@ class MyReferralPatientModel { } get patientName { - return this.firstName+" "+this.lastName; + return this.firstName!+" "+this.lastName!; } } diff --git a/lib/core/model/referral/ReferralRequest.dart b/lib/core/model/referral/ReferralRequest.dart index b3ad1f03..5b7ffc05 100644 --- a/lib/core/model/referral/ReferralRequest.dart +++ b/lib/core/model/referral/ReferralRequest.dart @@ -1,28 +1,28 @@ class ReferralRequest { - String roomID; - String referralClinic; - String referralDoctor; - int createdBy; - int editedBy; - int patientID; - int patientTypeID; - int referringClinic; - int referringDoctor; - int projectID; - int admissionNo; - String referringDoctorRemarks; - String priority; - String frequency; - String extension; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + String? roomID; + String? referralClinic; + String? referralDoctor; + int? createdBy; + int? editedBy; + int? patientID; + int? patientTypeID; + int? referringClinic; + int? referringDoctor; + int? projectID; + int? admissionNo; + String? referringDoctorRemarks; + String? priority; + String? frequency; + String? extension; + int? languageID; + String? stamp; + String? iPAdress; + double ?versionID; + int? channel; + String? tokenID; + String? sessionID; + bool ?isLoginForDoctorApp; + bool ?patientOutSA; ReferralRequest( {this.roomID, @@ -50,7 +50,7 @@ class ReferralRequest { this.isLoginForDoctorApp, this.patientOutSA}); - ReferralRequest.fromJson(Map json) { + ReferralRequest.fromJson(Map json) { roomID = json['RoomID']; referralClinic = json['ReferralClinic']; referralDoctor = json['ReferralDoctor']; @@ -77,8 +77,8 @@ class ReferralRequest { patientOutSA = json['PatientOutSA']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RoomID'] = this.roomID; data['ReferralClinic'] = this.referralClinic; data['ReferralDoctor'] = this.referralDoctor; diff --git a/lib/core/model/search_drug/get_medication_response_model.dart b/lib/core/model/search_drug/get_medication_response_model.dart index a42a8b47..24079b5e 100644 --- a/lib/core/model/search_drug/get_medication_response_model.dart +++ b/lib/core/model/search_drug/get_medication_response_model.dart @@ -1,13 +1,13 @@ class GetMedicationResponseModel { - String description; - String genericName; - int itemId; - String keywords; + String? description; + String? genericName; + int ?itemId; + String? keywords; dynamic price; dynamic quantity; dynamic mediSpanGPICode; - bool isNarcotic; - String uom; + bool ?isNarcotic; + String? uom; GetMedicationResponseModel( {this.description, this.genericName, @@ -19,7 +19,7 @@ class GetMedicationResponseModel { this.uom, this.mediSpanGPICode}); - GetMedicationResponseModel.fromJson(Map json) { + GetMedicationResponseModel.fromJson(Map json) { description = json['Description']; genericName = json['GenericName']; itemId = json['ItemId']; @@ -31,8 +31,8 @@ class GetMedicationResponseModel { uom = json['uom']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Description'] = this.description; data['GenericName'] = this.genericName; data['ItemId'] = this.itemId; diff --git a/lib/core/model/search_drug/item_by_medicine_model.dart b/lib/core/model/search_drug/item_by_medicine_model.dart index 0a93a4f1..a95988db 100644 --- a/lib/core/model/search_drug/item_by_medicine_model.dart +++ b/lib/core/model/search_drug/item_by_medicine_model.dart @@ -1,27 +1,27 @@ class ItemByMedicineModel { - List frequencies; - List routes; - List strengths; + List? frequencies; + List ?routes; + List? strengths; ItemByMedicineModel({this.frequencies, this.routes, this.strengths}); ItemByMedicineModel.fromJson(Map json) { if (json['frequencies'] != null) { - frequencies = new List(); + frequencies = []; json['frequencies'].forEach((v) { - frequencies.add(new Frequencies.fromJson(v)); + frequencies!.add(new Frequencies.fromJson(v)); }); } if (json['routes'] != null) { - routes = new List(); + routes = []; json['routes'].forEach((v) { - routes.add(new Routes.fromJson(v)); + routes!.add(new Routes.fromJson(v)); }); } if (json['strengths'] != null) { - strengths = new List(); + strengths = []; json['strengths'].forEach((v) { - strengths.add(new Strengths.fromJson(v)); + strengths!.add(new Strengths.fromJson(v)); }); } } @@ -29,22 +29,22 @@ class ItemByMedicineModel { Map toJson() { final Map data = new Map(); if (this.frequencies != null) { - data['frequencies'] = this.frequencies.map((v) => v.toJson()).toList(); + data['frequencies'] = this.frequencies!.map((v) => v.toJson()).toList(); } if (this.routes != null) { - data['routes'] = this.routes.map((v) => v.toJson()).toList(); + data['routes'] = this.routes!.map((v) => v.toJson()).toList(); } if (this.strengths != null) { - data['strengths'] = this.strengths.map((v) => v.toJson()).toList(); + data['strengths'] = this.strengths!.map((v) => v.toJson()).toList(); } return data; } } class Frequencies { - String description; - bool isDefault; - int parameterCode; + String? description; + bool? isDefault; + int ?parameterCode; Frequencies({this.description, this.isDefault, this.parameterCode}); @@ -64,9 +64,9 @@ class Frequencies { } class Strengths { - String description; - bool isDefault; - int parameterCode; + String? description; + bool ?isDefault; + int ?parameterCode; Strengths({this.description, this.isDefault, this.parameterCode}); @@ -86,9 +86,9 @@ class Strengths { } class Routes { - String description; - bool isDefault; - int parameterCode; + String ?description; + bool ?isDefault; + int ?parameterCode; Routes({this.description, this.isDefault, this.parameterCode}); diff --git a/lib/core/model/search_drug/item_by_medicine_request_model.dart b/lib/core/model/search_drug/item_by_medicine_request_model.dart index 7460044b..7ec3e21e 100644 --- a/lib/core/model/search_drug/item_by_medicine_request_model.dart +++ b/lib/core/model/search_drug/item_by_medicine_request_model.dart @@ -1,6 +1,6 @@ class ItemByMedicineRequestModel { - String vidaAuthTokenID; - int medicineCode; + String ?vidaAuthTokenID; + int ?medicineCode; ItemByMedicineRequestModel({this.vidaAuthTokenID, this.medicineCode}); diff --git a/lib/core/model/search_drug/search_drug_model.dart b/lib/core/model/search_drug/search_drug_model.dart index 396526c1..aa7739a2 100644 --- a/lib/core/model/search_drug/search_drug_model.dart +++ b/lib/core/model/search_drug/search_drug_model.dart @@ -1,15 +1,15 @@ class SearchDrugModel { - List entityList; - int rowcount; + List? entityList; + int ?rowcount; dynamic statusMessage; SearchDrugModel({this.entityList, this.rowcount, this.statusMessage}); SearchDrugModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -19,7 +19,7 @@ class SearchDrugModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; diff --git a/lib/core/model/search_drug/search_drug_request_model.dart b/lib/core/model/search_drug/search_drug_request_model.dart index b64e7d18..8c725c86 100644 --- a/lib/core/model/search_drug/search_drug_request_model.dart +++ b/lib/core/model/search_drug/search_drug_request_model.dart @@ -1,5 +1,5 @@ class SearchDrugRequestModel { - List search; + List ?search; // String vidaAuthTokenID; SearchDrugRequestModel({this.search}); diff --git a/lib/core/model/sick_leave/sick_leave_patient_model.dart b/lib/core/model/sick_leave/sick_leave_patient_model.dart index 3c78f1ff..db701206 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_model.dart @@ -1,41 +1,41 @@ import 'package:doctor_app_flutter/widgets/shared/StarRating.dart'; class SickLeavePatientModel { - String setupID; - int projectID; - int patientID; - int patientType; - int clinicID; - int doctorID; - int requestNo; - String requestDate; - int sickLeaveDays; - int appointmentNo; - int admissionNo; - int actualDoctorRate; - String appointmentDate; - String clinicName; - String doctorImageURL; - String doctorName; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isLiveCareAppointment; - int noOfPatientsRate; + String? setupID; + int? projectID; + int? patientID; + int? patientType; + int? clinicID; + int? doctorID; + int? requestNo; + String? requestDate; + int? sickLeaveDays; + int? appointmentNo; + int? admissionNo; + int? actualDoctorRate; + String? appointmentDate; + String? clinicName; + String? doctorImageURL; + String? doctorName; + int? doctorRate; + String? doctorTitle; + int? gender; + String? genderDescription; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; + String? isInOutPatientDescription; + String? isInOutPatientDescriptionN; + bool? isLiveCareAppointment; + int? noOfPatientsRate; dynamic patientName; - String projectName; - String qR; - // List speciality; - String strRequestDate; - String startDate; - String endDate; + String? projectName; + String? qR; + // List speciality; + String? strRequestDate; + String? startDate; + String? endDate; SickLeavePatientModel( {this.setupID, @@ -74,7 +74,7 @@ class SickLeavePatientModel { this.startDate, this.endDate}); - SickLeavePatientModel.fromJson(Map json) { + SickLeavePatientModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; @@ -107,14 +107,14 @@ class SickLeavePatientModel { patientName = json['PatientName']; projectName = json['ProjectName']; qR = json['QR']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); strRequestDate = json['StrRequestDate']; startDate = json['StartDate']; endDate = json['EndDate']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; diff --git a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart index ec588316..ff5079b1 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart @@ -1,16 +1,16 @@ class SickLeavePatientRequestModel { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - int deviceTypeID; - int patientType; - int patientTypeID; - String tokenID; - int patientID; - String sessionID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + int? deviceTypeID; + int? patientType; + int? patientTypeID; + String? tokenID; + int? patientID; + String? sessionID; SickLeavePatientRequestModel( {this.versionID, @@ -26,7 +26,7 @@ class SickLeavePatientRequestModel { this.patientID, this.sessionID}); - SickLeavePatientRequestModel.fromJson(Map json) { + SickLeavePatientRequestModel.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; @@ -41,8 +41,8 @@ class SickLeavePatientRequestModel { sessionID = json['SessionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index 09ee7c49..ac069304 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -6,33 +6,29 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; class BaseService { - String error; + String ?error; bool hasError = false; BaseAppClient baseAppClient = BaseAppClient(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - DoctorProfileModel doctorProfile; + DoctorProfileModel ?doctorProfile; List patientArrivalList = []; //TODO add the user login model when we need it - Future getDoctorProfile({bool isGetProfile = false}) async { + Future ? getDoctorProfile({bool isGetProfile = false}) async { if(isGetProfile) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; - } + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile!; } } if (doctorProfile == null) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; - } + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile!; } return null; } else { @@ -40,7 +36,7 @@ class BaseService { } } - Future getPatientArrivalList(String date,{String fromDate, int patientMrn = -1, int appointmentNo = -1}) async{ + Future getPatientArrivalList(String date,{String? fromDate, int patientMrn = -1, int appointmentNo = -1}) async{ hasError = false; Map body = Map(); body['From'] = fromDate == null ? date : fromDate; diff --git a/lib/core/service/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index b35d24f2..401ec76e 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -7,7 +7,7 @@ class DashboardService extends BaseService { List get dashboardItemsList => _dashboardItemsList; bool hasVirtualClinic = false; - String sServiceID; + String ?sServiceID; Future getDashboard() async { hasError = false; From 5a477848db66e7cc68e51ec466dfd2d855f9966f Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Jun 2021 11:04:59 +0300 Subject: [PATCH 04/18] Migrate view model to flutter 2 --- .../viewModel/DischargedPatientViewModel.dart | 4 +- lib/core/viewModel/InsuranceViewModel.dart | 8 +- .../viewModel/LiveCarePatientViewModel.dart | 26 ++-- .../PatientMedicalReportViewModel.dart | 8 +- .../viewModel/authentication_view_model.dart | 78 ++++++----- lib/core/viewModel/base_view_model.dart | 24 ++-- lib/core/viewModel/dashboard_view_model.dart | 14 +- .../viewModel/doctor_replay_view_model.dart | 4 +- lib/core/viewModel/hospitals_view_model.dart | 12 +- lib/core/viewModel/labs_view_model.dart | 54 ++++---- .../viewModel/leave_rechdule_response.dart | 28 ++-- lib/core/viewModel/livecare_view_model.dart | 2 +- .../viewModel/medical_file_view_model.dart | 4 +- lib/core/viewModel/medicine_view_model.dart | 40 +++--- .../patient-admission-request-viewmodel.dart | 22 ++-- .../viewModel/patient-referral-viewmodel.dart | 122 +++++++++--------- .../viewModel/patient-ucaf-viewmodel.dart | 31 +++-- .../patient-vital-sign-viewmodel.dart | 5 +- lib/core/viewModel/patient_view_model.dart | 54 ++++---- 19 files changed, 265 insertions(+), 275 deletions(-) diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index 9df347e2..f8e30851 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -42,7 +42,7 @@ class DischargedPatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _dischargedPatientService.getDischargedPatient(); if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error; + error = _dischargedPatientService.error!; setState(ViewState.Error); } else { filterData = myDischargedPatient; @@ -54,7 +54,7 @@ class DischargedPatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _dischargedPatientService.gtMyDischargeReferralPatient(); if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error; + error = _dischargedPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/InsuranceViewModel.dart b/lib/core/viewModel/InsuranceViewModel.dart index 46f48d35..edc57abd 100644 --- a/lib/core/viewModel/InsuranceViewModel.dart +++ b/lib/core/viewModel/InsuranceViewModel.dart @@ -16,12 +16,12 @@ class InsuranceViewModel extends BaseViewModel { _insuranceCardService.insuranceApprovalInPatient; Future getInsuranceApproval(PatiantInformtion patient, - {int appointmentNo, int projectId}) async { + {int ? appointmentNo, int? projectId}) async { error = ""; setState(ViewState.Busy); if (appointmentNo != null) await _insuranceCardService.getInsuranceApproval(patient, - appointmentNo: appointmentNo, projectId: projectId); + appointmentNo: appointmentNo, projectId: projectId!); else await _insuranceCardService.getInsuranceApproval(patient); if (_insuranceCardService.hasError) { @@ -31,13 +31,13 @@ class InsuranceViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getInsuranceInPatient({int mrn}) async { + Future getInsuranceInPatient({required int mrn}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _insuranceCardService.getInsuranceApprovalInPatient(mrn: mrn); if (_insuranceCardService.hasError) { - error = _insuranceCardService.error; + error = _insuranceCardService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 844ebf55..1899028a 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -35,7 +35,7 @@ class LiveCarePatientViewModel extends BaseViewModel { await _liveCarePatientServices.getPendingPatientERForDoctorApp( pendingPatientERForDoctorAppRequestModel); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { @@ -47,7 +47,7 @@ class LiveCarePatientViewModel extends BaseViewModel { Future endCall(int vCID, bool isPatient) async { await getDoctorProfile(isGetProfile: true); EndCallReq endCallReq = new EndCallReq(); - endCallReq.doctorId = doctorProfile.doctorID; + endCallReq.doctorId = doctorProfile!.doctorID; endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.vCID = vCID; endCallReq.isDestroy = isPatient; @@ -55,7 +55,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.endCall(endCallReq); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -67,24 +67,24 @@ class LiveCarePatientViewModel extends BaseViewModel { return token; } - Future startCall({int vCID, bool isReCall}) async { + Future startCall({required int vCID, required bool isReCall}) async { StartCallReq startCallReq = new StartCallReq(); await getDoctorProfile(); - startCallReq.clinicId = super.doctorProfile.clinicID; + startCallReq.clinicId = super.doctorProfile!.clinicID; startCallReq.vCID = vCID; //["VC_ID"]; startCallReq.isrecall = isReCall; - startCallReq.doctorId = doctorProfile.doctorID; + startCallReq.doctorId = doctorProfile!.doctorID; startCallReq.isOutKsa = false; //["IsOutKSA"]; - startCallReq.projectName = doctorProfile.projectName; - startCallReq.docotrName = doctorProfile.doctorName; - startCallReq.clincName = doctorProfile.clinicDescription; - startCallReq.docSpec = doctorProfile.doctorTitleForProfile; + startCallReq.projectName = doctorProfile!.projectName; + startCallReq.docotrName = doctorProfile!.doctorName; + startCallReq.clincName = doctorProfile!.clinicDescription; + startCallReq.docSpec = doctorProfile!.doctorTitleForProfile; startCallReq.generalid = 'Cs2020@2016\$2958'; setState(ViewState.BusyLocal); await _liveCarePatientServices.startCall(startCallReq); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -95,7 +95,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.endCallWithCharge(vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { await getPendingPatientERForDoctorApp(); @@ -107,7 +107,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.transferToAdmin(vcID, notes); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { await getPendingPatientERForDoctorApp(); diff --git a/lib/core/viewModel/PatientMedicalReportViewModel.dart b/lib/core/viewModel/PatientMedicalReportViewModel.dart index 999a0530..4a9045be 100644 --- a/lib/core/viewModel/PatientMedicalReportViewModel.dart +++ b/lib/core/viewModel/PatientMedicalReportViewModel.dart @@ -19,7 +19,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.getMedicalReportList(patient); if (_service.hasError) { - error = _service.error; + error = _service.error!; setState(ViewState.ErrorLocal); // ViewState.Error } else setState(ViewState.Idle); @@ -29,7 +29,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.getMedicalReportTemplate(); if (_service.hasError) { - error = _service.error; + error = _service.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -39,7 +39,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.insertMedicalReport(patient, htmlText); if (_service.hasError) { - error = _service.error; + error = _service.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -50,7 +50,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.verifyMedicalReport(patient, medicalReport); if (_service.hasError) { - error = _service.error; + error = _service.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index a5028266..c547b150 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -59,12 +59,12 @@ class AuthenticationViewModel extends BaseViewModel { get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; - NewLoginInformationModel loggedUser; - GetIMEIDetailsModel user; + late NewLoginInformationModel loggedUser; + late GetIMEIDetailsModel ? user; UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); - List _availableBiometrics; + late List _availableBiometrics; final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; bool isLogin = false; @@ -72,7 +72,7 @@ class AuthenticationViewModel extends BaseViewModel { bool isFromLogin = false; APP_STATUS app_status = APP_STATUS.LOADING; - AuthenticationViewModel({bool checkDeviceInfo = false}) { + AuthenticationViewModel() { getDeviceInfoFromFirebase(); getDoctorProfile(); } @@ -82,7 +82,7 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.Busy); await _authService.selectDeviceImei(imei); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -121,7 +121,7 @@ class AuthenticationViewModel extends BaseViewModel { await _authService.insertDeviceImei(insertIMEIDetailsModel); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -133,14 +133,14 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _authService.login(userInfo); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { sharedPref.setInt(PROJECT_ID, userInfo.projectID); loggedUser = loginInfo; saveObjToString(LOGGED_IN_USER, loginInfo); sharedPref.remove(LAST_LOGIN_USER); - sharedPref.setString(TOKEN, loginInfo.logInTokenID); + sharedPref.setString(TOKEN, loginInfo.logInTokenID!); setState(ViewState.Idle); } } @@ -150,37 +150,37 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.BusyLocal); ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( - iMEI: user.iMEI, - facilityId: user.projectID, - memberID: user.doctorID, - zipCode: user.outSA == true ? '971' : '966', - mobileNumber: user.mobile, + iMEI: user!.iMEI, + facilityId: user!.projectID, + memberID: user!.doctorID, + zipCode: user!.outSA == true ? '971' : '966', + mobileNumber: user!.mobile, oTPSendType: authMethodType.getTypeIdService(), isMobileFingerPrint: 1, - vidaAuthTokenID: user.vidaAuthTokenID, - vidaRefreshTokenID: user.vidaRefreshTokenID); + vidaAuthTokenID: user!.vidaAuthTokenID, + vidaRefreshTokenID: user!.vidaRefreshTokenID); await _authService.sendActivationCodeVerificationScreen(activationCodeModel); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } /// send activation code for silent login - Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password }) async { + Future sendActivationCodeForDoctorApp({required AuthMethodTypes authMethodType, required String password }) async { setState(ViewState.BusyLocal); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( facilityId: projectID, - memberID: loggedUser.listMemberInformation[0].memberID, + memberID: loggedUser.listMemberInformation![0].memberID, zipCode: loggedUser.zipCode, mobileNumber: loggedUser.mobileNumber, otpSendType: authMethodType.getTypeIdService().toString(), password: password); await _authService.sendActivationCodeForDoctorApp(activationCodeModel); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -188,24 +188,24 @@ class AuthenticationViewModel extends BaseViewModel { /// check activation code for sms and whats app - Future checkActivationCodeForDoctorApp({String activationCode}) async { + Future checkActivationCodeForDoctorApp({required String activationCode}) async { setState(ViewState.BusyLocal); CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( zipCode: - loggedUser != null ? loggedUser.zipCode :user.zipCode, + loggedUser != null ? loggedUser.zipCode :user!.zipCode, mobileNumber: - loggedUser != null ? loggedUser.mobileNumber : user.mobile, + loggedUser != null ? loggedUser.mobileNumber : user!.mobile, projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) - : user.projectID, + : user!.projectID, logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), activationCode: activationCode ?? '0000', oTPSendType: await sharedPref.getInt(OTP_TYPE), generalid: "Cs2020@2016\$2958"); await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -218,7 +218,7 @@ class AuthenticationViewModel extends BaseViewModel { getHospitalsRequestModel.memberID = memberID; await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { - error = _hospitalsService.error; + error = _hospitalsService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -255,13 +255,13 @@ class AuthenticationViewModel extends BaseViewModel { /// add  token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { print("VerificationCode : " + - sendActivationCodeForDoctorAppResponseModel.verificationCode); + sendActivationCodeForDoctorAppResponseModel.verificationCode!); sharedPref.setString(VIDA_AUTH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); + sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); + sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); sharedPref.setString(LOGIN_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.logInTokenID); + sendActivationCodeForDoctorAppResponseModel.logInTokenID!); } saveObjToString(String key, value) async { @@ -303,7 +303,7 @@ class AuthenticationViewModel extends BaseViewModel { languageID: 2);//TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { localSetDoctorProfile(doctorProfilesList.first); @@ -315,18 +315,18 @@ class AuthenticationViewModel extends BaseViewModel { onCheckActivationCodeSuccess() async { sharedPref.setString( TOKEN, - checkActivationCodeForDoctorAppRes.authenticationTokenID); + checkActivationCodeForDoctorAppRes.authenticationTokenID!); if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && - checkActivationCodeForDoctorAppRes.listDoctorProfile + checkActivationCodeForDoctorAppRes.listDoctorProfile! .isNotEmpty) { localSetDoctorProfile( - checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); + checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); } else { sharedPref.setObj( CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); ClinicModel clinic = ClinicModel.fromJson( - checkActivationCodeForDoctorAppRes.listDoctorsClinic[0] + checkActivationCodeForDoctorAppRes.listDoctorsClinic![0] .toJson()); await getDoctorProfileBasedOnClinic(clinic); } @@ -336,10 +336,8 @@ class AuthenticationViewModel extends BaseViewModel { Future checkIfBiometricAvailable(BiometricType biometricType) async { bool isAvailable = false; await _getAvailableBiometrics(); - if (_availableBiometrics != null) { - for (var i = 0; i < _availableBiometrics.length; i++) { - if (biometricType == _availableBiometrics[i]) isAvailable = true; - } + for (var i = 0; i < _availableBiometrics.length; i++) { + if (biometricType == _availableBiometrics[i]) isAvailable = true; } return isAvailable; } @@ -367,11 +365,11 @@ class AuthenticationViewModel extends BaseViewModel { } var token = await _firebaseMessaging.getToken(); if (DEVICE_TOKEN == "") { - DEVICE_TOKEN = token; + DEVICE_TOKEN = token!; await _authService.selectDeviceImei(DEVICE_TOKEN); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { if (_authService.dashboardItemsList.length > 0) { diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index 9d7032aa..cdc0f3d9 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; class BaseViewModel extends ChangeNotifier { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - DoctorProfileModel doctorProfile; + DoctorProfileModel ? doctorProfile; ViewState _state = ViewState.Idle; bool isInternetConnection = true; @@ -22,24 +22,20 @@ class BaseViewModel extends ChangeNotifier { notifyListeners(); } - Future getDoctorProfile({bool isGetProfile = false}) async { + Future ?getDoctorProfile({bool isGetProfile = false}) async { if(isGetProfile) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; - } + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; } } if (doctorProfile == null) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; - } + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; } return null; } else { diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 6f34f034..706b828e 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -20,7 +20,7 @@ class DashboardViewModel extends BaseViewModel { bool get hasVirtualClinic => _dashboardService.hasVirtualClinic; - String get sServiceID => _dashboardService.sServiceID; + String? get sServiceID => _dashboardService.sServiceID; Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { @@ -31,9 +31,9 @@ class DashboardViewModel extends BaseViewModel { _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); - _firebaseMessaging.getToken().then((String token) async { + _firebaseMessaging.getToken().then((String ?token) async { if (token != '') { - DEVICE_TOKEN = token; + DEVICE_TOKEN = token!; authProvider.insertDeviceImei(); } }); @@ -43,7 +43,7 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Busy); await _dashboardService.getDashboard(); if (_dashboardService.hasError) { - error = _dashboardService.error; + error = _dashboardService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -53,7 +53,7 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Busy); await _dashboardService.checkDoctorHasLiveCare(); if (_dashboardService.hasError) { - error = _dashboardService.error; + error = _dashboardService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -64,9 +64,9 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await getDoctorProfile(); ClinicModel clinicModel = ClinicModel( - doctorID: doctorProfile.doctorID, + doctorID: doctorProfile!.doctorID, clinicID: clinicId, - projectID: doctorProfile.projectID, + projectID: doctorProfile!.projectID, ); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); if (authProvider.state == ViewState.ErrorLocal) { diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 18f1a9f5..37a61afe 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -15,7 +15,7 @@ class DoctorReplayViewModel extends BaseViewModel { setState(ViewState.Busy); await _doctorReplyService.getDoctorReply(); if (_doctorReplyService.hasError) { - error = _doctorReplyService.error; + error = _doctorReplyService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -26,7 +26,7 @@ class DoctorReplayViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _doctorReplyService.replay(referredDoctorRemarks, model); if (_doctorReplyService.hasError) { - error = _doctorReplyService.error; + error = _doctorReplyService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/hospitals_view_model.dart b/lib/core/viewModel/hospitals_view_model.dart index c0ce1bc4..f2b2abe9 100644 --- a/lib/core/viewModel/hospitals_view_model.dart +++ b/lib/core/viewModel/hospitals_view_model.dart @@ -1,25 +1,21 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart'; -import 'package:flutter/cupertino.dart'; import '../../locator.dart'; import 'base_view_model.dart'; - class HospitalViewModel extends BaseViewModel { HospitalsService _hospitalsService = locator(); - // List get imeiDetails => _authService.dashboardItemsList; - // get loginInfo => _authService.loginInfo; + Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel =GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel = + GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; setState(ViewState.Busy); await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { - error = _hospitalsService.error; + error = _hospitalsService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 5b4b7e4c..674dddd5 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -18,8 +18,8 @@ class LabsViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; - List _patientLabOrdersListClinic = List(); - List _patientLabOrdersListHospital = List(); + List _patientLabOrdersListClinic = []; + List _patientLabOrdersListHospital = []; List get patientLabOrdersList => filterType == FilterType.Clinic @@ -30,7 +30,7 @@ class LabsViewModel extends BaseViewModel { setState(ViewState.Busy); await _labsService.getPatientLabOrdersList(patient, true); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { _labsService.patientLabOrdersList.forEach((element) { @@ -47,7 +47,7 @@ class LabsViewModel extends BaseViewModel { .add(element); } else { _patientLabOrdersListClinic.add(PatientLabOrdersList( - filterName: element.clinicDescription, + filterName: element.clinicDescription!, patientDoctorAppointment: element)); } @@ -67,7 +67,7 @@ class LabsViewModel extends BaseViewModel { .add(element); } else { _patientLabOrdersListHospital.add(PatientLabOrdersList( - filterName: element.projectName, + filterName: element.projectName!, patientDoctorAppointment: element)); } }); @@ -86,19 +86,19 @@ class LabsViewModel extends BaseViewModel { List get labResultList => _labsService.labResultList; - List labResultLists = List(); + List labResultLists = []; List get labResultListsCoustom { return labResultLists; } getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo, - PatiantInformtion patient, - bool isInpatient}) async { + {required String projectID, + required int clinicID, + required String invoiceNo, + required String orderNo, + required PatiantInformtion patient, + required bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult( invoiceNo: invoiceNo, @@ -108,7 +108,7 @@ class LabsViewModel extends BaseViewModel { patient: patient, isInpatient: isInpatient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -116,16 +116,16 @@ class LabsViewModel extends BaseViewModel { } getPatientLabResult( - {PatientLabOrders patientLabOrder, - PatiantInformtion patient, - bool isInpatient}) async { + {required PatientLabOrders patientLabOrder, + required PatiantInformtion patient, + required bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getPatientLabResult( patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -145,30 +145,30 @@ class LabsViewModel extends BaseViewModel { .add(element); } else { labResultLists - .add(LabResultList(filterName: element.testCode, lab: element)); + .add(LabResultList(filterName: element.testCode!, lab: element)); } }); } getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, - String procedure, - PatiantInformtion patient}) async { + {required PatientLabOrders patientLabOrder, + required String procedure, + required PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResults( patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { bool isShouldClear = false; if (_labsService.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue.contains('/') || - element.resultValue.contains('*') || - element.resultValue.isEmpty) isShouldClear = true; + if (element.resultValue!.contains('/') || + element.resultValue!.contains('*') || + element.resultValue!.isEmpty) isShouldClear = true; }); } if (isShouldClear) _labsService.labOrdersResultsList.clear(); @@ -176,10 +176,10 @@ class LabsViewModel extends BaseViewModel { } } - sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { + sendLabReportEmail({required PatientLabOrders patientLabOrder, required String mes}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; } else DrAppToastMsg.showSuccesToast(mes); } diff --git a/lib/core/viewModel/leave_rechdule_response.dart b/lib/core/viewModel/leave_rechdule_response.dart index 555e19cf..cb734073 100644 --- a/lib/core/viewModel/leave_rechdule_response.dart +++ b/lib/core/viewModel/leave_rechdule_response.dart @@ -1,16 +1,16 @@ class GetRescheduleLeavesResponse { - int clinicId; + int? clinicId; var coveringDoctorId; - String date; - String dateTimeFrom; - String dateTimeTo; - int doctorId; - int reasonId; - int requisitionNo; - int requisitionType; - int status; - String createdOn; - String statusDescription; + String? date; + String? dateTimeFrom; + String? dateTimeTo; + int? doctorId; + int? reasonId; + int? requisitionNo; + int? requisitionType; + int? status; + String? createdOn; + String? statusDescription; GetRescheduleLeavesResponse( {this.clinicId, this.coveringDoctorId, @@ -25,7 +25,7 @@ class GetRescheduleLeavesResponse { this.createdOn, this.statusDescription}); - GetRescheduleLeavesResponse.fromJson(Map json) { + GetRescheduleLeavesResponse.fromJson(Map json) { clinicId = json['clinicId']; coveringDoctorId = json['coveringDoctorId']; date = json['date']; @@ -40,8 +40,8 @@ class GetRescheduleLeavesResponse { statusDescription = json['statusDescription']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['clinicId'] = this.clinicId; data['coveringDoctorId'] = this.coveringDoctorId; data['date'] = this.date; diff --git a/lib/core/viewModel/livecare_view_model.dart b/lib/core/viewModel/livecare_view_model.dart index de586e1e..eb96e687 100644 --- a/lib/core/viewModel/livecare_view_model.dart +++ b/lib/core/viewModel/livecare_view_model.dart @@ -16,7 +16,7 @@ class LiveCareViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); List liveCarePendingList = []; - StartCallRes inCallResponse; + late StartCallRes inCallResponse; var transferToAdmin = {}; var endCallResponse = {}; bool isFinished = true; diff --git a/lib/core/viewModel/medical_file_view_model.dart b/lib/core/viewModel/medical_file_view_model.dart index 08e8ce90..406a4617 100644 --- a/lib/core/viewModel/medical_file_view_model.dart +++ b/lib/core/viewModel/medical_file_view_model.dart @@ -11,13 +11,13 @@ class MedicalFileViewModel extends BaseViewModel { List get medicalFileList => _medicalFileService.medicalFileList; - Future getMedicalFile({int mrn}) async { + Future getMedicalFile({required int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _medicalFileService.getMedicalFile(mrn: mrn); if (_medicalFileService.hasError) { - error = _medicalFileService.error; + error = _medicalFileService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 8ccf1a70..8fa484ea 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -18,7 +18,7 @@ class MedicineViewModel extends BaseViewModel { ProcedureService _procedureService = locator(); PrescriptionService _prescriptionService = locator(); List get procedureTemplate => _procedureService.templateList; - List templateList = List(); + List templateList = []; get pharmacyItemsList => _medicineService.pharmacyItemsList; get searchText => _medicineService.searchText; get pharmaciesList => _medicineService.pharmaciesList; @@ -42,13 +42,13 @@ class MedicineViewModel extends BaseViewModel { List get itemMedicineListRoute => _prescriptionService.itemMedicineListRoute; List get itemMedicineListUnit => _prescriptionService.itemMedicineListUnit; - Future getItem({int itemID}) async { + Future getItem({required int itemID}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -70,12 +70,12 @@ class MedicineViewModel extends BaseViewModel { print(templateList.length.toString()); } - Future getProcedureTemplate({String categoryID}) async { + Future getProcedureTemplate({required String categoryID}) async { hasError = false; setState(ViewState.Busy); await _procedureService.getProcedureTemplate(categoryID: categoryID); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { setTemplateListDependOnId(); @@ -83,13 +83,13 @@ class MedicineViewModel extends BaseViewModel { } } - Future getPrescription({int mrn}) async { + Future getPrescription({required int mrn}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.getPrescription(mrn: mrn); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -99,17 +99,17 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _medicineService.getMedicineItem(itemName); if (_medicineService.hasError) { - error = _medicineService.error; + error = _medicineService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getMedicationList({String drug}) async { + Future getMedicationList({required String drug}) async { setState(ViewState.Busy); await _prescriptionService.getMedicationList(drug: drug); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -119,7 +119,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getPatientAssessment(getAssessmentReqModel); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -129,7 +129,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationStrength); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -139,7 +139,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationRoute); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -149,7 +149,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationIndications); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -159,7 +159,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationDoseTime); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -169,7 +169,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationFrequency); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -179,18 +179,18 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationDuration); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getBoxQuantity({int itemCode, int duration, double strength, int freq}) async { + Future getBoxQuantity({required int itemCode, required int duration, required double strength, required int freq}) async { setState(ViewState.Busy); await _prescriptionService.calculateBoxQuantity( strength: strength, itemCode: itemCode, duration: duration, freq: freq); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -200,7 +200,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _medicineService.getPharmaciesList(itemId); if (_medicineService.hasError) { - error = _medicineService.error; + error = _medicineService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index 0868b601..8e1cbca0 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -39,7 +39,7 @@ class AdmissionRequestViewModel extends BaseViewModel { List get listOfDiagnosisSelectionTypes => _admissionRequestService.listOfDiagnosisSelectionTypes; - AdmissionRequest admissionRequestData; + late AdmissionRequest admissionRequestData; Future getSpecialityList() async { await getMasterLookup(MasterKeysService.Speciality); @@ -53,7 +53,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getClinics(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -63,7 +63,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getDoctorsList(clinicId); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -73,7 +73,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getFloors(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -83,7 +83,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getWardList(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -93,7 +93,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getRoomCategories(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -103,7 +103,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getDiagnosisTypesList(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -120,7 +120,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getDietTypesList(patientMrn); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -130,7 +130,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getICDCodes(patientMrn); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -140,7 +140,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.Busy); await _admissionRequestService.makeAdmissionRequest(admissionRequestData); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -150,7 +150,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getMasterLookup(keysService); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index a414c200..f93b057e 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -62,7 +62,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getPatientReferral(patient); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else { if (patientReferral.length == 0) { @@ -77,7 +77,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getMasterLookup(masterKeys); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else await getBranches(); @@ -87,7 +87,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getReferralFacilities(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -99,7 +99,7 @@ class PatientReferralViewModel extends BaseViewModel { await _referralPatientService.getClinicsList(projectId); await _referralPatientService.getProjectInfo(projectId); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -110,7 +110,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getDoctorsList(patient, clinicId, branchId); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else { doctorsList.clear(); @@ -122,7 +122,7 @@ class PatientReferralViewModel extends BaseViewModel { } Future getDoctorBranch() async { - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); if (doctorProfile != null) { dynamic _selectedBranch = { "facilityId": doctorProfile.projectID, @@ -137,7 +137,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getMyReferredPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -151,7 +151,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getPendingReferralList(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -161,7 +161,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.getMyReferralPatientService(); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -172,7 +172,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.replay(referredDoctorRemarks, referral); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; setState(ViewState.ErrorLocal); } else getMyReferralPatientService(); @@ -183,7 +183,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.responseReferral(pendingReferral, isAccepted); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -195,7 +195,7 @@ class PatientReferralViewModel extends BaseViewModel { await _referralPatientService.makeReferral( patient, isoStringDate, projectID, clinicID, doctorID, remarks); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -203,15 +203,15 @@ class PatientReferralViewModel extends BaseViewModel { } Future makeInPatientReferral( - {PatiantInformtion patient, - int projectID, - int clinicID, - int doctorID, - int frequencyCode, - int priority, - String referralDate, - String remarks, - String ext}) async { + {required PatiantInformtion patient, + required int projectID, + required int clinicID, + required int doctorID, + required int frequencyCode, + required int priority, + required String referralDate, + required String remarks, + required String ext}) async { setState(ViewState.Busy); await _referralService.referralPatient( patientID: patient.patientId, @@ -226,7 +226,7 @@ class PatientReferralViewModel extends BaseViewModel { extension: ext, ); if (_referralService.hasError) { - error = _referralService.error; + error = _referralService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -240,7 +240,7 @@ class PatientReferralViewModel extends BaseViewModel { await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -251,7 +251,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getReferralFrequencyList(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -262,7 +262,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.verifyReferralDoctorRemarks(referredPatient); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else { getMyReferredPatient(); @@ -274,7 +274,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _dischargedPatientService.gtMyDischargeReferralPatient(); if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error; + error = _dischargedPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -326,53 +326,53 @@ class PatientReferralViewModel extends BaseViewModel { PatiantInformtion getPatientFromReferralO( MyReferralPatientModel referredPatient) { PatiantInformtion patient = PatiantInformtion(); - patient.doctorId = referredPatient.doctorID; - patient.doctorName = referredPatient.doctorName; + patient.doctorId = referredPatient.doctorID!; + patient.doctorName = referredPatient.doctorName!; patient.patientId = referredPatient.patientID; - patient.firstName = referredPatient.firstName; - patient.middleName = referredPatient.middleName; - patient.lastName = referredPatient.lastName; - patient.gender = referredPatient.gender; - patient.dateofBirth = referredPatient.dateofBirth; - patient.mobileNumber = referredPatient.mobileNumber; - patient.emailAddress = referredPatient.emailAddress; - patient.patientIdentificationNo = referredPatient.patientIdentificationNo; - patient.patientType = referredPatient.patientType; - patient.admissionNo = referredPatient.admissionNo; - patient.admissionDate = referredPatient.admissionDate; - patient.roomId = referredPatient.roomID; - patient.bedId = referredPatient.bedID; - patient.nationalityName = referredPatient.nationalityName; - patient.nationalityFlagURL = referredPatient.nationalityFlagURL; + patient.firstName = referredPatient.firstName!; + patient.middleName = referredPatient.middleName!; + patient.lastName = referredPatient.lastName!; + patient.gender = referredPatient.gender!; + patient.dateofBirth = referredPatient.dateofBirth!; + patient.mobileNumber = referredPatient.mobileNumber!; + patient.emailAddress = referredPatient.emailAddress!; + patient.patientIdentificationNo = referredPatient.patientIdentificationNo!; + patient.patientType = referredPatient.patientType!; + patient.admissionNo = referredPatient.admissionNo!; + patient.admissionDate = referredPatient.admissionDate!; + patient.roomId = referredPatient.roomID!; + patient.bedId = referredPatient.bedID!; + patient.nationalityName = referredPatient.nationalityName!; + patient.nationalityFlagURL = referredPatient.nationalityFlagURL!; patient.age = referredPatient.age; - patient.clinicDescription = referredPatient.clinicDescription; + patient.clinicDescription = referredPatient.clinicDescription!; return patient; } PatiantInformtion getPatientFromDischargeReferralPatient( DischargeReferralPatient referredPatient) { PatiantInformtion patient = PatiantInformtion(); - patient.doctorId = referredPatient.doctorID; - patient.doctorName = referredPatient.doctorName; + patient.doctorId = referredPatient.doctorID!; + patient.doctorName = referredPatient.doctorName!; patient.patientId = referredPatient.patientID; - patient.firstName = referredPatient.firstName; - patient.middleName = referredPatient.middleName; - patient.lastName = referredPatient.lastName; - patient.gender = referredPatient.gender; - patient.dateofBirth = referredPatient.dateofBirth; - patient.mobileNumber = referredPatient.mobileNumber; - patient.emailAddress = referredPatient.emailAddress; - patient.patientIdentificationNo = referredPatient.patientIdentificationNo; - patient.patientType = referredPatient.patientType; - patient.admissionNo = referredPatient.admissionNo; - patient.admissionDate = referredPatient.admissionDate; - patient.roomId = referredPatient.roomID; - patient.bedId = referredPatient.bedID; - patient.nationalityName = referredPatient.nationalityName; + patient.firstName = referredPatient.firstName!; + patient.middleName = referredPatient.middleName!; + patient.lastName = referredPatient.lastName!; + patient.gender = referredPatient.gender!; + patient.dateofBirth = referredPatient.dateofBirth!; + patient.mobileNumber = referredPatient.mobileNumber!; + patient.emailAddress = referredPatient.emailAddress!; + patient.patientIdentificationNo = referredPatient.patientIdentificationNo!; + patient.patientType = referredPatient.patientType!; + patient.admissionNo = referredPatient.admissionNo!; + patient.admissionDate = referredPatient.admissionDate!; + patient.roomId = referredPatient.roomID!; + patient.bedId = referredPatient.bedID!; + patient.nationalityName = referredPatient.nationalityName!; patient.nationalityFlagURL = ''; // TODO from backend referredPatient.nationalityFlagURL; patient.age = referredPatient.age; - patient.clinicDescription = referredPatient.clinicDescription; + patient.clinicDescription = referredPatient.clinicDescription!; return patient; } } diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index b6887061..b665a385 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -36,7 +36,7 @@ class UcafViewModel extends BaseViewModel { List get orderProcedures => _ucafService.orderProcedureList; - String selectedLanguage; + late String selectedLanguage; String heightCm = "0"; String weightKg = "0"; String bodyMax = "0"; @@ -60,33 +60,32 @@ class UcafViewModel extends BaseViewModel { String from; String to; - if (from == null || from == "0") { + from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); - } - if (to == null || to == "0") { + + to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); - } + // await _ucafService.getPatientVitalSignsHistory(patient, from, to); await _ucafService.getInPatientVitalSignHistory(patient, false); await _ucafService.getPatientChiefComplaint(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else { patientVitalSignsHistory.forEach((element) { - if (heightCm == "0" || heightCm == null || heightCm == 'null') { + if (heightCm == "0" || heightCm == 'null') { heightCm = element.heightCm.toString(); } - if (weightKg == "0" || weightKg == null || weightKg == 'null') { + if (weightKg == "0" || weightKg == 'null') { weightKg = element.weightKg.toString(); } - if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') { + if (bodyMax == "0" || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } if (temperatureCelcius == "0" || - temperatureCelcius == null || temperatureCelcius == 'null') { temperatureCelcius = element.temperatureCelcius.toString(); } @@ -115,7 +114,7 @@ class UcafViewModel extends BaseViewModel { setState(ViewState.Busy); await _ucafService.getPatientAssessment(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else { if (patientAssessmentList.isNotEmpty) { @@ -127,7 +126,7 @@ class UcafViewModel extends BaseViewModel { await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType); } if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -142,7 +141,7 @@ class UcafViewModel extends BaseViewModel { setState(ViewState.Busy); await _ucafService.getOrderProcedures(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -155,7 +154,7 @@ class UcafViewModel extends BaseViewModel { setState(ViewState.Busy); await _ucafService.getPrescription(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -163,8 +162,8 @@ class UcafViewModel extends BaseViewModel { } } - MasterKeyModel findMasterDataById( - {@required MasterKeysService masterKeys, dynamic id}) { + MasterKeyModel ? findMasterDataById( + {required MasterKeysService masterKeys, dynamic id}) { switch (masterKeys) { case MasterKeysService.DiagnosisCondition: List result = diagnosisConditions.where((element) { diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index bab2ff9f..4f22d9e3 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -35,7 +35,7 @@ class VitalSignsViewModel extends BaseViewModel { setState(ViewState.Busy); await _vitalSignService.getPatientVitalSign(patient); if (_vitalSignService.hasError) { - error = _vitalSignService.error; + error = _vitalSignService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -59,7 +59,7 @@ class VitalSignsViewModel extends BaseViewModel { } if (_vitalSignService.hasError) { - error = _vitalSignService.error; + error = _vitalSignService.error!; setState(ViewState.Error); } else { patientVitalSignsHistory.forEach((element) { @@ -163,5 +163,6 @@ class VitalSignsViewModel extends BaseViewModel { } else if (temperatureCelciusMethod == 5) { return "Temporal"; } + return ""; } } diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index de40afde..547dbdec 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -64,7 +64,7 @@ class PatientViewModel extends BaseViewModel { isView: isView); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -76,7 +76,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getLabResultOrders(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -86,7 +86,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getOutPatientPrescriptions(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -96,7 +96,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getInPatientPrescriptions(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -106,7 +106,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getPrescriptionReport(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -116,7 +116,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getPatientRadiology(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -126,7 +126,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getLabResult(labOrdersResModel); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -136,7 +136,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getPatientInsuranceApprovals(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -151,7 +151,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getPatientProgressNote(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { @@ -165,7 +165,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientService.updatePatientProgressNote(req); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -175,7 +175,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientService.createPatientProgressNote(req); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -185,7 +185,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getClinicsList(); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else { { @@ -199,7 +199,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientService.getDoctorsList(clinicId); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else { { @@ -227,7 +227,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getReferralFrequancyList(); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -241,17 +241,17 @@ class PatientViewModel extends BaseViewModel { } Future referToDoctor( - {String selectedDoctorID, - String selectedClinicID, - int admissionNo, - String extension, - String priority, - String frequency, - String referringDoctorRemarks, - int patientID, - int patientTypeID, - String roomID, - int projectID}) async { + {required String selectedDoctorID, + required String selectedClinicID, + required int admissionNo, + required String extension, + required String priority, + required String frequency, + required String referringDoctorRemarks, + required int patientID, + required int patientTypeID, + required String roomID, + required int projectID}) async { setState(ViewState.BusyLocal); await _patientService.referToDoctor( selectedClinicID: selectedClinicID, @@ -266,7 +266,7 @@ class PatientViewModel extends BaseViewModel { roomID: roomID, projectID: projectID); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -276,7 +276,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getArrivedList(); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); From 6e6a7deba554dfb298f56d8413d623f46f2e0f67 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 7 Jun 2021 15:37:20 +0300 Subject: [PATCH 05/18] migration Services to flutter 2 --- lib/client/base_app_client.dart | 106 +++---- .../insurance_approval_request_model.dart | 26 +- ...t_get_list_pharmacy_for_prescriptions.dart | 52 ++-- .../request_prescription_report.dart | 80 +++--- .../request_prescription_report_enh.dart | 77 +++--- .../Procedure_template_request_model.dart | 4 +- ...cedure_template_details_request_model.dart | 4 +- lib/core/model/referral/ReferralRequest.dart | 56 ++-- .../sick_leave_patient_request_model.dart | 4 +- lib/core/service/authentication_service.dart | 120 ++++---- .../service/hospitals/hospitals_service.dart | 3 +- .../patient/DischargedPatientService.dart | 14 +- .../patient/LiveCarePatientServices.dart | 73 +++-- .../patient/MyReferralPatientService.dart | 26 +- .../service/patient/PatientMuseService.dart | 7 +- lib/core/service/patient/ReferralService.dart | 28 +- .../patient-doctor-referral-service.dart | 49 ++-- .../patient/patientInPatientService.dart | 11 +- lib/core/service/patient/patient_service.dart | 77 +++--- .../insurance/InsuranceCardService.dart | 36 +-- .../lab_order/labs_service.dart | 58 ++-- .../PatientMedicalReportService.dart | 56 ++-- .../medical_report/medical_file_service.dart | 10 +- .../prescription/prescription_service.dart | 86 ++---- .../prescription/prescriptions_service.dart | 100 +++---- .../procedure/procedure_service.dart | 88 +++--- .../radiology/radiology_service.dart | 16 +- .../sick_leave/sickleave_service.dart | 17 +- .../soap/SOAP_service.dart | 104 +++---- .../ucaf/patient-ucaf-service.dart | 30 +- .../patient-vital-signs-service.dart | 48 ++-- lib/icons_app/doctor_app_icons.dart | 7 +- lib/models/SOAP/Allergy_model.dart | 52 ++-- .../GetChiefComplaintReqModel.dart | 14 +- .../GetChiefComplaintResModel.dart | 52 ++-- lib/models/SOAP/GeneralGetReqForSOAP.dart | 6 +- lib/models/SOAP/GetAllergiesResModel.dart | 49 ++-- lib/models/SOAP/GetAssessmentReqModel.dart | 26 +- lib/models/SOAP/GetAssessmentResModel.dart | 58 ++-- .../SOAP/GetGetProgressNoteReqModel.dart | 27 +- .../SOAP/GetGetProgressNoteResModel.dart | 44 +-- lib/models/SOAP/GetHistoryReqModel.dart | 15 +- lib/models/SOAP/GetHistoryResModel.dart | 26 +- .../SOAP/GetPhysicalExamListResModel.dart | 74 ++--- lib/models/SOAP/GetPhysicalExamReqModel.dart | 10 +- lib/models/SOAP/PatchAssessmentReqModel.dart | 34 +-- lib/models/SOAP/PostEpisodeReqModel.dart | 14 +- .../SOAP/get_Allergies_request_model.dart | 17 +- lib/models/SOAP/master_key_model.dart | 46 ++-- lib/models/SOAP/my_selected_allergy.dart | 27 +- lib/models/SOAP/my_selected_assement.dart | 47 ++-- lib/models/SOAP/my_selected_examination.dart | 21 +- lib/models/SOAP/my_selected_history.dart | 16 +- lib/models/SOAP/order-procedure.dart | 98 ++++--- .../SOAP/post_allergy_request_model.dart | 65 ++--- .../SOAP/post_assessment_request_model.dart | 38 +-- .../post_chief_complaint_request_model.dart | 19 +- .../SOAP/post_histories_request_model.dart | 35 ++- .../post_physical_exam_request_model.dart | 178 ++++++------ .../post_progress_note_request_model.dart | 15 +- lib/models/dashboard/dashboard_model.dart | 27 +- lib/models/doctor/clinic_model.dart | 20 +- lib/models/doctor/doctor_profile_model.dart | 96 +++---- ...list_doctor_working_hours_table_model.dart | 13 +- .../list_gt_my_patients_question_model.dart | 119 ++++---- lib/models/doctor/profile_req_Model.dart | 36 +-- .../request_add_referred_doctor_remarks.dart | 63 +++-- lib/models/doctor/request_doctor_reply.dart | 44 +-- lib/models/doctor/request_schedule.dart | 30 +- .../statstics_for_certain_doctor_request.dart | 19 +- lib/models/doctor/user_model.dart | 26 +- .../verify_referral_doctor_remarks.dart | 107 ++++--- lib/models/livecare/end_call_req.dart | 13 +- lib/models/livecare/get_panding_req_list.dart | 25 +- lib/models/livecare/get_pending_res_list.dart | 66 ++--- lib/models/livecare/session_status_model.dart | 14 +- lib/models/livecare/start_call_req.dart | 22 +- lib/models/livecare/start_call_res.dart | 12 +- lib/models/livecare/transfer_to_admin.dart | 20 +- .../MedicalReport/MedicalReportTemplate.dart | 52 ++-- .../MedicalReport/MeidcalReportModel.dart | 106 +++---- lib/models/patient/PatientArrivalEntity.dart | 78 +++--- .../get_clinic_by_project_id_request.dart | 27 +- .../get_doctor_by_clinic_id_request.dart | 57 ++-- ...t_list_stp_referral_frequency_request.dart | 25 +- .../patient/get_pending_patient_er_model.dart | 226 +++++++-------- .../patient/insurance_aprovals_request.dart | 37 ++- .../lab_orders/lab_orders_req_model.dart | 45 ++- .../lab_orders/lab_orders_res_model.dart | 50 ++-- lib/models/patient/lab_result/lab_result.dart | 122 ++++---- .../lab_result/lab_result_req_model.dart | 56 ++-- .../patient/my_referral/PendingReferral.dart | 82 +++--- .../patient/my_referral/clinic-doctor.dart | 173 ++++++------ .../my_referral_patient_model.dart | 200 +++++++------- .../my_referred_patient_model.dart | 260 +++++++++--------- lib/models/patient/orders_request.dart | 39 ++- lib/models/patient/patiant_info_model.dart | 184 ++++++------- ...et_patient_arrival_list_request_model.dart | 17 +- lib/models/patient/patient_model.dart | 134 +++++---- .../prescription/prescription_report.dart | 114 ++++---- .../prescription_report_for_in_patient.dart | 168 +++++------ .../prescription/prescription_req_model.dart | 71 ----- .../prescription/prescription_res_model.dart | 72 ++--- .../request_prescription_report.dart | 54 ++-- lib/models/patient/progress_note_request.dart | 39 ++- .../radiology/radiology_req_model.dart | 30 +- .../radiology/radiology_res_model.dart | 36 +-- ...st_prescription_report_for_in_patient.dart | 56 ++-- .../patient/refer_to_doctor_request.dart | 68 +++-- .../request_my_referral_patient_model.dart | 60 ++-- .../patient/topten_users_res_model.dart | 15 +- .../vital_sign/patient-vital-sign-data.dart | 113 ++++---- .../patient-vital-sign-history.dart | 7 +- .../vital_sign/vital_sign_req_model.dart | 50 ++-- .../vital_sign/vital_sign_res_model.dart | 20 +- .../pharmacies_List_request_model.dart | 25 +- .../pharmacies_items_request_model.dart | 24 +- .../sickleave/add_sickleave_request.dart | 17 +- .../sickleave/extend_sick_leave_request.dart | 11 +- .../sickleave/get_all_sickleave_response.dart | 18 +- 120 files changed, 2978 insertions(+), 3428 deletions(-) delete mode 100644 lib/models/patient/prescription/prescription_req_model.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index f083258d..e2de1f86 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -21,36 +21,34 @@ class BaseAppClient { {required Map body, required Function(dynamic response, int statusCode) onSuccess, required Function(String error, int statusCode) onFailure, - bool isAllowAny = false,bool isLiveCare = false}) async { + bool isAllowAny = false, + bool isLiveCare = false}) async { String url; - if(isLiveCare) + if (isLiveCare) url = BASE_URL_LIVE_CARE + endPoint; else url = BASE_URL + endPoint; bool callLog = true; try { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) - body['DoctorID'] = doctorProfile?.doctorID; + if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; if (body['DoctorID'] == "") body['DoctorID'] = null; - if (body['EditedBy'] == null) - body['EditedBy'] = doctorProfile?.doctorID; + if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile?.doctorID; if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; } - if (body['ClinicID'] == null) - body['ClinicID'] = doctorProfile?.clinicID; + if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; if (body['DoctorID'] == '') { body['DoctorID'] = null; } if (body['EditedBy'] == '') { body.remove("EditedBy"); } - if(body['TokenID'] == null){ + if (body['TokenID'] == null) { body['TokenID'] = token ?? ''; } // body['TokenID'] = "@dm!n" ?? ''; @@ -69,18 +67,16 @@ class BaseAppClient { body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = body['PatientOutSA'] ?? 0; // PATIENT_OUT_SA; if (body['VidaAuthTokenID'] == null) { - body['VidaAuthTokenID'] = - await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); } if (body['VidaRefreshTokenID'] == null) { - body['VidaRefreshTokenID'] = - await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); } int projectID = await sharedPref.getInt(PROJECT_ID); if (projectID == 2 || projectID == 3) - body['PatientOutSA'] = true; - else if(body.containsKey('facilityId') && body['facilityId']==2 || body['facilityId']==3) + body['PatientOutSA'] = true; + else if (body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) body['PatientOutSA'] = true; else body['PatientOutSA'] = false; @@ -92,28 +88,21 @@ class BaseAppClient { var asd2; if (await Helpers.checkConnection()) { final response = await http.post(Uri.parse(url), - body: json.encode(body), - headers: { - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }); + body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}); final int statusCode = response.statusCode; if (statusCode < 200 || statusCode >= 400) { onFailure(Helpers.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], - parsed['AndroidLink'], parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); } if (!parsed['IsAuthenticated']) { if (body['OTP_SendType'] != null) { onFailure(getError(parsed), statusCode); } else if (!isAllowAny) { - await Provider.of(AppGlobal.CONTEX, - listen: false) - .logout(); + await Provider.of(AppGlobal.CONTEX, listen: false).logout(); Helpers.showErrorToast('Your session expired Please login again'); } if (isAllowAny) { @@ -141,19 +130,15 @@ class BaseAppClient { {required Map body, required Function(dynamic response, int statusCode) onSuccess, required Function(String error, int statusCode) onFailure, - required PatiantInformtion patient, + PatiantInformtion? patient, bool isExternal = false}) async { String url = BASE_URL + endPoint; try { - Map headers = { - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }; + Map headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; String token = await sharedPref.getString(TOKEN); - var languageID = - await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] @@ -173,12 +158,11 @@ class BaseAppClient { : PATIENT_OUT_SA_PATIENT_REQ; if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = - body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; + body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; } body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; @@ -186,7 +170,7 @@ class BaseAppClient { body['PatientType'] = body.containsKey('PatientType') ? body['PatientType'] != null ? body['PatientType'] - : patient.patientType != null + : patient!.patientType != null ? patient.patientType : PATIENT_TYPE : PATIENT_TYPE; @@ -194,15 +178,13 @@ class BaseAppClient { body['PatientTypeID'] = body.containsKey('PatientTypeID') ? body['PatientTypeID'] != null ? body['PatientTypeID'] - : patient.patientType != null + : patient!.patientType != null ? patient.patientType : PATIENT_TYPE_ID : PATIENT_TYPE_ID; body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] : token; - body['PatientID'] = body['PatientID'] != null - ? body['PatientID'] - : patient.patientId ?? patient.patientMRN; + body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient!.patientId ?? patient.patientMRN; body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['SessionID'] = SESSION_ID; //getSe @@ -217,8 +199,7 @@ class BaseAppClient { print("Body : ${json.encode(body)}"); if (await Helpers.checkConnection()) { - final response = await http.post(Uri.parse(url.trim()), - body: json.encode(body), headers: headers); + final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final int statusCode = response.statusCode; print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { @@ -230,8 +211,7 @@ class BaseAppClient { onSuccess(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], - parsed['AndroidLink'], parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); } if (parsed['IsAuthenticated'] == null) { if (parsed['isSMSSent'] == true) { @@ -247,28 +227,20 @@ class BaseAppClient { onFailure(getError(parsed), statusCode); } } - } else if (parsed['MessageStatus'] == 1 || - parsed['SMSLoginRequired'] == true) { + } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); - } else if (parsed['MessageStatus'] == 2 && - parsed['IsAuthenticated']) { + } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { if (parsed['SameClinicApptList'] != null) { onSuccess(parsed, statusCode); } else { - if (parsed['message'] == null && - parsed['ErrorEndUserMessage'] == null) { + if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure("Server Error found with no available message", - statusCode); + onFailure("Server Error found with no available message", statusCode); } else { onFailure(parsed['ErrorSearchMsg'], statusCode); } } else { - onFailure( - parsed['message'] ?? - parsed['ErrorEndUserMessage'] ?? - parsed['ErrorMessage'], - statusCode); + onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } } else { @@ -278,9 +250,7 @@ class BaseAppClient { if (parsed['message'] != null) { onFailure(parsed['message'] ?? parsed['message'], statusCode); } else { - onFailure( - parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], - statusCode); + onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } } @@ -303,12 +273,8 @@ class BaseAppClient { if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { - for (var i = 0; - i < parsed["ValidationErrors"]["ValidationErrors"].length; - i++) { - error = error + - parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + - "\n"; + for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) { + error = error + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n"; } } } diff --git a/lib/core/insurance_approval_request_model.dart b/lib/core/insurance_approval_request_model.dart index 02f71ecb..11f7804e 100644 --- a/lib/core/insurance_approval_request_model.dart +++ b/lib/core/insurance_approval_request_model.dart @@ -1,17 +1,17 @@ class InsuranceApprovalInPatientRequestModel { - int patientID; - int patientTypeID; - int eXuldAPPNO; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? patientID; + int? patientTypeID; + int? eXuldAPPNO; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; InsuranceApprovalInPatientRequestModel( {this.patientID, diff --git a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart index af8a3da8..7b453b9b 100644 --- a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart +++ b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart @@ -1,32 +1,32 @@ class RequestGetListPharmacyForPrescriptions { - int ? latitude; - int ? longitude; - double ?versionID; - int ? channel; - int ? languageID; - String ? iPAdress; - String ? generalid; - int ? patientOutSA; - String ? sessionID; - bool ?isDentalAllowedBackend; - int ? deviceTypeID; - int ? itemID; + int? latitude; + int? longitude; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? itemID; RequestGetListPharmacyForPrescriptions( {this.latitude, - this.longitude, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.itemID}); + this.longitude, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.itemID}); - RequestGetListPharmacyForPrescriptions.fromJson(Map json) { + RequestGetListPharmacyForPrescriptions.fromJson(Map json) { latitude = json['Latitude']; longitude = json['Longitude']; versionID = json['VersionID']; @@ -41,8 +41,8 @@ class RequestGetListPharmacyForPrescriptions { itemID = json['ItemID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Latitude'] = this.latitude; data['Longitude'] = this.longitude; data['VersionID'] = this.versionID; diff --git a/lib/core/model/Prescriptions/request_prescription_report.dart b/lib/core/model/Prescriptions/request_prescription_report.dart index 8eeefb7a..b7ade7d4 100644 --- a/lib/core/model/Prescriptions/request_prescription_report.dart +++ b/lib/core/model/Prescriptions/request_prescription_report.dart @@ -1,46 +1,46 @@ class RequestPrescriptionReport { - double ?versionID; - int ? channel; - int ? languageID; - String ? iPAdress; - String ? generalid; - int ? patientOutSA; - String ? sessionID; - bool ?isDentalAllowedBackend; - int ? deviceTypeID; - int ? patientID; - String ? tokenID; - int ? patientTypeID; - int ? patientType; - int ? appointmentNo; - String ? setupID; - int ? episodeID; - int ? clinicID; - int ? projectID; - int ? dischargeNo; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; + int? appointmentNo; + String? setupID; + int? episodeID; + int? clinicID; + int? projectID; + int? dischargeNo; RequestPrescriptionReport( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.appointmentNo, - this.setupID, - this.episodeID, - this.clinicID, - this.projectID, - this.dischargeNo}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID, + this.dischargeNo}); - RequestPrescriptionReport.fromJson(Map json) { + RequestPrescriptionReport.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; @@ -62,8 +62,8 @@ class RequestPrescriptionReport { dischargeNo = json['DischargeNo']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/model/Prescriptions/request_prescription_report_enh.dart b/lib/core/model/Prescriptions/request_prescription_report_enh.dart index 9ed39b47..fc048a95 100644 --- a/lib/core/model/Prescriptions/request_prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/request_prescription_report_enh.dart @@ -1,45 +1,46 @@ class RequestPrescriptionReportEnh { - double ?versionID; - int ? channel; - int ? languageID; - String ? iPAdress; - String ? generalid; - int ? patientOutSA; - String ? sessionID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; bool? isDentalAllowedBackend; - int ? deviceTypeID; - int ? patientID; - String ? tokenID; - int ? patientTypeID; - int ? patientType; - int ? appointmentNo; - String ? setupID; - int ? dischargeNo; - int ? episodeID; - int ? clinicID; - int ? projectID; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; + int? appointmentNo; + String? setupID; + int? dischargeNo; + int? episodeID; + int? clinicID; + int? projectID; RequestPrescriptionReportEnh( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.appointmentNo, - this.setupID, - this.episodeID, - this.clinicID, - this.projectID,this.dischargeNo}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID, + this.dischargeNo}); - RequestPrescriptionReportEnh.fromJson(Map json) { + RequestPrescriptionReportEnh.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; @@ -60,8 +61,8 @@ class RequestPrescriptionReportEnh { projectID = json['ProjectID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/model/procedure/Procedure_template_request_model.dart b/lib/core/model/procedure/Procedure_template_request_model.dart index a734382b..abd6a2b3 100644 --- a/lib/core/model/procedure/Procedure_template_request_model.dart +++ b/lib/core/model/procedure/Procedure_template_request_model.dart @@ -86,8 +86,8 @@ class ProcedureTempleteRequestModel { deviceTypeID = json['DeviceTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorID'] = this.doctorID; data['FirstName'] = this.firstName; data['MiddleName'] = this.middleName; diff --git a/lib/core/model/procedure/procedure_template_details_request_model.dart b/lib/core/model/procedure/procedure_template_details_request_model.dart index 7d48e1c8..c5504cdd 100644 --- a/lib/core/model/procedure/procedure_template_details_request_model.dart +++ b/lib/core/model/procedure/procedure_template_details_request_model.dart @@ -89,8 +89,8 @@ class ProcedureTempleteDetailsRequestModel { deviceTypeID = json['DeviceTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorID'] = this.doctorID; data['FirstName'] = this.firstName; data['TemplateID'] = this.templateID; diff --git a/lib/core/model/referral/ReferralRequest.dart b/lib/core/model/referral/ReferralRequest.dart index 5b7ffc05..0e0bc161 100644 --- a/lib/core/model/referral/ReferralRequest.dart +++ b/lib/core/model/referral/ReferralRequest.dart @@ -17,38 +17,38 @@ class ReferralRequest { int? languageID; String? stamp; String? iPAdress; - double ?versionID; + double? versionID; int? channel; String? tokenID; String? sessionID; - bool ?isLoginForDoctorApp; - bool ?patientOutSA; + bool? isLoginForDoctorApp; + bool? patientOutSA; ReferralRequest( {this.roomID, - this.referralClinic, - this.referralDoctor, - this.createdBy, - this.editedBy, - this.patientID, - this.patientTypeID, - this.referringClinic, - this.referringDoctor, - this.projectID, - this.admissionNo, - this.referringDoctorRemarks, - this.priority, - this.frequency, - this.extension, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.referralClinic, + this.referralDoctor, + this.createdBy, + this.editedBy, + this.patientID, + this.patientTypeID, + this.referringClinic, + this.referringDoctor, + this.projectID, + this.admissionNo, + this.referringDoctorRemarks, + this.priority, + this.frequency, + this.extension, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); ReferralRequest.fromJson(Map json) { roomID = json['RoomID']; @@ -77,8 +77,8 @@ class ReferralRequest { patientOutSA = json['PatientOutSA']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RoomID'] = this.roomID; data['ReferralClinic'] = this.referralClinic; data['ReferralDoctor'] = this.referralDoctor; diff --git a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart index ff5079b1..535836d8 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart @@ -41,8 +41,8 @@ class SickLeavePatientRequestModel { sessionID = json['SessionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/service/authentication_service.dart b/lib/core/service/authentication_service.dart index 49e89881..7771bea6 100644 --- a/lib/core/service/authentication_service.dart +++ b/lib/core/service/authentication_service.dart @@ -17,28 +17,29 @@ class AuthenticationService extends BaseService { List get dashboardItemsList => _imeiDetails; NewLoginInformationModel _loginInfo = NewLoginInformationModel(); NewLoginInformationModel get loginInfo => _loginInfo; - SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel(); + SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = + SendActivationCodeForDoctorAppResponseModel(); - SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _activationCodeVerificationScreenRes; + SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => + _activationCodeVerificationScreenRes; - SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel(); + SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = + SendActivationCodeForDoctorAppResponseModel(); SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _activationCodeForDoctorAppRes; - CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); + CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = + CheckActivationCodeForDoctorAppResponseModel(); - CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _checkActivationCodeForDoctorAppRes; + CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => + _checkActivationCodeForDoctorAppRes; Map _insertDeviceImeiRes = {}; List _doctorProfilesList = []; List get doctorProfilesList => _doctorProfilesList; - - - Future selectDeviceImei(imei) async { try { - await baseAppClient.post(SELECT_DEVICE_IMEI, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { _imeiDetails = []; response['List_DoctorDeviceDetails'].forEach((v) { _imeiDetails.add(GetIMEIDetailsModel.fromJson(v)); @@ -49,7 +50,7 @@ class AuthenticationService extends BaseService { }, body: {"IMEI": imei, "TokenID": "@dm!n"}); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } } @@ -57,8 +58,7 @@ class AuthenticationService extends BaseService { hasError = false; _loginInfo = NewLoginInformationModel(); try { - await baseAppClient.post(LOGIN_URL, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(LOGIN_URL, onSuccess: (dynamic response, int statusCode) { _loginInfo = NewLoginInformationModel.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; @@ -66,9 +66,8 @@ class AuthenticationService extends BaseService { }, body: userInfo.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } - } Future sendActivationCodeVerificationScreen(ActivationCodeForVerificationScreenModel activationCodeModel) async { @@ -77,88 +76,81 @@ class AuthenticationService extends BaseService { try { await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN, onSuccess: (dynamic response, int statusCode) { - _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: activationCodeModel.toJson()); + _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } - } - Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel)async { + Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel) async { hasError = false; _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel(); try { - await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, - onSuccess: (dynamic response, int statusCode) { - _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: activationCodeModel.toJson()); + await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { + _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } } - Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel)async { + Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel) async { hasError = false; _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); try { - await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, - onSuccess: (dynamic response, int statusCode) { - _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: checkActivationCodeRequestModel.toJson()); + await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { + _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: checkActivationCodeRequestModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } - } - - Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel)async { + Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel) async { hasError = false; - // insertIMEIDetailsModel.tokenID = "@dm!n"; + // insertIMEIDetailsModel.tokenID = "@dm!n"; _insertDeviceImeiRes = {}; try { - await baseAppClient.post(INSERT_DEVICE_IMEI, - onSuccess: (dynamic response, int statusCode) { - _insertDeviceImeiRes = response; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: insertIMEIDetailsModel.toJson()); + await baseAppClient.post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { + _insertDeviceImeiRes = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: insertIMEIDetailsModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } } - Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel)async { + Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel) async { hasError = false; try { - await baseAppClient.post(GET_DOC_PROFILES, - onSuccess: (dynamic response, int statusCode) { - _doctorProfilesList.clear(); - response['DoctorProfileList'].forEach((v) { - _doctorProfilesList.add(DoctorProfileModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: profileReqModel.toJson()); + await baseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) { + _doctorProfilesList.clear(); + response['DoctorProfileList'].forEach((v) { + _doctorProfilesList.add(DoctorProfileModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: profileReqModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } } } diff --git a/lib/core/service/hospitals/hospitals_service.dart b/lib/core/service/hospitals/hospitals_service.dart index f8a7579d..efa24209 100644 --- a/lib/core/service/hospitals/hospitals_service.dart +++ b/lib/core/service/hospitals/hospitals_service.dart @@ -4,8 +4,7 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class HospitalsService extends BaseService { - -List hospitals =List(); + List hospitals = []; Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { hasError = false; diff --git a/lib/core/service/patient/DischargedPatientService.dart b/lib/core/service/patient/DischargedPatientService.dart index 2b353016..6566a57d 100644 --- a/lib/core/service/patient/DischargedPatientService.dart +++ b/lib/core/service/patient/DischargedPatientService.dart @@ -4,15 +4,15 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class DischargedPatientService extends BaseService { - List myDischargedPatients = List(); + List myDischargedPatients = []; - List myDischargeReferralPatients = List(); + List myDischargeReferralPatients = []; Future getDischargedPatient() async { hasError = false; Map body = Map(); await getDoctorProfile(isGetProfile: true); - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; body['LastName'] = "0"; @@ -28,8 +28,7 @@ class DischargedPatientService extends BaseService { body['PatientTypeID'] = 1; hasError = false; myDischargedPatients.clear(); - await baseAppClient.post(GET_DISCHARGE_PATIENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_DISCHARGE_PATIENT, onSuccess: (dynamic response, int statusCode) { if (response['List_MyDischargePatient'] != null) { response['List_MyDischargePatient'].forEach((v) { myDischargedPatients.add(PatiantInformtion.fromJson(v)); @@ -45,7 +44,7 @@ class DischargedPatientService extends BaseService { hasError = false; Map body = Map(); await getDoctorProfile(isGetProfile: true); - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; body['LastName'] = "0"; @@ -61,8 +60,7 @@ class DischargedPatientService extends BaseService { body['PatientTypeID'] = 1; hasError = false; myDischargeReferralPatients.clear(); - await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, onSuccess: (dynamic response, int statusCode) { if (response['List_MyDischargeReferralPatient'] != null) { response['List_MyDischargeReferralPatient'].forEach((v) { myDischargeReferralPatients.add(DischargeReferralPatient.fromJson(v)); diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index 4fc25094..5b528a33 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -15,18 +15,18 @@ class LiveCarePatientServices extends BaseService { bool get isFinished => _isFinished; - setFinished(bool isFinished){ + setFinished(bool isFinished) { _isFinished = isFinished; } - var endCallResponse = {}; var transferToAdminResponse = {}; - StartCallRes _startCallRes; + late StartCallRes _startCallRes; StartCallRes get startCallRes => _startCallRes; - Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async{ + Future getPendingPatientERForDoctorApp( + PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async { hasError = false; await baseAppClient.post( GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP, @@ -47,58 +47,47 @@ class LiveCarePatientServices extends BaseService { Future endCall(EndCallReq endCallReq) async { hasError = false; await baseAppClient.post(END_CALL, onSuccess: (response, statusCode) async { - endCallResponse = response; }, onFailure: (String error, int statusCode) { - hasError = true; super.error = error; - }, body: endCallReq.toJson(),isLiveCare: true); + }, body: endCallReq.toJson(), isLiveCare: true); } Future startCall(StartCallReq startCallReq) async { hasError = false; - await baseAppClient.post(START_LIVE_CARE_CALL, - onSuccess: (response, statusCode) async { - _startCallRes = StartCallRes.fromJson(response); + await baseAppClient.post(START_LIVE_CARE_CALL, onSuccess: (response, statusCode) async { + _startCallRes = StartCallRes.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: startCallReq.toJson(),isLiveCare: true); + }, body: startCallReq.toJson(), isLiveCare: true); } - Future endCallWithCharge(int vcID) async{ + + Future endCallWithCharge(int vcID) async { hasError = false; - await baseAppClient.post( - END_CALL_WITH_CHARGE, - onSuccess: (dynamic response, int statusCode) { - endCallResponse = response; - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - body: { - "VC_ID": vcID,"generalid":"Cs2020@2016\$2958", - },isLiveCare: true - ); + await baseAppClient.post(END_CALL_WITH_CHARGE, onSuccess: (dynamic response, int statusCode) { + endCallResponse = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: { + "VC_ID": vcID, + "generalid": "Cs2020@2016\$2958", + }, isLiveCare: true); } - Future transferToAdmin(int vcID, String notes) async{ + Future transferToAdmin(int vcID, String notes) async { hasError = false; - await baseAppClient.post( - TRANSFERT_TO_ADMIN, - onSuccess: (dynamic response, int statusCode) { - transferToAdminResponse = response; - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - body: { - "VC_ID": vcID, - "IsOutKsa": false, - "Notes": notes, - },isLiveCare: true - ); + await baseAppClient.post(TRANSFERT_TO_ADMIN, onSuccess: (dynamic response, int statusCode) { + transferToAdminResponse = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: { + "VC_ID": vcID, + "IsOutKsa": false, + "Notes": notes, + }, isLiveCare: true); } -} \ No newline at end of file +} diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index 536e68a7..d1ef47fa 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -4,13 +4,13 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; class MyReferralInPatientService extends BaseService { - List myReferralPatients = List(); + List myReferralPatients = []; Future getMyReferralPatientService() async { hasError = false; Map body = Map(); await getDoctorProfile(); - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; body['LastName'] = "0"; @@ -42,21 +42,17 @@ class MyReferralInPatientService extends BaseService { ); } - Future replay( - String referredDoctorRemarks, MyReferralPatientModel referral) async { + Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async { hasError = false; await getDoctorProfile(); - RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = - RequestAddReferredDoctorRemarks(); - _requestAddReferredDoctorRemarks.projectID = referral.projectID; - _requestAddReferredDoctorRemarks.admissionNo = - referral.admissionNo.toString(); - _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; - _requestAddReferredDoctorRemarks.referredDoctorRemarks = - referredDoctorRemarks; - _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; - _requestAddReferredDoctorRemarks.patientID = referral.patientID; - _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; + RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); + _requestAddReferredDoctorRemarks.projectID = referral.projectID!; + _requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString(); + _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo!; + _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; + _requestAddReferredDoctorRemarks.editedBy = doctorProfile!.doctorID!; + _requestAddReferredDoctorRemarks.patientID = referral.patientID!; + _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor!; await baseAppClient.post( ADD_REFERRED_DOCTOR_REMARKS, body: _requestAddReferredDoctorRemarks.toJson(), diff --git a/lib/core/service/patient/PatientMuseService.dart b/lib/core/service/patient/PatientMuseService.dart index c34de9e0..893b6260 100644 --- a/lib/core/service/patient/PatientMuseService.dart +++ b/lib/core/service/patient/PatientMuseService.dart @@ -3,16 +3,15 @@ import 'package:doctor_app_flutter/core/model/patient_muse/PatientMuseResultsMod import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class PatientMuseService extends BaseService { - List patientMuseResultsModelList = List(); + List patientMuseResultsModelList = []; - getECGPatient({int patientType, int patientOutSA, int patientID}) async { + getECGPatient({int? patientType, int? patientOutSA, int? patientID}) async { Map body = Map(); body['PatientType'] = patientType == 7 ? 1 : patientType; body['PatientOutSA'] = patientOutSA; body['PatientID'] = patientID; hasError = false; - await baseAppClient.post(GET_ECG, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ECG, onSuccess: (dynamic response, int statusCode) { patientMuseResultsModelList.clear(); response['HIS_GetPatientMuseResultsList'].forEach((v) { patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v)); diff --git a/lib/core/service/patient/ReferralService.dart b/lib/core/service/patient/ReferralService.dart index 69e2a810..25469dc2 100644 --- a/lib/core/service/patient/ReferralService.dart +++ b/lib/core/service/patient/ReferralService.dart @@ -4,16 +4,16 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ReferralService extends BaseService { Future referralPatient( - {int admissionNo, - String roomID, - int referralClinic, - int referralDoctor, - int patientID, - int patientTypeID, - int priority, - int frequency, - String referringDoctorRemarks, - String extension}) async { + {int? admissionNo, + String? roomID, + int? referralClinic, + int? referralDoctor, + int? patientID, + int? patientTypeID, + int? priority, + int? frequency, + String? referringDoctorRemarks, + String? extension}) async { await getDoctorProfile(); ReferralRequest referralRequest = ReferralRequest(); referralRequest.admissionNo = admissionNo; @@ -25,11 +25,11 @@ class ReferralService extends BaseService { referralRequest.priority = priority.toString(); referralRequest.frequency = frequency.toString(); referralRequest.referringDoctorRemarks = referringDoctorRemarks; - referralRequest.referringClinic = doctorProfile.clinicID; - referralRequest.referringDoctor = doctorProfile.doctorID; + referralRequest.referringClinic = doctorProfile!.clinicID; + referralRequest.referringDoctor = doctorProfile!.doctorID; referralRequest.extension = extension; - referralRequest.editedBy = doctorProfile.doctorID; - referralRequest.createdBy = doctorProfile.doctorID; + referralRequest.editedBy = doctorProfile!.doctorID; + referralRequest.createdBy = doctorProfile!.doctorID; referralRequest.patientOutSA = false; await baseAppClient.post( diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index c83c74c9..abf3fab3 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -14,7 +14,7 @@ import '../base/lookup-service.dart'; class PatientReferralService extends LookupService { List projectsList = []; List clinicsList = []; - List doctorsList = List(); + List doctorsList = []; List listMyReferredPatientModel = []; List pendingReferralList = []; List patientReferralList = []; @@ -56,8 +56,7 @@ class PatientReferralService extends LookupService { Map body = Map(); body['isSameBranch'] = false; - await baseAppClient.post(GET_REFERRAL_FACILITIES, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_REFERRAL_FACILITIES, onSuccess: (response, statusCode) async { projectsList = response['ProjectInfo']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -84,8 +83,7 @@ class PatientReferralService extends LookupService { Future getClinicsList(int projectId) async { hasError = false; - ClinicByProjectIdRequest _clinicByProjectIdRequest = - ClinicByProjectIdRequest(); + ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); _clinicByProjectIdRequest.projectID = projectId; await baseAppClient.post( @@ -103,11 +101,9 @@ class PatientReferralService extends LookupService { ); } - Future getDoctorsList( - PatiantInformtion patient, int clinicId, int branchId) async { + Future getDoctorsList(PatiantInformtion patient, int clinicId, int branchId) async { hasError = false; - DoctorsByClinicIdRequest _doctorsByClinicIdRequest = - DoctorsByClinicIdRequest(); + DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); _doctorsByClinicIdRequest.projectID = branchId; _doctorsByClinicIdRequest.clinicID = clinicId; @@ -128,9 +124,8 @@ class PatientReferralService extends LookupService { Future getMyReferredPatient() async { hasError = false; - RequestMyReferralPatientModel _requestMyReferralPatient = - RequestMyReferralPatientModel(); - DoctorProfileModel doctorProfile = await getDoctorProfile(); + RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); await baseAppClient.post( GET_MY_REFERRED_PATIENT, @@ -140,8 +135,7 @@ class PatientReferralService extends LookupService { response['List_MyReferredPatient'].forEach((v) { MyReferredPatientModel item = MyReferredPatientModel.fromJson(v); if (doctorProfile != null) { - item.isReferralDoctorSameBranch = - doctorProfile.projectID == item.projectID; + item.isReferralDoctorSameBranch = doctorProfile.projectID == item.projectID; } else { item.isReferralDoctorSameBranch = false; } @@ -159,10 +153,10 @@ class PatientReferralService extends LookupService { Future getPendingReferralList() async { hasError = false; - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); Map body = Map(); // body['ClinicID'] = 0; - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; await baseAppClient.post( GET_PENDING_REFERRAL_PATIENT, @@ -171,8 +165,7 @@ class PatientReferralService extends LookupService { response['PendingReferralList'].forEach((v) { PendingReferral item = PendingReferral.fromJson(v); - item.isReferralDoctorSameBranch = - item.targetProjectId == item.sourceProjectId; + item.isReferralDoctorSameBranch = item.targetProjectId == item.sourceProjectId; pendingReferralList.add(item); }); }, @@ -197,8 +190,7 @@ class PatientReferralService extends LookupService { response['ReferralList']['entityList'].forEach((v) { PendingReferral item = PendingReferral.fromJson(v); - item.isReferralDoctorSameBranch = - item.targetProjectId == item.sourceProjectId; + item.isReferralDoctorSameBranch = item.targetProjectId == item.sourceProjectId; patientReferralList.add(item); }); }, @@ -211,10 +203,9 @@ class PatientReferralService extends LookupService { ); } - Future responseReferral( - PendingReferral pendingReferral, bool isAccepted) async { + Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { hasError = false; - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); Map body = Map(); body['PatientMRN'] = pendingReferral.patientID; @@ -224,7 +215,7 @@ class PatientReferralService extends LookupService { body['IsAccepted'] = isAccepted; body['PatientName'] = pendingReferral.patientName; body['ReferralResponse'] = pendingReferral.remarksFromSource; - body['DoctorName'] = doctorProfile.doctorName; + body['DoctorName'] = doctorProfile!.doctorName; await baseAppClient.post( RESPONSE_PENDING_REFERRAL_PATIENT, @@ -239,15 +230,14 @@ class PatientReferralService extends LookupService { ); } - Future makeReferral(PatiantInformtion patient, String isoStringDate, - int projectID, int clinicID, int doctorID, String remarks) async { + Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID, + String remarks) async { hasError = false; Map body = Map(); List physiotheraphyGoalsList = []; listOfPhysiotherapyGoals.forEach((element) { - physiotheraphyGoalsList - .add({"goalId": element.id, "remarks": element.remarks}); + physiotheraphyGoalsList.add({"goalId": element.id, "remarks": element.remarks}); }); body['PatientMRN'] = patient.patientMRN ?? patient.patientId; @@ -296,8 +286,7 @@ class PatientReferralService extends LookupService { ); } - Future verifyReferralDoctorRemarks( - MyReferredPatientModel referredPatient) async { + Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async { hasError = false; Map body = Map(); diff --git a/lib/core/service/patient/patientInPatientService.dart b/lib/core/service/patient/patientInPatientService.dart index e0bc94a3..8648a0cc 100644 --- a/lib/core/service/patient/patientInPatientService.dart +++ b/lib/core/service/patient/patientInPatientService.dart @@ -4,16 +4,15 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class PatientInPatientService extends BaseService { - List inPatientList = List(); - List myInPatientList = List(); + List inPatientList = []; + List myInPatientList = []; - Future getInPatientList( - PatientSearchRequestModel requestModel, bool isMyInpatient) async { + Future getInPatientList(PatientSearchRequestModel requestModel, bool isMyInpatient) async { hasError = false; await getDoctorProfile(); if (isMyInpatient) { - requestModel.doctorID = doctorProfile.doctorID; + requestModel.doctorID = doctorProfile!.doctorID; } else { requestModel.doctorID = 0; } @@ -27,7 +26,7 @@ class PatientInPatientService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if(patient.doctorId == doctorProfile.doctorID){ + if (patient.doctorId == doctorProfile!.doctorID) { myInPatientList.add(patient); } }); diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index e15cc8d1..8eedb7de 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -27,15 +27,12 @@ class PatientService extends BaseService { List _patientLabResultOrdersList = []; - List get patientLabResultOrdersList => - _patientLabResultOrdersList; + List get patientLabResultOrdersList => _patientLabResultOrdersList; - List get patientPrescriptionsList => - _patientPrescriptionsList; + List get patientPrescriptionsList => _patientPrescriptionsList; List _patientPrescriptionsList = []; - List get prescriptionReportForInPatientList => - _prescriptionReportForInPatientList; + List get prescriptionReportForInPatientList => _prescriptionReportForInPatientList; List _prescriptionReportForInPatientList = []; List _patientRadiologyList = []; @@ -79,13 +76,10 @@ class PatientService extends BaseService { get referalFrequancyList => _referalFrequancyList; - DoctorsByClinicIdRequest _doctorsByClinicIdRequest = - DoctorsByClinicIdRequest(); - STPReferralFrequencyRequest _referralFrequencyRequest = - STPReferralFrequencyRequest(); - ClinicByProjectIdRequest _clinicByProjectIdRequest = - ClinicByProjectIdRequest(); - ReferToDoctorRequest _referToDoctorRequest; + DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); + STPReferralFrequencyRequest _referralFrequencyRequest = STPReferralFrequencyRequest(); + ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); + ReferToDoctorRequest? _referToDoctorRequest; Future getPatientList(patient, patientType, {isView}) async { hasError = false; @@ -181,8 +175,7 @@ class PatientService extends BaseService { onSuccess: (dynamic response, int statusCode) { _prescriptionReportForInPatientList = []; response['List_PrescriptionReportForInPatient'].forEach((v) { - prescriptionReportForInPatientList - .add(PrescriptionReportForInPatient.fromJson(v)); + prescriptionReportForInPatientList.add(PrescriptionReportForInPatient.fromJson(v)); }); }, onFailure: (String error, int statusCode) { @@ -375,39 +368,39 @@ class PatientService extends BaseService { // TODO send the total model insted of each parameter Future referToDoctor( - {String selectedDoctorID, - String selectedClinicID, - int admissionNo, - String extension, - String priority, - String frequency, - String referringDoctorRemarks, - int patientID, - int patientTypeID, - String roomID, - int projectID}) async { + {String? selectedDoctorID, + String? selectedClinicID, + int? admissionNo, + String? extension, + String? priority, + String? frequency, + String? referringDoctorRemarks, + int? patientID, + int? patientTypeID, + String? roomID, + int? projectID}) async { hasError = false; // TODO Change it to use it when we implement authentication user Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - int doctorID = doctorProfile.doctorID; - int clinicId = doctorProfile.clinicID; + DoctorProfileModel? doctorProfile = new DoctorProfileModel.fromJson(profile); + int? doctorID = doctorProfile.doctorID; + int? clinicId = doctorProfile.clinicID; _referToDoctorRequest = ReferToDoctorRequest( - projectID: projectID, - admissionNo: admissionNo, - roomID: roomID, + projectID: projectID!, + admissionNo: admissionNo!, + roomID: roomID!, referralClinic: selectedClinicID.toString(), referralDoctor: selectedDoctorID.toString(), - createdBy: doctorID, - editedBy: doctorID, - patientID: patientID, - patientTypeID: patientTypeID, - referringClinic: clinicId, + createdBy: doctorID!, + editedBy: doctorID!, + patientID: patientID!, + patientTypeID: patientTypeID!, + referringClinic: clinicId!, referringDoctor: doctorID, - referringDoctorRemarks: referringDoctorRemarks, - priority: priority, - frequency: frequency, - extension: extension, + referringDoctorRemarks: referringDoctorRemarks!, + priority: priority!, + frequency: frequency!, + extension: extension!, ); await baseAppClient.post( PATIENT_PROGRESS_NOTE_URL, @@ -416,7 +409,7 @@ class PatientService extends BaseService { hasError = true; super.error = error; }, - body: _referToDoctorRequest.toJson(), + body: _referToDoctorRequest!.toJson(), ); } diff --git a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart index 2bb9dac7..2a1574f4 100644 --- a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart +++ b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart @@ -7,37 +7,28 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class InsuranceCardService extends BaseService { InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel( - isDentalAllowedBackend: false, - patientTypeID: 1, - patientType: 1, - eXuldAPPNO: 0, - projectID: 0); - InsuranceApprovalInPatientRequestModel - _insuranceApprovalInPatientRequestModel = + isDentalAllowedBackend: false, patientTypeID: 1, patientType: 1, eXuldAPPNO: 0, projectID: 0); + InsuranceApprovalInPatientRequestModel _insuranceApprovalInPatientRequestModel = InsuranceApprovalInPatientRequestModel(); - List _insuranceApproval = List(); + List _insuranceApproval = []; List get insuranceApproval => _insuranceApproval; - List _insuranceApprovalInPatient = List(); - List get insuranceApprovalInPatient => - _insuranceApprovalInPatient; + List _insuranceApprovalInPatient = []; + List get insuranceApprovalInPatient => _insuranceApprovalInPatient; - Future getInsuranceApprovalInPatient({int mrn}) async { - _insuranceApprovalInPatientRequestModel = - InsuranceApprovalInPatientRequestModel( - patientID: mrn, + Future getInsuranceApprovalInPatient({int? mrn}) async { + _insuranceApprovalInPatientRequestModel = InsuranceApprovalInPatientRequestModel( + patientID: mrn!, patientTypeID: 1, ); hasError = false; insuranceApprovalInPatient.clear(); - await baseAppClient.post(GET_INSURANCE_IN_PATIENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_INSURANCE_IN_PATIENT, onSuccess: (dynamic response, int statusCode) { //prescriptionsList.clear(); response['List_ApprovalMain_InPatient'].forEach((prescriptions) { - insuranceApprovalInPatient - .add(InsuranceApprovalInPatientModel.fromJson(prescriptions)); + insuranceApprovalInPatient.add(InsuranceApprovalInPatientModel.fromJson(prescriptions)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -45,8 +36,7 @@ class InsuranceCardService extends BaseService { }, body: _insuranceApprovalInPatientRequestModel.toJson()); } - Future getInsuranceApproval(PatiantInformtion patient, - {int appointmentNo, int projectId}) async { + Future getInsuranceApproval(PatiantInformtion patient, {int? appointmentNo, int? projectId}) async { hasError = false; // _cardList.clear(); // if (appointmentNo != null) { @@ -59,8 +49,8 @@ class InsuranceCardService extends BaseService { _insuranceApprovalModel.projectID = 0; // } - await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS, - patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS, patient: patient, + onSuccess: (dynamic response, int statusCode) { print(response['HIS_Approval_List'].length); _insuranceApproval.clear(); _insuranceApproval.length = 0; diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index c7bb9a78..4b7a2459 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -10,16 +10,15 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import '../../base/base_service.dart'; class LabsService extends BaseService { - List patientLabOrdersList = List(); + List patientLabOrdersList = []; - Future getPatientLabOrdersList( - PatiantInformtion patient, bool isInpatient) async { + Future getPatientLabOrdersList(PatiantInformtion patient, bool isInpatient) async { hasError = false; Map body = Map(); String url = ""; if (isInpatient) { await getDoctorProfile(); - body['ProjectID'] = doctorProfile.projectID; + body['ProjectID'] = doctorProfile!.projectID; url = GET_PATIENT_LAB_OREDERS; } else { body['isDentalAllowedBackend'] = false; @@ -27,8 +26,7 @@ class LabsService extends BaseService { } patientLabOrdersList = []; patientLabOrdersList.clear(); - await baseAppClient.postPatient(url, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabOrdersList = []; if (!isInpatient) { response['ListPLO'].forEach((hospital) { @@ -46,19 +44,18 @@ class LabsService extends BaseService { }, body: body); } - RequestPatientLabSpecialResult _requestPatientLabSpecialResult = - RequestPatientLabSpecialResult(); + RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult(); - List patientLabSpecialResult = List(); - List labResultList = List(); - List labOrdersResultsList = List(); + List patientLabSpecialResult = []; + List labResultList = []; + List labOrdersResultsList = []; Future getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo, - PatiantInformtion patient, + {String? projectID, + int? clinicID, + String? invoiceNo, + String? orderNo, + PatiantInformtion? patient, bool isInpatient = false}) async { hasError = false; @@ -69,8 +66,8 @@ class LabsService extends BaseService { _requestPatientLabSpecialResult.orderNo = orderNo; body = _requestPatientLabSpecialResult.toJson(); - await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, - patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient!, + onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); response['ListPLSR'].forEach((hospital) { @@ -82,29 +79,25 @@ class LabsService extends BaseService { }, body: body); } - Future getPatientLabResult( - {PatientLabOrders patientLabOrder, - PatiantInformtion patient, - bool isInpatient}) async { + Future getPatientLabResult({PatientLabOrders? patientLabOrder, PatiantInformtion? patient, bool? isInpatient}) async { hasError = false; String url = ""; - if (isInpatient) { + if (isInpatient!) { url = GET_PATIENT_LAB_RESULTS; } else { url = GET_Patient_LAB_RESULT; } Map body = Map(); - body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['InvoiceNo'] = patientLabOrder!.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID ?? 0; - await baseAppClient.postPatient(url, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient!, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult = []; labResultList = []; @@ -127,9 +120,7 @@ class LabsService extends BaseService { } Future getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, - String procedure, - PatiantInformtion patient}) async { + {PatientLabOrders? patientLabOrder, String? procedure, PatiantInformtion? patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -141,8 +132,8 @@ class LabsService extends BaseService { } body['isDentalAllowedBackend'] = false; body['Procedure'] = procedure; - await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, - patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, patient: patient!, + onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { labOrdersResultsList.add(LabOrderResult.fromJson(lab)); @@ -153,10 +144,9 @@ class LabsService extends BaseService { }, body: body); } - RequestSendLabReportEmail _requestSendLabReportEmail = - RequestSendLabReportEmail(); + RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); - Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { + Future sendLabReportEmail({PatientLabOrders? patientLabOrder}) async { // _requestSendLabReportEmail.projectID = patientLabOrder.projectID; // _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; // _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; diff --git a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart index 94933d7d..14139715 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -13,12 +13,10 @@ class PatientMedicalReportService extends BaseService { Map body = Map(); await getDoctorProfile(); body['AdmissionNo'] = patient.admissionNo; - body['SetupID'] = doctorProfile.setupID; - body['ProjectID'] = doctorProfile.projectID; - - await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, - onSuccess: (dynamic response, int statusCode) { + body['SetupID'] = doctorProfile!.setupID; + body['ProjectID'] = doctorProfile!.projectID; + await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) { medicalReportList.clear(); if (response['DAPP_ListMedicalReportList'] != null) { response['DAPP_ListMedicalReportList'].forEach((v) { @@ -38,19 +36,17 @@ class PatientMedicalReportService extends BaseService { body['SetupID'] = "91877"; body['TemplateID'] = 43; - await baseAppClient.post(PATIENT_MEDICAL_REPORT_GET_TEMPLATE, - onSuccess: (dynamic response, int statusCode) { - - medicalReportTemplate.clear(); - if (response['DAPP_GetTemplateByIDList'] != null) { - response['DAPP_GetTemplateByIDList'].forEach((v) { - medicalReportTemplate.add(MedicalReportTemplate.fromJson(v)); - }); - } - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error.toString(); - }, body: body); + await baseAppClient.post(PATIENT_MEDICAL_REPORT_GET_TEMPLATE, onSuccess: (dynamic response, int statusCode) { + medicalReportTemplate.clear(); + if (response['DAPP_GetTemplateByIDList'] != null) { + response['DAPP_GetTemplateByIDList'].forEach((v) { + medicalReportTemplate.add(MedicalReportTemplate.fromJson(v)); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, body: body); } Future insertMedicalReport(PatiantInformtion patient, String htmlText) async { @@ -61,13 +57,11 @@ class PatientMedicalReportService extends BaseService { body['AdmissionNo'] = patient.admissionNo; body['MedicalReportHTML'] = htmlText; - await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_INSERT, - onSuccess: (dynamic response, int statusCode) { - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error.toString(); - }, body: body, patient: patient); + await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_INSERT, onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, body: body, patient: patient); } Future verifyMedicalReport(PatiantInformtion patient, MedicalReportModel medicalReport) async { @@ -79,12 +73,10 @@ class PatientMedicalReportService extends BaseService { body['InvoiceNo'] = medicalReport.invoiceNo; body['LineItemNo'] = medicalReport.lineItemNo; - await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_VERIFIED, - onSuccess: (dynamic response, int statusCode) { - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error.toString(); - }, body: body, patient: patient); + await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_VERIFIED, onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, body: body, patient: patient); } } diff --git a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart index 42cdafc6..295d38ac 100644 --- a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart +++ b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/medical_report/medical_file_reques import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class MedicalFileService extends BaseService { - List _medicalFileList = List(); + List _medicalFileList = []; List get medicalFileList => _medicalFileList; MedicalFileRequestModel _fileRequestModel = MedicalFileRequestModel( @@ -13,15 +13,13 @@ class MedicalFileService extends BaseService { "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU", ); - Future getMedicalFile({int mrn}) async { + Future getMedicalFile({int? mrn}) async { _fileRequestModel = MedicalFileRequestModel(patientMRN: mrn); _fileRequestModel.iPAdress = "9.9.9.9"; hasError = false; _medicalFileList.clear(); - await baseAppClient.post(GET_MEDICAL_FILE, - onSuccess: (dynamic response, int statusCode) { - _medicalFileList - .add(MedicalFileModel.fromJson(response['PatientFileList'])); + await baseAppClient.post(GET_MEDICAL_FILE, onSuccess: (dynamic response, int statusCode) { + _medicalFileList.add(MedicalFileModel.fromJson(response['PatientFileList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index ffbcae9b..96399156 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -16,9 +16,9 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionService extends LookupService { - List _prescriptionList = List(); + List _prescriptionList = []; List get prescriptionList => _prescriptionList; - List _drugsList = List(); + List _drugsList = []; List get drugsList => _drugsList; List doctorsList = []; List allMedicationList = []; @@ -31,27 +31,22 @@ class PrescriptionService extends LookupService { dynamic boxQuantity; PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); - ItemByMedicineRequestModel _itemByMedicineRequestModel = - ItemByMedicineRequestModel(); + ItemByMedicineRequestModel _itemByMedicineRequestModel = ItemByMedicineRequestModel(); SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( //search: ["Acetaminophen"], search: ["Amoxicillin"], ); - CalculateBoxQuantityRequestModel _boxQuantityRequestModel = - CalculateBoxQuantityRequestModel(); + CalculateBoxQuantityRequestModel _boxQuantityRequestModel = CalculateBoxQuantityRequestModel(); - PostPrescriptionReqModel _postPrescriptionReqModel = - PostPrescriptionReqModel(); + PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel(); - Future getItem({int itemID}) async { - _itemByMedicineRequestModel = - ItemByMedicineRequestModel(medicineCode: itemID); + Future getItem({int? itemID}) async { + _itemByMedicineRequestModel = ItemByMedicineRequestModel(medicineCode: itemID); hasError = false; - await baseAppClient.post(GET_ITEM_BY_MEDICINE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ITEM_BY_MEDICINE, onSuccess: (dynamic response, int statusCode) { itemMedicineList = []; itemMedicineList = response['listItemByMedicineCode']['frequencies']; itemMedicineListRoute = response['listItemByMedicineCode']['routes']; @@ -62,11 +57,9 @@ class PrescriptionService extends LookupService { }, body: _itemByMedicineRequestModel.toJson()); } - Future getPatientAssessment( - GetAssessmentReqModel getAssessmentReqModel) async { + Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async { hasError = false; - await baseAppClient.post(GET_ASSESSMENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { print("Success"); patientAssessmentList.clear(); response['AssessmentList']['entityList'].forEach((v) { @@ -78,29 +71,26 @@ class PrescriptionService extends LookupService { }, body: getAssessmentReqModel.toJson()); } - Future getPrescription({int mrn}) async { + Future getPrescription({int? mrn}) async { _prescriptionReqModel = PrescriptionReqModel( patientMRN: mrn, ); hasError = false; _prescriptionList.clear(); - await baseAppClient.post(GET_PRESCRIPTION_LIST, - onSuccess: (dynamic response, int statusCode) { - _prescriptionList - .add(PrescriptionModel.fromJson(response['PrescriptionList'])); + await baseAppClient.post(GET_PRESCRIPTION_LIST, onSuccess: (dynamic response, int statusCode) { + _prescriptionList.add(PrescriptionModel.fromJson(response['PrescriptionList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: _prescriptionReqModel.toJson()); } - Future getDrugs({String drugName}) async { - _drugRequestModel = SearchDrugRequestModel(search: [drugName]); + Future getDrugs({String? drugName}) async { + _drugRequestModel = SearchDrugRequestModel(search: [drugName!]); hasError = false; - await baseAppClient.post(SEARCH_DRUG, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) { doctorsList = []; doctorsList = response['MedicationList']['entityList']; }, onFailure: (String error, int statusCode) { @@ -112,8 +102,7 @@ class PrescriptionService extends LookupService { Future getMedicationList({String drug = ''}) async { hasError = false; _drugRequestModel.search = ["$drug"]; - await baseAppClient.post(SEARCH_DRUG, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) { allMedicationList = []; response['MedicationList']['entityList'].forEach((v) { allMedicationList.add(GetMedicationResponseModel.fromJson(v)); @@ -124,8 +113,7 @@ class PrescriptionService extends LookupService { }, body: _drugRequestModel.toJson()); } - Future postPrescription( - PostPrescriptionReqModel postProcedureReqModel) async { + Future postPrescription(PostPrescriptionReqModel postProcedureReqModel) async { hasError = false; //_prescriptionList.clear(); await baseAppClient.post( @@ -141,8 +129,7 @@ class PrescriptionService extends LookupService { ); } - Future updatePrescription( - PostPrescriptionReqModel updatePrescriptionReqModel) async { + Future updatePrescription(PostPrescriptionReqModel updatePrescriptionReqModel) async { hasError = false; //_prescriptionList.clear(); await baseAppClient.post( @@ -158,12 +145,8 @@ class PrescriptionService extends LookupService { ); } - Future getDrugToDrug( - VitalSignData vital, - List lstAssessments, - List allergy, - PatiantInformtion patient, - List prescription) async { + Future getDrugToDrug(VitalSignData vital, List lstAssessments, + List allergy, PatiantInformtion patient, List prescription) async { // Map request = { // "Prescription": { // "objPatientInfo": {"Gender": "Male", "Age": "21/06/1967"}, @@ -218,8 +201,7 @@ class PrescriptionService extends LookupService { "Prescription": { "objPatientInfo": { "Gender": patient.gender == 1 ? 'Male' : 'Female', - "Age": AppDateUtils.convertDateFromServerFormat( - patient.dateofBirth, 'dd/MM/yyyy') + "Age": AppDateUtils.convertDateFromServerFormat(patient.dateofBirth!, 'dd/MM/yyyy') }, "objVitalSign": {"Height": vital?.heightCm, "Weight": vital?.weightKg}, "objPrescriptionItems": prescription, @@ -231,29 +213,22 @@ class PrescriptionService extends LookupService { }; hasError = false; - await baseAppClient.post(DRUG_TO_DRUG, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(DRUG_TO_DRUG, onSuccess: (dynamic response, int statusCode) { drugToDrug = []; - drugToDrug = - response['DrugToDrugResponse']['objPrescriptionCheckerResult']; + drugToDrug = response['DrugToDrugResponse']['objPrescriptionCheckerResult']; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: request); } - Future calculateBoxQuantity( - {int freq, int duration, int itemCode, double strength}) async { - _boxQuantityRequestModel = CalculateBoxQuantityRequestModel( - frequency: freq, - duration: duration, - itemCode: itemCode, - strength: strength); + Future calculateBoxQuantity({int? freq, int? duration, int? itemCode, double? strength}) async { + _boxQuantityRequestModel = + CalculateBoxQuantityRequestModel(frequency: freq, duration: duration, itemCode: itemCode, strength: strength); hasError = false; - await baseAppClient.post(GET_BOX_QUANTITY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_BOX_QUANTITY, onSuccess: (dynamic response, int statusCode) { boxQuantity = response['BoxQuantity']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -265,10 +240,7 @@ class PrescriptionService extends LookupService { var allergiesObj = []; allergies.forEach((element) { allergiesObj.add({ - "objProperties": { - 'Id': element.allergyDiseaseId, - 'Name': element.allergyDiseaseName - } + "objProperties": {'Id': element.allergyDiseaseId, 'Name': element.allergyDiseaseName} }); }); return allergiesObj; diff --git a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart index eb860141..83fc9fd3 100644 --- a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart @@ -15,14 +15,13 @@ import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; class PrescriptionsService extends BaseService { - List prescriptionsList = List(); - List prescriptionsOrderList = List(); - List prescriptionInPatientList = List(); + List prescriptionsList = []; + List prescriptionsOrderList = []; + List prescriptionInPatientList = []; - InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel = - InPatientPrescriptionRequestModel(); + InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel(); - Future getPrescriptionInPatient({int mrn, String adn}) async { + Future getPrescriptionInPatient({int? mrn, String? adn}) async { _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel( patientMRN: mrn, admissionNo: adn, @@ -30,12 +29,10 @@ class PrescriptionsService extends BaseService { hasError = false; prescriptionInPatientList.clear(); - await baseAppClient.post(GET_PRESCRIPTION_IN_PATIENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PRESCRIPTION_IN_PATIENT, onSuccess: (dynamic response, int statusCode) { prescriptionsList.clear(); response['List_PrescriptionReportForInPatient'].forEach((prescriptions) { - prescriptionInPatientList - .add(PrescriotionInPatient.fromJson(prescriptions)); + prescriptionInPatientList.add(PrescriotionInPatient.fromJson(prescriptions)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -47,8 +44,7 @@ class PrescriptionsService extends BaseService { hasError = false; Map body = Map(); body['isDentalAllowedBackend'] = false; - await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionsList.clear(); response['PatientPrescriptionList'].forEach((prescriptions) { prescriptionsList.add(Prescriptions.fromJson(prescriptions)); @@ -60,15 +56,12 @@ class PrescriptionsService extends BaseService { } RequestPrescriptionReport _requestPrescriptionReport = - RequestPrescriptionReport( - appointmentNo: 0, isDentalAllowedBackend: false); - List prescriptionReportList = List(); + RequestPrescriptionReport(appointmentNo: 0, isDentalAllowedBackend: false); + List prescriptionReportList = []; - Future getPrescriptionReport( - {Prescriptions prescriptions, - @required PatiantInformtion patient}) async { + Future getPrescriptionReport({Prescriptions? prescriptions, @required PatiantInformtion? patient}) async { hasError = false; - _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; + _requestPrescriptionReport.dischargeNo = prescriptions!.dischargeNo; _requestPrescriptionReport.projectID = prescriptions.projectID; _requestPrescriptionReport.clinicID = prescriptions.clinicID; _requestPrescriptionReport.setupID = prescriptions.setupID; @@ -76,23 +69,18 @@ class PrescriptionsService extends BaseService { _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; await baseAppClient.postPatient( - prescriptions.isInOutPatient - ? GET_PRESCRIPTION_REPORT_ENH - : GET_PRESCRIPTION_REPORT_NEW, - patient: patient, onSuccess: (dynamic response, int statusCode) { + prescriptions.isInOutPatient! ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, + patient: patient!, onSuccess: (dynamic response, int statusCode) { prescriptionReportList.clear(); prescriptionReportEnhList.clear(); - if (prescriptions.isInOutPatient) { + if (prescriptions.isInOutPatient!) { response['ListPRM'].forEach((prescriptions) { - prescriptionReportList - .add(PrescriptionReport.fromJson(prescriptions)); - prescriptionReportEnhList - .add(PrescriptionReportEnh.fromJson(prescriptions)); + prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); + prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); }); } else { response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { - prescriptionReportList - .add(PrescriptionReport.fromJson(prescriptions)); + prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); }); } }, onFailure: (String error, int statusCode) { @@ -101,25 +89,22 @@ class PrescriptionsService extends BaseService { }, body: _requestPrescriptionReport.toJson()); } - RequestGetListPharmacyForPrescriptions - requestGetListPharmacyForPrescriptions = + RequestGetListPharmacyForPrescriptions requestGetListPharmacyForPrescriptions = RequestGetListPharmacyForPrescriptions( latitude: 0, longitude: 0, isDentalAllowedBackend: false, ); - List pharmacyPrescriptionsList = List(); + List pharmacyPrescriptionsList = []; - Future getListPharmacyForPrescriptions( - {int itemId, @required PatiantInformtion patient}) async { + Future getListPharmacyForPrescriptions({int? itemId, @required PatiantInformtion? patient}) async { hasError = false; requestGetListPharmacyForPrescriptions.itemID = itemId; - await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient, + await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient!, onSuccess: (dynamic response, int statusCode) { pharmacyPrescriptionsList.clear(); response['PharmList'].forEach((prescriptions) { - pharmacyPrescriptionsList - .add(PharmacyPrescriptions.fromJson(prescriptions)); + pharmacyPrescriptionsList.add(PharmacyPrescriptions.fromJson(prescriptions)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -127,39 +112,36 @@ class PrescriptionsService extends BaseService { }, body: requestGetListPharmacyForPrescriptions.toJson()); } - RequestPrescriptionReportEnh _requestPrescriptionReportEnh = - RequestPrescriptionReportEnh( + RequestPrescriptionReportEnh _requestPrescriptionReportEnh = RequestPrescriptionReportEnh( isDentalAllowedBackend: false, ); - List prescriptionReportEnhList = List(); + List prescriptionReportEnhList = []; Future getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, - @required PatiantInformtion patient}) async { + {PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { ///This logic copy from the old app from class [order-history.component.ts] in line 45 bool isInPatient = false; prescriptionsList.forEach((element) { - if (prescriptionsOrder.appointmentNo == "0") { - if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { + if (prescriptionsOrder!.appointmentNo == "0") { + if (element.dischargeNo == int.parse(prescriptionsOrder!.dischargeID)) { _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; _requestPrescriptionReportEnh.clinicID = element.clinicID; _requestPrescriptionReportEnh.projectID = element.projectID; _requestPrescriptionReportEnh.episodeID = element.episodeID; _requestPrescriptionReportEnh.setupID = element.setupID; _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; - isInPatient = element.isInOutPatient; + isInPatient = element.isInOutPatient!; } } else { - if (int.parse(prescriptionsOrder.appointmentNo) == - element.appointmentNo) { + if (int.parse(prescriptionsOrder.appointmentNo) == element.appointmentNo) { _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; _requestPrescriptionReportEnh.clinicID = element.clinicID; _requestPrescriptionReportEnh.projectID = element.projectID; _requestPrescriptionReportEnh.episodeID = element.episodeID; _requestPrescriptionReportEnh.setupID = element.setupID; _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; - isInPatient = element.isInOutPatient; + isInPatient = element.isInOutPatient!; ///call inpGetPrescriptionReport } @@ -168,20 +150,17 @@ class PrescriptionsService extends BaseService { hasError = false; - await baseAppClient.postPatient( - isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, - patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, + patient: patient!, onSuccess: (dynamic response, int statusCode) { prescriptionReportEnhList.clear(); if (isInPatient) { response['ListPRM'].forEach((prescriptions) { - prescriptionReportEnhList - .add(PrescriptionReportEnh.fromJson(prescriptions)); + prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); }); } else { response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { - PrescriptionReportEnh reportEnh = - PrescriptionReportEnh.fromJson(prescriptions); + PrescriptionReportEnh reportEnh = PrescriptionReportEnh.fromJson(prescriptions); reportEnh.itemDescription = prescriptions['ItemDescriptionN']; prescriptionReportEnhList.add(reportEnh); }); @@ -195,13 +174,10 @@ class PrescriptionsService extends BaseService { Future getPrescriptionsOrders() async { Map body = Map(); body['isDentalAllowedBackend'] = false; - await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, onSuccess: (dynamic response, int statusCode) { prescriptionsOrderList.clear(); - response['PatientER_GetPatientAllPresOrdersList'] - .forEach((prescriptionsOrder) { - prescriptionsOrderList - .add(PrescriptionsOrder.fromJson(prescriptionsOrder)); + response['PatientER_GetPatientAllPresOrdersList'].forEach((prescriptionsOrder) { + prescriptionsOrderList.add(PrescriptionsOrder.fromJson(prescriptionsOrder)); }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index 0c284f3d..6a757986 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -14,30 +14,26 @@ import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ProcedureService extends BaseService { - List _procedureList = List(); + List _procedureList = []; List get procedureList => _procedureList; - List _valadteProcedureList = List(); + List _valadteProcedureList = []; List get valadteProcedureList => _valadteProcedureList; - List _categoriesList = List(); + List _categoriesList = []; List get categoriesList => _categoriesList; - List procedureslist = List(); + List procedureslist = []; List categoryList = []; // List _templateList = List(); // List get templateList => _templateList; - List templateList = List(); + List templateList = []; - List _templateDetailsList = List(); - List get templateDetailsList => - _templateDetailsList; + List _templateDetailsList = []; + List get templateDetailsList => _templateDetailsList; - GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = - GetOrderedProcedureRequestModel(); + GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(); - ProcedureTempleteRequestModel _procedureTempleteRequestModel = - ProcedureTempleteRequestModel(); - ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = - ProcedureTempleteDetailsRequestModel(); + ProcedureTempleteRequestModel _procedureTempleteRequestModel = ProcedureTempleteRequestModel(); + ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel(); GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( // clinicId: 17, @@ -63,8 +59,7 @@ class ProcedureService extends BaseService { //search: ["DENTAL"], ); - Future getProcedureTemplate( - {int doctorId, int projectId, int clinicId, String categoryID}) async { + Future getProcedureTemplate({int? doctorId, int? projectId, int? clinicId, String? categoryID}) async { _procedureTempleteRequestModel = ProcedureTempleteRequestModel( tokenID: "@dm!n", patientID: 0, @@ -72,19 +67,18 @@ class ProcedureService extends BaseService { ); hasError = false; - await baseAppClient.post(GET_TEMPLETE_LIST/*GET_PROCEDURE_TEMPLETE*/, + await baseAppClient.post(GET_TEMPLETE_LIST /*GET_PROCEDURE_TEMPLETE*/, onSuccess: (dynamic response, int statusCode) { - templateList.clear(); + templateList.clear(); response['DAPP_TemplateGetList'].forEach((template) { ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template); - if(categoryID != null){ - if(categoryID == templateElement.categoryID){ + if (categoryID != null) { + if (categoryID == templateElement.categoryID) { templateList.add(templateElement); } } else { templateList.add(templateElement); } - }); // response['HIS_ProcedureTemplateList'].forEach((template) { // _templateList.add(ProcedureTempleteModel.fromJson(template)); @@ -95,21 +89,17 @@ class ProcedureService extends BaseService { }, body: _procedureTempleteRequestModel.toJson()); } - Future getProcedureTemplateDetails( - {int doctorId, int projectId, int clinicId, int templateId}) async { + Future getProcedureTemplateDetails({int? doctorId, int? projectId, int? clinicId, int? templateId}) async { _procedureTempleteDetailsRequestModel = - ProcedureTempleteDetailsRequestModel( - templateID: templateId, searchType: 1, patientID: 0); + ProcedureTempleteDetailsRequestModel(templateID: templateId, searchType: 1, patientID: 0); hasError = false; //insuranceApprovalInPatient.clear(); _templateDetailsList.clear(); - await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, onSuccess: (dynamic response, int statusCode) { //prescriptionsList.clear(); response['HIS_ProcedureTemplateDetailsList'].forEach((template) { - _templateDetailsList - .add(ProcedureTempleteDetailsModel.fromJson(template)); + _templateDetailsList.add(ProcedureTempleteDetailsModel.fromJson(template)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -117,15 +107,12 @@ class ProcedureService extends BaseService { }, body: _procedureTempleteDetailsRequestModel.toJson()); } - Future getProcedure({int mrn}) async { - _getOrderedProcedureRequestModel = - GetOrderedProcedureRequestModel(patientMRN: mrn); + Future getProcedure({int? mrn}) async { + _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(patientMRN: mrn); hasError = false; _procedureList.clear(); - await baseAppClient.post(GET_PROCEDURE_LIST, - onSuccess: (dynamic response, int statusCode) { - _procedureList.add( - GetOrderedProcedureModel.fromJson(response['OrderedProcedureList'])); + await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) { + _procedureList.add(GetOrderedProcedureModel.fromJson(response['OrderedProcedureList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -135,8 +122,7 @@ class ProcedureService extends BaseService { Future getCategory() async { hasError = false; - await baseAppClient.post(GET_LIST_CATEGORISE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_LIST_CATEGORISE, onSuccess: (dynamic response, int statusCode) { categoryList = []; categoryList = response['listProcedureCategories']['entityList']; }, onFailure: (String error, int statusCode) { @@ -145,7 +131,7 @@ class ProcedureService extends BaseService { }, body: Map()); } - Future getProcedureCategory({String categoryName, String categoryID,patientId}) async { + Future getProcedureCategory({String? categoryName, String? categoryID, patientId}) async { _getProcedureCategoriseReqModel = GetProcedureReqModel( search: ["$categoryName"], patientMRN: patientId, @@ -156,10 +142,8 @@ class ProcedureService extends BaseService { ); hasError = false; _categoriesList.clear(); - await baseAppClient.post(GET_CATEGORISE_PROCEDURE, - onSuccess: (dynamic response, int statusCode) { - _categoriesList - .add(CategoriseProcedureModel.fromJson(response['ProcedureList'])); + await baseAppClient.post(GET_CATEGORISE_PROCEDURE, onSuccess: (dynamic response, int statusCode) { + _categoriesList.add(CategoriseProcedureModel.fromJson(response['ProcedureList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -169,8 +153,7 @@ class ProcedureService extends BaseService { Future postProcedure(PostProcedureReqModel postProcedureReqModel) async { hasError = false; _procedureList.clear(); - await baseAppClient.post(POST_PROCEDURE_LIST, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -178,12 +161,10 @@ class ProcedureService extends BaseService { }, body: postProcedureReqModel.toJson()); } - Future updateProcedure( - UpdateProcedureRequestModel updateProcedureRequestModel) async { + Future updateProcedure(UpdateProcedureRequestModel updateProcedureRequestModel) async { hasError = false; _procedureList.clear(); - await baseAppClient.post(UPDATE_PROCEDURE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(UPDATE_PROCEDURE, onSuccess: (dynamic response, int statusCode) { print("ACCEPTED"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -191,14 +172,11 @@ class ProcedureService extends BaseService { }, body: updateProcedureRequestModel.toJson()); } - Future valadteProcedure( - ProcedureValadteRequestModel procedureValadteRequestModel) async { + Future valadteProcedure(ProcedureValadteRequestModel procedureValadteRequestModel) async { hasError = false; _valadteProcedureList.clear(); - await baseAppClient.post(GET_PROCEDURE_VALIDATION, - onSuccess: (dynamic response, int statusCode) { - _valadteProcedureList.add( - ProcedureValadteModel.fromJson(response['ValidateProcedureList'])); + await baseAppClient.post(GET_PROCEDURE_VALIDATION, onSuccess: (dynamic response, int statusCode) { + _valadteProcedureList.add(ProcedureValadteModel.fromJson(response['ValidateProcedureList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index 7cf17753..771ee179 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -6,21 +6,17 @@ import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; class RadiologyService extends BaseService { - List finalRadiologyList = List(); + List finalRadiologyList = []; String url = ''; - Future getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + Future getRadImageURL({int? invoiceNo, int? lineItem, int? projectId, @required PatiantInformtion? patient}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; - await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, + await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient!, onSuccess: (dynamic response, int statusCode) { url = response['Data']; }, onFailure: (String error, int statusCode) { @@ -29,8 +25,7 @@ class RadiologyService extends BaseService { }, body: body); } - Future getPatientRadOrders(PatiantInformtion patient, - {isInPatient = false}) async { + Future getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { String url = GET_PATIENT_ORDERS; final Map body = new Map(); if (isInPatient) { @@ -39,8 +34,7 @@ class RadiologyService extends BaseService { } hasError = false; - await baseAppClient.postPatient(url, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { finalRadiologyList = []; String label = "ListRAD"; if (isInPatient) { diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index 8113c9a7..63b5d82a 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -16,13 +16,12 @@ class SickLeaveService extends BaseService { List get getReasons => reasonse; List reasonse = []; List get getAllSickLeave => _getAllsickLeave; - List _getAllsickLeave = List(); + List _getAllsickLeave = []; List get coveringDoctorsList => _coveringDoctors; List _coveringDoctors = []; - List get getAllRescheduleLeave => - _getReScheduleLeave; + List get getAllRescheduleLeave => _getReScheduleLeave; List _getReScheduleLeave = []; dynamic get postReschedule => _postReschedule; dynamic _postReschedule; @@ -30,10 +29,9 @@ class SickLeaveService extends BaseService { dynamic get sickLeaveResponse => _sickLeaveResponse; dynamic _sickLeaveResponse; - List getAllSickLeavePatient = List(); + List getAllSickLeavePatient = []; - SickLeavePatientRequestModel _sickLeavePatientRequestModel = - SickLeavePatientRequestModel(); + SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel(); Future getStatistics(appoNo, patientMRN) async { hasError = false; @@ -73,8 +71,7 @@ class SickLeaveService extends BaseService { Future extendSickLeave(GetAllSickLeaveResponse request) async { var extendSickLeaveRequest = ExtendSickLeaveRequest(); - extendSickLeaveRequest.patientMRN = - request.patientMRN.toString(); //'3120746'; + extendSickLeaveRequest.patientMRN = request.patientMRN.toString(); //'3120746'; extendSickLeaveRequest.previousRequestNo = request.requestNo.toString(); extendSickLeaveRequest.noOfDays = request.noOfDays.toString(); extendSickLeaveRequest.remarks = request.remarks; @@ -114,8 +111,8 @@ class SickLeaveService extends BaseService { } Future getSickLeavePatient(patientMRN) async { - _sickLeavePatientRequestModel = SickLeavePatientRequestModel( - patientID: patientMRN, patientTypeID: 2, patientType: 1); + _sickLeavePatientRequestModel = + SickLeavePatientRequestModel(patientID: patientMRN, patientTypeID: 2, patientType: 1); hasError = false; getAllSickLeavePatient = []; getAllSickLeavePatient.clear(); diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index b2e0d603..588dd904 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -32,7 +32,7 @@ class SOAPService extends LookupService { List patientProgressNoteList = []; List patientAssessmentList = []; - int episodeID; + int? episodeID; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, @@ -53,8 +53,7 @@ class SOAPService extends LookupService { Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async { hasError = false; - await baseAppClient.post(POST_EPISODE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_EPISODE, onSuccess: (dynamic response, int statusCode) { print("Success"); episodeID = response['EpisodeID']; }, onFailure: (String error, int statusCode) { @@ -66,8 +65,7 @@ class SOAPService extends LookupService { Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { hasError = false; - await baseAppClient.post(POST_ALLERGY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_ALLERGY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -75,11 +73,9 @@ class SOAPService extends LookupService { }, body: postAllergyRequestModel.toJson()); } - Future postHistories( - PostHistoriesRequestModel postHistoriesRequestModel) async { + Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async { hasError = false; - await baseAppClient.post(POST_HISTORY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_HISTORY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -87,11 +83,9 @@ class SOAPService extends LookupService { }, body: postHistoriesRequestModel.toJson()); } - Future postChiefComplaint( - PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { + Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { hasError = false; - await baseAppClient.post(POST_CHIEF_COMPLAINT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -99,11 +93,9 @@ class SOAPService extends LookupService { }, body: postChiefComplaintRequestModel.toJson()); } - Future postPhysicalExam( - PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { + Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { hasError = false; - await baseAppClient.post(POST_PHYSICAL_EXAM, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -111,11 +103,9 @@ class SOAPService extends LookupService { }, body: postPhysicalExamRequestModel.toJson()); } - Future postProgressNote( - PostProgressNoteRequestModel postProgressNoteRequestModel) async { + Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async { hasError = false; - await baseAppClient.post(POST_PROGRESS_NOTE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -123,11 +113,9 @@ class SOAPService extends LookupService { }, body: postProgressNoteRequestModel.toJson()); } - Future postAssessment( - PostAssessmentRequestModel postAssessmentRequestModel) async { + Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async { hasError = false; - await baseAppClient.post(POST_ASSESSMENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -138,8 +126,7 @@ class SOAPService extends LookupService { Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_ALLERGY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_ALLERGY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -147,11 +134,9 @@ class SOAPService extends LookupService { }, body: patchAllergyRequestModel.toJson()); } - Future patchHistories( - PostHistoriesRequestModel patchHistoriesRequestModel) async { + Future patchHistories(PostHistoriesRequestModel patchHistoriesRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_HISTORY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_HISTORY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -159,11 +144,9 @@ class SOAPService extends LookupService { }, body: patchHistoriesRequestModel.toJson()); } - Future patchChiefComplaint( - PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { + Future patchChiefComplaint(PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_CHIEF_COMPLAINT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -171,11 +154,9 @@ class SOAPService extends LookupService { }, body: patchChiefComplaintRequestModel.toJson()); } - Future patchPhysicalExam( - PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { + Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_PHYSICAL_EXAM, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -183,11 +164,9 @@ class SOAPService extends LookupService { }, body: patchPhysicalExamRequestModel.toJson()); } - Future patchProgressNote( - PostProgressNoteRequestModel patchProgressNoteRequestModel) async { + Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_PROGRESS_NOTE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -195,11 +174,9 @@ class SOAPService extends LookupService { }, body: patchProgressNoteRequestModel.toJson()); } - Future patchAssessment( - PatchAssessmentReqModel patchAssessmentRequestModel) async { + Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_ASSESSMENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -210,8 +187,7 @@ class SOAPService extends LookupService { Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { hasError = false; - await baseAppClient.post(GET_ALLERGY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ALLERGY, onSuccess: (dynamic response, int statusCode) { print("Success"); patientAllergiesList.clear(); @@ -224,11 +200,9 @@ class SOAPService extends LookupService { }, body: generalGetReqForSOAP.toJson()); } - Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, - {bool isFirst = false}) async { + Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { hasError = false; - await baseAppClient.post(GET_HISTORY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_HISTORY, onSuccess: (dynamic response, int statusCode) { print("Success"); if (isFirst) patientHistoryList.clear(); response['List_History']['entityList'].forEach((v) { @@ -240,11 +214,9 @@ class SOAPService extends LookupService { }, body: getHistoryReqModel.toJson()); } - Future getPatientChiefComplaint( - GetChiefComplaintReqModel getChiefComplaintReqModel) async { + Future getPatientChiefComplaint(GetChiefComplaintReqModel getChiefComplaintReqModel) async { hasError = false; - await baseAppClient.post(GET_CHIEF_COMPLAINT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); patientChiefComplaintList.clear(); response['List_ChiefComplaint']['entityList'].forEach((v) { @@ -256,11 +228,9 @@ class SOAPService extends LookupService { }, body: getChiefComplaintReqModel.toJson()); } - Future getPatientPhysicalExam( - GetPhysicalExamReqModel getPhysicalExamReqModel) async { + Future getPatientPhysicalExam(GetPhysicalExamReqModel getPhysicalExamReqModel) async { hasError = false; - await baseAppClient.post(GET_PHYSICAL_EXAM, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { patientPhysicalExamList.clear(); response['PhysicalExamList']['entityList'].forEach((v) { patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v)); @@ -271,11 +241,9 @@ class SOAPService extends LookupService { }, body: getPhysicalExamReqModel.toJson()); } - Future getPatientProgressNote( - GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { + Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { hasError = false; - await baseAppClient.post(GET_PROGRESS_NOTE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { print("Success"); patientProgressNoteList.clear(); response['ProgressNoteList']['entityList'].forEach((v) { @@ -287,11 +255,9 @@ class SOAPService extends LookupService { }, body: getGetProgressNoteReqModel.toJson()); } - Future getPatientAssessment( - GetAssessmentReqModel getAssessmentReqModel) async { + Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async { hasError = false; - await baseAppClient.post(GET_ASSESSMENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { print("Success"); patientAssessmentList.clear(); response['AssessmentList']['entityList'].forEach((v) { diff --git a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index 22f53226..84162053 100644 --- a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -12,18 +12,17 @@ class UcafService extends LookupService { List patientVitalSignsHistory = []; List patientAssessmentList = []; List orderProcedureList = []; - PrescriptionModel prescriptionList; + PrescriptionModel? prescriptionList; Future getPatientChiefComplaint(PatiantInformtion patient) async { hasError = false; Map body = Map(); - body['PatientMRN'] = patient.patientMRN ; + body['PatientMRN'] = patient.patientMRN; body['AppointmentNo'] = patient.appointmentNo; - body['EpisodeID'] = patient.episodeNo ; + body['EpisodeID'] = patient.episodeNo; body['DoctorID'] = ""; - await baseAppClient.post(GET_CHIEF_COMPLAINT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); patientChiefComplaintList.clear(); response['List_ChiefComplaint']['entityList'].forEach((v) { @@ -35,8 +34,7 @@ class UcafService extends LookupService { }, body: body); } - Future getInPatientVitalSignHistory( - PatiantInformtion patient, bool isInPatient) async { + Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; @@ -65,8 +63,7 @@ class UcafService extends LookupService { ); } - Future getPatientVitalSignsHistory( - PatiantInformtion patient, String fromDate, String toDate) async { + Future getPatientVitalSignsHistory(PatiantInformtion patient, String fromDate, String toDate) async { hasError = false; Map body = Map(); body['PatientMRN'] = patient.patientId; // patient.patientMRN @@ -104,8 +101,7 @@ class UcafService extends LookupService { body['AppointmentNo'] = patient.appointmentNo; body['EpisodeID'] = patient.episodeNo; - await baseAppClient.post(GET_ASSESSMENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { print("Success"); patientAssessmentList.clear(); response['AssessmentList']['entityList'].forEach((v) { @@ -127,10 +123,8 @@ class UcafService extends LookupService { hasError = false; prescriptionList = null; - await baseAppClient.post(GET_PRESCRIPTION_LIST, - onSuccess: (dynamic response, int statusCode) { - prescriptionList = - PrescriptionModel.fromJson(response['PrescriptionList']); + await baseAppClient.post(GET_PRESCRIPTION_LIST, onSuccess: (dynamic response, int statusCode) { + prescriptionList = PrescriptionModel.fromJson(response['PrescriptionList']); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -144,8 +138,7 @@ class UcafService extends LookupService { body['AppointmentNo'] = patient.appointmentNo; body['EpisodeID'] = patient.episodeNo; - await baseAppClient.post(GET_ORDER_PROCEDURE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ORDER_PROCEDURE, onSuccess: (dynamic response, int statusCode) { print("Success"); orderProcedureList.clear(); response['OrderedProcedureList']['entityList'].forEach((v) { @@ -163,8 +156,7 @@ class UcafService extends LookupService { body['PatientMRN'] = patient.patientMRN; body['AppointmentNo'] = patient.appointmentNo; - await baseAppClient.post(POST_UCAF, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_UCAF, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart index 1c07aa48..a6bf9649 100644 --- a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart +++ b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; class VitalSignsService extends BaseService { - VitalSignData patientVitalSigns; + VitalSignData? patientVitalSigns; List patientVitalSignsHistory = []; Future getPatientVitalSign(PatiantInformtion patient) async { @@ -21,8 +21,7 @@ class VitalSignsService extends BaseService { if (response['VitalSignsList'] != null) { if (response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0) { - patientVitalSigns = VitalSignData.fromJson( - response['VitalSignsList']['entityList'][0]); + patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList'][0]); } } }, @@ -34,8 +33,7 @@ class VitalSignsService extends BaseService { ); } - Future getPatientVitalSignsHistory( - PatiantInformtion patient, String fromDate, String toDate) async { + Future getPatientVitalSignsHistory(PatiantInformtion patient, String fromDate, String toDate) async { patientVitalSigns = null; hasError = false; Map body = Map(); @@ -54,14 +52,14 @@ class VitalSignsService extends BaseService { body['ProjectID'] = patient.projectId; } await baseAppClient.post( - GET_PATIENT_VITAL_SIGN, + GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); - if (response['List_DoctorPatientVitalSign'] != null) { - response['List_DoctorPatientVitalSign'].forEach((v) { - patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; @@ -84,22 +82,16 @@ class VitalSignsService extends BaseService { // body['InOutPatientType'] = 2; // } - - await baseAppClient.postPatient( - GET_PATIENT_VITAL_SIGN, - onSuccess: (dynamic response, int statusCode) { - patientVitalSignsHistory.clear(); - if (response['List_DoctorPatientVitalSign'] != null) { - response['List_DoctorPatientVitalSign'].forEach((v) { - patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - });} - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error.toString(); - }, - body: body, - patient: patient - ); + await baseAppClient.postPatient(GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { + patientVitalSignsHistory.clear(); + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, body: body, patient: patient); } } diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index a73be2e3..2c375a7a 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -11,7 +11,7 @@ /// fonts: /// - asset: fonts/DoctorApp.ttf /// -/// +/// /// * MFG Labs, Copyright (C) 2012 by Daniel Bruce /// Author: MFG Labs /// License: SIL (http://scripts.sil.org/OFL) @@ -23,8 +23,8 @@ import 'package:flutter/widgets.dart'; class DoctorApp { DoctorApp._(); - static const _kFontFam = 'DoctorApp'; - static const String _kFontPkg = null; + static const _kFontFam = 'DoctorApp'; + static const String? _kFontPkg = null; static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData male = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); @@ -192,6 +192,7 @@ class DoctorApp { static const IconData verify_finger = IconData(0xe8a4, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData verify_whtsapp = IconData(0xe8a5, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData verify_sms = IconData(0xe8a6, fontFamily: _kFontFam, fontPackage: _kFontPkg); + /// static const IconData 124 = IconData(0xe8a7, fontFamily: _kFontFam, fontPackage: _kFontPkg); ///static const IconData 123 = IconData(0xe8a8, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData obese_bmi_r_1 = IconData(0xe8a9, fontFamily: _kFontFam, fontPackage: _kFontPkg); diff --git a/lib/models/SOAP/Allergy_model.dart b/lib/models/SOAP/Allergy_model.dart index c3493832..3e0e9cbc 100644 --- a/lib/models/SOAP/Allergy_model.dart +++ b/lib/models/SOAP/Allergy_model.dart @@ -1,32 +1,32 @@ class AllergyModel { - int allergyDiseaseId; - String allergyDiseaseName; - int allergyDiseaseType; - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - int episodeID; - bool isChecked; - bool isUpdatedByNurse; - int severity; - String severityName; + int? allergyDiseaseId; + String? allergyDiseaseName; + int? allergyDiseaseType; + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + int? episodeID; + bool? isChecked; + bool? isUpdatedByNurse; + int? severity; + String? severityName; AllergyModel( {this.allergyDiseaseId, - this.allergyDiseaseName, - this.allergyDiseaseType, - this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.episodeID, - this.isChecked, - this.isUpdatedByNurse, - this.severity, - this.severityName}); + this.allergyDiseaseName, + this.allergyDiseaseType, + this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.episodeID, + this.isChecked, + this.isUpdatedByNurse, + this.severity, + this.severityName}); - AllergyModel.fromJson(Map json) { + AllergyModel.fromJson(Map json) { allergyDiseaseId = json['allergyDiseaseId']; allergyDiseaseName = json['allergyDiseaseName']; allergyDiseaseType = json['allergyDiseaseType']; @@ -41,8 +41,8 @@ class AllergyModel { severityName = json['severityName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['allergyDiseaseId'] = this.allergyDiseaseId; data['allergyDiseaseName'] = this.allergyDiseaseName; data['allergyDiseaseType'] = this.allergyDiseaseType; diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 80188dfe..878205fc 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -1,12 +1,11 @@ class GetChiefComplaintReqModel { - int patientMRN; - int appointmentNo; - int episodeId; - int episodeID; + int? patientMRN; + int? appointmentNo; + int? episodeId; + int? episodeID; dynamic doctorID; - GetChiefComplaintReqModel( - {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID}); + GetChiefComplaintReqModel({this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID}); GetChiefComplaintReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -14,8 +13,7 @@ class GetChiefComplaintReqModel { episodeId = json['EpisodeId']; episodeID = json['EpisodeID']; doctorID = json['DoctorID']; - -} + } Map toJson() { final Map data = new Map(); diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart index 85ada324..f8a48ed0 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart @@ -1,32 +1,32 @@ class GetChiefComplaintResModel { - int appointmentNo; - String ccdate; - String chiefComplaint; - String clinicDescription; - int clinicID; - String currentMedication; - int doctorID; - String doctorName; - int episodeId; - String hopi; - int patientMRN; - int status; + int? appointmentNo; + String? ccdate; + String? chiefComplaint; + String? clinicDescription; + int? clinicID; + String? currentMedication; + int? doctorID; + String? doctorName; + int? episodeId; + String? hopi; + int? patientMRN; + int? status; GetChiefComplaintResModel( {this.appointmentNo, - this.ccdate, - this.chiefComplaint, - this.clinicDescription, - this.clinicID, - this.currentMedication, - this.doctorID, - this.doctorName, - this.episodeId, - this.hopi, - this.patientMRN, - this.status}); + this.ccdate, + this.chiefComplaint, + this.clinicDescription, + this.clinicID, + this.currentMedication, + this.doctorID, + this.doctorName, + this.episodeId, + this.hopi, + this.patientMRN, + this.status}); - GetChiefComplaintResModel.fromJson(Map json) { + GetChiefComplaintResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; ccdate = json['ccdate']; chiefComplaint = json['chiefComplaint']; @@ -41,8 +41,8 @@ class GetChiefComplaintResModel { status = json['status']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['appointmentNo'] = this.appointmentNo; data['ccdate'] = this.ccdate; data['chiefComplaint'] = this.chiefComplaint; diff --git a/lib/models/SOAP/GeneralGetReqForSOAP.dart b/lib/models/SOAP/GeneralGetReqForSOAP.dart index 70e76313..65ba7d6b 100644 --- a/lib/models/SOAP/GeneralGetReqForSOAP.dart +++ b/lib/models/SOAP/GeneralGetReqForSOAP.dart @@ -1,7 +1,7 @@ class GeneralGetReqForSOAP { - int patientMRN; - int appointmentNo; - int episodeId; + int? patientMRN; + int? appointmentNo; + int? episodeId; dynamic editedBy; dynamic doctorID; diff --git a/lib/models/SOAP/GetAllergiesResModel.dart b/lib/models/SOAP/GetAllergiesResModel.dart index 1eeca63e..745b169a 100644 --- a/lib/models/SOAP/GetAllergiesResModel.dart +++ b/lib/models/SOAP/GetAllergiesResModel.dart @@ -1,31 +1,32 @@ class GetAllergiesResModel { - int allergyDiseaseId; - String allergyDiseaseName; - int allergyDiseaseType; - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - int episodeID; - bool isChecked; - bool isUpdatedByNurse; - int severity; - String severityName; - String remarks; + int? allergyDiseaseId; + String? allergyDiseaseName; + int? allergyDiseaseType; + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + int? episodeID; + bool? isChecked; + bool? isUpdatedByNurse; + int? severity; + String? severityName; + String? remarks; GetAllergiesResModel( {this.allergyDiseaseId, - this.allergyDiseaseName, - this.allergyDiseaseType, - this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.episodeID, - this.isChecked, - this.isUpdatedByNurse, - this.severity, - this.severityName, this.remarks=''}); + this.allergyDiseaseName, + this.allergyDiseaseType, + this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.episodeID, + this.isChecked, + this.isUpdatedByNurse, + this.severity, + this.severityName, + this.remarks = ''}); GetAllergiesResModel.fromJson(Map json) { allergyDiseaseId = json['allergyDiseaseId']; diff --git a/lib/models/SOAP/GetAssessmentReqModel.dart b/lib/models/SOAP/GetAssessmentReqModel.dart index 965382b5..fffe4f92 100644 --- a/lib/models/SOAP/GetAssessmentReqModel.dart +++ b/lib/models/SOAP/GetAssessmentReqModel.dart @@ -1,22 +1,22 @@ class GetAssessmentReqModel { - int patientMRN; - int appointmentNo; - String episodeID; - String from; - String to; - int clinicID; + int? patientMRN; + int? appointmentNo; + String? episodeID; + String? from; + String? to; + int? clinicID; dynamic doctorID; dynamic editedBy; GetAssessmentReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.from, - this.to, - this.clinicID, - this.editedBy, - this.doctorID}); + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.clinicID, + this.editedBy, + this.doctorID}); GetAssessmentReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/SOAP/GetAssessmentResModel.dart b/lib/models/SOAP/GetAssessmentResModel.dart index 4d1b1b68..fb92f994 100644 --- a/lib/models/SOAP/GetAssessmentResModel.dart +++ b/lib/models/SOAP/GetAssessmentResModel.dart @@ -1,36 +1,36 @@ class GetAssessmentResModel { - int appointmentNo; - String asciiDesc; - String clinicDescription; - int clinicID; - bool complexDiagnosis; - int conditionID; - int createdBy; - String createdOn; - int diagnosisTypeID; - int doctorID; - String doctorName; - int episodeId; - String icdCode10ID; - int patientMRN; - String remarks; + int? appointmentNo; + String? asciiDesc; + String? clinicDescription; + int? clinicID; + bool? complexDiagnosis; + int? conditionID; + int? createdBy; + String? createdOn; + int? diagnosisTypeID; + int? doctorID; + String? doctorName; + int? episodeId; + String? icdCode10ID; + int? patientMRN; + String? remarks; GetAssessmentResModel( {this.appointmentNo, - this.asciiDesc, - this.clinicDescription, - this.clinicID, - this.complexDiagnosis, - this.conditionID, - this.createdBy, - this.createdOn, - this.diagnosisTypeID, - this.doctorID, - this.doctorName, - this.episodeId, - this.icdCode10ID, - this.patientMRN, - this.remarks}); + this.asciiDesc, + this.clinicDescription, + this.clinicID, + this.complexDiagnosis, + this.conditionID, + this.createdBy, + this.createdOn, + this.diagnosisTypeID, + this.doctorID, + this.doctorName, + this.episodeId, + this.icdCode10ID, + this.patientMRN, + this.remarks}); GetAssessmentResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetGetProgressNoteReqModel.dart b/lib/models/SOAP/GetGetProgressNoteReqModel.dart index 1da4a8bf..0a36bb94 100644 --- a/lib/models/SOAP/GetGetProgressNoteReqModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteReqModel.dart @@ -1,22 +1,22 @@ class GetGetProgressNoteReqModel { - int patientMRN; - int appointmentNo; - String episodeID; - String from; - String to; - int clinicID; + int? patientMRN; + int? appointmentNo; + String? episodeID; + String? from; + String? to; + int? clinicID; dynamic doctorID; dynamic editedBy; GetGetProgressNoteReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.from, - this.to, - this.clinicID, - this.editedBy, - this.doctorID}); + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.clinicID, + this.editedBy, + this.doctorID}); GetGetProgressNoteReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -27,7 +27,6 @@ class GetGetProgressNoteReqModel { clinicID = json['ClinicID']; doctorID = json['DoctorID']; editedBy = json['EditedBy']; - } Map toJson() { diff --git a/lib/models/SOAP/GetGetProgressNoteResModel.dart b/lib/models/SOAP/GetGetProgressNoteResModel.dart index 4ae7ed8c..e5923ac8 100644 --- a/lib/models/SOAP/GetGetProgressNoteResModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteResModel.dart @@ -1,28 +1,28 @@ -class GetPatientProgressNoteResModel { - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - String dName; - String editedByName; - String editedOn; - int episodeId; - String mName; - int patientMRN; - String planNote; +class GetPatientProgressNoteResModel { + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + String? dName; + String? editedByName; + String? editedOn; + int? episodeId; + String? mName; + int? patientMRN; + String? planNote; GetPatientProgressNoteResModel( {this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.dName, - this.editedByName, - this.editedOn, - this.episodeId, - this.mName, - this.patientMRN, - this.planNote}); + this.createdBy, + this.createdByName, + this.createdOn, + this.dName, + this.editedByName, + this.editedOn, + this.episodeId, + this.mName, + this.patientMRN, + this.planNote}); GetPatientProgressNoteResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetHistoryReqModel.dart b/lib/models/SOAP/GetHistoryReqModel.dart index 720b6342..b4a5f404 100644 --- a/lib/models/SOAP/GetHistoryReqModel.dart +++ b/lib/models/SOAP/GetHistoryReqModel.dart @@ -1,11 +1,11 @@ class GetHistoryReqModel { - int patientMRN; - int historyType; - String episodeID; - String from; - String to; - int clinicID; - int appointmentNo; + int? patientMRN; + int? historyType; + String? episodeID; + String? from; + String? to; + int? clinicID; + int? appointmentNo; dynamic editedBy; dynamic doctorID; @@ -30,7 +30,6 @@ class GetHistoryReqModel { doctorID = json['DoctorID']; appointmentNo = json['AppointmentNo']; editedBy = json['EditedBy']; - } Map toJson() { diff --git a/lib/models/SOAP/GetHistoryResModel.dart b/lib/models/SOAP/GetHistoryResModel.dart index c4b4f129..9773aea8 100644 --- a/lib/models/SOAP/GetHistoryResModel.dart +++ b/lib/models/SOAP/GetHistoryResModel.dart @@ -1,20 +1,20 @@ class GetHistoryResModel { - int appointmentNo; - int episodeId; - int historyId; - int historyType; - bool isChecked; - int patientMRN; - String remarks; + int? appointmentNo; + int? episodeId; + int? historyId; + int? historyType; + bool? isChecked; + int? patientMRN; + String? remarks; GetHistoryResModel( {this.appointmentNo, - this.episodeId, - this.historyId, - this.historyType, - this.isChecked, - this.patientMRN, - this.remarks}); + this.episodeId, + this.historyId, + this.historyType, + this.isChecked, + this.patientMRN, + this.remarks}); GetHistoryResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetPhysicalExamListResModel.dart b/lib/models/SOAP/GetPhysicalExamListResModel.dart index c97189b1..952e3a5c 100644 --- a/lib/models/SOAP/GetPhysicalExamListResModel.dart +++ b/lib/models/SOAP/GetPhysicalExamListResModel.dart @@ -1,44 +1,44 @@ class GetPhysicalExamResModel { - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - Null editedBy; - String editedByName; - String editedOn; - int episodeId; - int examId; - String examName; - int examType; - int examinationType; - String examinationTypeName; - bool isAbnormal; - bool isNew; - bool isNormal; - bool notExamined; - int patientMRN; - String remarks; + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + dynamic editedBy; + String? editedByName; + String? editedOn; + int? episodeId; + int? examId; + String? examName; + int? examType; + int? examinationType; + String? examinationTypeName; + bool? isAbnormal; + bool? isNew; + bool? isNormal; + bool? notExamined; + int? patientMRN; + String? remarks; GetPhysicalExamResModel( {this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.editedBy, - this.editedByName, - this.editedOn, - this.episodeId, - this.examId, - this.examName, - this.examType, - this.examinationType, - this.examinationTypeName, - this.isAbnormal, - this.isNew, - this.isNormal, - this.notExamined, - this.patientMRN, - this.remarks}); + this.createdBy, + this.createdByName, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedOn, + this.episodeId, + this.examId, + this.examName, + this.examType, + this.examinationType, + this.examinationTypeName, + this.isAbnormal, + this.isNew, + this.isNormal, + this.notExamined, + this.patientMRN, + this.remarks}); GetPhysicalExamResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart index 5145c419..57d14a3f 100644 --- a/lib/models/SOAP/GetPhysicalExamReqModel.dart +++ b/lib/models/SOAP/GetPhysicalExamReqModel.dart @@ -1,9 +1,9 @@ class GetPhysicalExamReqModel { - int patientMRN; - int appointmentNo; - String episodeID; - String from; - String to; + int? patientMRN; + int? appointmentNo; + String? episodeID; + String? from; + String? to; dynamic editedBy; dynamic doctorID; diff --git a/lib/models/SOAP/PatchAssessmentReqModel.dart b/lib/models/SOAP/PatchAssessmentReqModel.dart index 8cbf5cb7..c52a6a51 100644 --- a/lib/models/SOAP/PatchAssessmentReqModel.dart +++ b/lib/models/SOAP/PatchAssessmentReqModel.dart @@ -1,24 +1,24 @@ class PatchAssessmentReqModel { - int patientMRN; - int appointmentNo; - int episodeID; - String icdcode10Id; - String prevIcdCode10ID; - int conditionId; - int diagnosisTypeId; - bool complexDiagnosis; - String remarks; + int? patientMRN; + int? appointmentNo; + int? episodeID; + String? icdcode10Id; + String? prevIcdCode10ID; + int? conditionId; + int? diagnosisTypeId; + bool? complexDiagnosis; + String? remarks; PatchAssessmentReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.icdcode10Id, - this.prevIcdCode10ID, - this.conditionId, - this.diagnosisTypeId, - this.complexDiagnosis, - this.remarks}); + this.appointmentNo, + this.episodeID, + this.icdcode10Id, + this.prevIcdCode10ID, + this.conditionId, + this.diagnosisTypeId, + this.complexDiagnosis, + this.remarks}); PatchAssessmentReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/SOAP/PostEpisodeReqModel.dart b/lib/models/SOAP/PostEpisodeReqModel.dart index 6d3ee45a..75402036 100644 --- a/lib/models/SOAP/PostEpisodeReqModel.dart +++ b/lib/models/SOAP/PostEpisodeReqModel.dart @@ -1,14 +1,10 @@ class PostEpisodeReqModel { - int appointmentNo; - int patientMRN; - int doctorID; - String vidaAuthTokenID; + int? appointmentNo; + int? patientMRN; + int? doctorID; + String? vidaAuthTokenID; - PostEpisodeReqModel( - {this.appointmentNo, - this.patientMRN, - this.doctorID, - this.vidaAuthTokenID}); + PostEpisodeReqModel({this.appointmentNo, this.patientMRN, this.doctorID, this.vidaAuthTokenID}); PostEpisodeReqModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; diff --git a/lib/models/SOAP/get_Allergies_request_model.dart b/lib/models/SOAP/get_Allergies_request_model.dart index 7676d530..25177e3e 100644 --- a/lib/models/SOAP/get_Allergies_request_model.dart +++ b/lib/models/SOAP/get_Allergies_request_model.dart @@ -1,16 +1,11 @@ class GetAllergiesRequestModel { - String vidaAuthTokenID; - int patientMRN; - int appointmentNo; - int episodeId; - String doctorID; + String? vidaAuthTokenID; + int? patientMRN; + int? appointmentNo; + int? episodeId; + String? doctorID; - GetAllergiesRequestModel( - {this.vidaAuthTokenID, - this.patientMRN, - this.appointmentNo, - this.episodeId, - this.doctorID}); + GetAllergiesRequestModel({this.vidaAuthTokenID, this.patientMRN, this.appointmentNo, this.episodeId, this.doctorID}); GetAllergiesRequestModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; diff --git a/lib/models/SOAP/master_key_model.dart b/lib/models/SOAP/master_key_model.dart index a1c32039..0f1a4c5a 100644 --- a/lib/models/SOAP/master_key_model.dart +++ b/lib/models/SOAP/master_key_model.dart @@ -1,6 +1,6 @@ class MasterKeyModel { - String alias; - String aliasN; + String? alias; + String? aliasN; dynamic code; dynamic description; dynamic detail1; @@ -8,31 +8,31 @@ class MasterKeyModel { dynamic detail3; dynamic detail4; dynamic detail5; - int groupID; - int id; - String nameAr; - String nameEn; + int? groupID; + int? id; + String? nameAr; + String? nameEn; dynamic remarks; - int typeId; - String valueList; + int? typeId; + String? valueList; MasterKeyModel( {this.alias, - this.aliasN, - this.code, - this.description, - this.detail1, - this.detail2, - this.detail3, - this.detail4, - this.detail5, - this.groupID, - this.id, - this.nameAr, - this.nameEn, - this.remarks, - this.typeId, - this.valueList}); + this.aliasN, + this.code, + this.description, + this.detail1, + this.detail2, + this.detail3, + this.detail4, + this.detail5, + this.groupID, + this.id, + this.nameAr, + this.nameEn, + this.remarks, + this.typeId, + this.valueList}); MasterKeyModel.fromJson(Map json) { alias = json['alias']; diff --git a/lib/models/SOAP/my_selected_allergy.dart b/lib/models/SOAP/my_selected_allergy.dart index c4e52af7..0347a5ba 100644 --- a/lib/models/SOAP/my_selected_allergy.dart +++ b/lib/models/SOAP/my_selected_allergy.dart @@ -1,28 +1,25 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedAllergy { - MasterKeyModel selectedAllergySeverity; - MasterKeyModel selectedAllergy; - String remark; - bool isChecked; - bool isExpanded; - int createdBy; + MasterKeyModel? selectedAllergySeverity; + MasterKeyModel? selectedAllergy; + String? remark; + bool? isChecked; + bool? isExpanded; + int? createdBy; MySelectedAllergy( {this.selectedAllergySeverity, this.selectedAllergy, this.remark, this.isChecked, - this.isExpanded = true, + this.isExpanded = true, this.createdBy}); MySelectedAllergy.fromJson(Map json) { - selectedAllergySeverity = json['selectedAllergySeverity'] != null - ? new MasterKeyModel.fromJson(json['selectedAllergySeverity']) - : null; - selectedAllergy = json['selectedAllergy'] != null - ? new MasterKeyModel.fromJson(json['selectedAllergy']) - : null; + selectedAllergySeverity = + json['selectedAllergySeverity'] != null ? new MasterKeyModel.fromJson(json['selectedAllergySeverity']) : null; + selectedAllergy = json['selectedAllergy'] != null ? new MasterKeyModel.fromJson(json['selectedAllergy']) : null; remark = json['remark']; isChecked = json['isChecked']; isExpanded = json['isExpanded']; @@ -32,10 +29,10 @@ class MySelectedAllergy { Map toJson() { final Map data = new Map(); if (this.selectedAllergySeverity != null) { - data['selectedAllergySeverity'] = this.selectedAllergySeverity.toJson(); + data['selectedAllergySeverity'] = this.selectedAllergySeverity!.toJson(); } if (this.selectedAllergy != null) { - data['selectedAllergy'] = this.selectedAllergy.toJson(); + data['selectedAllergy'] = this.selectedAllergy!.toJson(); } data['remark'] = this.remark; data['isChecked'] = this.isChecked; diff --git a/lib/models/SOAP/my_selected_assement.dart b/lib/models/SOAP/my_selected_assement.dart index 4d4afc2d..f683f8b7 100644 --- a/lib/models/SOAP/my_selected_assement.dart +++ b/lib/models/SOAP/my_selected_assement.dart @@ -1,37 +1,36 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedAssessment { - MasterKeyModel selectedICD; - MasterKeyModel selectedDiagnosisCondition; - MasterKeyModel selectedDiagnosisType; - String remark; - int appointmentId; - int createdBy; - String createdOn; - int doctorID; - String doctorName; - String icdCode10ID; + MasterKeyModel? selectedICD; + MasterKeyModel? selectedDiagnosisCondition; + MasterKeyModel? selectedDiagnosisType; + String? remark; + int? appointmentId; + int? createdBy; + String? createdOn; + int? doctorID; + String? doctorName; + String? icdCode10ID; MySelectedAssessment( {this.selectedICD, this.selectedDiagnosisCondition, this.selectedDiagnosisType, - this.remark, this.appointmentId, this.createdBy, - this.createdOn, - this.doctorID, - this.doctorName, - this.icdCode10ID}); + this.remark, + this.appointmentId, + this.createdBy, + this.createdOn, + this.doctorID, + this.doctorName, + this.icdCode10ID}); MySelectedAssessment.fromJson(Map json) { - selectedICD = json['selectedICD'] != null - ? new MasterKeyModel.fromJson(json['selectedICD']) - : null; + selectedICD = json['selectedICD'] != null ? new MasterKeyModel.fromJson(json['selectedICD']) : null; selectedDiagnosisCondition = json['selectedDiagnosisCondition'] != null ? new MasterKeyModel.fromJson(json['selectedDiagnosisCondition']) : null; - selectedDiagnosisType = json['selectedDiagnosisType'] != null - ? new MasterKeyModel.fromJson(json['selectedDiagnosisType']) - : null; + selectedDiagnosisType = + json['selectedDiagnosisType'] != null ? new MasterKeyModel.fromJson(json['selectedDiagnosisType']) : null; remark = json['remark']; appointmentId = json['appointmentId']; createdBy = json['createdBy']; @@ -45,13 +44,13 @@ class MySelectedAssessment { final Map data = new Map(); if (this.selectedICD != null) { - data['selectedICD'] = this.selectedICD.toJson(); + data['selectedICD'] = this.selectedICD!.toJson(); } if (this.selectedDiagnosisCondition != null) { - data['selectedICD'] = this.selectedDiagnosisCondition.toJson(); + data['selectedICD'] = this.selectedDiagnosisCondition!.toJson(); } if (this.selectedDiagnosisType != null) { - data['selectedICD'] = this.selectedDiagnosisType.toJson(); + data['selectedICD'] = this.selectedDiagnosisType!.toJson(); } data['remark'] = this.remark; data['appointmentId'] = this.appointmentId; diff --git a/lib/models/SOAP/my_selected_examination.dart b/lib/models/SOAP/my_selected_examination.dart index 393af944..fc147415 100644 --- a/lib/models/SOAP/my_selected_examination.dart +++ b/lib/models/SOAP/my_selected_examination.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedExamination { - MasterKeyModel selectedExamination; - String remark; - bool isNormal; - bool isAbnormal; - bool notExamined; - bool isNew; - int createdBy; + MasterKeyModel? selectedExamination; + String? remark; + bool? isNormal; + bool? isAbnormal; + bool? notExamined; + bool? isNew; + int? createdBy; MySelectedExamination( {this.selectedExamination, @@ -19,9 +19,8 @@ class MySelectedExamination { this.createdBy}); MySelectedExamination.fromJson(Map json) { - selectedExamination = json['selectedExamination'] != null - ? new MasterKeyModel.fromJson(json['selectedExamination']) - : null; + selectedExamination = + json['selectedExamination'] != null ? new MasterKeyModel.fromJson(json['selectedExamination']) : null; remark = json['remark']; isNormal = json['isNormal']; isAbnormal = json['isAbnormal']; @@ -34,7 +33,7 @@ class MySelectedExamination { final Map data = new Map(); if (this.selectedExamination != null) { - data['selectedExamination'] = this.selectedExamination.toJson(); + data['selectedExamination'] = this.selectedExamination!.toJson(); } data['remark'] = this.remark; data['isNormal'] = this.isNormal; diff --git a/lib/models/SOAP/my_selected_history.dart b/lib/models/SOAP/my_selected_history.dart index 11e366c2..59ae412a 100644 --- a/lib/models/SOAP/my_selected_history.dart +++ b/lib/models/SOAP/my_selected_history.dart @@ -1,18 +1,14 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedHistory { - MasterKeyModel selectedHistory; - String remark; - bool isChecked; + MasterKeyModel? selectedHistory; + String? remark; + bool? isChecked; - MySelectedHistory( - { this.selectedHistory, this.remark, this.isChecked}); + MySelectedHistory({this.selectedHistory, this.remark, this.isChecked}); MySelectedHistory.fromJson(Map json) { - - selectedHistory = json['selectedHistory'] != null - ? new MasterKeyModel.fromJson(json['selectedHistory']) - : null; + selectedHistory = json['selectedHistory'] != null ? new MasterKeyModel.fromJson(json['selectedHistory']) : null; remark = json['remark']; remark = json['isChecked']; } @@ -21,7 +17,7 @@ class MySelectedHistory { final Map data = new Map(); if (this.selectedHistory != null) { - data['selectedHistory'] = this.selectedHistory.toJson(); + data['selectedHistory'] = this.selectedHistory!.toJson(); } data['remark'] = this.remark; data['isChecked'] = this.remark; diff --git a/lib/models/SOAP/order-procedure.dart b/lib/models/SOAP/order-procedure.dart index 4e134a07..24865e44 100644 --- a/lib/models/SOAP/order-procedure.dart +++ b/lib/models/SOAP/order-procedure.dart @@ -1,55 +1,54 @@ class OrderProcedure { - - String achiCode; - String appointmentDate; - int appointmentNo; - int categoryID; - String clinicDescription; - String cptCode; - int createdBy; - String createdOn; - String doctorName; - bool isApprovalCreated; - bool isApprovalRequired; - bool isCovered; - bool isInvoiced; - bool isReferralInvoiced; - bool isUncoveredByDoctor; - int lineItemNo; - String orderDate; - int orderNo; - int orderType; - String procedureId; - String procedureName; - String remarks; - String status; - String template; + String? achiCode; + String? appointmentDate; + int? appointmentNo; + int? categoryID; + String? clinicDescription; + String? cptCode; + int? createdBy; + String? createdOn; + String? doctorName; + bool? isApprovalCreated; + bool? isApprovalRequired; + bool? isCovered; + bool? isInvoiced; + bool? isReferralInvoiced; + bool? isUncoveredByDoctor; + int? lineItemNo; + String? orderDate; + int? orderNo; + int? orderType; + String? procedureId; + String? procedureName; + String? remarks; + String? status; + String? template; OrderProcedure( {this.achiCode, - this.appointmentDate, - this.appointmentNo, - this.categoryID, - this.clinicDescription, - this.cptCode, - this.createdBy, - this.createdOn, - this.doctorName, - this.isApprovalCreated, - this.isApprovalRequired, - this.isCovered, - this.isInvoiced, - this.isReferralInvoiced, - this.isUncoveredByDoctor, - this.lineItemNo, - this.orderDate, - this.orderNo, - this.orderType, - this.procedureId, - this.procedureName, - this.remarks, - this.status, - this.template}); + this.appointmentDate, + this.appointmentNo, + this.categoryID, + this.clinicDescription, + this.cptCode, + this.createdBy, + this.createdOn, + this.doctorName, + this.isApprovalCreated, + this.isApprovalRequired, + this.isCovered, + this.isInvoiced, + this.isReferralInvoiced, + this.isUncoveredByDoctor, + this.lineItemNo, + this.orderDate, + this.orderNo, + this.orderType, + this.procedureId, + this.procedureName, + this.remarks, + this.status, + this.template}); OrderProcedure.fromJson(Map json) { achiCode = json['achiCode']; @@ -106,5 +105,4 @@ class OrderProcedure { data['template'] = this.template; return data; } - -} \ No newline at end of file +} diff --git a/lib/models/SOAP/post_allergy_request_model.dart b/lib/models/SOAP/post_allergy_request_model.dart index 6783d885..9488a965 100644 --- a/lib/models/SOAP/post_allergy_request_model.dart +++ b/lib/models/SOAP/post_allergy_request_model.dart @@ -1,16 +1,13 @@ class PostAllergyRequestModel { - List - listHisProgNotePatientAllergyDiseaseVM; + List? listHisProgNotePatientAllergyDiseaseVM; PostAllergyRequestModel({this.listHisProgNotePatientAllergyDiseaseVM}); PostAllergyRequestModel.fromJson(Map json) { if (json['listHisProgNotePatientAllergyDiseaseVM'] != null) { - listHisProgNotePatientAllergyDiseaseVM = - new List(); + listHisProgNotePatientAllergyDiseaseVM = []; json['listHisProgNotePatientAllergyDiseaseVM'].forEach((v) { - listHisProgNotePatientAllergyDiseaseVM - .add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v)); + listHisProgNotePatientAllergyDiseaseVM!.add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v)); }); } } @@ -18,44 +15,42 @@ class PostAllergyRequestModel { Map toJson() { final Map data = new Map(); if (this.listHisProgNotePatientAllergyDiseaseVM != null) { - data['listHisProgNotePatientAllergyDiseaseVM'] = this - .listHisProgNotePatientAllergyDiseaseVM - .map((v) => v.toJson()) - .toList(); + data['listHisProgNotePatientAllergyDiseaseVM'] = + this.listHisProgNotePatientAllergyDiseaseVM!.map((v) => v.toJson()).toList(); } return data; } } class ListHisProgNotePatientAllergyDiseaseVM { - int patientMRN; - int allergyDiseaseType; - int allergyDiseaseId; - int episodeId; - int appointmentNo; - int severity; - bool isChecked; - bool isUpdatedByNurse; - String remarks; - int createdBy; - String createdOn; - int editedBy; - String editedOn; + int? patientMRN; + int? allergyDiseaseType; + int? allergyDiseaseId; + int? episodeId; + int? appointmentNo; + int? severity; + bool? isChecked; + bool? isUpdatedByNurse; + String? remarks; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; ListHisProgNotePatientAllergyDiseaseVM( {this.patientMRN, - this.allergyDiseaseType, - this.allergyDiseaseId, - this.episodeId, - this.appointmentNo, - this.severity, - this.isChecked, - this.isUpdatedByNurse, - this.remarks, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn}); + this.allergyDiseaseType, + this.allergyDiseaseId, + this.episodeId, + this.appointmentNo, + this.severity, + this.isChecked, + this.isUpdatedByNurse, + this.remarks, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn}); ListHisProgNotePatientAllergyDiseaseVM.fromJson(Map json) { patientMRN = json['patientMRN']; diff --git a/lib/models/SOAP/post_assessment_request_model.dart b/lib/models/SOAP/post_assessment_request_model.dart index af577671..3222f248 100644 --- a/lib/models/SOAP/post_assessment_request_model.dart +++ b/lib/models/SOAP/post_assessment_request_model.dart @@ -1,23 +1,19 @@ class PostAssessmentRequestModel { - int patientMRN; - int appointmentNo; - int episodeId; - List icdCodeDetails; + int? patientMRN; + int? appointmentNo; + int? episodeId; + List? icdCodeDetails; - PostAssessmentRequestModel( - {this.patientMRN, - this.appointmentNo, - this.episodeId, - this.icdCodeDetails}); + PostAssessmentRequestModel({this.patientMRN, this.appointmentNo, this.episodeId, this.icdCodeDetails}); PostAssessmentRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeID']; if (json['icdCodeDetails'] != null) { - icdCodeDetails = new List(); + icdCodeDetails = []; json['icdCodeDetails'].forEach((v) { - icdCodeDetails.add(new IcdCodeDetails.fromJson(v)); + icdCodeDetails!.add(new IcdCodeDetails.fromJson(v)); }); } } @@ -28,26 +24,20 @@ class PostAssessmentRequestModel { data['AppointmentNo'] = this.appointmentNo; data['EpisodeID'] = this.episodeId; if (this.icdCodeDetails != null) { - data['icdCodeDetails'] = - this.icdCodeDetails.map((v) => v.toJson()).toList(); + data['icdCodeDetails'] = this.icdCodeDetails!.map((v) => v.toJson()).toList(); } return data; } } class IcdCodeDetails { - String icdcode10Id; - int conditionId; - int diagnosisTypeId; - bool complexDiagnosis; - String remarks; + String? icdcode10Id; + int? conditionId; + int? diagnosisTypeId; + bool? complexDiagnosis; + String? remarks; - IcdCodeDetails( - {this.icdcode10Id, - this.conditionId, - this.diagnosisTypeId, - this.complexDiagnosis, - this.remarks}); + IcdCodeDetails({this.icdcode10Id, this.conditionId, this.diagnosisTypeId, this.complexDiagnosis, this.remarks}); IcdCodeDetails.fromJson(Map json) { icdcode10Id = json['icdcode10Id']; diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index f1e9c2b4..fa4c1684 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -1,17 +1,16 @@ class PostChiefComplaintRequestModel { - int appointmentNo; - int episodeID; - int patientMRN; - String chiefComplaint; - String hopi; - String currentMedication; - bool ispregnant; - bool isLactation; - int numberOfWeeks; + int? appointmentNo; + int? episodeID; + int? patientMRN; + String? chiefComplaint; + String? hopi; + String? currentMedication; + bool? ispregnant; + bool? isLactation; + int? numberOfWeeks; dynamic doctorID; dynamic editedBy; - PostChiefComplaintRequestModel( {this.appointmentNo, this.episodeID, diff --git a/lib/models/SOAP/post_histories_request_model.dart b/lib/models/SOAP/post_histories_request_model.dart index d8be3fb2..89b6586d 100644 --- a/lib/models/SOAP/post_histories_request_model.dart +++ b/lib/models/SOAP/post_histories_request_model.dart @@ -1,14 +1,14 @@ class PostHistoriesRequestModel { - List listMedicalHistoryVM; + List? listMedicalHistoryVM; dynamic doctorID; PostHistoriesRequestModel({this.listMedicalHistoryVM, this.doctorID}); PostHistoriesRequestModel.fromJson(Map json) { if (json['listMedicalHistoryVM'] != null) { - listMedicalHistoryVM = new List(); + listMedicalHistoryVM = []; json['listMedicalHistoryVM'].forEach((v) { - listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v)); + listMedicalHistoryVM!.add(new ListMedicalHistoryVM.fromJson(v)); }); } doctorID = json['DoctorID']; @@ -17,8 +17,7 @@ class PostHistoriesRequestModel { Map toJson() { final Map data = new Map(); if (this.listMedicalHistoryVM != null) { - data['listMedicalHistoryVM'] = - this.listMedicalHistoryVM.map((v) => v.toJson()).toList(); + data['listMedicalHistoryVM'] = this.listMedicalHistoryVM!.map((v) => v.toJson()).toList(); } data['DoctorID'] = this.doctorID; return data; @@ -26,22 +25,22 @@ class PostHistoriesRequestModel { } class ListMedicalHistoryVM { - int patientMRN; - int historyType; - int historyId; - int episodeId; - int appointmentNo; - bool isChecked; - String remarks; + int? patientMRN; + int? historyType; + int? historyId; + int? episodeId; + int? appointmentNo; + bool? isChecked; + String? remarks; ListMedicalHistoryVM( {this.patientMRN, - this.historyType, - this.historyId, - this.episodeId, - this.appointmentNo, - this.isChecked, - this.remarks}); + this.historyType, + this.historyId, + this.episodeId, + this.appointmentNo, + this.isChecked, + this.remarks}); ListMedicalHistoryVM.fromJson(Map json) { patientMRN = json['patientMRN']; diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index 52836232..d1b44e04 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -1,15 +1,13 @@ - class PostPhysicalExamRequestModel { - List listHisProgNotePhysicalExaminationVM; + List? listHisProgNotePhysicalExaminationVM; PostPhysicalExamRequestModel({this.listHisProgNotePhysicalExaminationVM}); PostPhysicalExamRequestModel.fromJson(Map json) { if (json['listHisProgNotePhysicalExaminationVM'] != null) { - listHisProgNotePhysicalExaminationVM = new List(); + listHisProgNotePhysicalExaminationVM = []; json['listHisProgNotePhysicalExaminationVM'].forEach((v) { - listHisProgNotePhysicalExaminationVM - .add(new ListHisProgNotePhysicalExaminationVM.fromJson(v)); + listHisProgNotePhysicalExaminationVM!.add(new ListHisProgNotePhysicalExaminationVM.fromJson(v)); }); } } @@ -18,97 +16,97 @@ class PostPhysicalExamRequestModel { final Map data = new Map(); if (this.listHisProgNotePhysicalExaminationVM != null) { data['listHisProgNotePhysicalExaminationVM'] = - this.listHisProgNotePhysicalExaminationVM.map((v) => v.toJson()).toList(); + this.listHisProgNotePhysicalExaminationVM!.map((v) => v.toJson()).toList(); } return data; } } - class ListHisProgNotePhysicalExaminationVM { - int episodeId; - int appointmentNo; - int examType; - int examId; - int patientMRN; - bool isNormal; - bool isAbnormal; - bool notExamined; - String examName; - String examinationTypeName; - int examinationType; - String remarks; - bool isNew; - int createdBy; - String createdOn; - String createdByName; - int editedBy; - String editedOn; - String editedByName; +class ListHisProgNotePhysicalExaminationVM { + int? episodeId; + int? appointmentNo; + int? examType; + int? examId; + int? patientMRN; + bool? isNormal; + bool? isAbnormal; + bool? notExamined; + String? examName; + String? examinationTypeName; + int? examinationType; + String? remarks; + bool? isNew; + int? createdBy; + String? createdOn; + String? createdByName; + int? editedBy; + String? editedOn; + String? editedByName; - ListHisProgNotePhysicalExaminationVM( - {this.episodeId, - this.appointmentNo, - this.examType, - this.examId, - this.patientMRN, - this.isNormal, - this.isAbnormal, - this.notExamined, - this.examName, - this.examinationTypeName, - this.examinationType, - this.remarks, - this.isNew, - this.createdBy, - this.createdOn, - this.createdByName, - this.editedBy, - this.editedOn, - this.editedByName}); + ListHisProgNotePhysicalExaminationVM( + {this.episodeId, + this.appointmentNo, + this.examType, + this.examId, + this.patientMRN, + this.isNormal, + this.isAbnormal, + this.notExamined, + this.examName, + this.examinationTypeName, + this.examinationType, + this.remarks, + this.isNew, + this.createdBy, + this.createdOn, + this.createdByName, + this.editedBy, + this.editedOn, + this.editedByName}); - ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { - episodeId = json['episodeId']; - appointmentNo = json['appointmentNo']; - examType = json['examType']; - examId = json['examId']; - patientMRN = json['patientMRN']; - isNormal = json['isNormal']; - isAbnormal = json['isAbnormal']; - notExamined = json['notExamined']; - examName = json['examName']; - examinationTypeName = json['examinationTypeName']; - examinationType = json['examinationType']; - remarks = json['remarks']; - isNew = json['isNew']; - createdBy = json['createdBy']; - createdOn = json['createdOn']; - createdByName = json['createdByName']; - editedBy = json['editedBy']; - editedOn = json['editedOn']; - editedByName = json['editedByName']; - } + ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { + episodeId = json['episodeId']; + appointmentNo = json['appointmentNo']; + examType = json['examType']; + examId = json['examId']; + patientMRN = json['patientMRN']; + isNormal = json['isNormal']; + isAbnormal = json['isAbnormal']; + notExamined = json['notExamined']; + examName = json['examName']; + examinationTypeName = json['examinationTypeName']; + examinationType = json['examinationType']; + remarks = json['remarks']; + isNew = json['isNew']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + createdByName = json['createdByName']; + editedBy = json['editedBy']; + editedOn = json['editedOn']; + editedByName = json['editedByName']; + } - Map toJson() { - final Map data = new Map(); - data['episodeId'] = this.episodeId; - data['appointmentNo'] = this.appointmentNo; - data['examType'] = this.examType; - data['examId'] = this.examId; - data['patientMRN'] = this.patientMRN; - data['isNormal'] = this.isNormal; - data['isAbnormal'] = this.isAbnormal; - data['notExamined'] = this.notExamined; - data['examName'] = this.examName; - data['examinationTypeName'] = this.examinationTypeName; - data['examinationType'] = this.examinationType; - data['remarks'] = this.remarks; - data['isNew'] = this.isNew; - data['createdBy'] = this.createdBy; - data['createdOn'] = this.createdOn; - data['createdByName'] = this.createdByName; - data['editedBy'] = this.editedBy; - data['editedOn'] = this.editedOn; - data['editedByName'] = this.editedByName; - return data; - } + Map toJson() { + final Map data = new Map(); + data['episodeId'] = this.episodeId; + data['appointmentNo'] = this.appointmentNo; + data['examType'] = this.examType; + data['examId'] = this.examId; + data['patientMRN'] = this.patientMRN; + data['isNormal'] = this.isNormal; + data['isAbnormal'] = this.isAbnormal; + data['notExamined'] = this.notExamined; + data['examName'] = this.examName; + data['examinationTypeName'] = this.examinationTypeName; + data['examinationType'] = this.examinationType; + data['remarks'] = this.remarks; + data['isNew'] = this.isNew; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['createdByName'] = this.createdByName; + data['editedBy'] = this.editedBy; + data['editedOn'] = this.editedOn; + data['editedByName'] = this.editedByName; + return data; } +} diff --git a/lib/models/SOAP/post_progress_note_request_model.dart b/lib/models/SOAP/post_progress_note_request_model.dart index 2925819d..da603bee 100644 --- a/lib/models/SOAP/post_progress_note_request_model.dart +++ b/lib/models/SOAP/post_progress_note_request_model.dart @@ -1,18 +1,13 @@ class PostProgressNoteRequestModel { - int appointmentNo; - int episodeId; - int patientMRN; - String planNote; + int? appointmentNo; + int? episodeId; + int? patientMRN; + String? planNote; dynamic doctorID; dynamic editedBy; PostProgressNoteRequestModel( - {this.appointmentNo, - this.episodeId, - this.patientMRN, - this.planNote, - this.doctorID, - this.editedBy}); + {this.appointmentNo, this.episodeId, this.patientMRN, this.planNote, this.doctorID, this.editedBy}); PostProgressNoteRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; diff --git a/lib/models/dashboard/dashboard_model.dart b/lib/models/dashboard/dashboard_model.dart index 0e03e899..5719b06b 100644 --- a/lib/models/dashboard/dashboard_model.dart +++ b/lib/models/dashboard/dashboard_model.dart @@ -1,7 +1,7 @@ class DashboardModel { - String kPIName; - int displaySequence; - List summaryoptions; + String? kPIName; + int? displaySequence; + List? summaryoptions; DashboardModel({this.kPIName, this.displaySequence, this.summaryoptions}); @@ -9,9 +9,9 @@ class DashboardModel { kPIName = json['KPIName']; displaySequence = json['displaySequence']; if (json['summaryoptions'] != null) { - summaryoptions = new List(); + summaryoptions = []; json['summaryoptions'].forEach((v) { - summaryoptions.add(new Summaryoptions.fromJson(v)); + summaryoptions!.add(new Summaryoptions.fromJson(v)); }); } } @@ -21,21 +21,20 @@ class DashboardModel { data['KPIName'] = this.kPIName; data['displaySequence'] = this.displaySequence; if (this.summaryoptions != null) { - data['summaryoptions'] = - this.summaryoptions.map((v) => v.toJson()).toList(); + data['summaryoptions'] = this.summaryoptions!.map((v) => v.toJson()).toList(); } return data; } } class Summaryoptions { - String kPIParameter; - String captionColor; - bool isCaptionBold; - bool isValueBold; - int order; - int value; - String valueColor; + String? kPIParameter; + String? captionColor; + bool? isCaptionBold; + bool? isValueBold; + int? order; + int? value; + String? valueColor; Summaryoptions( {this.kPIParameter, diff --git a/lib/models/doctor/clinic_model.dart b/lib/models/doctor/clinic_model.dart index e5eb8eee..690837fe 100644 --- a/lib/models/doctor/clinic_model.dart +++ b/lib/models/doctor/clinic_model.dart @@ -6,20 +6,14 @@ *@desc: Clinic Model */ class ClinicModel { - Null setupID; - int projectID; - int doctorID; - int clinicID; - bool isActive; - String clinicName; + dynamic setupID; + int? projectID; + int? doctorID; + int? clinicID; + bool? isActive; + String? clinicName; - ClinicModel( - {this.setupID, - this.projectID, - this.doctorID, - this.clinicID, - this.isActive, - this.clinicName}); + ClinicModel({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName}); ClinicModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/doctor/doctor_profile_model.dart b/lib/models/doctor/doctor_profile_model.dart index 7c7f6e37..f0221c34 100644 --- a/lib/models/doctor/doctor_profile_model.dart +++ b/lib/models/doctor/doctor_profile_model.dart @@ -1,45 +1,45 @@ class DoctorProfileModel { - int doctorID; - String doctorName; - Null doctorNameN; - int clinicID; - String clinicDescription; - Null clinicDescriptionN; - Null licenseExpiry; - int employmentType; + int? doctorID; + String? doctorName; + dynamic doctorNameN; + int? clinicID; + String? clinicDescription; + dynamic clinicDescriptionN; + dynamic licenseExpiry; + int? employmentType; dynamic setupID; - int projectID; - String projectName; - String nationalityID; - String nationalityName; - Null nationalityNameN; - int gender; - String genderDescription; - Null genderDescriptionN; - Null doctorTitle; - Null projectNameN; - bool isAllowWaitList; - String titleDescription; - Null titleDescriptionN; - Null isRegistered; - Null isDoctorDummy; - bool isActive; - Null isDoctorAppointmentDisplayed; - bool doctorClinicActive; - Null isbookingAllowed; - String doctorCases; - Null doctorPicture; - String doctorProfileInfo; - List specialty; - int actualDoctorRate; - String doctorImageURL; - int doctorRate; - String doctorTitleForProfile; - bool isAppointmentAllowed; - String nationalityFlagURL; - int noOfPatientsRate; - String qR; - int serviceID; + int? projectID; + String? projectName; + String? nationalityID; + String? nationalityName; + dynamic nationalityNameN; + int? gender; + String? genderDescription; + dynamic genderDescriptionN; + dynamic doctorTitle; + dynamic projectNameN; + bool? isAllowWaitList; + String? titleDescription; + dynamic titleDescriptionN; + dynamic isRegistered; + dynamic isDoctorDummy; + bool? isActive; + dynamic isDoctorAppointmentDisplayed; + bool? doctorClinicActive; + dynamic isbookingAllowed; + String? doctorCases; + dynamic doctorPicture; + String? doctorProfileInfo; + List? specialty; + int? actualDoctorRate; + String? doctorImageURL; + int? doctorRate; + String? doctorTitleForProfile; + bool? isAppointmentAllowed; + String? nationalityFlagURL; + int? noOfPatientsRate; + String? qR; + int? serviceID; DoctorProfileModel( {this.doctorID, @@ -84,7 +84,7 @@ class DoctorProfileModel { this.qR, this.serviceID}); - DoctorProfileModel.fromJson(Map json) { + DoctorProfileModel.fromJson(Map json) { doctorID = json['DoctorID']; doctorName = json['DoctorName']; doctorNameN = json['DoctorNameN']; @@ -110,26 +110,26 @@ class DoctorProfileModel { isRegistered = json['IsRegistered']; isDoctorDummy = json['IsDoctorDummy']; isActive = json['IsActive']; - isDoctorAppointmentDisplayed = json['IsDoctorAppointmentDisplayed']; + isDoctorAppointmentDisplayed = json['IsDoctorAppoint?mentDisplayed']; doctorClinicActive = json['DoctorClinicActive']; isbookingAllowed = json['IsbookingAllowed']; doctorCases = json['DoctorCases']; doctorPicture = json['DoctorPicture']; doctorProfileInfo = json['DoctorProfileInfo']; - specialty = json['Specialty'].cast(); + specialty = json['Specialty'].cast(); actualDoctorRate = json['ActualDoctorRate']; doctorImageURL = json['DoctorImageURL']; doctorRate = json['DoctorRate']; doctorTitleForProfile = json['DoctorTitleForProfile']; - isAppointmentAllowed = json['IsAppointmentAllowed']; + isAppointmentAllowed = json['IsAppoint?mentAllowed']; nationalityFlagURL = json['NationalityFlagURL']; noOfPatientsRate = json['NoOfPatientsRate']; qR = json['QR']; serviceID = json['ServiceID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorID'] = this.doctorID; data['DoctorName'] = this.doctorName; data['DoctorNameN'] = this.doctorNameN; @@ -155,7 +155,7 @@ class DoctorProfileModel { data['IsRegistered'] = this.isRegistered; data['IsDoctorDummy'] = this.isDoctorDummy; data['IsActive'] = this.isActive; - data['IsDoctorAppointmentDisplayed'] = this.isDoctorAppointmentDisplayed; + data['IsDoctorAppoint?mentDisplayed'] = this.isDoctorAppointmentDisplayed; data['DoctorClinicActive'] = this.doctorClinicActive; data['IsbookingAllowed'] = this.isbookingAllowed; data['DoctorCases'] = this.doctorCases; @@ -166,7 +166,7 @@ class DoctorProfileModel { data['DoctorImageURL'] = this.doctorImageURL; data['DoctorRate'] = this.doctorRate; data['DoctorTitleForProfile'] = this.doctorTitleForProfile; - data['IsAppointmentAllowed'] = this.isAppointmentAllowed; + data['IsAppoint?mentAllowed'] = this.isAppointmentAllowed; data['NationalityFlagURL'] = this.nationalityFlagURL; data['NoOfPatientsRate'] = this.noOfPatientsRate; data['QR'] = this.qR; diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/models/doctor/list_doctor_working_hours_table_model.dart index 4712d285..94e507c8 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/models/doctor/list_doctor_working_hours_table_model.dart @@ -1,12 +1,11 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class ListDoctorWorkingHoursTable { - DateTime date; - String dayName; - String workingHours; - String projectName; - String clinicName; - + DateTime? date; + String? dayName; + String? workingHours; + String? projectName; + String? clinicName; ListDoctorWorkingHoursTable({ this.date, @@ -37,5 +36,5 @@ class ListDoctorWorkingHoursTable { class WorkingHours { String from; String to; - WorkingHours({this.from, this.to}); + WorkingHours({required this.from, required this.to}); } diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/models/doctor/list_gt_my_patients_question_model.dart index 35d09812..a5b881f1 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -1,68 +1,64 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; - - - - class ListGtMyPatientsQuestions { - String setupID; - int projectID; - int transactionNo; - int patientType; - int patientID; - int doctorID; - int requestType; - DateTime requestDate; - String requestTime; - String remarks; - int status; - int createdBy; - String createdOn; - int editedBy; - String editedOn; - String patientName; - Null patientNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - int admissionNo; - int referringDoctor; - int lineItemNo; - String age; - String genderDescription; - bool isVidaCall; + String? setupID; + int? projectID; + int? transactionNo; + int? patientType; + int? patientID; + int? doctorID; + int? requestType; + DateTime? requestDate; + String? requestTime; + String? remarks; + int? status; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; + String? patientName; + dynamic patientNameN; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + int? admissionNo; + int? referringDoctor; + int? lineItemNo; + String? age; + String? genderDescription; + bool? isVidaCall; ListGtMyPatientsQuestions( {this.setupID, - this.projectID, - this.transactionNo, - this.patientType, - this.patientID, - this.doctorID, - this.requestType, - this.requestDate, - this.requestTime, - this.remarks, - this.status, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, - this.patientName, - this.patientNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.admissionNo, - this.referringDoctor, - this.lineItemNo, - this.age, - this.genderDescription, - this.isVidaCall}); + this.projectID, + this.transactionNo, + this.patientType, + this.patientID, + this.doctorID, + this.requestType, + this.requestDate, + this.requestTime, + this.remarks, + this.status, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.patientName, + this.patientNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.admissionNo, + this.referringDoctor, + this.lineItemNo, + this.age, + this.genderDescription, + this.isVidaCall}); - ListGtMyPatientsQuestions.fromJson(Map json) { + ListGtMyPatientsQuestions.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; transactionNo = json['TransactionNo']; @@ -70,7 +66,7 @@ class ListGtMyPatientsQuestions { patientID = json['PatientID']; doctorID = json['DoctorID']; requestType = json['RequestType']; - requestDate = AppDateUtils.convertStringToDate(json['RequestDate']) ; + requestDate = AppDateUtils.convertStringToDate(json['RequestDate']); requestTime = json['RequestTime']; remarks = json['Remarks']; status = json['Status']; @@ -92,8 +88,8 @@ class ListGtMyPatientsQuestions { isVidaCall = json['IsVidaCall']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['TransactionNo'] = this.transactionNo; @@ -124,4 +120,3 @@ class ListGtMyPatientsQuestions { return data; } } - diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/models/doctor/profile_req_Model.dart index 8f2ef985..56d937da 100644 --- a/lib/models/doctor/profile_req_Model.dart +++ b/lib/models/doctor/profile_req_Model.dart @@ -6,32 +6,32 @@ *@desc: ProfileReqModel */ class ProfileReqModel { - int projectID; - int clinicID; - int doctorID; - bool isRegistered; - bool license; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; + int? projectID; + int? clinicID; + int? doctorID; + bool? isRegistered; + bool? license; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; ProfileReqModel( {this.projectID, this.clinicID, this.doctorID, - this.isRegistered =true, + this.isRegistered = true, this.license, this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress='11.11.11.11', - this.versionID=5.5, - this.channel=9, - this.sessionID='E2bsEeYEJo', + this.iPAdress = '11.11.11.11', + this.versionID = 5.5, + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', this.tokenID, this.isLoginForDoctorApp = true}); diff --git a/lib/models/doctor/request_add_referred_doctor_remarks.dart b/lib/models/doctor/request_add_referred_doctor_remarks.dart index b396c47f..e4d3ecdb 100644 --- a/lib/models/doctor/request_add_referred_doctor_remarks.dart +++ b/lib/models/doctor/request_add_referred_doctor_remarks.dart @@ -1,41 +1,40 @@ import 'package:doctor_app_flutter/config/config.dart'; class RequestAddReferredDoctorRemarks { - int projectID; - String admissionNo; - int lineItemNo; - String referredDoctorRemarks; - int editedBy; - int patientID; - int referringDoctor; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - + int? projectID; + String? admissionNo; + int? lineItemNo; + String? referredDoctorRemarks; + int? editedBy; + int? patientID; + int? referringDoctor; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestAddReferredDoctorRemarks( {this.projectID, - this.admissionNo, - this.lineItemNo, - this.referredDoctorRemarks, - this.editedBy, - this.patientID, - this.referringDoctor, - this.languageID = LANGUAGE_ID, - this.stamp = STAMP, - this.iPAdress = IP_ADDRESS, - this.versionID = VERSION_ID, - this.channel= CHANNEL, - this.tokenID, - this.sessionID = SESSION_ID, - this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, - this.patientOutSA = PATIENT_OUT_SA}); + this.admissionNo, + this.lineItemNo, + this.referredDoctorRemarks, + this.editedBy, + this.patientID, + this.referringDoctor, + this.languageID = LANGUAGE_ID, + this.stamp = STAMP, + this.iPAdress = IP_ADDRESS, + this.versionID = VERSION_ID, + this.channel = CHANNEL, + this.tokenID, + this.sessionID = SESSION_ID, + this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, + this.patientOutSA = PATIENT_OUT_SA}); RequestAddReferredDoctorRemarks.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/doctor/request_doctor_reply.dart b/lib/models/doctor/request_doctor_reply.dart index 707336d6..3720d647 100644 --- a/lib/models/doctor/request_doctor_reply.dart +++ b/lib/models/doctor/request_doctor_reply.dart @@ -1,34 +1,34 @@ import 'package:doctor_app_flutter/config/config.dart'; class RequestDoctorReply { - int projectID; - int doctorID; - int transactionNo; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + int? doctorID; + int? transactionNo; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestDoctorReply( - {this.projectID , - this.doctorID , - this.transactionNo = TRANSACTION_NO , - this.languageID , - this.stamp , + {this.projectID, + this.doctorID, + this.transactionNo = TRANSACTION_NO, + this.languageID, + this.stamp, this.iPAdress, - this.versionID , + this.versionID, this.channel, - this.tokenID , + this.tokenID, this.sessionID, - this.isLoginForDoctorApp , - this.patientOutSA }); + this.isLoginForDoctorApp, + this.patientOutSA}); - RequestDoctorReply.fromJson(Map json) { + RequestDoctorReply.fromJson(Map json) { projectID = json['ProjectID']; doctorID = json['DoctorID']; transactionNo = json['TransactionNo']; diff --git a/lib/models/doctor/request_schedule.dart b/lib/models/doctor/request_schedule.dart index 03bafeca..55e70a9a 100644 --- a/lib/models/doctor/request_schedule.dart +++ b/lib/models/doctor/request_schedule.dart @@ -1,20 +1,18 @@ - - class RequestSchedule { - int projectID; - int clinicID; - int doctorID; - int doctorWorkingHoursDays; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? projectID; + int? clinicID; + int? doctorID; + int? doctorWorkingHoursDays; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; RequestSchedule( {this.projectID, diff --git a/lib/models/doctor/statstics_for_certain_doctor_request.dart b/lib/models/doctor/statstics_for_certain_doctor_request.dart index 08fa03f3..8b810fe0 100644 --- a/lib/models/doctor/statstics_for_certain_doctor_request.dart +++ b/lib/models/doctor/statstics_for_certain_doctor_request.dart @@ -1,18 +1,13 @@ class StatsticsForCertainDoctorRequest { - bool outSA; - int doctorID; - String tokenID; - int channel; - int projectID; - String generalid; + bool? outSA; + int? doctorID; + String? tokenID; + int? channel; + int? projectID; + String? generalid; StatsticsForCertainDoctorRequest( - {this.outSA, - this.doctorID, - this.tokenID, - this.channel, - this.projectID, - this.generalid}); + {this.outSA, this.doctorID, this.tokenID, this.channel, this.projectID, this.generalid}); StatsticsForCertainDoctorRequest.fromJson(Map json) { outSA = json['OutSA']; diff --git a/lib/models/doctor/user_model.dart b/lib/models/doctor/user_model.dart index 95035f8d..2500bfd7 100644 --- a/lib/models/doctor/user_model.dart +++ b/lib/models/doctor/user_model.dart @@ -1,16 +1,16 @@ class UserModel { - String userID; - String password; - int projectID; - int languageID; - String iPAdress; - double versionID; - int channel; - String sessionID; - String tokenID; - String stamp; - bool isLoginForDoctorApp; - int patientOutSA; + String? userID; + String? password; + int? projectID; + int? languageID; + String? iPAdress; + double? versionID; + int? channel; + String? sessionID; + String? tokenID; + String? stamp; + bool? isLoginForDoctorApp; + int? patientOutSA; UserModel( {this.userID, @@ -26,7 +26,7 @@ class UserModel { this.isLoginForDoctorApp, this.patientOutSA}); - UserModel.fromJson(Map json) { + UserModel.fromJson(Map json) { userID = json['UserID']; password = json['Password']; projectID = json['ProjectID']; diff --git a/lib/models/doctor/verify_referral_doctor_remarks.dart b/lib/models/doctor/verify_referral_doctor_remarks.dart index b9bfce0a..97c00390 100644 --- a/lib/models/doctor/verify_referral_doctor_remarks.dart +++ b/lib/models/doctor/verify_referral_doctor_remarks.dart @@ -1,54 +1,54 @@ import 'package:doctor_app_flutter/config/config.dart'; class VerifyReferralDoctorRemarks { - int projectID; - String admissionNo; - int lineItemNo; - String referredDoctorRemarks; - int editedBy; - int patientID; - int referringDoctor; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - String firstName; + int? projectID; + String? admissionNo; + int? lineItemNo; + String? referredDoctorRemarks; + int? editedBy; + int? patientID; + int? referringDoctor; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + String? firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; - VerifyReferralDoctorRemarks( - {this.projectID, - this.admissionNo, - this.lineItemNo, - this.referredDoctorRemarks, - this.editedBy, - this.patientID, - this.referringDoctor, - this.languageID = LANGUAGE_ID, - this.stamp = STAMP, - this.iPAdress = IP_ADDRESS, - this.versionID = VERSION_ID, - this.channel= CHANNEL, - this.tokenID, - this.sessionID = SESSION_ID, - this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, - this.patientOutSA = PATIENT_OUT_SA, - this.firstName, - this.middleName, - this.lastName, - this.patientMobileNumber, - this.patientIdentificationID, - }); + VerifyReferralDoctorRemarks({ + this.projectID, + this.admissionNo, + this.lineItemNo, + this.referredDoctorRemarks, + this.editedBy, + this.patientID, + this.referringDoctor, + this.languageID = LANGUAGE_ID, + this.stamp = STAMP, + this.iPAdress = IP_ADDRESS, + this.versionID = VERSION_ID, + this.channel = CHANNEL, + this.tokenID, + this.sessionID = SESSION_ID, + this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, + this.patientOutSA = PATIENT_OUT_SA, + this.firstName, + this.middleName, + this.lastName, + this.patientMobileNumber, + this.patientIdentificationID, + }); - VerifyReferralDoctorRemarks.fromJson(Map json) { + VerifyReferralDoctorRemarks.fromJson(Map json) { projectID = json['ProjectID']; admissionNo = json['AdmissionNo']; lineItemNo = json['LineItemNo']; @@ -65,18 +65,15 @@ class VerifyReferralDoctorRemarks { sessionID = json['SessionID']; isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; - firstName= json["FirstName"]; - middleName= json["MiddleName"]; - lastName= json["LastName"]; - patientMobileNumber= json["PatientMobileNumber"]; - patientIdentificationID = json["PatientIdentificationID"]; - - - + firstName = json["FirstName"]; + middleName = json["MiddleName"]; + lastName = json["LastName"]; + patientMobileNumber = json["PatientMobileNumber"]; + patientIdentificationID = json["PatientIdentificationID"]; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.projectID; data['AdmissionNo'] = this.admissionNo; data['LineItemNo'] = this.lineItemNo; diff --git a/lib/models/livecare/end_call_req.dart b/lib/models/livecare/end_call_req.dart index 7a1ae8eb..e3cc2722 100644 --- a/lib/models/livecare/end_call_req.dart +++ b/lib/models/livecare/end_call_req.dart @@ -1,12 +1,11 @@ class EndCallReq { - int vCID; - String tokenID; - String generalid; - int doctorId; - bool isDestroy; + int? vCID; + String? tokenID; + String? generalid; + int? doctorId; + bool? isDestroy; - EndCallReq( - {this.vCID, this.tokenID, this.generalid, this.doctorId, this.isDestroy}); + EndCallReq({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isDestroy}); EndCallReq.fromJson(Map json) { vCID = json['VC_ID']; diff --git a/lib/models/livecare/get_panding_req_list.dart b/lib/models/livecare/get_panding_req_list.dart index 719b9134..2ed2638a 100644 --- a/lib/models/livecare/get_panding_req_list.dart +++ b/lib/models/livecare/get_panding_req_list.dart @@ -1,16 +1,11 @@ class LiveCarePendingListRequest { - PatientData patientData; - int doctorID; - String sErServiceID; - int projectID; - int sourceID; - - LiveCarePendingListRequest( - {this.patientData, - this.doctorID, - this.sErServiceID, - this.projectID, - this.sourceID}); + PatientData? patientData; + int? doctorID; + String? sErServiceID; + int? projectID; + int? sourceID; + + LiveCarePendingListRequest({this.patientData, this.doctorID, this.sErServiceID, this.projectID, this.sourceID}); LiveCarePendingListRequest.fromJson(Map json) { patientData = new PatientData.fromJson(json['PatientData']); @@ -23,7 +18,7 @@ class LiveCarePendingListRequest { Map toJson() { final Map data = new Map(); - data['PatientData'] = this.patientData.toJson(); + data['PatientData'] = this.patientData!.toJson(); data['DoctorID'] = this.doctorID; data['SErServiceID'] = this.sErServiceID; data['ProjectID'] = this.projectID; @@ -33,9 +28,9 @@ class LiveCarePendingListRequest { } class PatientData { - bool isOutKSA; + bool? isOutKSA; - PatientData({this.isOutKSA}); + PatientData({required this.isOutKSA}); PatientData.fromJson(Map json) { isOutKSA = json['IsOutKSA']; diff --git a/lib/models/livecare/get_pending_res_list.dart b/lib/models/livecare/get_pending_res_list.dart index b45c53b9..85d62d35 100644 --- a/lib/models/livecare/get_pending_res_list.dart +++ b/lib/models/livecare/get_pending_res_list.dart @@ -1,43 +1,43 @@ class LiveCarePendingListResponse { dynamic acceptedBy; dynamic acceptedOn; - int age; + int? age; dynamic appointmentNo; - String arrivalTime; - String arrivalTimeD; - int callStatus; - String clientRequestID; - String clinicName; + String? arrivalTime; + String? arrivalTimeD; + int? callStatus; + String? clientRequestID; + String? clinicName; dynamic consoltationEnd; dynamic consultationNotes; dynamic createdOn; - String dateOfBirth; - String deviceToken; - String deviceType; + String? dateOfBirth; + String? deviceToken; + String? deviceType; dynamic doctorName; - String editOn; - String gender; - bool isFollowUP; + String? editOn; + String? gender; + bool? isFollowUP; dynamic isFromVida; - int isLoginB; - bool isOutKSA; - int isRejected; - String language; - double latitude; - double longitude; - String mobileNumber; + int? isLoginB; + bool? isOutKSA; + int? isRejected; + String? language; + double? latitude; + double? longitude; + String? mobileNumber; dynamic openSession; dynamic openTokenID; - String patientID; - String patientName; - int patientStatus; - String preferredLanguage; - int projectID; - double scoring; - int serviceID; + String? patientID; + String? patientName; + int? patientStatus; + String? preferredLanguage; + int? projectID; + double? scoring; + int? serviceID; dynamic tokenID; - int vCID; - String voipToken; + int? vCID; + String? voipToken; LiveCarePendingListResponse( {this.acceptedBy, @@ -80,11 +80,11 @@ class LiveCarePendingListResponse { this.vCID, this.voipToken}); - LiveCarePendingListResponse.fromJson(Map json) { + LiveCarePendingListResponse.fromJson(Map json) { acceptedBy = json['AcceptedBy']; acceptedOn = json['AcceptedOn']; age = json['Age']; - appointmentNo = json['AppointmentNo']; + appointmentNo = json['Appoint?mentNo']; arrivalTime = json['ArrivalTime']; arrivalTimeD = json['ArrivalTimeD']; callStatus = json['CallStatus']; @@ -122,12 +122,12 @@ class LiveCarePendingListResponse { voipToken = json['VoipToken']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['AcceptedBy'] = this.acceptedBy; data['AcceptedOn'] = this.acceptedOn; data['Age'] = this.age; - data['AppointmentNo'] = this.appointmentNo; + data['Appoint?mentNo'] = this.appointmentNo; data['ArrivalTime'] = this.arrivalTime; data['ArrivalTimeD'] = this.arrivalTimeD; data['CallStatus'] = this.callStatus; diff --git a/lib/models/livecare/session_status_model.dart b/lib/models/livecare/session_status_model.dart index 7e7a3e43..18d5ae6b 100644 --- a/lib/models/livecare/session_status_model.dart +++ b/lib/models/livecare/session_status_model.dart @@ -1,14 +1,10 @@ class SessionStatusModel { - bool isAuthenticated; - int messageStatus; - String result; - int sessionStatus; + bool? isAuthenticated; + int? messageStatus; + String? result; + int? sessionStatus; - SessionStatusModel( - {this.isAuthenticated, - this.messageStatus, - this.result, - this.sessionStatus}); + SessionStatusModel({this.isAuthenticated, this.messageStatus, this.result, this.sessionStatus}); SessionStatusModel.fromJson(Map json) { isAuthenticated = json['IsAuthenticated']; diff --git a/lib/models/livecare/start_call_req.dart b/lib/models/livecare/start_call_req.dart index 1ad04480..9dabccc1 100644 --- a/lib/models/livecare/start_call_req.dart +++ b/lib/models/livecare/start_call_req.dart @@ -1,15 +1,15 @@ class StartCallReq { - int vCID; - bool isrecall; - String tokenID; - String generalid; - int doctorId; - bool isOutKsa; - String projectName; - String docotrName; - String clincName; - String docSpec; - int clinicId; + int? vCID; + bool? isrecall; + String? tokenID; + String? generalid; + int? doctorId; + bool? isOutKsa; + String? projectName; + String? docotrName; + String? clincName; + String? docSpec; + int? clinicId; StartCallReq( {this.vCID, diff --git a/lib/models/livecare/start_call_res.dart b/lib/models/livecare/start_call_res.dart index 67259996..acbe9c4b 100644 --- a/lib/models/livecare/start_call_res.dart +++ b/lib/models/livecare/start_call_res.dart @@ -1,10 +1,10 @@ class StartCallRes { - String result; - String openSessionID; - String openTokenID; - bool isAuthenticated; - int messageStatus; - String appointmentNo; + String? result; + String? openSessionID; + String? openTokenID; + bool? isAuthenticated; + int? messageStatus; + String? appointmentNo; StartCallRes( {this.result, diff --git a/lib/models/livecare/transfer_to_admin.dart b/lib/models/livecare/transfer_to_admin.dart index 841f5e7d..291528b9 100644 --- a/lib/models/livecare/transfer_to_admin.dart +++ b/lib/models/livecare/transfer_to_admin.dart @@ -1,18 +1,12 @@ class TransferToAdminReq { - int vCID; - String tokenID; - String generalid; - int doctorId; - bool isOutKsa; - String notes; + int? vCID; + String? tokenID; + String? generalid; + int? doctorId; + bool? isOutKsa; + String? notes; - TransferToAdminReq( - {this.vCID, - this.tokenID, - this.generalid, - this.doctorId, - this.isOutKsa, - this.notes}); + TransferToAdminReq({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa, this.notes}); TransferToAdminReq.fromJson(Map json) { vCID = json['VC_ID']; diff --git a/lib/models/patient/MedicalReport/MedicalReportTemplate.dart b/lib/models/patient/MedicalReport/MedicalReportTemplate.dart index f00e84a0..aa0d1279 100644 --- a/lib/models/patient/MedicalReport/MedicalReportTemplate.dart +++ b/lib/models/patient/MedicalReport/MedicalReportTemplate.dart @@ -1,32 +1,32 @@ class MedicalReportTemplate { - String setupID; - int projectID; - int templateID; - String procedureID; - int reportType; - String templateName; - String templateNameN; - String templateText; - String templateTextN; - bool isActive; - String templateTextHtml; - String templateTextNHtml; + String? setupID; + int? projectID; + int? templateID; + String? procedureID; + int? reportType; + String? templateName; + String? templateNameN; + String? templateText; + String? templateTextN; + bool? isActive; + String? templateTextHtml; + String? templateTextNHtml; MedicalReportTemplate( {this.setupID, - this.projectID, - this.templateID, - this.procedureID, - this.reportType, - this.templateName, - this.templateNameN, - this.templateText, - this.templateTextN, - this.isActive, - this.templateTextHtml, - this.templateTextNHtml}); + this.projectID, + this.templateID, + this.procedureID, + this.reportType, + this.templateName, + this.templateNameN, + this.templateText, + this.templateTextN, + this.isActive, + this.templateTextHtml, + this.templateTextNHtml}); - MedicalReportTemplate.fromJson(Map json) { + MedicalReportTemplate.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; templateID = json['TemplateID']; @@ -41,8 +41,8 @@ class MedicalReportTemplate { templateTextNHtml = json['TemplateTextNHtml']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['TemplateID'] = this.templateID; diff --git a/lib/models/patient/MedicalReport/MeidcalReportModel.dart b/lib/models/patient/MedicalReport/MeidcalReportModel.dart index 74ee53a5..6cfe81ca 100644 --- a/lib/models/patient/MedicalReport/MeidcalReportModel.dart +++ b/lib/models/patient/MedicalReport/MeidcalReportModel.dart @@ -1,60 +1,60 @@ class MedicalReportModel { - String reportData; - String setupID; - int projectID; - String projectName; - String projectNameN; - int patientID; - String invoiceNo; - int status; - String verifiedOn; + String? reportData; + String? setupID; + int? projectID; + String? projectName; + String? projectNameN; + int? patientID; + String? invoiceNo; + int? status; + String? verifiedOn; dynamic verifiedBy; - String editedOn; - int editedBy; - int lineItemNo; - String createdOn; - int templateID; - int doctorID; - int doctorGender; - String doctorGenderDescription; - String doctorGenderDescriptionN; - String doctorImageURL; - String doctorName; - String doctorNameN; - int clinicID; - String clinicName; - String clinicNameN; - String reportDataHtml; + String? editedOn; + int? editedBy; + int? lineItemNo; + String? createdOn; + int? templateID; + int? doctorID; + int? doctorGender; + String? doctorGenderDescription; + String? doctorGenderDescriptionN; + String? doctorImageURL; + String? doctorName; + String? doctorNameN; + int? clinicID; + String? clinicName; + String? clinicNameN; + String? reportDataHtml; MedicalReportModel( {this.reportData, - this.setupID, - this.projectID, - this.projectName, - this.projectNameN, - this.patientID, - this.invoiceNo, - this.status, - this.verifiedOn, - this.verifiedBy, - this.editedOn, - this.editedBy, - this.lineItemNo, - this.createdOn, - this.templateID, - this.doctorID, - this.doctorGender, - this.doctorGenderDescription, - this.doctorGenderDescriptionN, - this.doctorImageURL, - this.doctorName, - this.doctorNameN, - this.clinicID, - this.clinicName, - this.clinicNameN, - this.reportDataHtml}); + this.setupID, + this.projectID, + this.projectName, + this.projectNameN, + this.patientID, + this.invoiceNo, + this.status, + this.verifiedOn, + this.verifiedBy, + this.editedOn, + this.editedBy, + this.lineItemNo, + this.createdOn, + this.templateID, + this.doctorID, + this.doctorGender, + this.doctorGenderDescription, + this.doctorGenderDescriptionN, + this.doctorImageURL, + this.doctorName, + this.doctorNameN, + this.clinicID, + this.clinicName, + this.clinicNameN, + this.reportDataHtml}); - MedicalReportModel.fromJson(Map json) { + MedicalReportModel.fromJson(Map json) { reportData = json['ReportData']; setupID = json['SetupID']; projectID = json['ProjectID']; @@ -83,8 +83,8 @@ class MedicalReportModel { reportDataHtml = json['ReportDataHtml']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ReportData'] = this.reportData; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; diff --git a/lib/models/patient/PatientArrivalEntity.dart b/lib/models/patient/PatientArrivalEntity.dart index 54622cd7..710cd70f 100644 --- a/lib/models/patient/PatientArrivalEntity.dart +++ b/lib/models/patient/PatientArrivalEntity.dart @@ -1,44 +1,44 @@ class PatientArrivalEntity { - String age; - String appointmentDate; - int appointmentNo; - String appointmentType; - String arrivedOn; - String companyName; - String endTime; - int episodeNo; - int fallRiskScore; - String gender; - int medicationOrders; - String mobileNumber; - String nationality; - int patientMRN; - String patientName; - int rowCount; - String startTime; - String visitType; + String? age; + String? appointmentDate; + int? appointmentNo; + String? appointmentType; + String? arrivedOn; + String? companyName; + String? endTime; + int? episodeNo; + int? fallRiskScore; + String? gender; + int? medicationOrders; + String? mobileNumber; + String? nationality; + int? patientMRN; + String? patientName; + int? rowCount; + String? startTime; + String? visitType; PatientArrivalEntity( {this.age, - this.appointmentDate, - this.appointmentNo, - this.appointmentType, - this.arrivedOn, - this.companyName, - this.endTime, - this.episodeNo, - this.fallRiskScore, - this.gender, - this.medicationOrders, - this.mobileNumber, - this.nationality, - this.patientMRN, - this.patientName, - this.rowCount, - this.startTime, - this.visitType}); + this.appointmentDate, + this.appointmentNo, + this.appointmentType, + this.arrivedOn, + this.companyName, + this.endTime, + this.episodeNo, + this.fallRiskScore, + this.gender, + this.medicationOrders, + this.mobileNumber, + this.nationality, + this.patientMRN, + this.patientName, + this.rowCount, + this.startTime, + this.visitType}); - PatientArrivalEntity.fromJson(Map json) { + PatientArrivalEntity.fromJson(Map json) { age = json['age']; appointmentDate = json['appointmentDate']; appointmentNo = json['appointmentNo']; @@ -59,8 +59,8 @@ class PatientArrivalEntity { visitType = json['visitType']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['age'] = this.age; data['appointmentDate'] = this.appointmentDate; data['appointmentNo'] = this.appointmentNo; @@ -81,4 +81,4 @@ class PatientArrivalEntity { data['visitType'] = this.visitType; return data; } -} \ No newline at end of file +} diff --git a/lib/models/patient/get_clinic_by_project_id_request.dart b/lib/models/patient/get_clinic_by_project_id_request.dart index 09198dc0..c3ba279d 100644 --- a/lib/models/patient/get_clinic_by_project_id_request.dart +++ b/lib/models/patient/get_clinic_by_project_id_request.dart @@ -1,6 +1,5 @@ class ClinicByProjectIdRequest { - - /* + /* *@author: Ibrahim Albitar *@Date:03/06/2020 *@param: @@ -8,17 +7,17 @@ class ClinicByProjectIdRequest { *@desc: ClinicByProjectIdRequest */ - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; /* { "ProjectID": 21, @@ -48,7 +47,7 @@ class ClinicByProjectIdRequest { this.patientOutSA = false, this.patientTypeID = 1}); - ClinicByProjectIdRequest.fromJson(Map json) { + ClinicByProjectIdRequest.fromJson(Map json) { projectID = json['ProjectID']; languageID = json['LanguageID']; stamp = json['stamp']; diff --git a/lib/models/patient/get_doctor_by_clinic_id_request.dart b/lib/models/patient/get_doctor_by_clinic_id_request.dart index 9504fc35..351f19f7 100644 --- a/lib/models/patient/get_doctor_by_clinic_id_request.dart +++ b/lib/models/patient/get_doctor_by_clinic_id_request.dart @@ -1,35 +1,31 @@ class DoctorsByClinicIdRequest { + int? clinicID; + int? projectID; + bool? continueDentalPlan; + bool? isSearchAppointmnetByClinicID; + int? patientID; + int? gender; + bool? isGetNearAppointment; + bool? isVoiceCommand; + int? latitude; + int? longitude; + bool? license; + bool? isDentalAllowedBackend; - int clinicID; - int projectID; - bool continueDentalPlan; - bool isSearchAppointmnetByClinicID; - int patientID; - int gender; - bool isGetNearAppointment; - bool isVoiceCommand; - int latitude; - int longitude; - bool license; - bool isDentalAllowedBackend; - - - DoctorsByClinicIdRequest( - { - this.clinicID, - this.projectID, - this.continueDentalPlan = false, - this.isSearchAppointmnetByClinicID = true, - this.patientID, - this.gender, - this.isGetNearAppointment = false, - this.isVoiceCommand = true, - this.latitude = 0, - this.longitude = 0, - this.license = true, - this.isDentalAllowedBackend = false, - }); - + DoctorsByClinicIdRequest({ + this.clinicID, + this.projectID, + this.continueDentalPlan = false, + this.isSearchAppointmnetByClinicID = true, + this.patientID, + this.gender, + this.isGetNearAppointment = false, + this.isVoiceCommand = true, + this.latitude = 0, + this.longitude = 0, + this.license = true, + this.isDentalAllowedBackend = false, + }); DoctorsByClinicIdRequest.fromJson(Map json) { clinicID = json['ClinicID']; @@ -61,6 +57,5 @@ class DoctorsByClinicIdRequest { data['License'] = this.license; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; return data; - } } diff --git a/lib/models/patient/get_list_stp_referral_frequency_request.dart b/lib/models/patient/get_list_stp_referral_frequency_request.dart index 7f466deb..ca4f3bd3 100644 --- a/lib/models/patient/get_list_stp_referral_frequency_request.dart +++ b/lib/models/patient/get_list_stp_referral_frequency_request.dart @@ -1,6 +1,5 @@ class STPReferralFrequencyRequest { - -/* +/* *@author: Ibrahim Albitar *@Date:03/06/2020 *@param: @@ -8,16 +7,16 @@ class STPReferralFrequencyRequest { *@desc: */ - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; /* { "LanguageID": 2, @@ -45,7 +44,7 @@ class STPReferralFrequencyRequest { this.patientOutSA = false, this.patientTypeID = 1}); - STPReferralFrequencyRequest.fromJson(Map json) { + STPReferralFrequencyRequest.fromJson(Map json) { languageID = json['LanguageID']; stamp = json['stamp']; iPAdress = json['IPAdress']; diff --git a/lib/models/patient/get_pending_patient_er_model.dart b/lib/models/patient/get_pending_patient_er_model.dart index e1b50a81..e16024ac 100644 --- a/lib/models/patient/get_pending_patient_er_model.dart +++ b/lib/models/patient/get_pending_patient_er_model.dart @@ -7,9 +7,10 @@ */ import 'dart:convert'; -ListPendingPatientListModel listPendingPatientListModelFromJson(String str) => ListPendingPatientListModel.fromJson(json.decode(str)); +ListPendingPatientListModel listPendingPatientListModelFromJson(String? str) => + ListPendingPatientListModel.fromJson(json.decode(str!)); -String listPendingPatientListModelToJson(ListPendingPatientListModel data) => json.encode(data.toJson()); +String? listPendingPatientListModelToJson(ListPendingPatientListModel data) => json.encode(data.toJson()); class ListPendingPatientListModel { ListPendingPatientListModel({ @@ -56,127 +57,128 @@ class ListPendingPatientListModel { dynamic acceptedBy; dynamic acceptedOn; - int age; + int? age; dynamic appointmentNo; - String arrivalTime; - String arrivalTimeD; - int callStatus; - String clientRequestId; - String clinicName; + String? arrivalTime; + String? arrivalTimeD; + int? callStatus; + String? clientRequestId; + String? clinicName; dynamic consoltationEnd; dynamic consultationNotes; dynamic createdOn; - DateTime dateOfBirth; - String deviceToken; - String deviceType; + DateTime? dateOfBirth; + String? deviceToken; + String? deviceType; dynamic doctorName; - String editOn; - String gender; - bool isFollowUp; + String? editOn; + String? gender; + bool? isFollowUp; dynamic isFromVida; - int isLoginB; - bool isOutKsa; - int isRejected; - String language; - double latitude; - double longitude; - String mobileNumber; + int? isLoginB; + bool? isOutKsa; + int? isRejected; + String? language; + double? latitude; + double? longitude; + String? mobileNumber; dynamic openSession; dynamic openTokenId; - String patientId; - String patientName; - int patientStatus; - String preferredLanguage; - int projectId; - int scoring; - int serviceId; + String? patientId; + String? patientName; + int? patientStatus; + String? preferredLanguage; + int? projectId; + int? scoring; + int? serviceId; dynamic tokenId; - int vcId; - String voipToken; + int? vcId; + String? voipToken; - factory ListPendingPatientListModel.fromJson(Map json) => ListPendingPatientListModel( - acceptedBy: json["AcceptedBy"], - acceptedOn: json["AcceptedOn"], - age: json["Age"], - appointmentNo: json["AppointmentNo"], - arrivalTime: json["ArrivalTime"], - arrivalTimeD: json["ArrivalTimeD"], - callStatus: json["CallStatus"], - clientRequestId: json["ClientRequestID"], - clinicName: json["ClinicName"], - consoltationEnd: json["ConsoltationEnd"], - consultationNotes: json["ConsultationNotes"], - createdOn: json["CreatedOn"], - dateOfBirth: DateTime.parse(json["DateOfBirth"]), - deviceToken: json["DeviceToken"], - deviceType: json["DeviceType"], - doctorName: json["DoctorName"], - editOn: json["EditOn"], - gender: json["Gender"], - isFollowUp: json["IsFollowUP"], - isFromVida: json["IsFromVida"], - isLoginB: json["IsLoginB"], - isOutKsa: json["IsOutKSA"], - isRejected: json["IsRejected"], - language: json["Language"], - latitude: json["Latitude"].toDouble(), - longitude: json["Longitude"].toDouble(), - mobileNumber: json["MobileNumber"], - openSession: json["OpenSession"], - openTokenId: json["OpenTokenID"], - patientId: json["PatientID"], - patientName: json["PatientName"], - patientStatus: json["PatientStatus"], - preferredLanguage: json["PreferredLanguage"], - projectId: json["ProjectID"], - scoring: json["Scoring"], - serviceId: json["ServiceID"], - tokenId: json["TokenID"], - vcId: json["VC_ID"], - voipToken: json["VoipToken"], - ); + factory ListPendingPatientListModel.fromJson(Map json) => ListPendingPatientListModel( + acceptedBy: json["AcceptedBy"], + acceptedOn: json["AcceptedOn"], + age: json["Age"], + appointmentNo: json["AppointmentNo"], + arrivalTime: json["ArrivalTime"], + arrivalTimeD: json["ArrivalTimeD"], + callStatus: json["CallStatus"], + clientRequestId: json["ClientRequestID"], + clinicName: json["ClinicName"], + consoltationEnd: json["ConsoltationEnd"], + consultationNotes: json["ConsultationNotes"], + createdOn: json["CreatedOn"], + dateOfBirth: DateTime.parse(json["DateOfBirth"]), + deviceToken: json["DeviceToken"], + deviceType: json["DeviceType"], + doctorName: json["DoctorName"], + editOn: json["EditOn"], + gender: json["Gender"], + isFollowUp: json["IsFollowUP"], + isFromVida: json["IsFromVida"], + isLoginB: json["IsLoginB"], + isOutKsa: json["IsOutKSA"], + isRejected: json["IsRejected"], + language: json["Language"], + latitude: json["Latitude"].toDouble(), + longitude: json["Longitude"].toDouble(), + mobileNumber: json["MobileNumber"], + openSession: json["OpenSession"], + openTokenId: json["OpenTokenID"], + patientId: json["PatientID"], + patientName: json["PatientName"], + patientStatus: json["PatientStatus"], + preferredLanguage: json["PreferredLanguage"], + projectId: json["ProjectID"], + scoring: json["Scoring"], + serviceId: json["ServiceID"], + tokenId: json["TokenID"], + vcId: json["VC_ID"], + voipToken: json["VoipToken"], + ); - Map toJson() => { - "AcceptedBy": acceptedBy, - "AcceptedOn": acceptedOn, - "Age": age, - "AppointmentNo": appointmentNo, - "ArrivalTime": arrivalTime, - "ArrivalTimeD": arrivalTimeD, - "CallStatus": callStatus, - "ClientRequestID": clientRequestId, - "ClinicName": clinicName, - "ConsoltationEnd": consoltationEnd, - "ConsultationNotes": consultationNotes, - "CreatedOn": createdOn, - "DateOfBirth": "${dateOfBirth.year.toString().padLeft(4, '0')}-${dateOfBirth.month.toString().padLeft(2, '0')}-${dateOfBirth.day.toString().padLeft(2, '0')}", - "DeviceToken": deviceToken, - "DeviceType": deviceType, - "DoctorName": doctorName, - "EditOn": editOn, - "Gender": gender, - "IsFollowUP": isFollowUp, - "IsFromVida": isFromVida, - "IsLoginB": isLoginB, - "IsOutKSA": isOutKsa, - "IsRejected": isRejected, - "Language": language, - "Latitude": latitude, - "Longitude": longitude, - "MobileNumber": mobileNumber, - "OpenSession": openSession, - "OpenTokenID": openTokenId, - "PatientID": patientId, - "PatientName": patientName, - "PatientStatus": patientStatus, - "PreferredLanguage": preferredLanguage, - "ProjectID": projectId, - "Scoring": scoring, - "ServiceID": serviceId, - "TokenID": tokenId, - "VC_ID": vcId, - "VoipToken": voipToken, - }; + Map toJson() => { + "AcceptedBy": acceptedBy, + "AcceptedOn": acceptedOn, + "Age": age, + "AppointmentNo": appointmentNo, + "ArrivalTime": arrivalTime, + "ArrivalTimeD": arrivalTimeD, + "CallStatus": callStatus, + "ClientRequestID": clientRequestId, + "ClinicName": clinicName, + "ConsoltationEnd": consoltationEnd, + "ConsultationNotes": consultationNotes, + "CreatedOn": createdOn, + "DateOfBirth": + "${dateOfBirth!.year.toString().padLeft(4, '0')}-${dateOfBirth!.month.toString().padLeft(2, '0')}-${dateOfBirth!.day.toString().padLeft(2, '0')}", + "DeviceToken": deviceToken, + "DeviceType": deviceType, + "DoctorName": doctorName, + "EditOn": editOn, + "Gender": gender, + "IsFollowUP": isFollowUp, + "IsFromVida": isFromVida, + "IsLoginB": isLoginB, + "IsOutKSA": isOutKsa, + "IsRejected": isRejected, + "Language": language, + "Latitude": latitude, + "Longitude": longitude, + "MobileNumber": mobileNumber, + "OpenSession": openSession, + "OpenTokenID": openTokenId, + "PatientID": patientId, + "PatientName": patientName, + "PatientStatus": patientStatus, + "PreferredLanguage": preferredLanguage, + "ProjectID": projectId, + "Scoring": scoring, + "ServiceID": serviceId, + "TokenID": tokenId, + "VC_ID": vcId, + "VoipToken": voipToken, + }; } // To parse this JSON data, do // diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/models/patient/insurance_aprovals_request.dart index 2d3ac663..eb505c34 100644 --- a/lib/models/patient/insurance_aprovals_request.dart +++ b/lib/models/patient/insurance_aprovals_request.dart @@ -21,23 +21,22 @@ *@desc: */ class InsuranceAprovalsRequest { - int exuldAppNO; - int patientID; - int channel; - int projectID; - int languageID; - String stamp; - String ipAdress; - double versionID; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? exuldAppNO; + int? patientID; + int? channel; + int? projectID; + int? languageID; + String? stamp; + String? ipAdress; + double? versionID; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; InsuranceAprovalsRequest( - { - this.exuldAppNO, + {this.exuldAppNO, this.patientID, this.channel = 9, this.projectID = 12, @@ -46,12 +45,12 @@ class InsuranceAprovalsRequest { this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', this.versionID = 5.8, - this.tokenID , + this.tokenID, this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, this.patientOutSA = false}); - InsuranceAprovalsRequest.fromJson(Map json) { + InsuranceAprovalsRequest.fromJson(Map json) { exuldAppNO = json['EXuldAPPNO']; patientID = json['PatientID']; channel = json['Channel']; @@ -67,8 +66,8 @@ class InsuranceAprovalsRequest { patientOutSA = json['PatientOutSA']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['EXuldAPPNO'] = this.exuldAppNO; data['PatientID'] = this.patientID; data['Channel'] = this.channel; diff --git a/lib/models/patient/lab_orders/lab_orders_req_model.dart b/lib/models/patient/lab_orders/lab_orders_req_model.dart index a97f4093..15efb56e 100644 --- a/lib/models/patient/lab_orders/lab_orders_req_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_req_model.dart @@ -1,24 +1,23 @@ - -/* - *@author: Elham Rababah - *@Date:6/5/2020 - *@param: +/* + *@author: Elham Rababah + *@Date:6/5/2020 + *@param: *@return:LabOrdersReqModel *@desc: LabOrdersReqModel class */ class LabOrdersReqModel { - int patientID; - int patientTypeID; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? patientID; + int? patientTypeID; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; LabOrdersReqModel( {this.patientID, @@ -27,12 +26,12 @@ class LabOrdersReqModel { this.languageID, this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress='11.11.11.11', - this.versionID=5.5, - this.channel=9, - this.sessionID='E2bsEeYEJo', - this.isLoginForDoctorApp =true, - this.patientOutSA=false}); + this.iPAdress = '11.11.11.11', + this.versionID = 5.5, + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', + this.isLoginForDoctorApp = true, + this.patientOutSA = false}); LabOrdersReqModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/models/patient/lab_orders/lab_orders_res_model.dart b/lib/models/patient/lab_orders/lab_orders_res_model.dart index 7f463933..3aa46535 100644 --- a/lib/models/patient/lab_orders/lab_orders_res_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_res_model.dart @@ -1,29 +1,27 @@ - - import 'package:doctor_app_flutter/util/date-utils.dart'; class LabOrdersResModel { - String setupID; - int projectID; - int patientID; - int patientType; - int orderNo; - String orderDate; - int invoiceTransactionType; - int invoiceNo; - int clinicId; - int doctorId; - int status; - String createdBy; - Null createdByN; - DateTime createdOn; - String editedBy; - Null editedByN; - String editedOn; - String clinicName; - String doctorImageURL; - String doctorName; - String projectName; + String? setupID; + int? projectID; + int? patientID; + int? patientType; + int? orderNo; + String? orderDate; + int? invoiceTransactionType; + int? invoiceNo; + int? clinicId; + int? doctorId; + int? status; + String? createdBy; + dynamic createdByN; + DateTime? createdOn; + String? editedBy; + dynamic editedByN; + String? editedOn; + String? clinicName; + String? doctorImageURL; + String? doctorName; + String? projectName; LabOrdersResModel( {this.setupID, @@ -48,7 +46,7 @@ class LabOrdersResModel { this.doctorName, this.projectName}); - LabOrdersResModel.fromJson(Map json) { + LabOrdersResModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -72,8 +70,8 @@ class LabOrdersResModel { projectName = json['ProjectName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; diff --git a/lib/models/patient/lab_result/lab_result.dart b/lib/models/patient/lab_result/lab_result.dart index ca753f2d..6e740e16 100644 --- a/lib/models/patient/lab_result/lab_result.dart +++ b/lib/models/patient/lab_result/lab_result.dart @@ -1,64 +1,64 @@ class LabResult { - String setupID; - int projectID; - int orderNo; - int lineItemNo; - int packageID; - int testID; - String description; - String resultValue; - String referenceRange; - Null convertedResultValue; - Null convertedReferenceRange; - Null resultValueFlag; - int status; - String createdBy; - Null createdByN; - String createdOn; - String editedBy; - Null editedByN; - String editedOn; - String verifiedBy; - Null verifiedByN; - String verifiedOn; + String? setupID; + int? projectID; + int? orderNo; + int? lineItemNo; + int? packageID; + int? testID; + String? description; + String? resultValue; + String? referenceRange; + dynamic convertedResultValue; + dynamic convertedReferenceRange; + dynamic resultValueFlag; + int? status; + String? createdBy; + dynamic createdByN; + String? createdOn; + String? editedBy; + dynamic editedByN; + String? editedOn; + String? verifiedBy; + dynamic verifiedByN; + String? verifiedOn; Null patientID; - int gender; - Null maleInterpretativeData; - Null femaleInterpretativeData; - String testCode; - String statusDescription; + int? gender; + dynamic maleinterpretativeData; + dynamic femaleinterpretativeData; + String? testCode; + String? statusDescription; LabResult( {this.setupID, - this.projectID, - this.orderNo, - this.lineItemNo, - this.packageID, - this.testID, - this.description, - this.resultValue, - this.referenceRange, - this.convertedResultValue, - this.convertedReferenceRange, - this.resultValueFlag, - this.status, - this.createdBy, - this.createdByN, - this.createdOn, - this.editedBy, - this.editedByN, - this.editedOn, - this.verifiedBy, - this.verifiedByN, - this.verifiedOn, - this.patientID, - this.gender, - this.maleInterpretativeData, - this.femaleInterpretativeData, - this.testCode, - this.statusDescription}); + this.projectID, + this.orderNo, + this.lineItemNo, + this.packageID, + this.testID, + this.description, + this.resultValue, + this.referenceRange, + this.convertedResultValue, + this.convertedReferenceRange, + this.resultValueFlag, + this.status, + this.createdBy, + this.createdByN, + this.createdOn, + this.editedBy, + this.editedByN, + this.editedOn, + this.verifiedBy, + this.verifiedByN, + this.verifiedOn, + this.patientID, + this.gender, + this.maleinterpretativeData, + this.femaleinterpretativeData, + this.testCode, + this.statusDescription}); - LabResult.fromJson(Map json) { + LabResult.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; orderNo = json['OrderNo']; @@ -83,14 +83,14 @@ class LabResult { verifiedOn = json['VerifiedOn']; patientID = json['PatientID']; gender = json['Gender']; - maleInterpretativeData = json['MaleInterpretativeData']; - femaleInterpretativeData = json['FemaleInterpretativeData']; + maleinterpretativeData = json['Maleint?erpretativeData']; + femaleinterpretativeData = json['Femaleint?erpretativeData']; testCode = json['TestCode']; statusDescription = json['StatusDescription']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['OrderNo'] = this.orderNo; @@ -115,8 +115,8 @@ class LabResult { data['VerifiedOn'] = this.verifiedOn; data['PatientID'] = this.patientID; data['Gender'] = this.gender; - data['MaleInterpretativeData'] = this.maleInterpretativeData; - data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Maleint?erpretativeData'] = this.maleinterpretativeData; + data['Femaleint?erpretativeData'] = this.femaleinterpretativeData; data['TestCode'] = this.testCode; data['StatusDescription'] = this.statusDescription; return data; diff --git a/lib/models/patient/lab_result/lab_result_req_model.dart b/lib/models/patient/lab_result/lab_result_req_model.dart index 5e58a4a5..91510d38 100644 --- a/lib/models/patient/lab_result/lab_result_req_model.dart +++ b/lib/models/patient/lab_result/lab_result_req_model.dart @@ -1,36 +1,36 @@ class RequestLabResult { - int projectID; - String setupID; - int orderNo; - int invoiceNo; - int patientTypeID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + String? setupID; + int? orderNo; + int? invoiceNo; + int? patientTypeID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestLabResult( {this.projectID, - this.setupID, - this.orderNo, - this.invoiceNo, - this.patientTypeID, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.setupID, + this.orderNo, + this.invoiceNo, + this.patientTypeID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); - RequestLabResult.fromJson(Map json) { + RequestLabResult.fromJson(Map json) { projectID = json['ProjectID']; setupID = json['SetupID']; orderNo = json['OrderNo']; diff --git a/lib/models/patient/my_referral/PendingReferral.dart b/lib/models/patient/my_referral/PendingReferral.dart index 6d3f0b83..58f12baf 100644 --- a/lib/models/patient/my_referral/PendingReferral.dart +++ b/lib/models/patient/my_referral/PendingReferral.dart @@ -1,37 +1,37 @@ import '../patiant_info_model.dart'; class PendingReferral { - PatiantInformtion patientDetails; - String doctorImageUrl; - String nationalityFlagUrl; - String responded; - String answerFromTarget; - String createdOn; - int data; - int isSameBranch; - String editedOn; - int interBranchReferral; - int patientID; - String patientName; - int patientType; - int referralNo; - String referralStatus; - String referredByDoctorInfo; - String referredFromBranchName; - String referredOn; - String referredType; - String remarksFromSource; - String respondedOn; - int sourceAppointmentNo; - int sourceProjectId; - String sourceSetupID; - String startDate; - int targetAppointmentNo; - String targetClinicID; - String targetDoctorID; - int targetProjectId; - String targetSetupID; - bool isReferralDoctorSameBranch; + PatiantInformtion? patientDetails; + String? doctorImageUrl; + String? nationalityFlagUrl; + String? responded; + String? answerFromTarget; + String? createdOn; + int? data; + int? isSameBranch; + String? editedOn; + int? interBranchReferral; + int? patientID; + String? patientName; + int? patientType; + int? referralNo; + String? referralStatus; + String? referredByDoctorInfo; + String? referredFromBranchName; + String? referredOn; + String? referredType; + String? remarksFromSource; + String? respondedOn; + int? sourceAppointmentNo; + int? sourceProjectId; + String? sourceSetupID; + String? startDate; + int? targetAppointmentNo; + String? targetClinicID; + String? targetDoctorID; + int? targetProjectId; + String? targetSetupID; + bool? isReferralDoctorSameBranch; PendingReferral({ this.patientDetails, @@ -68,9 +68,7 @@ class PendingReferral { }); PendingReferral.fromJson(Map json) { - patientDetails = json['patientDetails'] != null - ? PatiantInformtion.fromJson(json['patientDetails']) - : null; + patientDetails = json['patientDetails'] != null ? PatiantInformtion.fromJson(json['patientDetails']) : null; doctorImageUrl = json['DoctorImageURL']; nationalityFlagUrl = json['NationalityFlagURL']; responded = json['Responded']; @@ -79,7 +77,7 @@ class PendingReferral { data = json['data']; isSameBranch = json['isSameBranch']; editedOn = json['editedOn']; - interBranchReferral = json['interBranchReferral']; + int? erBranchReferral = json['int?erBranchReferral']; patientID = json['patientID']; patientName = json['patientName']; patientType = json['patientType']; @@ -91,19 +89,19 @@ class PendingReferral { referredType = json['referredType']; remarksFromSource = json['remarksFromSource']; respondedOn = json['respondedOn']; - sourceAppointmentNo = json['sourceAppointmentNo']; + sourceAppointmentNo = json['sourceAppoint?mentNo']; sourceProjectId = json['sourceProjectId']; sourceSetupID = json['sourceSetupID']; startDate = json['startDate']; - targetAppointmentNo = json['targetAppointmentNo']; + targetAppointmentNo = json['targetAppoint?mentNo']; targetClinicID = json['targetClinicID']; targetDoctorID = json['targetDoctorID']; targetProjectId = json['targetProjectId']; targetSetupID = json['targetSetupID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorImageURL'] = this.doctorImageUrl; data['NationalityFlagURL'] = this.nationalityFlagUrl; data['Responded'] = this.responded; @@ -112,7 +110,7 @@ class PendingReferral { data['data'] = this.data; data['isSameBranch'] = this.isSameBranch; data['editedOn'] = this.editedOn; - data['interBranchReferral'] = this.interBranchReferral; + data['int?erBranchReferral'] = this.interBranchReferral; data['patientID'] = this.patientID; data['patientName'] = this.patientName; data['patientType'] = this.patientType; @@ -124,11 +122,11 @@ class PendingReferral { data['referredType'] = this.referredType; data['remarksFromSource'] = this.remarksFromSource; data['respondedOn'] = this.respondedOn; - data['sourceAppointmentNo'] = this.sourceAppointmentNo; + data['sourceAppoint?mentNo'] = this.sourceAppointmentNo; data['sourceProjectId'] = this.sourceProjectId; data['sourceSetupID'] = this.sourceSetupID; data['startDate'] = this.startDate; - data['targetAppointmentNo'] = this.targetAppointmentNo; + data['targetAppoint?mentNo'] = this.targetAppointmentNo; data['targetClinicID'] = this.targetClinicID; data['targetDoctorID'] = this.targetDoctorID; data['targetProjectId'] = this.targetProjectId; diff --git a/lib/models/patient/my_referral/clinic-doctor.dart b/lib/models/patient/my_referral/clinic-doctor.dart index 843f636c..a8c541cf 100644 --- a/lib/models/patient/my_referral/clinic-doctor.dart +++ b/lib/models/patient/my_referral/clinic-doctor.dart @@ -1,86 +1,86 @@ class ClinicDoctor { - int clinicID; - String clinicName; - String doctorTitle; - int iD; - String name; - int projectID; - String projectName; - int actualDoctorRate; - int clinicRoomNo; - String date; - String dayName; - int doctorID; - String doctorImageURL; - String doctorProfile; - String doctorProfileInfo; - int doctorRate; - int gender; - String genderDescription; - bool isAppointmentAllowed; - bool isDoctorAllowVedioCall; - bool isDoctorDummy; - bool isLiveCare; - String latitude; - String longitude; - String nationalityFlagURL; - String nationalityID; - String nationalityName; - String nearestFreeSlot; - int noOfPatientsRate; - String originalClinicID; - int personRate; - int projectDistanceInKiloMeters; - String qR; - String qRString; - int rateNumber; - String serviceID; - String setupID; - List speciality; - String workingHours; + int? clinicID; + String? clinicName; + String? doctorTitle; + int? iD; + String? name; + int? projectID; + String? projectName; + int? actualDoctorRate; + int? clinicRoomNo; + String? date; + String? dayName; + int? doctorID; + String? doctorImageURL; + String? doctorProfile; + String? doctorProfileInfo; + int? doctorRate; + int? gender; + String? genderDescription; + bool? isAppointmentAllowed; + bool? isDoctorAllowVedioCall; + bool? isDoctorDummy; + bool? isLiveCare; + String? latitude; + String? longitude; + String? nationalityFlagURL; + String? nationalityID; + String? nationalityName; + String? nearestFreeSlot; + int? noOfPatientsRate; + String? originalClinicID; + int? personRate; + int? projectDistanceInKiloMeters; + String? qR; + String? qRString; + int? rateNumber; + String? serviceID; + String? setupID; + List? speciality; + String? workingHours; ClinicDoctor( {this.clinicID, - this.clinicName, - this.doctorTitle, - this.iD, - this.name, - this.projectID, - this.projectName, - this.actualDoctorRate, - this.clinicRoomNo, - this.date, - this.dayName, - this.doctorID, - this.doctorImageURL, - this.doctorProfile, - this.doctorProfileInfo, - this.doctorRate, - this.gender, - this.genderDescription, - this.isAppointmentAllowed, - this.isDoctorAllowVedioCall, - this.isDoctorDummy, - this.isLiveCare, - this.latitude, - this.longitude, - this.nationalityFlagURL, - this.nationalityID, - this.nationalityName, - this.nearestFreeSlot, - this.noOfPatientsRate, - this.originalClinicID, - this.personRate, - this.projectDistanceInKiloMeters, - this.qR, - this.qRString, - this.rateNumber, - this.serviceID, - this.setupID, - this.speciality, - this.workingHours}); + this.clinicName, + this.doctorTitle, + this.iD, + this.name, + this.projectID, + this.projectName, + this.actualDoctorRate, + this.clinicRoomNo, + this.date, + this.dayName, + this.doctorID, + this.doctorImageURL, + this.doctorProfile, + this.doctorProfileInfo, + this.doctorRate, + this.gender, + this.genderDescription, + this.isAppointmentAllowed, + this.isDoctorAllowVedioCall, + this.isDoctorDummy, + this.isLiveCare, + this.latitude, + this.longitude, + this.nationalityFlagURL, + this.nationalityID, + this.nationalityName, + this.nearestFreeSlot, + this.noOfPatientsRate, + this.originalClinicID, + this.personRate, + this.projectDistanceInKiloMeters, + this.qR, + this.qRString, + this.rateNumber, + this.serviceID, + this.setupID, + this.speciality, + this.workingHours}); - ClinicDoctor.fromJson(Map json) { + ClinicDoctor.fromJson(Map json) { clinicID = json['ClinicID']; clinicName = json['ClinicName']; doctorTitle = json['DoctorTitle']; @@ -99,7 +99,7 @@ class ClinicDoctor { doctorRate = json['DoctorRate']; gender = json['Gender']; genderDescription = json['GenderDescription']; - isAppointmentAllowed = json['IsAppointmentAllowed']; + isAppointmentAllowed = json['IsAppoint?mentAllowed']; isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; isDoctorDummy = json['IsDoctorDummy']; isLiveCare = json['IsLiveCare']; @@ -114,16 +114,16 @@ class ClinicDoctor { personRate = json['PersonRate']; projectDistanceInKiloMeters = json['ProjectDistanceInKiloMeters']; qR = json['QR']; - qRString = json['QRString']; + qRString = json['QRString?']; rateNumber = json['RateNumber']; serviceID = json['ServiceID']; setupID = json['SetupID']; - speciality = json['Speciality'].cast(); + speciality = json['Speciality'].cast(); workingHours = json['WorkingHours']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ClinicID'] = this.clinicID; data['ClinicName'] = this.clinicName; data['DoctorTitle'] = this.doctorTitle; @@ -142,7 +142,7 @@ class ClinicDoctor { data['DoctorRate'] = this.doctorRate; data['Gender'] = this.gender; data['GenderDescription'] = this.genderDescription; - data['IsAppointmentAllowed'] = this.isAppointmentAllowed; + data['IsAppoint?mentAllowed'] = this.isAppointmentAllowed; data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; data['IsDoctorDummy'] = this.isDoctorDummy; data['IsLiveCare'] = this.isLiveCare; @@ -157,7 +157,7 @@ class ClinicDoctor { data['PersonRate'] = this.personRate; data['ProjectDistanceInKiloMeters'] = this.projectDistanceInKiloMeters; data['QR'] = this.qR; - data['QRString'] = this.qRString; + data['QRString?'] = this.qRString; data['RateNumber'] = this.rateNumber; data['ServiceID'] = this.serviceID; data['SetupID'] = this.setupID; @@ -165,5 +165,4 @@ class ClinicDoctor { data['WorkingHours'] = this.workingHours; return data; } - -} \ No newline at end of file +} diff --git a/lib/models/patient/my_referral/my_referral_patient_model.dart b/lib/models/patient/my_referral/my_referral_patient_model.dart index f1506f8e..f79a57c3 100644 --- a/lib/models/patient/my_referral/my_referral_patient_model.dart +++ b/lib/models/patient/my_referral/my_referral_patient_model.dart @@ -1,108 +1,108 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class MyReferralPatientModel { - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; - String nursingStationID; - String description; - String nationalityName; - String nationalityNameN; - String clinicDescription; - String clinicDescriptionN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - String referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - DateTime mAXResponseTime; - String age; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referringDoctorName; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; + String? doctorNameN; + String? firstName; + String? middleName; + String? lastName; + String? firstNameN; + String? middleNameN; + String? lastNameN; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; + String? nursingStationID; + String? description; + String? nationalityName; + String? nationalityNameN; + String? clinicDescription; + String? clinicDescriptionN; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + String? referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + DateTime? mAXResponseTime; + String? age; + String? frequencyDescription; + String? genderDescription; + bool? isDoctorLate; + bool? isDoctorResponse; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referringDoctorName; MyReferralPatientModel( {this.projectID, - this.lineItemNo, - this.doctorID, - this.patientID, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomID, - this.bedID, - this.nursingStationID, - this.description, - this.nationalityName, - this.nationalityNameN, - this.clinicDescription, - this.clinicDescriptionN, - this.referralDoctor, - this.referringDoctor, - this.referralClinic, - this.referringClinic, - this.referralStatus, - this.referralDate, - this.referringDoctorRemarks, - this.referredDoctorRemarks, - this.referralResponseOn, - this.priority, - this.frequency, - this.mAXResponseTime, - this.age, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName}); + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.clinicDescription, + this.clinicDescriptionN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.age, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName}); - MyReferralPatientModel.fromJson(Map json) { + MyReferralPatientModel.fromJson(Map json) { projectID = json['ProjectID']; lineItemNo = json['LineItemNo']; doctorID = json['DoctorID']; @@ -154,8 +154,8 @@ class MyReferralPatientModel { referringDoctorName = json['ReferringDoctorName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.projectID; data['LineItemNo'] = this.lineItemNo; data['DoctorID'] = this.doctorID; diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/models/patient/my_referral/my_referred_patient_model.dart index 44a427f7..0dad14af 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -1,136 +1,134 @@ - - class MyReferredPatientModel { - String rowID; - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; - String nursingStationID; - String description; - String nationalityName; - String nationalityNameN; - String clinicDescription; - String clinicDescriptionN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - String referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - String mAXResponseTime; - int episodeID; - int appointmentNo; - String appointmentDate; - int appointmentType; - int patientMRN; - String createdOn; - int clinicID; - String nationalityID; - String age; - String doctorImageURL; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nationalityFlagURL; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referralDoctorName; - String referralClinicDescription; - String referringDoctorName; - bool isReferralDoctorSameBranch; - String referralStatusDesc; + String? rowID; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; + String? doctorNameN; + String? firstName; + String? middleName; + String? lastName; + String? firstNameN; + String? middleNameN; + String? lastNameN; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; + String? nursingStationID; + String? description; + String? nationalityName; + String? nationalityNameN; + String? clinicDescription; + String? clinicDescriptionN; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + String? referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + String? mAXResponseTime; + int? episodeID; + int? appointmentNo; + String? appointmentDate; + int? appointmentType; + int? patientMRN; + String? createdOn; + int? clinicID; + String? nationalityID; + String? age; + String? doctorImageURL; + String? frequencyDescription; + String? genderDescription; + bool? isDoctorLate; + bool? isDoctorResponse; + String? nationalityFlagURL; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referralDoctorName; + String? referralClinicDescription; + String? referringDoctorName; + bool? isReferralDoctorSameBranch; + String? referralStatusDesc; - MyReferredPatientModel({ - this.rowID, - this.projectID, - this.lineItemNo, - this.doctorID, - this.patientID, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomID, - this.bedID, - this.nursingStationID, - this.description, - this.nationalityName, - this.nationalityNameN, - this.clinicDescription, - this.clinicDescriptionN, - this.referralDoctor, - this.referringDoctor, - this.referralClinic, - this.referringClinic, - this.referralStatus, - this.referralDate, - this.referringDoctorRemarks, - this.referredDoctorRemarks, - this.referralResponseOn, - this.priority, - this.frequency, - this.mAXResponseTime, - this.episodeID, - this.appointmentNo, - this.appointmentDate, - this.appointmentType, - this.patientMRN, - this.createdOn, - this.clinicID, - this.nationalityID, - this.age, - this.doctorImageURL, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nationalityFlagURL, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName, - this.isReferralDoctorSameBranch, - this.referralDoctorName, - this.referralClinicDescription,this.referralStatusDesc - }); + MyReferredPatientModel( + {this.rowID, + this.projectID, + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.clinicDescription, + this.clinicDescriptionN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.episodeID, + this.appointmentNo, + this.appointmentDate, + this.appointmentType, + this.patientMRN, + this.createdOn, + this.clinicID, + this.nationalityID, + this.age, + this.doctorImageURL, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nationalityFlagURL, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName, + this.isReferralDoctorSameBranch, + this.referralDoctorName, + this.referralClinicDescription, + this.referralStatusDesc}); MyReferredPatientModel.fromJson(Map json) { rowID = json['RowID']; diff --git a/lib/models/patient/orders_request.dart b/lib/models/patient/orders_request.dart index 1372cfd6..8fb336aa 100644 --- a/lib/models/patient/orders_request.dart +++ b/lib/models/patient/orders_request.dart @@ -1,4 +1,3 @@ - /* *@author: Ibrahim Albitar *@Date:15/5/2020 @@ -23,36 +22,36 @@ */ class OrdersRequest { - int visitType; - int admissionNo; - int projectID; - int languageID; - String stamp; - String iPAdress; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; - double versionID; + int? visitType; + int? admissionNo; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; + double? versionID; OrdersRequest( - {this.visitType , + {this.visitType, this.admissionNo, this.projectID = 12, this.stamp = '2020-04-23T21:01:21.492Z', this.languageID = 2, this.iPAdress = '11.11.11.11', this.channel = 9, - this.tokenID , + this.tokenID, this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, this.versionID = 5.5, this.patientOutSA = false}); - OrdersRequest.fromJson(Map json) { + OrdersRequest.fromJson(Map json) { visitType = json['VisitType']; admissionNo = json['AdmissionNo']; projectID = json['ProjectID']; @@ -68,8 +67,8 @@ class OrdersRequest { versionID = json['VersionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VisitType'] = this.visitType; data['AdmissionNo'] = this.admissionNo; data['ProjectID'] = this.projectID; @@ -85,4 +84,4 @@ class OrdersRequest { data['VersionID'] = this.versionID; return data; } -} \ No newline at end of file +} diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 71d46dc9..16377e7a 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,79 +1,79 @@ // TODO : it have to be changed. class PatiantInformtion { - final PatiantInformtion patientDetails; - int genderInt; + final PatiantInformtion? patientDetails; + int? genderInt; dynamic age; - String appointmentDate; + String? appointmentDate; dynamic appointmentNo; dynamic appointmentType; - String arrivalTime; - String arrivalTimeD; - int callStatus; + String? arrivalTime; + String? arrivalTimeD; + int? callStatus; dynamic callStatusDisc; - int callTypeID; - String clientRequestID; - String clinicName; - String consoltationEnd; - String consultationNotes; - int appointmentTypeId; - String arrivedOn; - int clinicGroupId; - String companyName; + int? callTypeID; + String? clientRequestID; + String? clinicName; + String? consoltationEnd; + String? consultationNotes; + int? appointmentTypeId; + String? arrivedOn; + int? clinicGroupId; + String? companyName; dynamic dischargeStatus; dynamic doctorDetails; - int doctorId; - String endTime; - int episodeNo; - int fallRiskScore; - bool isSigned; - int medicationOrders; - String mobileNumber; - String nationality; - int projectId; - int clinicId; + int? doctorId; + String? endTime; + int? episodeNo; + int? fallRiskScore; + bool? isSigned; + int? medicationOrders; + String? mobileNumber; + String? nationality; + int? projectId; + int? clinicId; dynamic patientId; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - String fullName; - String fullNameN; - int gender; - String dateofBirth; - String nationalityId; - String emailAddress; - String patientIdentificationNo; - int patientType; - int patientMRN; - String admissionNo; - String admissionDate; - String createdOn; - String roomId; - String bedId; - String nursingStationId; - String description; - String clinicDescription; - String clinicDescriptionN; - String nationalityName; - String nationalityNameN; - String genderDescription; - String nursingStationName; - String startTime; - String visitType; - String nationalityFlagURL; - int patientStatus; - int patientStatusType; - int visitTypeId; - String startTimes; - String dischargeDate; - int status; - int vcId; - String voipToken; + String? doctorName; + String? doctorNameN; + String? firstName; + String? middleName; + String? lastName; + String? firstNameN; + String? middleNameN; + String? lastNameN; + String? fullName; + String? fullNameN; + int? gender; + String? dateofBirth; + String? nationalityId; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + int? patientMRN; + String? admissionNo; + String? admissionDate; + String? createdOn; + String? roomId; + String? bedId; + String? nursingStationId; + String? description; + String? clinicDescription; + String? clinicDescriptionN; + String? nationalityName; + String? nationalityNameN; + String? genderDescription; + String? nursingStationName; + String? startTime; + String? visitType; + String? nationalityFlagURL; + int? patientStatus; + int? patientStatusType; + int? visitTypeId; + String? startTimes; + String? dischargeDate; + int? status; + int? vcId; + String? voipToken; PatiantInformtion( {this.patientDetails, @@ -150,17 +150,14 @@ class PatiantInformtion { this.vcId, this.voipToken}); - factory PatiantInformtion.fromJson(Map json) => - PatiantInformtion( - patientDetails: json['patientDetails'] != null - ? new PatiantInformtion.fromJson(json['patientDetails']) - : null, + factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( + patientDetails: json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null, projectId: json["ProjectID"] ?? json["projectID"], clinicId: json["ClinicID"] ?? json["clinicID"], doctorId: json["DoctorID"] ?? json["doctorID"], patientId: json["PatientID"] != null ? json["PatientID"] is String - ? int.parse(json["PatientID"]) + ? int?.parse(json["PatientID"]) : json["PatientID"] : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN'], doctorName: json["DoctorName"] ?? json["doctorName"], @@ -173,18 +170,16 @@ class PatiantInformtion { lastNameN: json["LastNameN"] ?? json["lastNameN"], gender: json["Gender"] != null ? json["Gender"] is String - ? int.parse(json["Gender"]) + ? int?.parse(json["Gender"]) : json["Gender"] : json["gender"], fullName: json["fullName"] ?? json["fullName"] ?? json["PatientName"], - fullNameN: - json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"], + fullNameN: json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"], dateofBirth: json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth'], nationalityId: json["NationalityID"] ?? json["nationalityID"], mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], emailAddress: json["EmailAddress"] ?? json["emailAddress"], - patientIdentificationNo: - json["PatientIdentificationNo"] ?? json["patientIdentificationNo"], + patientIdentificationNo: json["PatientIdentificationNo"] ?? json["patientIdentificationNo"], //TODO make 7 dynamic when the backend retrun it in patient arrival patientType: json["PatientType"] ?? json["patientType"] ?? 1, admissionNo: json["AdmissionNo"] ?? json["admissionNo"], @@ -194,16 +189,10 @@ class PatiantInformtion { bedId: json["BedID"] ?? json["bedID"], nursingStationId: json["NursingStationID"] ?? json["nursingStationID"], description: json["Description"] ?? json["description"], - clinicDescription: - json["ClinicDescription"] ?? json["clinicDescription"], - clinicDescriptionN: - json["ClinicDescriptionN"] ?? json["clinicDescriptionN"], - nationalityName: json["NationalityName"] ?? - json["nationalityName"] ?? - json['NationalityName'], - nationalityNameN: json["NationalityNameN"] ?? - json["nationalityNameN"] ?? - json['NationalityNameN'], + clinicDescription: json["ClinicDescription"] ?? json["clinicDescription"], + clinicDescriptionN: json["ClinicDescriptionN"] ?? json["clinicDescriptionN"], + nationalityName: json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName'], + nationalityNameN: json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN'], age: json["Age"] ?? json["age"], genderDescription: json["GenderDescription"], nursingStationName: json["NursingStationName"], @@ -211,8 +200,7 @@ class PatiantInformtion { startTime: json["startTime"] ?? json['StartTime'], appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], appointmentType: json['appointmentType'], - appointmentTypeId: - json['appointmentTypeId'] ?? json['appointmentTypeid'], + appointmentTypeId: json['appointmentTypeId'] ?? json['appointmentTypeid'], arrivedOn: json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'], clinicGroupId: json['clinicGroupId'], companyName: json['companyName'], @@ -224,17 +212,15 @@ class PatiantInformtion { isSigned: json['isSigned'], medicationOrders: json['medicationOrders'], nationality: json['nationality'] ?? json['NationalityNameN'], - patientMRN: json['patientMRN'] ?? json['PatientMRN']?? ( - json["PatientID"] != null ? - int.parse(json["PatientID"].toString()) - : int.parse(json["patientID"].toString())), + patientMRN: json['patientMRN'] ?? + json['PatientMRN'] ?? + (json["PatientID"] != null + ? int?.parse(json["PatientID"].toString()) + : int?.parse(json["patientID"].toString())), visitType: json['visitType'] ?? json['visitType'] ?? json['visitType'], - nationalityFlagURL: - json['NationalityFlagURL'] ?? json['NationalityFlagURL'], - patientStatusType: - json['patientStatusType'] ?? json['PatientStatusType'], - visitTypeId: - json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], + nationalityFlagURL: json['NationalityFlagURL'] ?? json['NationalityFlagURL'], + patientStatusType: json['patientStatusType'] ?? json['PatientStatusType'], + visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], startTimes: json['StartTime'] ?? json['StartTime'], dischargeDate: json['DischargeDate'], status: json['Status'], diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart index 1d0da9c5..c37cd72b 100644 --- a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart +++ b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart @@ -1,12 +1,12 @@ class GetPatientArrivalListRequestModel { - String vidaAuthTokenID; - String from; - String to; - String doctorID; - int pageIndex; - int pageSize; - int clinicID; - int patientMRN; + String? vidaAuthTokenID; + String? from; + String? to; + String? doctorID; + int? pageIndex; + int? pageSize; + int? clinicID; + int? patientMRN; GetPatientArrivalListRequestModel( {this.vidaAuthTokenID, @@ -40,7 +40,6 @@ class GetPatientArrivalListRequestModel { data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['PatientMRN'] = this.patientMRN; - return data; } } diff --git a/lib/models/patient/patient_model.dart b/lib/models/patient/patient_model.dart index 7368c538..27da32f1 100644 --- a/lib/models/patient/patient_model.dart +++ b/lib/models/patient/patient_model.dart @@ -7,110 +7,108 @@ *@desc: */ class PatientModel { - int ProjectID; - int ClinicID; - int DoctorID; - String FirstName; + int? ProjectID; + int? ClinicID; + int? DoctorID; + String? FirstName; - String MiddleName; - String LastName; - String PatientMobileNumber; - String PatientIdentificationID; - int PatientID; - String From; - String To; - int LanguageID; - String stamp; - String IPAdress; - double VersionID; - int Channel; - String TokenID; - String SessionID; - bool IsLoginForDoctorApp; - bool PatientOutSA; - int Searchtype; - String IdentificationNo; - String MobileNo; - int get getProjectID => ProjectID; + String? MiddleName; + String? LastName; + String? PatientMobileNumber; + String? PatientIdentificationID; + int? PatientID; + String? From; + String? To; + int? LanguageID; + String? stamp; + String? IPAdress; + double? VersionID; + int? Channel; + String? TokenID; + String? SessionID; + bool? IsLoginForDoctorApp; + bool? PatientOutSA; + int? Searchtype; + String? IdentificationNo; + String? MobileNo; + int? get getProjectID => ProjectID; - set setProjectID(int ProjectID) => this.ProjectID = ProjectID; + set setProjectID(int? ProjectID) => this.ProjectID = ProjectID; - int get getClinicID => ClinicID; + int? get getClinicID => ClinicID; - set setClinicID(int ClinicID) => this.ClinicID = ClinicID; + set setClinicID(int? ClinicID) => this.ClinicID = ClinicID; - int get getDoctorID => DoctorID; + int? get getDoctorID => DoctorID; - set setDoctorID(int DoctorID) => this.DoctorID = DoctorID; - String get getFirstName => FirstName; + set setDoctorID(int? DoctorID) => this.DoctorID = DoctorID; + String? get getFirstName => FirstName; - set setFirstName(String FirstName) => this.FirstName = FirstName; + set setFirstName(String? FirstName) => this.FirstName = FirstName; - String get getMiddleName => MiddleName; + String? get getMiddleName => MiddleName; - set setMiddleName(String MiddleName) => this.MiddleName = MiddleName; + set setMiddleName(String? MiddleName) => this.MiddleName = MiddleName; - String get getLastName => LastName; + String? get getLastName => LastName; - set setLastName(String LastName) => this.LastName = LastName; + set setLastName(String? LastName) => this.LastName = LastName; - String get getPatientMobileNumber => PatientMobileNumber; + String? get getPatientMobileNumber => PatientMobileNumber; - set setPatientMobileNumber(String PatientMobileNumber) => - this.PatientMobileNumber = PatientMobileNumber; + set setPatientMobileNumber(String? PatientMobileNumber) => this.PatientMobileNumber = PatientMobileNumber; -// String get getPatientIdentificationID => PatientIdentificationID; +// String? get getPatientIdentificationID => PatientIdentificationID; -// set setPatientIdentificationID(String PatientIdentificationID) => this.PatientIdentificationID = PatientIdentificationID; +// set setPatientIdentificationID(String? PatientIdentificationID) => this.PatientIdentificationID = PatientIdentificationID; - int get getPatientID => PatientID; + int? get getPatientID => PatientID; - set setPatientID(int PatientID) => this.PatientID = PatientID; + set setPatientID(int? PatientID) => this.PatientID = PatientID; - String get getFrom => From; + String? get getFrom => From; - set setFrom(String From) => this.From = From; + set setFrom(String? From) => this.From = From; - String get getTo => To; + String? get getTo => To; - set setTo(String To) => this.To = To; + set setTo(String? To) => this.To = To; - int get getLanguageID => LanguageID; + int? get getLanguageID => LanguageID; - set setLanguageID(int LanguageID) => this.LanguageID = LanguageID; + set setLanguageID(int? LanguageID) => this.LanguageID = LanguageID; - String get getStamp => stamp; + String? get getStamp => stamp; - set setStamp(String stamp) => this.stamp = stamp; + set setStamp(String? stamp) => this.stamp = stamp; - String get getIPAdress => IPAdress; + String? get getIPAdress => IPAdress; - set setIPAdress(String IPAdress) => this.IPAdress = IPAdress; + set setIPAdress(String? IPAdress) => this.IPAdress = IPAdress; - double get getVersionID => VersionID; + double? get getVersionID => VersionID; - set setVersionID(double VersionID) => this.VersionID = VersionID; + set setVersionID(double? VersionID) => this.VersionID = VersionID; - int get getChannel => Channel; + int? get getChannel => Channel; - set setChannel(int Channel) => this.Channel = Channel; + set setChannel(int? Channel) => this.Channel = Channel; - String get getTokenID => TokenID; + String? get getTokenID => TokenID; - set setTokenID(String TokenID) => this.TokenID = TokenID; + set setTokenID(String? TokenID) => this.TokenID = TokenID; - String get getSessionID => SessionID; + String? get getSessionID => SessionID; - set setSessionID(String SessionID) => this.SessionID = SessionID; + set setSessionID(String? SessionID) => this.SessionID = SessionID; - bool get getIsLoginForDoctorApp => IsLoginForDoctorApp; + bool? get getIsLoginForDoctorApp => IsLoginForDoctorApp; - set setIsLoginForDoctorApp(bool IsLoginForDoctorApp) => - this.IsLoginForDoctorApp = IsLoginForDoctorApp; + set setIsLoginForDoctorApp(bool? IsLoginForDoctorApp) => this.IsLoginForDoctorApp = IsLoginForDoctorApp; - bool get getPatientOutSA => PatientOutSA; + bool? get getPatientOutSA => PatientOutSA; - set setPatientOutSA(bool PatientOutSA) => this.PatientOutSA = PatientOutSA; + set setPatientOutSA(bool? PatientOutSA) => this.PatientOutSA = PatientOutSA; PatientModel( {this.ProjectID, @@ -137,12 +135,12 @@ class PatientModel { this.IdentificationNo, this.MobileNo}); - factory PatientModel.fromJson(Map json) => PatientModel( + factory PatientModel.fromJson(Map json) => PatientModel( FirstName: json["FirstName"], LastName: json["LasttName"], ); - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.ProjectID; data['ClinicID'] = this.ClinicID; data['DoctorID'] = this.DoctorID; diff --git a/lib/models/patient/prescription/prescription_report.dart b/lib/models/patient/prescription/prescription_report.dart index 05d28bdc..10119e75 100644 --- a/lib/models/patient/prescription/prescription_report.dart +++ b/lib/models/patient/prescription/prescription_report.dart @@ -1,70 +1,70 @@ class PrescriptionReport { - String address; - int appointmentNo; - String clinic; - String companyName; - int days; - String doctorName; - int doseDailyQuantity; - String frequency; - int frequencyNumber; + String? address; + int? appointmentNo; + String? clinic; + String? companyName; + int? days; + String? doctorName; + int? doseDailyQuantity; + String? frequency; + int? frequencyNumber; Null imageExtension; Null imageSRCUrl; Null imageString; Null imageThumbUrl; - String isCovered; - String itemDescription; - int itemID; - String orderDate; - int patientID; - String patientName; - String phoneOffice1; + String? isCovered; + String? itemDescription; + int? itemID; + String? orderDate; + int? patientID; + String? patientName; + String? phoneOffice1; Null prescriptionQR; - int prescriptionTimes; + int? prescriptionTimes; Null productImage; - String productImageBase64; - String productImageString; - int projectID; - String projectName; - String remarks; - String route; - String sKU; - int scaleOffset; - String startDate; + String? productImageBase64; + String? productImageString; + int? projectID; + String? projectName; + String? remarks; + String? route; + String? sKU; + int? scaleOffset; + String? startDate; PrescriptionReport( {this.address, - this.appointmentNo, - this.clinic, - this.companyName, - this.days, - this.doctorName, - this.doseDailyQuantity, - this.frequency, - this.frequencyNumber, - this.imageExtension, - this.imageSRCUrl, - this.imageString, - this.imageThumbUrl, - this.isCovered, - this.itemDescription, - this.itemID, - this.orderDate, - this.patientID, - this.patientName, - this.phoneOffice1, - this.prescriptionQR, - this.prescriptionTimes, - this.productImage, - this.productImageBase64, - this.productImageString, - this.projectID, - this.projectName, - this.remarks, - this.route, - this.sKU, - this.scaleOffset, - this.startDate}); + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate}); PrescriptionReport.fromJson(Map json) { address = json['Address']; diff --git a/lib/models/patient/prescription/prescription_report_for_in_patient.dart b/lib/models/patient/prescription/prescription_report_for_in_patient.dart index 21cb13b1..f6285885 100644 --- a/lib/models/patient/prescription/prescription_report_for_in_patient.dart +++ b/lib/models/patient/prescription/prescription_report_for_in_patient.dart @@ -1,104 +1,104 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionReportForInPatient { - int admissionNo; - int authorizedBy; + int? admissionNo; + int? authorizedBy; Null bedNo; - String comments; - int createdBy; - String createdByName; + String? comments; + int? createdBy; + String? createdByName; Null createdByNameN; - String createdOn; - String direction; - int directionID; + String? createdOn; + String? direction; + int? directionID; Null directionN; - String dose; - int editedBy; + String? dose; + int? editedBy; Null iVDiluentLine; - int iVDiluentType; + int? iVDiluentType; Null iVDiluentVolume; Null iVRate; Null iVStability; - String itemDescription; - int itemID; - int lineItemNo; - int locationId; - int noOfDoses; - int orderNo; - int patientID; - String pharmacyRemarks; - DateTime prescriptionDatetime; - int prescriptionNo; - String processedBy; - int projectID; - int refillID; - String refillType; + String? itemDescription; + int? itemID; + int? lineItemNo; + int? locationId; + int? noOfDoses; + int? orderNo; + int? patientID; + String? pharmacyRemarks; + DateTime? prescriptionDatetime; + int? prescriptionNo; + String? processedBy; + int? projectID; + int? refillID; + String? refillType; Null refillTypeN; - int reviewedPharmacist; + int? reviewedPharmacist; Null roomId; - String route; - int routeId; + String? route; + int? routeId; Null routeN; Null setupID; - DateTime startDatetime; - int status; - String statusDescription; + DateTime? startDatetime; + int? status; + String? statusDescription; Null statusDescriptionN; - DateTime stopDatetime; - int unitofMeasurement; - String unitofMeasurementDescription; + DateTime? stopDatetime; + int? unitofMeasurement; + String? unitofMeasurementDescription; Null unitofMeasurementDescriptionN; PrescriptionReportForInPatient( {this.admissionNo, - this.authorizedBy, - this.bedNo, - this.comments, - this.createdBy, - this.createdByName, - this.createdByNameN, - this.createdOn, - this.direction, - this.directionID, - this.directionN, - this.dose, - this.editedBy, - this.iVDiluentLine, - this.iVDiluentType, - this.iVDiluentVolume, - this.iVRate, - this.iVStability, - this.itemDescription, - this.itemID, - this.lineItemNo, - this.locationId, - this.noOfDoses, - this.orderNo, - this.patientID, - this.pharmacyRemarks, - this.prescriptionDatetime, - this.prescriptionNo, - this.processedBy, - this.projectID, - this.refillID, - this.refillType, - this.refillTypeN, - this.reviewedPharmacist, - this.roomId, - this.route, - this.routeId, - this.routeN, - this.setupID, - this.startDatetime, - this.status, - this.statusDescription, - this.statusDescriptionN, - this.stopDatetime, - this.unitofMeasurement, - this.unitofMeasurementDescription, - this.unitofMeasurementDescriptionN}); + this.authorizedBy, + this.bedNo, + this.comments, + this.createdBy, + this.createdByName, + this.createdByNameN, + this.createdOn, + this.direction, + this.directionID, + this.directionN, + this.dose, + this.editedBy, + this.iVDiluentLine, + this.iVDiluentType, + this.iVDiluentVolume, + this.iVRate, + this.iVStability, + this.itemDescription, + this.itemID, + this.lineItemNo, + this.locationId, + this.noOfDoses, + this.orderNo, + this.patientID, + this.pharmacyRemarks, + this.prescriptionDatetime, + this.prescriptionNo, + this.processedBy, + this.projectID, + this.refillID, + this.refillType, + this.refillTypeN, + this.reviewedPharmacist, + this.roomId, + this.route, + this.routeId, + this.routeN, + this.setupID, + this.startDatetime, + this.status, + this.statusDescription, + this.statusDescriptionN, + this.stopDatetime, + this.unitofMeasurement, + this.unitofMeasurementDescription, + this.unitofMeasurementDescriptionN}); - PrescriptionReportForInPatient.fromJson(Map json) { + PrescriptionReportForInPatient.fromJson(Map json) { admissionNo = json['AdmissionNo']; authorizedBy = json['AuthorizedBy']; bedNo = json['BedNo']; @@ -138,7 +138,7 @@ class PrescriptionReportForInPatient { routeId = json['RouteId']; routeN = json['RouteN']; setupID = json['SetupID']; - startDatetime = AppDateUtils.convertStringToDate(json['StartDatetime']) ; + startDatetime = AppDateUtils.convertStringToDate(json['StartDatetime']); status = json['Status']; statusDescription = json['StatusDescription']; statusDescriptionN = json['StatusDescriptionN']; @@ -148,8 +148,8 @@ class PrescriptionReportForInPatient { unitofMeasurementDescriptionN = json['UnitofMeasurementDescriptionN']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['AdmissionNo'] = this.admissionNo; data['AuthorizedBy'] = this.authorizedBy; data['BedNo'] = this.bedNo; diff --git a/lib/models/patient/prescription/prescription_req_model.dart b/lib/models/patient/prescription/prescription_req_model.dart deleted file mode 100644 index 9141c282..00000000 --- a/lib/models/patient/prescription/prescription_req_model.dart +++ /dev/null @@ -1,71 +0,0 @@ -/* - *@author: Elham Rababah - *@Date:6/5/2020 - *@param: - *@return:PrescriptionReqModel - *@desc: PrescriptionReqModel class - */ -class PrescriptionReqModel { - int patientID; - int setupID; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; - - PrescriptionReqModel( - {this.patientID, - this.setupID, - this.projectID, - this.languageID, - this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress = '11.11.11.11', - this.versionID = 5.5, - this.channel = 9, - this.sessionID = 'E2bsEeYEJo', - this.tokenID, - this.isLoginForDoctorApp = true, - this.patientOutSA = false, - this.patientTypeID}); - - PrescriptionReqModel.fromJson(Map json) { - patientID = json['PatientID']; - setupID = json['SetupID']; - projectID = json['ProjectID']; - languageID = json['LanguageID']; - stamp = json['stamp']; - iPAdress = json['IPAdress']; - versionID = json['VersionID']; - channel = json['Channel']; - tokenID = json['TokenID']; - sessionID = json['SessionID']; - isLoginForDoctorApp = json['IsLoginForDoctorApp']; - patientOutSA = json['PatientOutSA']; - patientTypeID = json['PatientTypeID']; - } - - Map toJson() { - final Map data = new Map(); - data['PatientID'] = this.patientID; - data['SetupID'] = this.setupID; - data['ProjectID'] = this.projectID; - data['LanguageID'] = this.languageID; - data['stamp'] = this.stamp; - data['IPAdress'] = this.iPAdress; - data['VersionID'] = this.versionID; - data['Channel'] = this.channel; - data['TokenID'] = this.tokenID; - data['SessionID'] = this.sessionID; - data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; - data['PatientOutSA'] = this.patientOutSA; - data['PatientTypeID'] = this.patientTypeID; - return data; - } -} diff --git a/lib/models/patient/prescription/prescription_res_model.dart b/lib/models/patient/prescription/prescription_res_model.dart index 9c7e296d..cc7fc44d 100644 --- a/lib/models/patient/prescription/prescription_res_model.dart +++ b/lib/models/patient/prescription/prescription_res_model.dart @@ -6,39 +6,39 @@ *@desc: PrescriptionResModel class */ class PrescriptionResModel { - String setupID; - int projectID; - int patientID; - int appointmentNo; - String appointmentDate; - String doctorName; - String clinicDescription; - String name; - int episodeID; - int actualDoctorRate; - int admission; - int clinicID; - String companyName; - String despensedStatus; - String dischargeDate; - int dischargeNo; - int doctorID; - String doctorImageURL; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isInsurancePatient; - String nationalityFlagURL; - int noOfPatientsRate; - String qR; - List speciality; + String? setupID; + int? projectID; + int? patientID; + int? appointmentNo; + String? appointmentDate; + String? doctorName; + String? clinicDescription; + String? name; + int? episodeID; + int? actualDoctorRate; + int? admission; + int? clinicID; + String? companyName; + String? despensedStatus; + String? dischargeDate; + int? dischargeNo; + int? doctorID; + String? doctorImageURL; + int? doctorRate; + String? doctorTitle; + int? gender; + String? genderDescription; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; + String? isInOutPatientDescription; + String? isInOutPatientDescriptionN; + bool? isInsurancePatient; + String? nationalityFlagURL; + int? noOfPatientsRate; + String? qR; + List? speciality; PrescriptionResModel( {this.setupID, @@ -75,7 +75,7 @@ class PrescriptionResModel { this.qR, this.speciality}); - PrescriptionResModel.fromJson(Map json) { + PrescriptionResModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -111,8 +111,8 @@ class PrescriptionResModel { speciality = json['Speciality']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; diff --git a/lib/models/patient/prescription/request_prescription_report.dart b/lib/models/patient/prescription/request_prescription_report.dart index 0581692e..078fd874 100644 --- a/lib/models/patient/prescription/request_prescription_report.dart +++ b/lib/models/patient/prescription/request_prescription_report.dart @@ -1,34 +1,34 @@ class RequestPrescriptionReport { - int projectID; - int appointmentNo; - int episodeID; - String setupID; - int patientTypeID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + int? appointmentNo; + int? episodeID; + String? setupID; + int? patientTypeID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestPrescriptionReport( {this.projectID, - this.appointmentNo, - this.episodeID, - this.setupID, - this.patientTypeID, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.appointmentNo, + this.episodeID, + this.setupID, + this.patientTypeID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); RequestPrescriptionReport.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/patient/progress_note_request.dart b/lib/models/patient/progress_note_request.dart index fe0add5f..e19c50ed 100644 --- a/lib/models/patient/progress_note_request.dart +++ b/lib/models/patient/progress_note_request.dart @@ -1,4 +1,3 @@ - /* *@author: Ibrahim Albitar *@Date:15/5/2020 @@ -23,36 +22,36 @@ */ class ProgressNoteRequest { - int visitType; - int admissionNo; - int projectID; - int languageID; - String stamp; - String iPAdress; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; - double versionID; + int? visitType; + int? admissionNo; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; + double? versionID; ProgressNoteRequest( - {this.visitType , + {this.visitType, this.admissionNo, this.projectID = 12, this.stamp = '2020-04-23T21:01:21.492Z', this.languageID = 2, this.iPAdress = '11.11.11.11', this.channel = 9, - this.tokenID , + this.tokenID, this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, this.versionID = 5.5, this.patientOutSA = false}); - ProgressNoteRequest.fromJson(Map json) { + ProgressNoteRequest.fromJson(Map json) { visitType = json['VisitType']; admissionNo = json['AdmissionNo']; projectID = json['ProjectID']; @@ -68,8 +67,8 @@ class ProgressNoteRequest { versionID = json['VersionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VisitType'] = this.visitType; data['AdmissionNo'] = this.admissionNo; data['ProjectID'] = this.projectID; @@ -85,4 +84,4 @@ class ProgressNoteRequest { data['VersionID'] = this.versionID; return data; } -} \ No newline at end of file +} diff --git a/lib/models/patient/radiology/radiology_req_model.dart b/lib/models/patient/radiology/radiology_req_model.dart index 47154d8b..3b510019 100644 --- a/lib/models/patient/radiology/radiology_req_model.dart +++ b/lib/models/patient/radiology/radiology_req_model.dart @@ -6,18 +6,18 @@ *@desc: RadiologyReqModel class */ class RadiologyReqModel { - int patientID; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? patientID; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; RadiologyReqModel( {this.patientID, @@ -33,7 +33,7 @@ class RadiologyReqModel { this.patientOutSA = false, this.patientTypeID}); - RadiologyReqModel.fromJson(Map json) { + RadiologyReqModel.fromJson(Map json) { patientID = json['PatientID']; projectID = json['ProjectID']; languageID = json['LanguageID']; @@ -48,8 +48,8 @@ class RadiologyReqModel { patientTypeID = json['PatientTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['PatientID'] = this.patientID; data['ProjectID'] = this.projectID; data['LanguageID'] = this.languageID; diff --git a/lib/models/patient/radiology/radiology_res_model.dart b/lib/models/patient/radiology/radiology_res_model.dart index 6c6509a9..cf618dd7 100644 --- a/lib/models/patient/radiology/radiology_res_model.dart +++ b/lib/models/patient/radiology/radiology_res_model.dart @@ -6,21 +6,21 @@ *@desc: RadiologyResModel class */ class RadiologyResModel { - String setupID; - int projectID; - int patientID; - int invoiceLineItemNo; - int invoiceNo; - String reportData; - String imageURL; - int clinicId; - int doctorId; - String reportDate; - String clinicName; - String doctorImageURL; - String doctorName; - String projectName; - Null statusDescription; + String? setupID; + int? projectID; + int? patientID; + int? invoiceLineItemNo; + int? invoiceNo; + String? reportData; + String? imageURL; + int? clinicId; + int? doctorId; + String? reportDate; + String? clinicName; + String? doctorImageURL; + String? doctorName; + String? projectName; + dynamic statusDescription; RadiologyResModel( {this.setupID, @@ -39,7 +39,7 @@ class RadiologyResModel { this.projectName, this.statusDescription}); - RadiologyResModel.fromJson(Map json) { + RadiologyResModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -57,8 +57,8 @@ class RadiologyResModel { statusDescription = json['StatusDescription']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; diff --git a/lib/models/patient/reauest_prescription_report_for_in_patient.dart b/lib/models/patient/reauest_prescription_report_for_in_patient.dart index 857705c4..fe8bc3f1 100644 --- a/lib/models/patient/reauest_prescription_report_for_in_patient.dart +++ b/lib/models/patient/reauest_prescription_report_for_in_patient.dart @@ -1,34 +1,34 @@ class RequestPrescriptionReportForInPatient { - int patientID; - int projectID; - int admissionNo; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? patientID; + int? projectID; + int? admissionNo; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; RequestPrescriptionReportForInPatient( {this.patientID, - this.projectID, - this.admissionNo, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA, - this.patientTypeID}); + this.projectID, + this.admissionNo, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA, + this.patientTypeID}); - RequestPrescriptionReportForInPatient.fromJson(Map json) { + RequestPrescriptionReportForInPatient.fromJson(Map json) { patientID = json['PatientID']; projectID = json['ProjectID']; admissionNo = json['AdmissionNo']; @@ -44,8 +44,8 @@ class RequestPrescriptionReportForInPatient { patientTypeID = json['PatientTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['PatientID'] = this.patientID; data['ProjectID'] = this.projectID; data['AdmissionNo'] = this.admissionNo; diff --git a/lib/models/patient/refer_to_doctor_request.dart b/lib/models/patient/refer_to_doctor_request.dart index 83db54f4..fc1fd80d 100644 --- a/lib/models/patient/refer_to_doctor_request.dart +++ b/lib/models/patient/refer_to_doctor_request.dart @@ -1,40 +1,38 @@ import 'package:flutter/cupertino.dart'; class ReferToDoctorRequest { - -/* - *@author: Ibrahim Albitar - *@Date:03/06/2020 - *@param: +/* + *@author: Ibrahim Albitar + *@Date:03/06/2020 + *@param: *@return: *@desc: ReferToDoctor */ - int projectID; - int admissionNo; - String roomID; - String referralClinic; - String referralDoctor; - int createdBy; - int editedBy; - int patientID; - int patientTypeID; - int referringClinic; - int referringDoctor; - String referringDoctorRemarks; - String priority; - String frequency; - String extension; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - + int? projectID; + int? admissionNo; + String? roomID; + String? referralClinic; + String? referralDoctor; + int? createdBy; + int? editedBy; + int? patientID; + int? patientTypeID; + int? referringClinic; + int? referringDoctor; + String? referringDoctorRemarks; + String? priority; + String? frequency; + String? extension; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; /* { @@ -68,17 +66,17 @@ class ReferToDoctorRequest { ReferToDoctorRequest( {@required this.projectID, @required this.admissionNo, - @required this.roomID , + @required this.roomID, @required this.referralClinic, - @required this.referralDoctor , + @required this.referralDoctor, @required this.createdBy, - @required this.editedBy , + @required this.editedBy, @required this.patientID, @required this.patientTypeID, @required this.referringClinic, @required this.referringDoctor, @required this.referringDoctorRemarks, - @required this.priority , + @required this.priority, @required this.frequency, @required this.extension, this.languageID = 2, @@ -91,7 +89,7 @@ class ReferToDoctorRequest { this.isLoginForDoctorApp = true, this.patientOutSA = false}); - ReferToDoctorRequest.fromJson(Map json) { + ReferToDoctorRequest.fromJson(Map json) { projectID = json['ProjectID']; admissionNo = json['AdmissionNo']; roomID = json['RoomID']; diff --git a/lib/models/patient/request_my_referral_patient_model.dart b/lib/models/patient/request_my_referral_patient_model.dart index 219b7b2a..21e725d2 100644 --- a/lib/models/patient/request_my_referral_patient_model.dart +++ b/lib/models/patient/request_my_referral_patient_model.dart @@ -1,26 +1,24 @@ - - class RequestMyReferralPatientModel { - int projectID; - int clinicID; - int doctorID; - String firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + int? clinicID; + int? doctorID; + String? firstName; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; + int? patientID; + String? from; + String? to; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestMyReferralPatientModel( {this.projectID, @@ -34,17 +32,17 @@ class RequestMyReferralPatientModel { this.patientID = 0, this.from = "0", this.to = "0", - this.languageID , - this.stamp , - this.iPAdress , - this.versionID , - this.channel , + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, this.tokenID, - this.sessionID , - this.isLoginForDoctorApp , - this.patientOutSA }); + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); - RequestMyReferralPatientModel.fromJson(Map json) { + RequestMyReferralPatientModel.fromJson(Map json) { projectID = json['ProjectID']; clinicID = json['ClinicID']; doctorID = json['DoctorID']; diff --git a/lib/models/patient/topten_users_res_model.dart b/lib/models/patient/topten_users_res_model.dart index 3454568f..b1144d9a 100644 --- a/lib/models/patient/topten_users_res_model.dart +++ b/lib/models/patient/topten_users_res_model.dart @@ -1,4 +1,3 @@ - /* *@author: Amjad Amireh *@Date:27/4/2020 @@ -8,25 +7,23 @@ *@desc: */ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + //ModelResponse class ModelResponse { - final List list; - String firstName; + final List? list; + String? firstName; ModelResponse({ this.list, this.firstName, }); factory ModelResponse.fromJson(List parsedJson) { - - - List list = new List(); - + List list = []; + list = parsedJson.map((i) => PatiantInformtion.fromJson(i)).toList(); return new ModelResponse(list: list); } } -class PatiantInformtionl { -} \ No newline at end of file +class PatiantInformtionl {} diff --git a/lib/models/patient/vital_sign/patient-vital-sign-data.dart b/lib/models/patient/vital_sign/patient-vital-sign-data.dart index 57133a08..c02c2464 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-data.dart @@ -1,68 +1,68 @@ class VitalSignData { - int appointmentNo; - int bloodPressureCuffLocation; - int bloodPressureCuffSize; - int bloodPressureHigher; - int bloodPressureLower; - int bloodPressurePatientPosition; + int? appointmentNo; + int? bloodPressureCuffLocation; + int? bloodPressureCuffSize; + int? bloodPressureHigher; + int? bloodPressureLower; + int? bloodPressurePatientPosition; var bodyMassIndex; - int fio2; - int headCircumCm; + int? fio2; + int? headCircumCm; var heightCm; - int idealBodyWeightLbs; - bool isPainManagementDone; - bool isVitalsRequired; - int leanBodyWeightLbs; - String painCharacter; - String painDuration; - String painFrequency; - String painLocation; - int painScore; - int patientMRN; - int patientType; - int pulseBeatPerMinute; - int pulseRhythm; - int respirationBeatPerMinute; - int respirationPattern; - int sao2; - int status; + int? idealBodyWeightLbs; + bool? isPainManagementDone; + bool? isVitalsRequired; + int? leanBodyWeightLbs; + String? painCharacter; + String? painDuration; + String? painFrequency; + String? painLocation; + int? painScore; + int? patientMRN; + int? patientType; + int? pulseBeatPerMinute; + int? pulseRhythm; + int? respirationBeatPerMinute; + int? respirationPattern; + int? sao2; + int? status; var temperatureCelcius; - int temperatureCelciusMethod; + int? temperatureCelciusMethod; var waistSizeInch; var weightKg; VitalSignData( {this.appointmentNo, - this.bloodPressureCuffLocation, - this.bloodPressureCuffSize, - this.bloodPressureHigher, - this.bloodPressureLower, - this.bloodPressurePatientPosition, - this.bodyMassIndex, - this.fio2, - this.headCircumCm, - this.heightCm, - this.idealBodyWeightLbs, - this.isPainManagementDone, - this.isVitalsRequired, - this.leanBodyWeightLbs, - this.painCharacter, - this.painDuration, - this.painFrequency, - this.painLocation, - this.painScore, - this.patientMRN, - this.patientType, - this.pulseBeatPerMinute, - this.pulseRhythm, - this.respirationBeatPerMinute, - this.respirationPattern, - this.sao2, - this.status, - this.temperatureCelcius, - this.temperatureCelciusMethod, - this.waistSizeInch, - this.weightKg}); + this.bloodPressureCuffLocation, + this.bloodPressureCuffSize, + this.bloodPressureHigher, + this.bloodPressureLower, + this.bloodPressurePatientPosition, + this.bodyMassIndex, + this.fio2, + this.headCircumCm, + this.heightCm, + this.idealBodyWeightLbs, + this.isPainManagementDone, + this.isVitalsRequired, + this.leanBodyWeightLbs, + this.painCharacter, + this.painDuration, + this.painFrequency, + this.painLocation, + this.painScore, + this.patientMRN, + this.patientType, + this.pulseBeatPerMinute, + this.pulseRhythm, + this.respirationBeatPerMinute, + this.respirationPattern, + this.sao2, + this.status, + this.temperatureCelcius, + this.temperatureCelciusMethod, + this.waistSizeInch, + this.weightKg}); VitalSignData.fromJson(Map json) { appointmentNo = json['appointmentNo']; @@ -133,5 +133,4 @@ class VitalSignData { data['weightKg'] = this.weightKg; return data; } - } diff --git a/lib/models/patient/vital_sign/patient-vital-sign-history.dart b/lib/models/patient/vital_sign/patient-vital-sign-history.dart index ed39a86e..9b125216 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-history.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-history.dart @@ -25,9 +25,9 @@ class VitalSignHistory { var painDuration; var painCharacter; var painFrequency; - bool isPainManagementDone; + bool? isPainManagementDone; var status; - bool isVitalsRequired; + bool? isVitalsRequired; var patientID; var createdOn; var doctorID; @@ -242,8 +242,7 @@ class VitalSignHistory { data['BloodPressure'] = this.bloodPressure; data['BloodPressureCuffLocationDesc'] = this.bloodPressureCuffLocationDesc; data['BloodPressureCuffSizeDesc'] = this.bloodPressureCuffSizeDesc; - data['BloodPressurePatientPositionDesc'] = - this.bloodPressurePatientPositionDesc; + data['BloodPressurePatientPositionDesc'] = this.bloodPressurePatientPositionDesc; data['ClinicName'] = this.clinicName; data['DoctorImageURL'] = this.doctorImageURL; data['DoctorName'] = this.doctorName; diff --git a/lib/models/patient/vital_sign/vital_sign_req_model.dart b/lib/models/patient/vital_sign/vital_sign_req_model.dart index 2cfd24c2..e18e3a0a 100644 --- a/lib/models/patient/vital_sign/vital_sign_req_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_req_model.dart @@ -1,26 +1,25 @@ - -/* - *@author: Elham Rababah - *@Date:27/4/2020 - *@param: +/* + *@author: Elham Rababah + *@Date:27/4/2020 + *@param: *@return: *@desc: VitalSignReqModel */ class VitalSignReqModel { - int patientID; - int projectID; - int patientTypeID; - int inOutpatientType; - int transNo; - int languageID; - String stamp ; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? patientID; + int? projectID; + int? patientTypeID; + int? inOutpatientType; + int? transNo; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; VitalSignReqModel( {this.patientID, @@ -30,13 +29,13 @@ class VitalSignReqModel { this.languageID, this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress='11.11.11.11', - this.versionID=5.8, - this.channel=9, - this.sessionID='E2bsEeYEJo', - this.isLoginForDoctorApp=true, + this.iPAdress = '11.11.11.11', + this.versionID = 5.8, + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', + this.isLoginForDoctorApp = true, this.patientTypeID, - this.patientOutSA=false}); + this.patientOutSA = false}); VitalSignReqModel.fromJson(Map json) { projectID = json['ProjectID']; @@ -73,5 +72,4 @@ class VitalSignReqModel { data['PatientTypeID'] = this.patientTypeID; return data; } - } diff --git a/lib/models/patient/vital_sign/vital_sign_res_model.dart b/lib/models/patient/vital_sign/vital_sign_res_model.dart index 78af108d..e5af8aef 100644 --- a/lib/models/patient/vital_sign/vital_sign_res_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_res_model.dart @@ -34,17 +34,17 @@ class VitalSignResModel { var painDuration; var painCharacter; var painFrequency; - bool isPainManagementDone; + bool? isPainManagementDone; var status; - bool isVitalsRequired; + bool? isVitalsRequired; var patientID; - var createdOn; + var createdOn; var doctorID; var clinicID; var triageCategory; var gCScore; var lineItemNo; - DateTime vitalSignDate; + DateTime? vitalSignDate; var actualTimeTaken; var sugarLevel; var fBS; @@ -61,9 +61,9 @@ class VitalSignResModel { var bloodPressureCuffLocationDesc; var bloodPressureCuffSizeDesc; var bloodPressurePatientPositionDesc; - var clinicName; - var doctorImageURL; - var doctorName; + var clinicName; + var doctorImageURL; + var doctorName; var painScoreDesc; var pulseRhythmDesc; var respirationPatternDesc; @@ -170,7 +170,8 @@ class VitalSignResModel { triageCategory = json['TriageCategory']; gCScore = json['GCScore']; lineItemNo = json['LineItemNo']; - vitalSignDate = json['VitalSignDate'] !=null? AppDateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now(); + vitalSignDate = + json['VitalSignDate'] != null ? AppDateUtils.convertStringToDate(json['VitalSignDate']) : new DateTime.now(); actualTimeTaken = json['ActualTimeTaken']; sugarLevel = json['SugarLevel']; fBS = json['FBS']; @@ -251,8 +252,7 @@ class VitalSignResModel { data['BloodPressure'] = this.bloodPressure; data['BloodPressureCuffLocationDesc'] = this.bloodPressureCuffLocationDesc; data['BloodPressureCuffSizeDesc'] = this.bloodPressureCuffSizeDesc; - data['BloodPressurePatientPositionDesc'] = - this.bloodPressurePatientPositionDesc; + data['BloodPressurePatientPositionDesc'] = this.bloodPressurePatientPositionDesc; data['ClinicName'] = this.clinicName; data['DoctorImageURL'] = this.doctorImageURL; data['DoctorName'] = this.doctorName; diff --git a/lib/models/pharmacies/pharmacies_List_request_model.dart b/lib/models/pharmacies/pharmacies_List_request_model.dart index 90b5c378..31c3f758 100644 --- a/lib/models/pharmacies/pharmacies_List_request_model.dart +++ b/lib/models/pharmacies/pharmacies_List_request_model.dart @@ -1,4 +1,3 @@ - /* *@author: Ibrahim Albitar *@Date:27/4/2020 @@ -8,17 +7,17 @@ */ class PharmaciesListRequestModel { - int itemID; - int languageID; - String stamp; - String ipAdress; - double versionID; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; - int channel; + int? itemID; + int? languageID; + String? stamp; + String? ipAdress; + double? versionID; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; + int? channel; PharmaciesListRequestModel( {this.itemID, @@ -62,4 +61,4 @@ class PharmaciesListRequestModel { data['Channel'] = this.channel; return data; } -} \ No newline at end of file +} diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/models/pharmacies/pharmacies_items_request_model.dart index 4f2e947a..801fed36 100644 --- a/lib/models/pharmacies/pharmacies_items_request_model.dart +++ b/lib/models/pharmacies/pharmacies_items_request_model.dart @@ -7,18 +7,18 @@ */ class PharmaciesItemsRequestModel { - String pHRItemName; - int pageIndex = 0; - int pageSize = 20; - double versionID = 5.5; - int channel = 3; - int languageID = 2; - String iPAdress = "10.20.10.20"; - String generalid = "Cs2020@2016\$2958"; - int patientOutSA = 0; - String sessionID = "KvFJENeAUCxyVdIfEkHw"; - bool isDentalAllowedBackend = false; - int deviceTypeID = 2; + String? pHRItemName; + int? pageIndex = 0; + int? pageSize = 20; + double? versionID = 5.5; + int? channel = 3; + int? languageID = 2; + String? iPAdress = "10.20.10.20"; + String? generalid = "Cs2020@2016\$2958"; + int? patientOutSA = 0; + String? sessionID = "KvFJENeAUCxyVdIfEkHw"; + bool? isDentalAllowedBackend = false; + int? deviceTypeID = 2; PharmaciesItemsRequestModel( {this.pHRItemName, diff --git a/lib/models/sickleave/add_sickleave_request.dart b/lib/models/sickleave/add_sickleave_request.dart index d398153b..05d839f1 100644 --- a/lib/models/sickleave/add_sickleave_request.dart +++ b/lib/models/sickleave/add_sickleave_request.dart @@ -1,16 +1,11 @@ class AddSickLeaveRequest { - String patientMRN; - String appointmentNo; - String startDate; - String noOfDays; - String remarks; + String? patientMRN; + String? appointmentNo; + String? startDate; + String? noOfDays; + String? remarks; - AddSickLeaveRequest( - {this.patientMRN, - this.appointmentNo, - this.startDate, - this.noOfDays, - this.remarks}); + AddSickLeaveRequest({this.patientMRN, this.appointmentNo, this.startDate, this.noOfDays, this.remarks}); AddSickLeaveRequest.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/sickleave/extend_sick_leave_request.dart b/lib/models/sickleave/extend_sick_leave_request.dart index 8b61eb90..e25c2eb8 100644 --- a/lib/models/sickleave/extend_sick_leave_request.dart +++ b/lib/models/sickleave/extend_sick_leave_request.dart @@ -1,11 +1,10 @@ class ExtendSickLeaveRequest { - String patientMRN; - String previousRequestNo; - String noOfDays; - String remarks; + String? patientMRN; + String? previousRequestNo; + String? noOfDays; + String? remarks; - ExtendSickLeaveRequest( - {this.patientMRN, this.previousRequestNo, this.noOfDays, this.remarks}); + ExtendSickLeaveRequest({this.patientMRN, this.previousRequestNo, this.noOfDays, this.remarks}); ExtendSickLeaveRequest.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/sickleave/get_all_sickleave_response.dart b/lib/models/sickleave/get_all_sickleave_response.dart index de831213..7cfb292b 100644 --- a/lib/models/sickleave/get_all_sickleave_response.dart +++ b/lib/models/sickleave/get_all_sickleave_response.dart @@ -1,13 +1,13 @@ class GetAllSickLeaveResponse { - int appointmentNo; - bool isExtendedLeave; - int noOfDays; - int patientMRN; - String remarks; - int requestNo; - String startDate; - int status; - String statusDescription; + int? appointmentNo; + bool? isExtendedLeave; + int? noOfDays; + int? patientMRN; + String? remarks; + int? requestNo; + String? startDate; + int? status; + String? statusDescription; GetAllSickLeaveResponse( {this.appointmentNo, this.isExtendedLeave, From 110a1983c71f4168ca04ff9a4b0ce00ef6f15288 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 13 Jun 2021 10:01:05 +0300 Subject: [PATCH 06/18] flutter vervion 2 migration --- android/app/build.gradle | 2 +- android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- android/settings_aar.gradle | 1 + lib/UpdatePage.dart | 36 +- lib/config/size_config.dart | 19 +- .../admissionRequest/admission-request.dart | 19 +- .../sick_leave/sickleave_service.dart | 2 +- .../viewModel/DischargedPatientViewModel.dart | 12 +- .../viewModel/LiveCarePatientViewModel.dart | 27 +- lib/core/viewModel/PatientMuseViewModel.dart | 12 +- .../viewModel/PatientSearchViewModel.dart | 89 +- lib/core/viewModel/SOAP_view_model.dart | 205 +-- .../viewModel/authentication_view_model.dart | 141 +- lib/core/viewModel/dashboard_view_model.dart | 14 +- lib/core/viewModel/medicine_view_model.dart | 7 +- .../viewModel/patient-referral-viewmodel.dart | 82 +- .../viewModel/patient-ucaf-viewmodel.dart | 48 +- .../patient-vital-sign-viewmodel.dart | 55 +- .../viewModel/prescription_view_model.dart | 137 +- .../viewModel/prescriptions_view_model.dart | 82 +- lib/core/viewModel/procedure_View_model.dart | 66 +- lib/core/viewModel/project_view_model.dart | 17 +- lib/core/viewModel/radiology_view_model.dart | 62 +- lib/core/viewModel/referral_view_model.dart | 13 +- lib/core/viewModel/referred_view_model.dart | 8 +- lib/core/viewModel/schedule_view_model.dart | 5 +- lib/core/viewModel/sick_leave_view_model.dart | 24 +- lib/landing_page.dart | 12 +- ...list_doctor_working_hours_table_model.dart | 6 +- lib/models/doctor/user_model.dart | 2 +- lib/screens/auth/login_screen.dart | 302 ++-- .../auth/verification_methods_screen.dart | 638 +++---- lib/screens/base/base_view.dart | 12 +- lib/screens/doctor/doctor_repaly_chat.dart | 72 +- lib/screens/doctor/doctor_reply_screen.dart | 32 +- .../doctor/my_referral_patient_screen.dart | 11 +- .../doctor/patient_arrival_screen.dart | 26 +- .../home/dashboard_slider-item-widget.dart | 5 +- lib/screens/home/dashboard_swipe_widget.dart | 97 +- lib/screens/home/home_page_card.dart | 21 +- lib/screens/home/home_patient_card.dart | 12 +- lib/screens/home/home_screen.dart | 198 +-- lib/screens/live_care/end_call_screen.dart | 135 +- .../live-care_transfer_to_admin.dart | 61 +- .../live_care/live_care_patient_screen.dart | 137 +- lib/screens/live_care/panding_list.dart | 104 +- lib/screens/live_care/video_call.dart | 77 +- .../medical-file/health_summary_page.dart | 131 +- .../medical-file/medical_file_details.dart | 656 +++---- .../medicine/medicine_search_screen.dart | 58 +- .../medicine/pharmacies_list_screen.dart | 179 +- .../patients/DischargedPatientPage.dart | 609 ++++--- lib/screens/patients/ECGPage.dart | 183 +- lib/screens/patients/InPatientPage.dart | 78 +- .../patients/PatientsInPatientScreen.dart | 27 +- .../ReferralDischargedPatientDetails.dart | 141 +- .../ReferralDischargedPatientPage.dart | 133 +- .../insurance_approval_screen_patient.dart | 87 +- .../patients/insurance_approvals_details.dart | 1235 ++++++------- .../out_patient/filter_date_page.dart | 87 +- .../out_patient/out_patient_screen.dart | 179 +- ...t_patient_prescription_details_screen.dart | 40 +- .../patient_search/patient_search_header.dart | 7 +- .../patient_search_result_screen.dart | 109 +- .../patient_search/patient_search_screen.dart | 119 +- .../patients/patient_search/time_bar.dart | 110 -- .../profile/UCAF/UCAF-detail-screen.dart | 79 +- .../profile/UCAF/UCAF-input-screen.dart | 61 +- .../profile/UCAF/page-stepper-widget.dart | 46 +- .../admission-request-first-screen.dart | 214 +-- .../admission-request-third-screen.dart | 153 +- .../admission-request_second-screen.dart | 372 ++-- .../profile/lab_result/FlowChartPage.dart | 43 +- .../profile/lab_result/LabResultWidget.dart | 71 +- .../Lab_Result_details_wideget.dart | 12 +- .../profile/lab_result/LineChartCurved.dart | 58 +- .../lab_result_chart_and_detials.dart | 27 +- .../lab_result/lab_result_secreen.dart | 11 +- .../lab_result/laboratory_result_page.dart | 22 +- .../lab_result/laboratory_result_widget.dart | 59 +- .../profile/lab_result/labs_home_page.dart | 82 +- .../AddVerifyMedicalReport.dart | 23 +- .../MedicalReportDetailPage.dart | 44 +- .../medical_report/MedicalReportPage.dart | 96 +- .../profile/note/progress_note_screen.dart | 659 +++---- .../patients/profile/note/update_note.dart | 145 +- ...n_patient_prescription_details_screen.dart | 80 +- ...out_patient_prescription_details_item.dart | 2 +- .../PatientProfileCardModel.dart | 26 +- .../patient_profile_screen.dart | 438 +++-- .../profile_gird_for_InPatient.dart | 109 +- .../profile_gird_for_other.dart | 148 +- .../profile_gird_for_search.dart | 103 +- .../radiology/radiology_details_page.dart | 21 +- .../radiology/radiology_home_page.dart | 89 +- .../radiology/radiology_report_screen.dart | 8 +- .../referral/AddReplayOnReferralPatient.dart | 33 +- .../referral/my-referral-detail-screen.dart | 222 +-- .../my-referral-inpatient-screen.dart | 18 +- .../referral/my-referral-patient-screen.dart | 56 +- .../referral/patient_referral_screen.dart | 43 +- .../refer-patient-screen-in-patient.dart | 247 +-- .../referral/refer-patient-screen.dart | 256 +-- .../referral_patient_detail_in-paint.dart | 167 +- .../referral/referred-patient-screen.dart | 57 +- .../referred_patient_detail_in-paint.dart | 211 +-- .../assessment/add_assessment_details.dart | 485 +++-- .../assessment/update_assessment_page.dart | 710 ++++---- .../objective/add_examination_page.dart | 142 +- .../objective/add_examination_widget.dart | 30 +- .../objective/examination_item_card.dart | 19 +- .../examinations_list_search_widget.dart | 31 +- .../objective/update_objective_page.dart | 340 ++-- .../soap_update/plan/update_plan_page.dart | 496 +++--- .../shared_soap_widgets/SOAP_open_items.dart | 49 +- .../shared_soap_widgets/SOAP_step_header.dart | 12 +- .../bottom_sheet_title.dart | 21 +- .../expandable_SOAP_widget.dart | 39 +- .../shared_soap_widgets/steps_widget.dart | 102 +- .../subjective/allergies/add_allergies.dart | 209 +-- .../allergies/update_allergies_widget.dart | 104 +- .../update_Chief_complaints.dart | 73 +- .../history/add_history_dialog.dart | 219 ++- .../subjective/history/priority_bar.dart | 21 +- .../history/update_history_widget.dart | 65 +- .../subjective/medication/add_medication.dart | 552 +++--- .../medication/update_medication_widget.dart | 19 +- .../subjective/update_subjective_page.dart | 306 ++-- .../soap_update/update_soap_index.dart | 167 +- .../profile/vital_sign/LineChartCurved.dart | 13 +- .../LineChartCurvedBloodPressure.dart | 53 +- .../vital_sign/vital-signs-screen.dart | 1074 ----------- ...al_sign_details_blood_pressurewideget.dart | 22 +- .../vital_sign/vital_sign_details_screen.dart | 345 ++-- .../vital_sign_details_wideget.dart | 9 +- .../profile/vital_sign/vital_sign_item.dart | 10 +- .../vital_sign_item_details_screen.dart | 51 +- .../vital_sing_chart_and_detials.dart | 106 +- .../vital_sing_chart_blood_pressure.dart | 35 +- .../add_favourite_prescription.dart | 22 +- .../prescription/add_prescription_form.dart | 125 +- lib/screens/prescription/drugtodrug.dart | 67 +- .../prescription_checkout_screen.dart | 156 +- .../prescription_details_page.dart | 33 +- .../prescription_home_screen.dart | 10 +- .../prescription_item_in_patient_page.dart | 91 +- .../prescription/prescription_items_page.dart | 320 ++-- .../prescription/prescription_screen.dart | 1186 ++++++------- .../prescription_screen_history.dart | 819 ++++----- .../prescription/prescription_text_filed.dart | 24 +- .../prescription/prescriptions_page.dart | 22 +- .../update_prescription_form.dart | 656 +++---- .../procedures/ExpansionProcedure.dart | 28 +- lib/screens/procedures/ProcedureCard.dart | 47 +- .../procedures/add-favourite-procedure.dart | 37 +- .../procedures/add-procedure-form.dart | 133 +- .../procedures/add_lab_home_screen.dart | 219 ++- lib/screens/procedures/add_lab_orders.dart | 85 +- .../procedures/add_procedure_homeScreen.dart | 71 +- .../procedures/add_radiology_order.dart | 85 +- .../procedures/add_radiology_screen.dart | 219 ++- .../entity_list_checkbox_search_widget.dart | 117 +- .../procedures/entity_list_fav_procedure.dart | 58 +- .../entity_list_procedure_widget.dart | 63 +- .../procedures/procedure_checkout_screen.dart | 57 +- lib/screens/procedures/procedure_screen.dart | 60 +- lib/screens/procedures/update-procedure.dart | 119 +- lib/screens/qr_reader/QR_reader_screen.dart | 28 +- .../add-rescheduleleave.dart | 157 +- .../reschedule-leaves/reschedule_leave.dart | 475 ++--- lib/screens/sick-leave/add-sickleave.dart | 98 +- lib/screens/sick-leave/show-sickleave.dart | 122 +- lib/screens/sick-leave/sick_leave.dart | 279 ++- lib/util/VideoChannel.dart | 42 +- lib/util/dr_app_shared_pref.dart | 10 +- lib/util/extenstions.dart | 7 +- lib/util/helpers.dart | 48 +- lib/util/translations_delegate_base.dart | 1568 +++++++---------- lib/widgets/auth/method_type_card.dart | 17 +- lib/widgets/auth/sms-popup.dart | 157 +- .../auth/verification_methods_list.dart | 51 +- lib/widgets/charts/app_bar_chart.dart | 43 - lib/widgets/charts/app_line_chart.dart | 10 +- lib/widgets/charts/app_time_series_chart.dart | 11 +- .../dashboard_item_texts_widget.dart | 66 - lib/widgets/dashboard/guage_chart.dart | 12 +- lib/widgets/dashboard/out_patient_stack.dart | 19 +- .../data_display/list/custom_Item.dart | 24 +- .../data_display/list/flexible_container.dart | 10 +- lib/widgets/doctor/doctor_reply_widget.dart | 191 +- lib/widgets/doctor/lab_result_widget.dart | 24 +- .../doctor/my_referral_patient_widget.dart | 63 +- lib/widgets/doctor/my_schedule_widget.dart | 47 +- .../medicine/medicine_item_widget.dart | 10 +- lib/widgets/patients/PatientCard.dart | 370 ++-- .../patients/clinic_list_dropdwon.dart | 99 -- lib/widgets/patients/dynamic_elements.dart | 163 -- .../patient-referral-item-widget.dart | 132 +- .../profile/PatientHeaderWidgetNoAvatar.dart | 2 +- .../profile/PatientProfileButton.dart | 51 +- .../profile/Profile_general_info_Widget.dart | 45 - .../profile/add-order/addNewOrder.dart | 9 +- .../patients/profile/large_avatar.dart | 34 +- .../profile/patient-page-header-widget.dart | 32 +- ...ent-profile-header-new-design-app-bar.dart | 143 +- .../patient-profile-header-new-design.dart | 79 +- ...-profile-header-new-design_in_patient.dart | 242 --- ..._profile_header_with_appointment_card.dart | 507 ------ ..._header_with_appointment_card_app_bar.dart | 262 ++- .../prescription_in_patinets_widget.dart | 39 +- .../prescription_out_patinets_widget.dart | 38 +- .../profile/profile-welcome-widget.dart | 28 +- .../profile_general_info_content_widget.dart | 45 - .../profile/profile_header_widget.dart | 39 - .../profile/profile_medical_info_widget.dart | 184 -- ...rofile_medical_info_widget_in_patient.dart | 176 -- .../profile_medical_info_widget_search.dart | 352 ++-- .../profile/profile_status_info_widget.dart | 5 +- .../patients/vital_sign_details_wideget.dart | 14 +- lib/widgets/shared/StarRating.dart | 15 +- lib/widgets/shared/app_drawer_widget.dart | 18 +- .../shared/app_expandable_notifier.dart | 58 - .../shared/app_expandable_notifier_new.dart | 127 -- lib/widgets/shared/app_loader_widget.dart | 15 +- lib/widgets/shared/app_scaffold_widget.dart | 28 +- lib/widgets/shared/app_texts_widget.dart | 133 +- lib/widgets/shared/bottom_nav_bar.dart | 2 +- .../shared/bottom_navigation_item.dart | 34 +- .../shared/buttons/app_buttons_widget.dart | 71 +- .../shared/buttons/button_bottom_sheet.dart | 39 +- .../shared/buttons/secondary_button.dart | 80 +- .../shared/card_with_bgNew_widget.dart | 28 +- lib/widgets/shared/card_with_bg_widget.dart | 35 +- lib/widgets/shared/charts/app_line_chart.dart | 41 - .../shared/charts/app_time_series_chart.dart | 121 -- lib/widgets/shared/custom_shape_clipper.dart | 26 - .../shared/dialogs/ShowImageDialog.dart | 10 +- .../shared/dialogs/dailog-list-select.dart | 39 +- .../shared/dialogs/master_key_dailog.dart | 46 +- .../dialogs/search-drugs-dailog-list.dart | 92 - .../shared/divider_with_spaces_around.dart | 5 +- lib/widgets/shared/doctor_card.dart | 145 +- lib/widgets/shared/doctor_card_insurance.dart | 178 +- .../dr_app_circular_progress_Indeicator.dart | 5 +- lib/widgets/shared/drawer_item_widget.dart | 26 +- .../shared/errors/dr_app_embedded_error.dart | 27 +- lib/widgets/shared/errors/error_message.dart | 17 +- .../shared/expandable-widget-header-body.dart | 21 +- .../shared/expandable_item_widget.dart | 91 - .../shared/in_patient_doctor_card.dart | 194 ++ .../shared/loader/gif_loader_container.dart | 29 +- ..._key_checkbox_search_allergies_widget.dart | 299 ++-- .../master_key_checkbox_search_widget.dart | 56 +- lib/widgets/shared/network_base_view.dart | 12 +- lib/widgets/shared/profile_image_widget.dart | 61 +- .../shared/rounded_container_widget.dart | 69 +- lib/widgets/shared/speech-text-popup.dart | 17 +- .../shared/{ => text_fields}/TextFields.dart | 281 ++- .../text_fields/app-textfield-custom.dart | 95 +- .../text_fields/app_text_form_field.dart | 43 +- .../text_fields/auto_complete_text_field.dart | 13 +- .../shared/text_fields/html_rich_editor.dart | 25 +- .../shared/text_fields/new_text_Field.dart | 213 +-- .../shared/text_fields/text_field_error.dart | 4 +- .../shared/text_fields/text_fields_utils.dart | 19 +- .../app_anchored_overlay_widget.dart | 183 -- .../shared/user-guid/app_get_position.dart | 75 - .../shared/user-guid/app_shape_painter.dart | 42 - .../shared/user-guid/app_showcase.dart | 349 ---- .../shared/user-guid/app_showcase_widget.dart | 97 - .../shared/user-guid/app_tool_tip_widget.dart | 290 --- .../user-guid/custom_validation_error.dart | 21 +- .../user-guid/in_patient_doctor_card.dart | 196 --- lib/widgets/transitions/fade_page.dart | 48 +- lib/widgets/transitions/slide_up_page.dart | 15 +- pubspec.lock | 2 +- pubspec.yaml | 1 + 278 files changed, 12170 insertions(+), 21619 deletions(-) create mode 100644 android/settings_aar.gradle delete mode 100644 lib/screens/patients/patient_search/time_bar.dart delete mode 100644 lib/screens/patients/profile/vital_sign/vital-signs-screen.dart delete mode 100644 lib/widgets/charts/app_bar_chart.dart delete mode 100644 lib/widgets/dashboard/dashboard_item_texts_widget.dart delete mode 100644 lib/widgets/patients/clinic_list_dropdwon.dart delete mode 100644 lib/widgets/patients/dynamic_elements.dart delete mode 100644 lib/widgets/patients/profile/Profile_general_info_Widget.dart delete mode 100644 lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart delete mode 100644 lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart delete mode 100644 lib/widgets/patients/profile/profile_general_info_content_widget.dart delete mode 100644 lib/widgets/patients/profile/profile_header_widget.dart delete mode 100644 lib/widgets/patients/profile/profile_medical_info_widget.dart delete mode 100644 lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart delete mode 100644 lib/widgets/shared/app_expandable_notifier.dart delete mode 100644 lib/widgets/shared/app_expandable_notifier_new.dart delete mode 100644 lib/widgets/shared/charts/app_line_chart.dart delete mode 100644 lib/widgets/shared/charts/app_time_series_chart.dart delete mode 100644 lib/widgets/shared/custom_shape_clipper.dart delete mode 100644 lib/widgets/shared/dialogs/search-drugs-dailog-list.dart delete mode 100644 lib/widgets/shared/expandable_item_widget.dart create mode 100644 lib/widgets/shared/in_patient_doctor_card.dart rename lib/widgets/shared/{ => text_fields}/TextFields.dart (52%) delete mode 100644 lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart delete mode 100644 lib/widgets/shared/user-guid/app_get_position.dart delete mode 100644 lib/widgets/shared/user-guid/app_shape_painter.dart delete mode 100644 lib/widgets/shared/user-guid/app_showcase.dart delete mode 100644 lib/widgets/shared/user-guid/app_showcase_widget.dart delete mode 100644 lib/widgets/shared/user-guid/app_tool_tip_widget.dart delete mode 100644 lib/widgets/shared/user-guid/in_patient_doctor_card.dart diff --git a/android/app/build.gradle b/android/app/build.gradle index b7605ad0..26a2484d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -39,7 +39,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.hmg.hmgDr" - minSdkVersion 18 + minSdkVersion 21 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/android/build.gradle b/android/build.gradle index ea0f0026..49bd99ef 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:4.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.2' } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146b..bfae97b2 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Sun Jun 13 08:51:58 EEST 2021 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/android/settings_aar.gradle b/android/settings_aar.gradle new file mode 100644 index 00000000..e7b4def4 --- /dev/null +++ b/android/settings_aar.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/lib/UpdatePage.dart b/lib/UpdatePage.dart index 16284ed1..b3202c52 100644 --- a/lib/UpdatePage.dart +++ b/lib/UpdatePage.dart @@ -10,12 +10,11 @@ import 'package:url_launcher/url_launcher.dart'; import 'widgets/shared/buttons/secondary_button.dart'; class UpdatePage extends StatelessWidget { - final String message; - final String androidLink; - final String iosLink; + final String? message; + final String? androidLink; + final String? iosLink; - const UpdatePage({Key key, this.message, this.androidLink, this.iosLink}) - : super(key: key); + const UpdatePage({Key? key, this.message, this.androidLink, this.iosLink}) : super(key: key); @override Widget build(BuildContext context) { @@ -30,18 +29,27 @@ class UpdatePage extends StatelessWidget { children: [ Image.asset( 'assets/images/update_rocket_image.png', - width: double.maxFinite,fit: BoxFit.fill, + width: double.maxFinite, + fit: BoxFit.fill, ), Image.asset('assets/images/HMG_logo.png'), - SizedBox(height: 8,), + SizedBox( + height: 8, + ), AppText( - TranslationBase.of(context).updateTheApp.toUpperCase(),fontSize: 17, + TranslationBase.of(context).updateTheApp!.toUpperCase(), + fontSize: 17, fontWeight: FontWeight.w600, ), - SizedBox(height: 12,), + SizedBox( + height: 12, + ), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(message??"Update the app",fontSize: 12,), + child: AppText( + message ?? "Update the app", + fontSize: 12, + ), ) ], ), @@ -52,14 +60,14 @@ class UpdatePage extends StatelessWidget { // padding: const EdgeInsets.all(8.0), margin: EdgeInsets.all(15), child: SecondaryButton( - color: Colors.red[800], + color: Colors.red[800]!, onTap: () { if (Platform.isIOS) - launch(iosLink); + launch(iosLink!); else - launch(androidLink); + launch(androidLink!); }, - label: TranslationBase.of(context).updateNow.toUpperCase(), + label: TranslationBase.of(context).updateNow!.toUpperCase(), ), ), ), diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 06dc3cda..e4b1e745 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -5,14 +5,14 @@ class SizeConfig { static double _blockWidth = 0; static double _blockHeight = 0; - static double ? realScreenWidth; - static double ? realScreenHeight; - static double ? screenWidth; - static double ? screenHeight; - static double ? textMultiplier; - static double ? imageSizeMultiplier; - static double ? heightMultiplier; - static double ? widthMultiplier; + static late double realScreenWidth; + static late double realScreenHeight; + static late double screenWidth; + static late double screenHeight; + static late double textMultiplier; + static late double imageSizeMultiplier; + static late double heightMultiplier; + static late double widthMultiplier; static bool isPortrait = true; static bool isMobilePortrait = false; @@ -22,7 +22,6 @@ class SizeConfig { realScreenHeight = constraints.maxHeight; realScreenWidth = constraints.maxWidth; - if (constraints.maxWidth <= MAX_SMALL_SCREEN) { isMobile = true; } @@ -45,7 +44,7 @@ class SizeConfig { } _blockWidth = (screenWidth! / 100); _blockHeight = (screenHeight! / 100)!; - + textMultiplier = _blockHeight; imageSizeMultiplier = _blockWidth; heightMultiplier = _blockHeight; diff --git a/lib/core/model/admissionRequest/admission-request.dart b/lib/core/model/admissionRequest/admission-request.dart index 5cf56e8e..94fe46cc 100644 --- a/lib/core/model/admissionRequest/admission-request.dart +++ b/lib/core/model/admissionRequest/admission-request.dart @@ -1,5 +1,5 @@ class AdmissionRequest { - late int patientMRN; + late int? patientMRN; late int? admitToClinic; late bool? isPregnant; late int pregnancyWeeks; @@ -42,7 +42,7 @@ class AdmissionRequest { late int? admissionRequestNo; AdmissionRequest( - {required this.patientMRN, + {this.patientMRN, this.admitToClinic, this.isPregnant, this.pregnancyWeeks = 0, @@ -110,8 +110,7 @@ class AdmissionRequest { dietType = json['dietType']; dietRemarks = json['dietRemarks']; isPhysicalActivityModification = json['isPhysicalActivityModification']; - physicalActivityModificationComments = - json['physicalActivityModificationComments']; + physicalActivityModificationComments = json['physicalActivityModificationComments']; orStatus = json['orStatus']; mainLineOfTreatment = json['mainLineOfTreatment']; estimatedCost = json['estimatedCost']; @@ -164,16 +163,13 @@ class AdmissionRequest { data['transportComments'] = this.transportComments; data['isPhysioAppointmentNeeded'] = this.isPhysioAppointmentNeeded; data['physioAppointmentComments'] = this.physioAppointmentComments; - data['isOPDFollowupAppointmentNeeded'] = - this.isOPDFollowupAppointmentNeeded; + data['isOPDFollowupAppointmentNeeded'] = this.isOPDFollowupAppointmentNeeded; data['opdFollowUpComments'] = this.opdFollowUpComments; data['isDietType'] = this.isDietType; data['dietType'] = this.dietType; data['dietRemarks'] = this.dietRemarks; - data['isPhysicalActivityModification'] = - this.isPhysicalActivityModification; - data['physicalActivityModificationComments'] = - this.physicalActivityModificationComments; + data['isPhysicalActivityModification'] = this.isPhysicalActivityModification; + data['physicalActivityModificationComments'] = this.physicalActivityModificationComments; data['orStatus'] = this.orStatus; data['mainLineOfTreatment'] = this.mainLineOfTreatment; data['estimatedCost'] = this.estimatedCost; @@ -189,8 +185,7 @@ class AdmissionRequest { // this.admissionRequestDiagnoses.map((v) => v.toJson()).toList(); } if (this.admissionRequestProcedures != null) { - data['admissionRequestProcedures'] = - this.admissionRequestProcedures!.map((v) => v.toJson()).toList(); + data['admissionRequestProcedures'] = this.admissionRequestProcedures!.map((v) => v.toJson()).toList(); } data['appointmentNo'] = this.appointmentNo; data['episodeID'] = this.episodeID; diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index 63b5d82a..bbddbde2 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -146,7 +146,7 @@ class SickLeaveService extends BaseService { _getReScheduleLeave.sort((a, b) { var adate = a.dateTimeFrom; //before -> var adate = a.date; var bdate = b.dateTimeFrom; //var bdate = b.date; - return -adate.compareTo(bdate); + return -adate!.compareTo(bdate!); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index f8e30851..4d1ea631 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -6,11 +6,9 @@ import '../../locator.dart'; import 'base_view_model.dart'; class DischargedPatientViewModel extends BaseViewModel { - DischargedPatientService _dischargedPatientService = - locator(); + DischargedPatientService _dischargedPatientService = locator(); - List get myDischargedPatient => - _dischargedPatientService.myDischargedPatients; + List get myDischargedPatient => _dischargedPatientService.myDischargedPatients; List filterData = []; @@ -19,9 +17,9 @@ class DischargedPatientViewModel extends BaseViewModel { if (strExist) { filterData = []; for (var i = 0; i < myDischargedPatient.length; i++) { - String firstName = myDischargedPatient[i].firstName.toUpperCase(); - String lastName = myDischargedPatient[i].lastName.toUpperCase(); - String mobile = myDischargedPatient[i].mobileNumber.toUpperCase(); + String firstName = myDischargedPatient[i].firstName!.toUpperCase(); + String lastName = myDischargedPatient[i].lastName!.toUpperCase(); + String mobile = myDischargedPatient[i].mobileNumber!.toUpperCase(); String patientID = myDischargedPatient[i].patientId.toString(); if (firstName.contains(str.toUpperCase()) || diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 1899028a..c963e0f9 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -14,8 +14,7 @@ import '../../locator.dart'; class LiveCarePatientViewModel extends BaseViewModel { List filterData = []; - LiveCarePatientServices _liveCarePatientServices = - locator(); + LiveCarePatientServices _liveCarePatientServices = locator(); StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; @@ -28,12 +27,9 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); } - PendingPatientERForDoctorAppRequestModel - pendingPatientERForDoctorAppRequestModel = - PendingPatientERForDoctorAppRequestModel( - sErServiceID: _dashboardService.sServiceID, outSA: false); - await _liveCarePatientServices.getPendingPatientERForDoctorApp( - pendingPatientERForDoctorAppRequestModel); + PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel = + PendingPatientERForDoctorAppRequestModel(sErServiceID: _dashboardService.sServiceID, outSA: false); + await _liveCarePatientServices.getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error!; @@ -120,16 +116,11 @@ class LiveCarePatientViewModel extends BaseViewModel { if (strExist) { filterData = []; for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) { - String fullName = - _liveCarePatientServices.patientList[i].fullName.toUpperCase(); - String patientID = - _liveCarePatientServices.patientList[i].patientId.toString(); - String mobile = - _liveCarePatientServices.patientList[i].mobileNumber.toUpperCase(); - - if (fullName.contains(str.toUpperCase()) || - patientID.contains(str) || - mobile.contains(str)) { + String fullName = _liveCarePatientServices.patientList[i].fullName!.toUpperCase(); + String patientID = _liveCarePatientServices.patientList[i].patientId.toString(); + String mobile = _liveCarePatientServices.patientList[i].mobileNumber!.toUpperCase(); + + if (fullName.contains(str.toUpperCase()) || patientID.contains(str) || mobile.contains(str)) { filterData.add(_liveCarePatientServices.patientList[i]); } } diff --git a/lib/core/viewModel/PatientMuseViewModel.dart b/lib/core/viewModel/PatientMuseViewModel.dart index 312d6ebb..80f917b7 100644 --- a/lib/core/viewModel/PatientMuseViewModel.dart +++ b/lib/core/viewModel/PatientMuseViewModel.dart @@ -8,17 +8,13 @@ import '../../locator.dart'; class PatientMuseViewModel extends BaseViewModel { PatientMuseService _patientMuseService = locator(); - List get patientMuseResultsModelList => - _patientMuseService.patientMuseResultsModelList; + List get patientMuseResultsModelList => _patientMuseService.patientMuseResultsModelList; - getECGPatient({int patientType, int patientOutSA, int patientID}) async { + getECGPatient({int? patientType, int? patientOutSA, int? patientID}) async { setState(ViewState.Busy); - await _patientMuseService.getECGPatient( - patientID: patientID, - patientOutSA: patientOutSA, - patientType: patientType); + await _patientMuseService.getECGPatient(patientID: patientID, patientOutSA: patientOutSA, patientType: patientType); if (_patientMuseService.hasError) { - error = _patientMuseService.error; + error = _patientMuseService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index a0cd68d9..9cc1110b 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -17,22 +17,18 @@ class PatientSearchViewModel extends BaseViewModel { List filterData = []; - DateTime selectedFromDate; - DateTime selectedToDate; + DateTime? selectedFromDate; + DateTime? selectedToDate; searchData(String str) { var strExist = str.length > 0 ? true : false; if (strExist) { filterData = []; for (var i = 0; i < _outPatientService.patientList.length; i++) { - String firstName = - _outPatientService.patientList[i].firstName.toUpperCase(); - String lastName = - _outPatientService.patientList[i].lastName.toUpperCase(); - String mobile = - _outPatientService.patientList[i].mobileNumber.toUpperCase(); - String patientID = - _outPatientService.patientList[i].patientId.toString(); + String firstName = _outPatientService.patientList[i].firstName!.toUpperCase(); + String lastName = _outPatientService.patientList[i].lastName!.toUpperCase(); + String mobile = _outPatientService.patientList[i].mobileNumber!.toUpperCase(); + String patientID = _outPatientService.patientList[i].patientId.toString(); if (firstName.contains(str.toUpperCase()) || lastName.contains(str.toUpperCase()) || @@ -48,18 +44,17 @@ class PatientSearchViewModel extends BaseViewModel { } } - getOutPatient(PatientSearchRequestModel patientSearchRequestModel, - {bool isLocalBusy = false}) async { + getOutPatient(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); } await getDoctorProfile(isGetProfile: true); - patientSearchRequestModel.doctorID = doctorProfile.doctorID; + patientSearchRequestModel.doctorID = doctorProfile!.doctorID; await _outPatientService.getOutPatient(patientSearchRequestModel); if (_outPatientService.hasError) { - error = _outPatientService.error; + error = _outPatientService.error!; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { @@ -71,13 +66,11 @@ class PatientSearchViewModel extends BaseViewModel { } } - getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, - {bool isLocalBusy = false}) async { + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { setState(ViewState.Busy); - await _outPatientService - .getPatientFileInformation(patientSearchRequestModel); + await _outPatientService.getPatientFileInformation(patientSearchRequestModel); if (_outPatientService.hasError) { - error = _outPatientService.error; + error = _outPatientService.error!; setState(ViewState.Error); } else { filterData = _outPatientService.patientList; @@ -87,41 +80,31 @@ class PatientSearchViewModel extends BaseViewModel { getPatientBasedOnDate( {item, - PatientSearchRequestModel patientSearchRequestModel, - PatientType selectedPatientType, - bool isSearchWithKeyInfo, - OutPatientFilterType outPatientFilterType}) async { + PatientSearchRequestModel? patientSearchRequestModel, + PatientType? selectedPatientType, + bool? isSearchWithKeyInfo, + OutPatientFilterType? outPatientFilterType}) async { String dateTo; String dateFrom; if (OutPatientFilterType.Previous == outPatientFilterType) { - selectedFromDate = DateTime( - DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); - selectedToDate = DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); - dateTo = AppDateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd'); - dateFrom = AppDateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd'); + selectedFromDate = DateTime(DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); + selectedToDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); + dateTo = AppDateUtils.convertDateToFormat(selectedToDate!, 'yyyy-MM-dd'); + dateFrom = AppDateUtils.convertDateToFormat(selectedFromDate!, 'yyyy-MM-dd'); } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { dateTo = AppDateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 6), - 'yyyy-MM-dd'); + DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 6), 'yyyy-MM-dd'); dateFrom = AppDateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); + DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1), 'yyyy-MM-dd'); } else { dateFrom = AppDateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); + DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); dateTo = AppDateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); + DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); } PatientSearchRequestModel currentModel = PatientSearchRequestModel(); - currentModel.patientID = patientSearchRequestModel.patientID; + currentModel.patientID = patientSearchRequestModel!.patientID; currentModel.firstName = patientSearchRequestModel.firstName; currentModel.lastName = patientSearchRequestModel.lastName; currentModel.middleName = patientSearchRequestModel.middleName; @@ -132,25 +115,21 @@ class PatientSearchViewModel extends BaseViewModel { filterData = _outPatientService.patientList; } - PatientInPatientService _inPatientService = - locator(); + PatientInPatientService _inPatientService = locator(); List get inPatientList => _inPatientService.inPatientList; - List get myIinPatientList => - _inPatientService.myInPatientList; + List get myIinPatientList => _inPatientService.myInPatientList; - List filteredInPatientItems = List(); + List filteredInPatientItems = []; - Future getInPatientList(PatientSearchRequestModel requestModel, - {bool isMyInpatient = false}) async { + Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false}) async { await getDoctorProfile(); setState(ViewState.Busy); - if (inPatientList.length == 0) - await _inPatientService.getInPatientList(requestModel, false); + if (inPatientList.length == 0) await _inPatientService.getInPatientList(requestModel, false); if (_inPatientService.hasError) { - error = _inPatientService.error; + error = _inPatientService.error!; setState(ViewState.Error); } else { // setDefaultInPatientList(); @@ -176,9 +155,9 @@ class PatientSearchViewModel extends BaseViewModel { if (strExist) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { - String firstName = inPatientList[i].firstName.toUpperCase(); - String lastName = inPatientList[i].lastName.toUpperCase(); - String mobile = inPatientList[i].mobileNumber.toUpperCase(); + String firstName = inPatientList[i].firstName!.toUpperCase(); + String lastName = inPatientList[i].lastName!.toUpperCase(); + String mobile = inPatientList[i].mobileNumber!.toUpperCase(); String patientID = inPatientList[i].patientId.toString(); if (firstName.contains(query.toUpperCase()) || diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 8b789cbc..9c3bf75a 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -37,80 +37,67 @@ class SOAPViewModel extends BaseViewModel { List get allergiesList => _SOAPService.allergiesList; - List get allergySeverityList => - _SOAPService.allergySeverityList; + List get allergySeverityList => _SOAPService.allergySeverityList; List get historyFamilyList => _SOAPService.historyFamilyList; - List get historyMedicalList => - _SOAPService.historyMedicalList; + List get historyMedicalList => _SOAPService.historyMedicalList; List get historySportList => _SOAPService.historySportList; List get historySocialList => _SOAPService.historySocialList; - List get historySurgicalList => - _SOAPService.historySurgicalList; + List get historySurgicalList => _SOAPService.historySurgicalList; - List get mergeHistorySurgicalWithHistorySportList => - [...historySurgicalList, ...historySportList]; + List get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList, ...historySportList]; - List get physicalExaminationList => - _SOAPService.physicalExaminationList; + List get physicalExaminationList => _SOAPService.physicalExaminationList; - List get listOfDiagnosisType => - _SOAPService.listOfDiagnosisType; + List get listOfDiagnosisType => _SOAPService.listOfDiagnosisType; - List get listOfDiagnosisCondition => - _SOAPService.listOfDiagnosisCondition; + List get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition; List get listOfICD10 => _SOAPService.listOfICD10; - List get patientChiefComplaintList => - _SOAPService.patientChiefComplaintList; + List get patientChiefComplaintList => _SOAPService.patientChiefComplaintList; - List get patientAllergiesList => - _SOAPService.patientAllergiesList; + List get patientAllergiesList => _SOAPService.patientAllergiesList; - List get patientHistoryList => - _SOAPService.patientHistoryList; + List get patientHistoryList => _SOAPService.patientHistoryList; - List get patientPhysicalExamList => - _SOAPService.patientPhysicalExamList; + List get patientPhysicalExamList => _SOAPService.patientPhysicalExamList; - List get patientProgressNoteList => - _SOAPService.patientProgressNoteList; + List get patientProgressNoteList => _SOAPService.patientProgressNoteList; - List get patientAssessmentList => - _SOAPService.patientAssessmentList; - int get episodeID => _SOAPService.episodeID; + List get patientAssessmentList => _SOAPService.patientAssessmentList; + int? get episodeID => _SOAPService.episodeID; get medicationStrengthList => _SOAPService.medicationStrengthListWithModel; get medicationDoseTimeList => _SOAPService.medicationDoseTimeListWithModel; get medicationRouteList => _SOAPService.medicationRouteListWithModel; get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel; - List get allMedicationList => - _prescriptionService.allMedicationList; + List get allMedicationList => _prescriptionService.allMedicationList; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); await _SOAPService.getAllergies(getAllergiesRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getMasterLookup(MasterKeysService masterKeys, - {bool isBusyLocal = false}) async { + Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false}) async { if (isBusyLocal) { setState(ViewState.Busy); } else setState(ViewState.Busy); await _SOAPService.getMasterLookup(masterKeys); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); @@ -120,7 +107,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.postEpisode(postEpisodeReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -130,62 +118,63 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.postAllergy(postAllergyRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postHistories( - PostHistoriesRequestModel postHistoriesRequestModel) async { + Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postHistories(postHistoriesRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postChiefComplaint( - PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { + Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postPhysicalExam( - PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { + Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postProgressNote( - PostProgressNoteRequestModel postProgressNoteRequestModel) async { + Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postProgressNote(postProgressNoteRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postAssessment( - PostAssessmentRequestModel postAssessmentRequestModel) async { + Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postAssessment(postAssessmentRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -195,76 +184,77 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.patchAllergy(patchAllergyRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future patchHistories( - PostHistoriesRequestModel patchHistoriesRequestModel) async { + Future patchHistories(PostHistoriesRequestModel patchHistoriesRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchHistories(patchHistoriesRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future patchChiefComplaint( - PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { + Future patchChiefComplaint(PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchChiefComplaint(patchChiefComplaintRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future patchPhysicalExam( - PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { + Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future patchProgressNote( - PostProgressNoteRequestModel patchProgressNoteRequestModel) async { + Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchProgressNote(patchProgressNoteRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future patchAssessment( - PatchAssessmentReqModel patchAssessmentRequestModel) async { + Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchAssessment(patchAssessmentRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, - {isLocalBusy = false}) async { + Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, {isLocalBusy = false}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else setState(ViewState.Busy); await _SOAPService.getPatientAllergy(generalGetReqForSOAP); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + if (isLocalBusy) { setState(ViewState.ErrorLocal); } else @@ -276,69 +266,64 @@ class SOAPViewModel extends BaseViewModel { String getAllergicNames(isArabic) { String allergiesString = ''; patientAllergiesList.forEach((element) { - MasterKeyModel selectedAllergy = getOneMasterKey( - masterKeys: MasterKeysService.Allergies, - id: element.allergyDiseaseId, - typeId: element.allergyDiseaseType); - if (selectedAllergy != null && element.isChecked) - allergiesString += - (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + - ' , '; + MasterKeyModel? selectedAllergy = getOneMasterKey( + masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); + if (selectedAllergy != null && element.isChecked!) + allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , '; }); return allergiesString; } - Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, - {bool isFirst = false}) async { + Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { setState(ViewState.Busy); - await _SOAPService.getPatientHistories(getHistoryReqModel, - isFirst: isFirst); + await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: isFirst); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientChiefComplaint( - GetChiefComplaintReqModel getChiefComplaintReqModel) async { + Future getPatientChiefComplaint(GetChiefComplaintReqModel getChiefComplaintReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientPhysicalExam( - GetPhysicalExamReqModel getPhysicalExamReqModel) async { + Future getPatientPhysicalExam(GetPhysicalExamReqModel getPhysicalExamReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientProgressNote( - GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { + Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientAssessment( - GetAssessmentReqModel getAssessmentReqModel) async { + Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientAssessment(getAssessmentReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); @@ -348,20 +333,18 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMedicationList(); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } // ignore: missing_return - MasterKeyModel getOneMasterKey( - {@required MasterKeysService masterKeys, dynamic id, int typeId}) { + MasterKeyModel? getOneMasterKey({@required MasterKeysService? masterKeys, dynamic id, int? typeId}) { switch (masterKeys) { case MasterKeysService.Allergies: List result = allergiesList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -370,8 +353,7 @@ class SOAPViewModel extends BaseViewModel { case MasterKeysService.HistoryFamily: List result = historyFamilyList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -379,8 +361,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistoryMedical: List result = historyMedicalList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -388,8 +369,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySocial: List result = historySocialList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -397,8 +377,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySports: List result = historySocialList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -414,8 +393,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.PhysicalExamination: List result = physicalExaminationList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -423,8 +401,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.AllergySeverity: List result = allergySeverityList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -439,8 +416,7 @@ class SOAPViewModel extends BaseViewModel { case MasterKeysService.DiagnosisType: List result = listOfDiagnosisType.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -448,8 +424,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.DiagnosisCondition: List result = listOfDiagnosisCondition.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index c547b150..bf7a20ec 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -47,20 +47,17 @@ class AuthenticationViewModel extends BaseViewModel { List get doctorProfilesList => _authService.doctorProfilesList; - SendActivationCodeForDoctorAppResponseModel - get activationCodeVerificationScreenRes => + SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _authService.activationCodeVerificationScreenRes; - SendActivationCodeForDoctorAppResponseModel - get activationCodeForDoctorAppRes => + SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _authService.activationCodeForDoctorAppRes; - CheckActivationCodeForDoctorAppResponseModel - get checkActivationCodeForDoctorAppRes => + CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; late NewLoginInformationModel loggedUser; - late GetIMEIDetailsModel ? user; + late GetIMEIDetailsModel? user; UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); @@ -101,8 +98,7 @@ class AuthenticationViewModel extends BaseViewModel { profileInfo['IMEI'] = DEVICE_TOKEN; profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; - profileInfo['MobileNo'] = - loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; + profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; @@ -110,13 +106,11 @@ class AuthenticationViewModel extends BaseViewModel { insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); - insertIMEIDetailsModel.doctorID = loggedIn != null - ? loggedIn['List_MemberInformation'][0]['MemberID'] - : user.doctorID; + insertIMEIDetailsModel.doctorID = + loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID; insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - insertIMEIDetailsModel.vidaRefreshTokenID = - await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = await sharedPref.getString(PASSWORD); await _authService.insertDeviceImei(insertIMEIDetailsModel); @@ -127,7 +121,6 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.Idle); } - /// first step login Future login(UserModel userInfo) async { setState(ViewState.BusyLocal); @@ -136,7 +129,7 @@ class AuthenticationViewModel extends BaseViewModel { error = _authService.error!; setState(ViewState.ErrorLocal); } else { - sharedPref.setInt(PROJECT_ID, userInfo.projectID); + sharedPref.setInt(PROJECT_ID, userInfo.projectID!); loggedUser = loginInfo; saveObjToString(LOGGED_IN_USER, loginInfo); sharedPref.remove(LAST_LOGIN_USER); @@ -146,10 +139,9 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for for msg methods - Future sendActivationCodeVerificationScreen( AuthMethodTypes authMethodType) async { + Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { setState(ViewState.BusyLocal); - ActivationCodeForVerificationScreenModel activationCodeModel = - ActivationCodeForVerificationScreenModel( + ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( iMEI: user!.iMEI, facilityId: user!.projectID, memberID: user!.doctorID, @@ -168,7 +160,7 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for silent login - Future sendActivationCodeForDoctorApp({required AuthMethodTypes authMethodType, required String password }) async { + Future sendActivationCodeForDoctorApp({required AuthMethodTypes authMethodType, required String password}) async { setState(ViewState.BusyLocal); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( @@ -186,19 +178,13 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.Idle); } - /// check activation code for sms and whats app Future checkActivationCodeForDoctorApp({required String activationCode}) async { setState(ViewState.BusyLocal); - CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = - new CheckActivationCodeRequestModel( - zipCode: - loggedUser != null ? loggedUser.zipCode :user!.zipCode, - mobileNumber: - loggedUser != null ? loggedUser.mobileNumber : user!.mobile, - projectID: await sharedPref.getInt(PROJECT_ID) != null - ? await sharedPref.getInt(PROJECT_ID) - : user!.projectID, + CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( + zipCode: loggedUser != null ? loggedUser.zipCode : user!.zipCode, + mobileNumber: loggedUser != null ? loggedUser.mobileNumber : user!.mobile, + projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID, logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), activationCode: activationCode ?? '0000', oTPSendType: await sharedPref.getInt(OTP_TYPE), @@ -214,7 +200,7 @@ class AuthenticationViewModel extends BaseViewModel { /// get list of Hospitals Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel =GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel = GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { @@ -224,24 +210,17 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.Idle); } - /// get type name based on id. getType(type, context) { switch (type) { case 1: - return TranslationBase - .of(context) - .verifySMS; + return TranslationBase.of(context).verifySMS; break; case 3: - return TranslationBase - .of(context) - .verifyFingerprint; + return TranslationBase.of(context).verifyFingerprint; break; case 4: - return TranslationBase - .of(context) - .verifyFaceID; + return TranslationBase.of(context).verifyFaceID; break; case 2: return TranslationBase.of(context).verifyWhatsApp; @@ -253,15 +232,12 @@ class AuthenticationViewModel extends BaseViewModel { } /// add  token to shared preferences in case of send activation code is success - setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { - print("VerificationCode : " + - sendActivationCodeForDoctorAppResponseModel.verificationCode!); - sharedPref.setString(VIDA_AUTH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); - sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); - sharedPref.setString(LOGIN_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.logInTokenID!); + setDataAfterSendActivationSuccess( + SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { + print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode!); + sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); + sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); + sharedPref.setString(LOGIN_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.logInTokenID!); } saveObjToString(String key, value) async { @@ -300,7 +276,7 @@ class AuthenticationViewModel extends BaseViewModel { license: true, projectID: clinicInfo.projectID, tokenID: '', - languageID: 2);//TODO change the lan + languageID: 2); //TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { error = _authService.error!; @@ -313,27 +289,19 @@ class AuthenticationViewModel extends BaseViewModel { /// add some logic in case of check activation code is success onCheckActivationCodeSuccess() async { - sharedPref.setString( - TOKEN, - checkActivationCodeForDoctorAppRes.authenticationTokenID!); + sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!); if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && - checkActivationCodeForDoctorAppRes.listDoctorProfile! - .isNotEmpty) { - localSetDoctorProfile( - checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); + checkActivationCodeForDoctorAppRes.listDoctorProfile!.isNotEmpty) { + localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); } else { - sharedPref.setObj( - CLINIC_NAME, - checkActivationCodeForDoctorAppRes.listDoctorsClinic); - ClinicModel clinic = ClinicModel.fromJson( - checkActivationCodeForDoctorAppRes.listDoctorsClinic![0] - .toJson()); + sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); + ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic![0].toJson()); await getDoctorProfileBasedOnClinic(clinic); } } /// check specific biometric if it available or not - Future checkIfBiometricAvailable(BiometricType biometricType) async { + Future checkIfBiometricAvailable(BiometricType biometricType) async { bool isAvailable = false; await _getAvailableBiometrics(); for (var i = 0; i < _availableBiometrics.length; i++) { @@ -355,13 +323,13 @@ class AuthenticationViewModel extends BaseViewModel { getDeviceInfoFromFirebase() async { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - await _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); + await _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); } try { setState(ViewState.Busy); } catch (e) { - Helpers.showErrorToast("fdfdfdfdf"+e.toString()); + Helpers.showErrorToast("fdfdfdfdf" + e.toString()); } var token = await _firebaseMessaging.getToken(); if (DEVICE_TOKEN == "") { @@ -373,9 +341,8 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else { if (_authService.dashboardItemsList.length > 0) { - user =_authService.dashboardItemsList[0]; - sharedPref.setObj( - LAST_LOGIN_USER, _authService.dashboardItemsList[0]); + user = _authService.dashboardItemsList[0]; + sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]); this.unverified = true; } setState(ViewState.Idle); @@ -390,9 +357,9 @@ class AuthenticationViewModel extends BaseViewModel { if (state == ViewState.Busy) { app_status = APP_STATUS.LOADING; } else { - if(this.doctorProfile !=null) + if (this.doctorProfile != null) app_status = APP_STATUS.AUTHENTICATED; - else if (this.unverified) { + else if (this.unverified) { app_status = APP_STATUS.UNVERIFIED; } else if (this.isLogin) { app_status = APP_STATUS.AUTHENTICATED; @@ -402,12 +369,13 @@ class AuthenticationViewModel extends BaseViewModel { } return app_status; } - setAppStatus(APP_STATUS status){ + + setAppStatus(APP_STATUS status) { this.app_status = status; notifyListeners(); } - setUnverified(bool unverified,{bool isFromLogin = false}){ + setUnverified(bool unverified, {bool isFromLogin = false}) { this.unverified = unverified; this.isFromLogin = isFromLogin; notifyListeners(); @@ -415,24 +383,21 @@ class AuthenticationViewModel extends BaseViewModel { /// logout function logout({bool isFromLogin = false}) async { - - - DEVICE_TOKEN = ""; - String lang = await sharedPref.getString(APP_Language); - await Helpers.clearSharedPref(); - doctorProfile = null; - sharedPref.setString(APP_Language, lang); - deleteUser(); - await getDeviceInfoFromFirebase(); - this.isFromLogin = isFromLogin; - app_status = APP_STATUS.UNAUTHENTICATED; - setState(ViewState.Idle); + DEVICE_TOKEN = ""; + String lang = await sharedPref.getString(APP_Language); + await Helpers.clearSharedPref(); + doctorProfile = null; + sharedPref.setString(APP_Language, lang); + deleteUser(); + await getDeviceInfoFromFirebase(); + this.isFromLogin = isFromLogin; + app_status = APP_STATUS.UNAUTHENTICATED; + setState(ViewState.Idle); } - deleteUser(){ + deleteUser() { user = null; unverified = false; isLogin = false; } - } diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 706b828e..8fe5a88c 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -15,23 +15,20 @@ class DashboardViewModel extends BaseViewModel { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; DashboardService _dashboardService = locator(); - List get dashboardItemsList => - _dashboardService.dashboardItemsList; + List get dashboardItemsList => _dashboardService.dashboardItemsList; bool get hasVirtualClinic => _dashboardService.hasVirtualClinic; String? get sServiceID => _dashboardService.sServiceID; - Future setFirebaseNotification(ProjectViewModel projectsProvider, - AuthenticationViewModel authProvider) async { + Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { setState(ViewState.Busy); await projectsProvider.getDoctorClinicsList(); // _firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); - - _firebaseMessaging.getToken().then((String ?token) async { + _firebaseMessaging.getToken().then((String? token) async { if (token != '') { DEVICE_TOKEN = token!; authProvider.insertDeviceImei(); @@ -59,8 +56,7 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future changeClinic( - int clinicId, AuthenticationViewModel authProvider) async { + Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async { setState(ViewState.BusyLocal); await getDoctorProfile(); ClinicModel clinicModel = ClinicModel( @@ -76,7 +72,7 @@ class DashboardViewModel extends BaseViewModel { getPatientCount(DashboardModel inPatientCount) { int value = 0; - inPatientCount.summaryoptions.forEach((result) => {value += result.value}); + inPatientCount.summaryoptions!.forEach((result) => {value += result.value!}); return value.toString(); } diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 8fa484ea..f95702a5 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -105,9 +105,9 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getMedicationList({required String drug}) async { + Future getMedicationList({String? drug}) async { setState(ViewState.Busy); - await _prescriptionService.getMedicationList(drug: drug); + await _prescriptionService.getMedicationList(drug: drug!); if (_prescriptionService.hasError) { error = _prescriptionService.error!; setState(ViewState.Error); @@ -185,7 +185,8 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getBoxQuantity({required int itemCode, required int duration, required double strength, required int freq}) async { + Future getBoxQuantity( + {required int itemCode, required int duration, required double strength, required int freq}) async { setState(ViewState.Busy); await _prescriptionService.calculateBoxQuantity( strength: strength, itemCode: itemCode, duration: duration, freq: freq); diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index f93b057e..6e67aea3 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -18,16 +18,13 @@ import 'package:flutter/cupertino.dart'; import '../../locator.dart'; class PatientReferralViewModel extends BaseViewModel { - PatientReferralService _referralPatientService = - locator(); + PatientReferralService _referralPatientService = locator(); ReferralService _referralService = locator(); - MyReferralInPatientService _myReferralService = - locator(); + MyReferralInPatientService _myReferralService = locator(); - DischargedPatientService _dischargedPatientService = - locator(); + DischargedPatientService _dischargedPatientService = locator(); List get myDischargeReferralPatient => _dischargedPatientService.myDischargeReferralPatients; @@ -35,28 +32,21 @@ class PatientReferralViewModel extends BaseViewModel { List get clinicsList => _referralPatientService.clinicsList; - List get referralFrequencyList => - _referralPatientService.frequencyList; + List get referralFrequencyList => _referralPatientService.frequencyList; List doctorsList = []; - List get clinicDoctorsList => - _referralPatientService.doctorsList; + List get clinicDoctorsList => _referralPatientService.doctorsList; - List get myReferralPatients => - _myReferralService.myReferralPatients; + List get myReferralPatients => _myReferralService.myReferralPatients; - List get listMyReferredPatientModel => - _referralPatientService.listMyReferredPatientModel; + List get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel; - List get pendingReferral => - _referralPatientService.pendingReferralList; + List get pendingReferral => _referralPatientService.pendingReferralList; - List get patientReferral => - _referralPatientService.patientReferralList; + List get patientReferral => _referralPatientService.patientReferralList; - List get patientArrivalList => - _referralPatientService.patientArrivalList; + List get patientArrivalList => _referralPatientService.patientArrivalList; Future getPatientReferral(PatiantInformtion patient) async { setState(ViewState.Busy); @@ -105,8 +95,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getClinicDoctors( - PatiantInformtion patient, int clinicId, int branchId) async { + Future getClinicDoctors(PatiantInformtion patient, int clinicId, int branchId) async { setState(ViewState.BusyLocal); await _referralPatientService.getDoctorsList(patient, clinicId, branchId); if (_referralPatientService.hasError) { @@ -124,10 +113,7 @@ class PatientReferralViewModel extends BaseViewModel { Future getDoctorBranch() async { DoctorProfileModel? doctorProfile = await getDoctorProfile(); if (doctorProfile != null) { - dynamic _selectedBranch = { - "facilityId": doctorProfile.projectID, - "facilityName": doctorProfile.projectName - }; + dynamic _selectedBranch = {"facilityId": doctorProfile.projectID, "facilityName": doctorProfile.projectName}; return _selectedBranch; } return null; @@ -167,8 +153,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future replay( - String referredDoctorRemarks, MyReferralPatientModel referral) async { + Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async { setState(ViewState.Busy); await _myReferralService.replay(referredDoctorRemarks, referral); if (_myReferralService.hasError) { @@ -178,8 +163,7 @@ class PatientReferralViewModel extends BaseViewModel { getMyReferralPatientService(); } - Future responseReferral( - PendingReferral pendingReferral, bool isAccepted) async { + Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { setState(ViewState.Busy); await _referralPatientService.responseReferral(pendingReferral, isAccepted); if (_referralPatientService.hasError) { @@ -189,11 +173,10 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future makeReferral(PatiantInformtion patient, String isoStringDate, - int projectID, int clinicID, int doctorID, String remarks) async { + Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID, + String remarks) async { setState(ViewState.Busy); - await _referralPatientService.makeReferral( - patient, isoStringDate, projectID, clinicID, doctorID, remarks); + await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks); if (_referralPatientService.hasError) { error = _referralPatientService.error!; setState(ViewState.Error); @@ -233,12 +216,10 @@ class PatientReferralViewModel extends BaseViewModel { } } - Future getPatientDetails( - String fromDate, String toDate, int patientMrn, int appointmentNo) async { + Future getPatientDetails(String fromDate, String toDate, int patientMrn, int appointmentNo) async { setState(ViewState.Busy); - await _referralPatientService.getPatientArrivalList(toDate, - fromDate: fromDate, patientMrn: patientMrn); + await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn); if (_referralPatientService.hasError) { error = _referralPatientService.error!; setState(ViewState.Error); @@ -257,8 +238,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future verifyReferralDoctorRemarks( - MyReferredPatientModel referredPatient) async { + Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async { setState(ViewState.Busy); await _referralPatientService.verifyReferralDoctorRemarks(referredPatient); if (_referralPatientService.hasError) { @@ -283,22 +263,21 @@ class PatientReferralViewModel extends BaseViewModel { String getReferralStatusNameByCode(int statusCode, BuildContext context) { switch (statusCode) { case 1: - return TranslationBase.of(context).pending /*referralStatusHold*/; + return TranslationBase.of(context).pending ?? "" /*referralStatusHold*/; case 2: - return TranslationBase.of(context).accepted /*referralStatusActive*/; + return TranslationBase.of(context).accepted ?? "" /*referralStatusActive*/; case 4: - return TranslationBase.of(context).rejected /*referralStatusCancelled*/; + return TranslationBase.of(context).rejected ?? "" /*referralStatusCancelled*/; case 46: - return TranslationBase.of(context).accepted /*referralStatusCompleted*/; + return TranslationBase.of(context).accepted ?? "" /*referralStatusCompleted*/; case 63: - return TranslationBase.of(context).rejected /*referralStatusNotSeen*/; + return TranslationBase.of(context).rejected ?? "" /*referralStatusNotSeen*/; default: return "-"; } } - PatiantInformtion getPatientFromReferral( - MyReferredPatientModel referredPatient) { + PatiantInformtion getPatientFromReferral(MyReferredPatientModel referredPatient) { PatiantInformtion patient = PatiantInformtion(); patient.doctorId = referredPatient.doctorID; patient.doctorName = referredPatient.doctorName; @@ -323,8 +302,7 @@ class PatientReferralViewModel extends BaseViewModel { return patient; } - PatiantInformtion getPatientFromReferralO( - MyReferralPatientModel referredPatient) { + PatiantInformtion getPatientFromReferralO(MyReferralPatientModel referredPatient) { PatiantInformtion patient = PatiantInformtion(); patient.doctorId = referredPatient.doctorID!; patient.doctorName = referredPatient.doctorName!; @@ -349,8 +327,7 @@ class PatientReferralViewModel extends BaseViewModel { return patient; } - PatiantInformtion getPatientFromDischargeReferralPatient( - DischargeReferralPatient referredPatient) { + PatiantInformtion getPatientFromDischargeReferralPatient(DischargeReferralPatient referredPatient) { PatiantInformtion patient = PatiantInformtion(); patient.doctorId = referredPatient.doctorID!; patient.doctorName = referredPatient.doctorName!; @@ -369,8 +346,7 @@ class PatientReferralViewModel extends BaseViewModel { patient.roomId = referredPatient.roomID!; patient.bedId = referredPatient.bedID!; patient.nationalityName = referredPatient.nationalityName!; - patient.nationalityFlagURL = - ''; // TODO from backend referredPatient.nationalityFlagURL; + patient.nationalityFlagURL = ''; // TODO from backend referredPatient.nationalityFlagURL; patient.age = referredPatient.age; patient.clinicDescription = referredPatient.clinicDescription!; return patient; diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index b665a385..4c4d6e56 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -18,21 +18,17 @@ import '../../locator.dart'; class UcafViewModel extends BaseViewModel { UcafService _ucafService = locator(); - List get patientChiefComplaintList => - _ucafService.patientChiefComplaintList; + List get patientChiefComplaintList => _ucafService.patientChiefComplaintList; - List get patientVitalSignsHistory => - _ucafService.patientVitalSignsHistory; + List get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory; - List get patientAssessmentList => - _ucafService.patientAssessmentList; + List get patientAssessmentList => _ucafService.patientAssessmentList; List get diagnosisTypes => _ucafService.listOfDiagnosisType; - List get diagnosisConditions => - _ucafService.listOfDiagnosisCondition; + List get diagnosisConditions => _ucafService.listOfDiagnosisCondition; - PrescriptionModel get prescriptionList => _ucafService.prescriptionList; + PrescriptionModel? get prescriptionList => _ucafService.prescriptionList; List get orderProcedures => _ucafService.orderProcedureList; @@ -61,11 +57,9 @@ class UcafViewModel extends BaseViewModel { String from; String to; - from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); - - - to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); // await _ucafService.getPatientVitalSignsHistory(patient, from, to); await _ucafService.getInPatientVitalSignHistory(patient, false); @@ -85,22 +79,16 @@ class UcafViewModel extends BaseViewModel { if (bodyMax == "0" || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } - if (temperatureCelcius == "0" || - temperatureCelcius == 'null') { + if (temperatureCelcius == "0" || temperatureCelcius == 'null') { temperatureCelcius = element.temperatureCelcius.toString(); } if (hartRat == "0" || hartRat == null || hartRat == 'null') { hartRat = element.pulseBeatPerMinute.toString(); } - if (respirationBeatPerMinute == "0" || - respirationBeatPerMinute == null || - respirationBeatPerMinute == 'null') { - respirationBeatPerMinute = - element.respirationBeatPerMinute.toString(); + if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') { + respirationBeatPerMinute = element.respirationBeatPerMinute.toString(); } - if (bloodPressure == "0 / 0" || - bloodPressure == null || - bloodPressure == 'null') { + if (bloodPressure == "0 / 0" || bloodPressure == null || bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } }); @@ -119,8 +107,7 @@ class UcafViewModel extends BaseViewModel { } else { if (patientAssessmentList.isNotEmpty) { if (diagnosisConditions.length == 0) { - await _ucafService - .getMasterLookup(MasterKeysService.DiagnosisCondition); + await _ucafService.getMasterLookup(MasterKeysService.DiagnosisCondition); } if (diagnosisTypes.length == 0) { await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType); @@ -162,13 +149,11 @@ class UcafViewModel extends BaseViewModel { } } - MasterKeyModel ? findMasterDataById( - {required MasterKeysService masterKeys, dynamic id}) { + MasterKeyModel? findMasterDataById({required MasterKeysService masterKeys, dynamic id}) { switch (masterKeys) { case MasterKeysService.DiagnosisCondition: List result = diagnosisConditions.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -176,8 +161,7 @@ class UcafViewModel extends BaseViewModel { return null; case MasterKeysService.DiagnosisType: List result = diagnosisTypes.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -192,7 +176,7 @@ class UcafViewModel extends BaseViewModel { setState(ViewState.Busy); await _ucafService.postUCAF(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); // but with empty list diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 4f22d9e3..83148044 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -11,10 +11,9 @@ import '../../locator.dart'; class VitalSignsViewModel extends BaseViewModel { VitalSignsService _vitalSignService = locator(); - VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; + VitalSignData? get patientVitalSigns => _vitalSignService.patientVitalSigns; - List get patientVitalSignsHistory => - _vitalSignService.patientVitalSignsHistory; + List get patientVitalSignsHistory => _vitalSignService.patientVitalSignsHistory; String heightCm = "0"; String weightKg = "0"; @@ -42,8 +41,7 @@ class VitalSignsViewModel extends BaseViewModel { } } - Future getPatientVitalSignHistory(PatiantInformtion patient, String from, - String to, bool isInPatient) async { + Future getPatientVitalSignHistory(PatiantInformtion patient, String from, String to, bool isInPatient) async { setState(ViewState.Busy); if (from == null || from == "0") { from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); @@ -72,50 +70,29 @@ class VitalSignsViewModel extends BaseViewModel { if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } - if (temperatureCelcius == "0" || - temperatureCelcius == null || - temperatureCelcius == 'null') { + if (temperatureCelcius == "0" || temperatureCelcius == null || temperatureCelcius == 'null') { temperatureCelcius = element.temperatureCelcius.toString(); } if (hartRat == "0" || hartRat == null || hartRat == 'null') { hartRat = element.pulseBeatPerMinute.toString(); } - if (respirationBeatPerMinute == "0" || - respirationBeatPerMinute == null || - respirationBeatPerMinute == 'null') { - respirationBeatPerMinute = - element.respirationBeatPerMinute.toString(); + if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') { + respirationBeatPerMinute = element.respirationBeatPerMinute.toString(); } - if (bloodPressure == "0 / 0" || - bloodPressure == null || - bloodPressure == 'null') { + if (bloodPressure == "0 / 0" || bloodPressure == null || bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } - if (oxygenation == "0" || - oxygenation == null || - oxygenation == 'null') { - oxygenation = - "${element.sAO2.toString()}"; /* - ${element.fIO2.toString()}*/ + if (oxygenation == "0" || oxygenation == null || oxygenation == 'null') { + oxygenation = "${element.sAO2.toString()}"; /* - ${element.fIO2.toString()}*/ } if (painScore == null || painScore == "-") { - painScore = element.painScoreDesc.toString() != 'null' - ? element.painScoreDesc.toString() - : "-"; - painLocation = element.painLocation.toString() != 'null' - ? element.painLocation.toString() - : "-"; - painCharacter = element.painCharacter.toString() != 'null' - ? element.painCharacter.toString() - : "-"; - painDuration = element.painDuration.toString() != 'null' - ? element.painDuration.toString() - : "-"; - isPainDone = element.isPainManagementDone.toString() != 'null' - ? element.isPainManagementDone.toString() - : "-"; - painFrequency = element.painFrequency.toString() != 'null' - ? element.painFrequency.toString() - : "-"; + painScore = element.painScoreDesc.toString() != 'null' ? element.painScoreDesc.toString() : "-"; + painLocation = element.painLocation.toString() != 'null' ? element.painLocation.toString() : "-"; + painCharacter = element.painCharacter.toString() != 'null' ? element.painCharacter.toString() : "-"; + painDuration = element.painDuration.toString() != 'null' ? element.painDuration.toString() : "-"; + isPainDone = + element.isPainManagementDone.toString() != 'null' ? element.isPainManagementDone.toString() : "-"; + painFrequency = element.painFrequency.toString() != 'null' ? element.painFrequency.toString() : "-"; } }); setState(ViewState.Idle); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 902268da..349da950 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -26,11 +26,9 @@ class PrescriptionViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; bool hasError = false; PrescriptionService _prescriptionService = locator(); - List get allMedicationList => - _prescriptionService.allMedicationList; + List get allMedicationList => _prescriptionService.allMedicationList; - List get prescriptionList => - _prescriptionService.prescriptionList; + List get prescriptionList => _prescriptionService.prescriptionList; List get drugsList => _prescriptionService.doctorsList; //List get allMedicationList => _prescriptionService.allMedicationList; List get drugToDrug => _prescriptionService.drugToDrugList; @@ -38,33 +36,25 @@ class PrescriptionViewModel extends BaseViewModel { List get itemMedicineList => _prescriptionService.itemMedicineList; PrescriptionsService _prescriptionsService = locator(); - List _prescriptionsOrderListClinic = List(); - List _prescriptionsOrderListHospital = List(); + List _prescriptionsOrderListClinic = []; + List _prescriptionsOrderListHospital = []; - List get prescriptionReportList => - _prescriptionsService.prescriptionReportList; + List get prescriptionReportList => _prescriptionsService.prescriptionReportList; - List get prescriptionsList => - _prescriptionsService.prescriptionsList; + List get prescriptionsList => _prescriptionsService.prescriptionsList; - List get pharmacyPrescriptionsList => - _prescriptionsService.pharmacyPrescriptionsList; - List get prescriptionReportEnhList => - _prescriptionsService.prescriptionReportEnhList; + List get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList; + List get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList; List get prescriptionsOrderList => - filterType == FilterType.Clinic - ? _prescriptionsOrderListClinic - : _prescriptionsOrderListHospital; + filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital; - List get inPatientPrescription => - _prescriptionsService.prescriptionInPatientList; + List get inPatientPrescription => _prescriptionsService.prescriptionInPatientList; getPrescriptionsInPatient(PatiantInformtion patient) async { setState(ViewState.Busy); error = ""; - await _prescriptionsService.getPrescriptionInPatient( - mrn: patient.patientId, adn: patient.admissionNo); + await _prescriptionsService.getPrescriptionInPatient(mrn: patient.patientId, adn: patient.admissionNo); if (_prescriptionsService.hasError) { error = "No Prescription Found"; setState(ViewState.Error); @@ -76,38 +66,37 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getItem({int itemID}) async { + Future getItem({int? itemID}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getPrescription({int mrn}) async { + Future getPrescription({int? mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.getPrescription(mrn: mrn); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postPrescription( - PostPrescriptionReqModel postProcedureReqModel, int mrn) async { + Future postPrescription(PostPrescriptionReqModel postProcedureReqModel, int mrn) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.postPrescription(postProcedureReqModel); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else { await getPrescription(mrn: mrn); @@ -115,24 +104,23 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getMedicationList({String drug}) async { + Future getMedicationList({String? drug}) async { setState(ViewState.Busy); - await _prescriptionService.getMedicationList(drug: drug); + await _prescriptionService.getMedicationList(drug: drug!); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future updatePrescription( - PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async { + Future updatePrescription(PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.updatePrescription(updatePrescriptionReqModel); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else { await getPrescription(mrn: mrn); @@ -140,30 +128,25 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getDrugs({String drugName}) async { + Future getDrugs({String? drugName}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); await _prescriptionService.getDrugs(drugName: drugName); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getDrugToDrug( - VitalSignData vital, - List lstAssessments, - List allergy, - PatiantInformtion patient, - List prescription) async { + Future getDrugToDrug(VitalSignData vital, List lstAssessments, + List allergy, PatiantInformtion patient, List prescription) async { hasError = false; setState(ViewState.Busy); - await _prescriptionService.getDrugToDrug( - vital, lstAssessments, allergy, patient, prescription); + await _prescriptionService.getDrugToDrug(vital, lstAssessments, allergy, patient, prescription); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -174,27 +157,22 @@ class PrescriptionViewModel extends BaseViewModel { notifyListeners(); } - getPrescriptionReport( - {Prescriptions prescriptions, - @required PatiantInformtion patient}) async { + getPrescriptionReport({Prescriptions? prescriptions, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport( - prescriptions: prescriptions, patient: patient); + await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getListPharmacyForPrescriptions( - {int itemId, @required PatiantInformtion patient}) async { + getListPharmacyForPrescriptions({int? itemId, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getListPharmacyForPrescriptions( - itemId: itemId, patient: patient); + await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -204,50 +182,41 @@ class PrescriptionViewModel extends BaseViewModel { void _filterList() { _prescriptionsService.prescriptionsList.forEach((element) { /// PrescriptionsList list sort clinic - List prescriptionsByClinic = - _prescriptionsOrderListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + List prescriptionsByClinic = _prescriptionsOrderListClinic + .where((elementClinic) => elementClinic.filterName == element.clinicDescription) + .toList(); if (prescriptionsByClinic.length != 0) { - _prescriptionsOrderListClinic[ - _prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] + _prescriptionsOrderListClinic[_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] .prescriptionsList .add(element); } else { - _prescriptionsOrderListClinic.add(PrescriptionsList( - filterName: element.clinicDescription, prescriptions: element)); + _prescriptionsOrderListClinic + .add(PrescriptionsList(filterName: element.clinicDescription, prescriptions: element)); } /// PrescriptionsList list sort via hospital - List prescriptionsByHospital = - _prescriptionsOrderListHospital - .where( - (elementClinic) => elementClinic.filterName == element.name, - ) - .toList(); + List prescriptionsByHospital = _prescriptionsOrderListHospital + .where( + (elementClinic) => elementClinic.filterName == element.name, + ) + .toList(); if (prescriptionsByHospital.length != 0) { - _prescriptionsOrderListHospital[_prescriptionsOrderListHospital - .indexOf(prescriptionsByHospital[0])] + _prescriptionsOrderListHospital[_prescriptionsOrderListHospital.indexOf(prescriptionsByHospital[0])] .prescriptionsList .add(element); } else { - _prescriptionsOrderListHospital.add(PrescriptionsList( - filterName: element.name, prescriptions: element)); + _prescriptionsOrderListHospital.add(PrescriptionsList(filterName: element.name, prescriptions: element)); } }); } - getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, - @required PatiantInformtion patient}) async { + getPrescriptionReportEnh({PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReportEnh( - prescriptionsOrder: prescriptionsOrder, patient: patient); + await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -257,18 +226,18 @@ class PrescriptionViewModel extends BaseViewModel { _getPrescriptionsOrders() async { await _prescriptionsService.getPrescriptionsOrders(); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getPrescriptions(PatiantInformtion patient, {String patientType}) async { + getPrescriptions(PatiantInformtion patient, {String? patientType}) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptions(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; if (patientType == "7") setState(ViewState.ErrorLocal); else diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart index b5916bac..d0718597 100644 --- a/lib/core/viewModel/prescriptions_view_model.dart +++ b/lib/core/viewModel/prescriptions_view_model.dart @@ -16,30 +16,24 @@ class PrescriptionsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; PrescriptionsService _prescriptionsService = locator(); - List _prescriptionsOrderListClinic = List(); - List _prescriptionsOrderListHospital = List(); + List _prescriptionsOrderListClinic = []; + List _prescriptionsOrderListHospital = []; - List get prescriptionReportList => - _prescriptionsService.prescriptionReportList; + List get prescriptionReportList => _prescriptionsService.prescriptionReportList; - List get prescriptionsList => - _prescriptionsService.prescriptionsList; + List get prescriptionsList => _prescriptionsService.prescriptionsList; - List get pharmacyPrescriptionsList => - _prescriptionsService.pharmacyPrescriptionsList; - List get prescriptionReportEnhList => - _prescriptionsService.prescriptionReportEnhList; + List get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList; + List get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList; List get prescriptionsOrderList => - filterType == FilterType.Clinic - ? _prescriptionsOrderListClinic - : _prescriptionsOrderListHospital; + filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital; getPrescriptions(PatiantInformtion patient) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptions(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { _filterList(); @@ -52,7 +46,7 @@ class PrescriptionsViewModel extends BaseViewModel { _getPrescriptionsOrders() async { await _prescriptionsService.getPrescriptionsOrders(); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -62,38 +56,32 @@ class PrescriptionsViewModel extends BaseViewModel { void _filterList() { _prescriptionsService.prescriptionsList.forEach((element) { /// PrescriptionsList list sort clinic - List prescriptionsByClinic = - _prescriptionsOrderListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + List prescriptionsByClinic = _prescriptionsOrderListClinic + .where((elementClinic) => elementClinic.filterName == element.clinicDescription) + .toList(); if (prescriptionsByClinic.length != 0) { - _prescriptionsOrderListClinic[ - _prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] + _prescriptionsOrderListClinic[_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] .prescriptionsList .add(element); } else { - _prescriptionsOrderListClinic.add(PrescriptionsList( - filterName: element.clinicDescription, prescriptions: element)); + _prescriptionsOrderListClinic + .add(PrescriptionsList(filterName: element.clinicDescription, prescriptions: element)); } /// PrescriptionsList list sort via hospital - List prescriptionsByHospital = - _prescriptionsOrderListHospital - .where( - (elementClinic) => elementClinic.filterName == element.name, - ) - .toList(); + List prescriptionsByHospital = _prescriptionsOrderListHospital + .where( + (elementClinic) => elementClinic.filterName == element.name, + ) + .toList(); if (prescriptionsByHospital.length != 0) { - _prescriptionsOrderListHospital[_prescriptionsOrderListHospital - .indexOf(prescriptionsByHospital[0])] + _prescriptionsOrderListHospital[_prescriptionsOrderListHospital.indexOf(prescriptionsByHospital[0])] .prescriptionsList .add(element); } else { - _prescriptionsOrderListHospital.add(PrescriptionsList( - filterName: element.name, prescriptions: element)); + _prescriptionsOrderListHospital.add(PrescriptionsList(filterName: element.name, prescriptions: element)); } }); } @@ -103,41 +91,33 @@ class PrescriptionsViewModel extends BaseViewModel { notifyListeners(); } - getPrescriptionReport( - {Prescriptions prescriptions, - @required PatiantInformtion patient}) async { + getPrescriptionReport({Prescriptions? prescriptions, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport( - prescriptions: prescriptions, patient: patient); + await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getListPharmacyForPrescriptions( - {int itemId, @required PatiantInformtion patient}) async { + getListPharmacyForPrescriptions({int? itemId, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getListPharmacyForPrescriptions( - itemId: itemId, patient: patient); + await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, - @required PatiantInformtion patient}) async { + getPrescriptionReportEnh({PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReportEnh( - prescriptionsOrder: prescriptionsOrder, patient: patient); + await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index cb3a2a7e..43758e65 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -37,8 +37,8 @@ class ProcedureViewModel extends BaseViewModel { List get categoryList => _procedureService.categoryList; RadiologyService _radiologyService = locator(); LabsService _labsService = locator(); - List _finalRadiologyListClinic = List(); - List _finalRadiologyListHospital = List(); + List _finalRadiologyListClinic = []; + List _finalRadiologyListHospital = []; List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; @@ -50,14 +50,14 @@ class ProcedureViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; List get procedureTemplate => _procedureService.templateList; - List templateList = List(); + List templateList = []; List get procedureTemplateDetails => _procedureService.templateDetailsList; - List _patientLabOrdersListClinic = List(); - List _patientLabOrdersListHospital = List(); + List _patientLabOrdersListClinic = []; + List _patientLabOrdersListHospital = []; - Future getProcedure({int mrn, String patientType}) async { + Future getProcedure({int? mrn, String? patientType}) async { hasError = false; await getDoctorProfile(); @@ -65,7 +65,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.getProcedure(mrn: mrn); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; if (patientType == "7") setState(ViewState.ErrorLocal); else @@ -74,13 +74,13 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureCategory({String categoryName, String categoryID, patientId}) async { + Future getProcedureCategory({String? categoryName, String? categoryID, patientId}) async { hasError = false; setState(ViewState.Busy); await _procedureService.getProcedureCategory( categoryName: categoryName, categoryID: categoryID, patientId: patientId); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -92,18 +92,18 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.getCategory(); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getProcedureTemplate({String categoryID}) async { + Future getProcedureTemplate({String? categoryID}) async { hasError = false; setState(ViewState.Busy); await _procedureService.getProcedureTemplate(categoryID: categoryID); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { setTemplateListDependOnId(); @@ -129,14 +129,14 @@ class ProcedureViewModel extends BaseViewModel { int tempId = 0; - Future getProcedureTemplateDetails({int templateId}) async { - tempId = templateId; + Future getProcedureTemplateDetails({int? templateId}) async { + tempId = templateId!; hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); await _procedureService.getProcedureTemplateDetails(templateId: templateId); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -148,7 +148,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.postProcedure(postProcedureReqModel); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { await getProcedure(mrn: mrn); @@ -162,31 +162,31 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.valadteProcedure(procedureValadteRequestModel); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn}) async { + Future updateProcedure({UpdateProcedureRequestModel? updateProcedureRequestModel, int? mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.updateProcedure(updateProcedureRequestModel); + await _procedureService.updateProcedure(updateProcedureRequestModel!); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); //await getProcedure(mrn: mrn); } - void getPatientRadOrders(PatiantInformtion patient, {String patientType, bool isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, {String? patientType, bool isInPatient = false}) async { setState(ViewState.Busy); await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); if (_radiologyService.hasError) { - error = _radiologyService.error; + error = _radiologyService.error!; if (patientType == "7") setState(ViewState.ErrorLocal); else @@ -228,12 +228,12 @@ class ProcedureViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { + getRadImageURL({int? invoiceNo, int? lineItem, int? projectId, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL( invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); if (_radiologyService.hasError) { - error = _radiologyService.error; + error = _radiologyService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -248,7 +248,7 @@ class ProcedureViewModel extends BaseViewModel { List get labResultList => _labsService.labResultList; - List labResultLists = List(); + List labResultLists = []; List get labResultListsCoustom { return labResultLists; @@ -258,7 +258,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _labsService.getPatientLabOrdersList(patient, isInpatient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -266,30 +266,30 @@ class ProcedureViewModel extends BaseViewModel { } getLaboratoryResult( - {String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async { + {String? projectID, int? clinicID, String? invoiceNo, String? orderNo, PatiantInformtion? patient}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult( invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async { + getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, String? procedure, PatiantInformtion? patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResults( patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { bool isShouldClear = false; if (_labsService.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) + if (element.resultValue!.contains('/') || element.resultValue!.contains('*') || element.resultValue!.isEmpty) isShouldClear = true; }); } @@ -298,10 +298,10 @@ class ProcedureViewModel extends BaseViewModel { } } - sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { + sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; } else DrAppToastMsg.showSuccesToast(mes); } diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index f464df0e..e8e5a4fe 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -17,7 +17,7 @@ Helpers helpers = Helpers(); class ProjectViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); - Locale _appLocale; + late Locale _appLocale; String currentLanguage = 'ar'; bool _isArabic = false; bool isInternetConnection = true; @@ -30,13 +30,11 @@ class ProjectViewModel with ChangeNotifier { Locale get appLocal => _appLocale; bool get isArabic => _isArabic; - StreamSubscription subscription; + late StreamSubscription subscription; ProjectViewModel() { loadSharedPrefLanguage(); - subscription = Connectivity() - .onConnectivityChanged - .listen((ConnectivityResult result) { + subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { switch (result) { case ConnectivityResult.wifi: isInternetConnection = true; @@ -94,8 +92,7 @@ class ProjectViewModel with ChangeNotifier { try { dynamic localRes; - await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, onSuccess: (dynamic response, int statusCode) { doctorClinicsList = []; response['List_DoctorsClinic'].forEach((v) { doctorClinicsList.add(new ClinicModel.fromJson(v)); @@ -115,7 +112,11 @@ class ProjectViewModel with ChangeNotifier { void getProfile() async { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - ClinicModel clinicModel = ClinicModel(doctorID:doctorProfile.doctorID,clinicID: doctorProfile.clinicID, projectID: doctorProfile.projectID,); + ClinicModel clinicModel = ClinicModel( + doctorID: doctorProfile.doctorID, + clinicID: doctorProfile.clinicID, + projectID: doctorProfile.projectID, + ); await Provider.of(AppGlobal.CONTEX, listen: false) .getDoctorProfileBasedOnClinic(clinicModel); diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index d656de6c..8fbbfc7c 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -12,57 +12,46 @@ class RadiologyViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; RadiologyService _radiologyService = locator(); - List _finalRadiologyListClinic = List(); - List _finalRadiologyListHospital = List(); + List _finalRadiologyListClinic = []; + List _finalRadiologyListHospital = []; List get finalRadiologyList => - filterType == FilterType.Clinic - ? _finalRadiologyListClinic - : _finalRadiologyListHospital; + filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; - void getPatientRadOrders(PatiantInformtion patient, - {isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient, - isInPatient: isInPatient); + await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); if (_radiologyService.hasError) { - error = _radiologyService.error; + error = _radiologyService.error!; setState(ViewState.Error); } else { _radiologyService.finalRadiologyList.forEach((element) { - List finalRadiologyListClinic = - _finalRadiologyListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + List finalRadiologyListClinic = _finalRadiologyListClinic + .where((elementClinic) => elementClinic.filterName == element.clinicDescription) + .toList(); if (finalRadiologyListClinic.length != 0) { - _finalRadiologyListClinic[ - finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] + _finalRadiologyListClinic[finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] .finalRadiologyList .add(element); } else { - _finalRadiologyListClinic.add(FinalRadiologyList( - filterName: element.clinicDescription, finalRadiology: element)); + _finalRadiologyListClinic + .add(FinalRadiologyList(filterName: element.clinicDescription, finalRadiology: element)); } // FinalRadiologyList list sort via project - List finalRadiologyListHospital = - _finalRadiologyListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); + List finalRadiologyListHospital = _finalRadiologyListHospital + .where( + (elementClinic) => elementClinic.filterName == element.projectName, + ) + .toList(); if (finalRadiologyListHospital.length != 0) { - _finalRadiologyListHospital[finalRadiologyListHospital - .indexOf(finalRadiologyListHospital[0])] + _finalRadiologyListHospital[finalRadiologyListHospital.indexOf(finalRadiologyListHospital[0])] .finalRadiologyList .add(element); } else { - _finalRadiologyListHospital.add(FinalRadiologyList( - filterName: element.projectName, finalRadiology: element)); + _finalRadiologyListHospital.add(FinalRadiologyList(filterName: element.projectName, finalRadiology: element)); } }); @@ -72,19 +61,12 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + getRadImageURL({int? invoiceNo, int? lineItem, int? projectId, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL( - invoiceNo: invoiceNo, - lineItem: lineItem, - projectId: projectId, - patient: patient); + invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); if (_radiologyService.hasError) { - error = _radiologyService.error; + error = _radiologyService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/referral_view_model.dart b/lib/core/viewModel/referral_view_model.dart index 892284e2..c8993da0 100644 --- a/lib/core/viewModel/referral_view_model.dart +++ b/lib/core/viewModel/referral_view_model.dart @@ -6,28 +6,25 @@ import '../../locator.dart'; import 'base_view_model.dart'; class ReferralPatientViewModel extends BaseViewModel { - ReferralPatientService _referralPatientService = - locator(); + ReferralPatientService _referralPatientService = locator(); - List get listMyReferralPatientModel => - _referralPatientService.listMyReferralPatientModel; + List get listMyReferralPatientModel => _referralPatientService.listMyReferralPatientModel; Future getMyReferralPatient() async { setState(ViewState.Busy); await _referralPatientService.getMyReferralPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future replay( - String referredDoctorRemarks, MyReferralPatientModel model) async { + Future replay(String referredDoctorRemarks, MyReferralPatientModel model) async { setState(ViewState.BusyLocal); await _referralPatientService.replay(referredDoctorRemarks, model); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/referred_view_model.dart b/lib/core/viewModel/referred_view_model.dart index 173aa60a..da99d26b 100644 --- a/lib/core/viewModel/referred_view_model.dart +++ b/lib/core/viewModel/referred_view_model.dart @@ -6,17 +6,15 @@ import '../../locator.dart'; import 'base_view_model.dart'; class ReferredPatientViewModel extends BaseViewModel { - ReferredPatientService _referralPatientService = - locator(); + ReferredPatientService _referralPatientService = locator(); - List get listMyReferredPatientModel => - _referralPatientService.listMyReferredPatientModel; + List get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel; Future getMyReferredPatient() async { setState(ViewState.Busy); await _referralPatientService.getMyReferredPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/schedule_view_model.dart b/lib/core/viewModel/schedule_view_model.dart index 3ee64c9b..681d7321 100644 --- a/lib/core/viewModel/schedule_view_model.dart +++ b/lib/core/viewModel/schedule_view_model.dart @@ -8,14 +8,13 @@ import 'base_view_model.dart'; class ScheduleViewModel extends BaseViewModel { ScheduleService _scheduleService = locator(); - List get listDoctorWorkingHoursTable => - _scheduleService.listDoctorWorkingHoursTable; + List get listDoctorWorkingHoursTable => _scheduleService.listDoctorWorkingHoursTable; Future getDoctorSchedule() async { setState(ViewState.Busy); await _scheduleService.getDoctorSchedule(); if (_scheduleService.hasError) { - error = _scheduleService.error; + error = _scheduleService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index b768cc9d..c5a0bc73 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -21,7 +21,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.addSickLeave(addSickLeaveRequest); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -31,7 +31,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.extendSickLeave(extendSickLeaveRequest); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -41,7 +41,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getStatistics(appoNo, patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -51,7 +51,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getSickLeave(patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -61,7 +61,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getSickLeavePatient(patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -71,7 +71,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getRescheduleLeave(); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -81,7 +81,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getOffTime(); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -91,7 +91,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getReasonsByID(id: id); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -101,8 +101,8 @@ class SickLeaveViewModel extends BaseViewModel { //setState(ViewState.Busy); await _sickLeaveService.getCoveringDoctors(); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; - // setState(ViewState.Error); + error = _sickLeaveService.error!; +// setState(ViewState.Error); } //else // setState(ViewState.Idle); @@ -113,7 +113,7 @@ class SickLeaveViewModel extends BaseViewModel { await _sickLeaveService.addReschedule(request); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -123,7 +123,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.updateReschedule(request); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/landing_page.dart b/lib/landing_page.dart index cd7a8171..90b8453f 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/screens/qr_reader/QR_reader_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart'; 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'; @@ -16,7 +15,7 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State { int currentTab = 0; - PageController pageController; + late PageController pageController; _changeCurrentTab(int tab) { setState(() { @@ -39,14 +38,11 @@ class _LandingPageState extends State { elevation: 0, backgroundColor: Colors.grey[100], //textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), - title: currentTab != 0 - ? Text(getText(currentTab).toUpperCase()) - : SizedBox(), + title: currentTab != 0 ? Text(getText(currentTab).toUpperCase()) : SizedBox(), leading: Builder( builder: (BuildContext context) { return IconButton( - icon: Image.asset('assets/images/menu.png', - height: 50, width: 50), + icon: Image.asset('assets/images/menu.png', height: 50, width: 50), iconSize: 15, color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), @@ -97,7 +93,7 @@ class MyAppbar extends StatelessWidget with PreferredSizeWidget { @override final Size preferredSize; - MyAppbar({Key key}) + MyAppbar({Key? key}) : preferredSize = Size.fromHeight(0.0), super(key: key); @override diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/models/doctor/list_doctor_working_hours_table_model.dart index 94e507c8..fa6f53a6 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/models/doctor/list_doctor_working_hours_table_model.dart @@ -34,7 +34,7 @@ class ListDoctorWorkingHoursTable { } class WorkingHours { - String from; - String to; - WorkingHours({required this.from, required this.to}); + String? from; + String? to; + WorkingHours({this.from, this.to}); } diff --git a/lib/models/doctor/user_model.dart b/lib/models/doctor/user_model.dart index 2500bfd7..66768c8a 100644 --- a/lib/models/doctor/user_model.dart +++ b/lib/models/doctor/user_model.dart @@ -26,7 +26,7 @@ class UserModel { this.isLoginForDoctorApp, this.patientOutSA}); - UserModel.fromJson(Map json) { + UserModel.fromJson(Map json) { userID = json['UserID']; password = json['Password']; projectID = json['ProjectID']; diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 9563b29c..e6d024fd 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -16,14 +16,13 @@ import 'package:provider/provider.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; - class LoginScreen extends StatefulWidget { @override _LoginScreenState createState() => _LoginScreenState(); } class _LoginScreenState extends State { - String platformImei; + late String platformImei; bool allowCallApi = true; //TODO change AppTextFormField to AppTextFormFieldCustom @@ -34,7 +33,7 @@ class _LoginScreenState extends State { List projectsList = []; FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { @@ -47,170 +46,117 @@ class _LoginScreenState extends State { Container( margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), alignment: Alignment.topLeft, - child: Column( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( + //TODO Use App Text rather than text + Container( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - //TODO Use App Text rather than text - Container( - - child: Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - SizedBox( - height: 30, - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment - .start, children: [ - SizedBox( - height: 10, - ), - Text( - TranslationBase - .of(context) - .welcomeTo, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight - .w600, - fontFamily: 'Poppins'), - ), - Text( - TranslationBase - .of(context) - .drSulaimanAlHabib, - style: TextStyle( - color:Color(0xFF2B353E), - fontWeight: FontWeight - .bold, - fontSize: SizeConfig - .isMobile - ? 24 - : SizeConfig - .realScreenWidth * - 0.029, - fontFamily: 'Poppins'), - ), - - Text( - "Doctor App", - style: TextStyle( - fontSize: - SizeConfig.isMobile - ? 16 - : SizeConfig - .realScreenWidth * - 0.030, - fontWeight: FontWeight - .w600, - color: Color(0xFFD02127)), - ), - ]), - ], - )), - SizedBox( - height: 40, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + ], ), - Form( - key: loginFormKey, - child: Column( - mainAxisAlignment: MainAxisAlignment - .spaceBetween, - children: [ - Container( - width: SizeConfig - .realScreenWidth * 0.90, - height: SizeConfig - .realScreenHeight * 0.65, - child: - Column( - crossAxisAlignment: CrossAxisAlignment - .start, children: [ - - buildSizedBox(), - AppTextFieldCustom( - hintText: TranslationBase.of(context).enterId, - hasBorder: true, - controller: userIdController, - onChanged: (value){ - if (value != null) - setState(() { - authenticationViewModel.userInfo - .userID = - value - .trim(); - }); - }, - ), - buildSizedBox(), - AppTextFieldCustom( - hintText: TranslationBase.of(context).enterPassword, - hasBorder: true, - isSecure: true, - controller: passwordController, - onChanged: (value){ - if (value != null) - setState(() { - authenticationViewModel.userInfo - .password = - value - .trim(); - }); - // if(allowCallApi) { - this.getProjects( - authenticationViewModel.userInfo - .userID); - // setState(() { - // allowCallApi = false; - // }); - // } - }, - onClick: (){ - - }, - ), - buildSizedBox(), - AppTextFieldCustom( - hintText: TranslationBase.of(context).selectYourProject, - hasBorder: true, - controller: projectIdController, - isTextFieldHasSuffix: true, - enabled: false, - onClick: (){ - Helpers - .showCupertinoPicker( - context, - projectsList, - 'facilityName', - onSelectProject, - authenticationViewModel); - }, - - - ), - buildSizedBox() - ]), - ), - ], + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 10, + ), + Text( + TranslationBase.of(context).welcomeTo ?? "", + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, fontFamily: 'Poppins'), + ), + Text( + TranslationBase.of(context).drSulaimanAlHabib ?? "", + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029, + fontFamily: 'Poppins'), ), - ) + Text( + "Doctor App", + style: TextStyle( + fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth * 0.030, + fontWeight: FontWeight.w600, + color: Color(0xFFD02127)), + ), + ]), ], + )), + SizedBox( + height: 40, + ), + Form( + key: loginFormKey, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: SizeConfig.realScreenWidth * 0.90, + height: SizeConfig.realScreenHeight * 0.65, + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).enterId, + hasBorder: true, + controller: userIdController, + onChanged: (value) { + if (value != null) + setState(() { + authenticationViewModel.userInfo.userID = value.trim(); + }); + }, + ), + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).enterPassword, + hasBorder: true, + isSecure: true, + controller: passwordController, + onChanged: (value) { + if (value != null) + setState(() { + authenticationViewModel.userInfo.password = value.trim(); + }); + // if(allowCallApi) { + this.getProjects(authenticationViewModel.userInfo.userID); + // setState(() { + // allowCallApi = false; + // }); + // } + }, + onClick: () {}, + ), + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).selectYourProject, + hasBorder: true, + controller: projectIdController, + isTextFieldHasSuffix: true, + enabled: false, + onClick: () { + Helpers.showCupertinoPicker( + context, projectsList, 'facilityName', onSelectProject, authenticationViewModel); + }, + ), + buildSizedBox() + ]), + ), + ], + ), ) - ])) + ], + ) + ])) ]), ), bottomSheet: Container( - height: 90, width: double.infinity, child: Center( @@ -220,26 +166,23 @@ class _LoginScreenState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ AppButton( - title: TranslationBase - .of(context) - .login, + title: TranslationBase.of(context).login, color: Color(0xFFD02127), fontWeight: FontWeight.w700, - disabled: authenticationViewModel.userInfo - .userID == null || - authenticationViewModel.userInfo - .password == - null, + disabled: authenticationViewModel.userInfo.userID == null || + authenticationViewModel.userInfo.password == null, onPressed: () { login(context); }, ), - - SizedBox(height: 25,) + SizedBox( + height: 25, + ) ], ), ), - ),), + ), + ), ); } @@ -249,9 +192,11 @@ class _LoginScreenState extends State { ); } - login(context,) async { - if (loginFormKey.currentState.validate()) { - loginFormKey.currentState.save(); + login( + context, + ) async { + if (loginFormKey.currentState!.validate()) { + loginFormKey.currentState!.save(); GifLoaderDialogUtils.showMyDialog(context); await authenticationViewModel.login(authenticationViewModel.userInfo); if (authenticationViewModel.state == ViewState.ErrorLocal) { @@ -259,7 +204,7 @@ class _LoginScreenState extends State { Helpers.showErrorToast(authenticationViewModel.error); } else { GifLoaderDialogUtils.hideDialog(context); - authenticationViewModel.setUnverified(true,isFromLogin: true); + authenticationViewModel.setUnverified(true, isFromLogin: true); // Navigator.of(context).pushReplacement( // MaterialPageRoute( // builder: (BuildContext context) => @@ -276,22 +221,23 @@ class _LoginScreenState extends State { onSelectProject(index) { setState(() { authenticationViewModel.userInfo.projectID = projectsList[index].facilityId; - projectIdController.text = projectsList[index].facilityName; + projectIdController.text = projectsList[index].facilityName!; }); - primaryFocus.unfocus(); + primaryFocus!.unfocus(); } - String memberID =""; - getProjects(memberID)async { + + String memberID = ""; + getProjects(memberID) async { if (memberID != null && memberID != '') { - if (this.memberID !=memberID) { + if (this.memberID != memberID) { this.memberID = memberID; await authenticationViewModel.getHospitalsList(memberID); - if(authenticationViewModel.state == ViewState.Idle) { + if (authenticationViewModel.state == ViewState.Idle) { projectsList = authenticationViewModel.hospitals; setState(() { authenticationViewModel.userInfo.projectID = projectsList[0].facilityId; - projectIdController.text = projectsList[0].facilityName; + projectIdController.text = projectsList[0].facilityName!; }); } } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 69d4a47a..94404bc1 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -33,33 +33,29 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); class VerificationMethodsScreen extends StatefulWidget { - - final password; - - VerificationMethodsScreen({this.password, }); + VerificationMethodsScreen({ + this.password, + }); @override _VerificationMethodsScreenState createState() => _VerificationMethodsScreenState(); } class _VerificationMethodsScreenState extends State { - - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; bool isMoreOption = false; bool onlySMSBox = false; - AuthMethodTypes fingerPrintBefore; - AuthMethodTypes selectedOption; - AuthenticationViewModel authenticationViewModel; + late AuthMethodTypes fingerPrintBefore; + late AuthMethodTypes selectedOption; + late AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); authenticationViewModel = Provider.of(context); - - return AppScaffold( isShowAppBar: false, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -78,17 +74,17 @@ class _VerificationMethodsScreenState extends State { SizedBox( height: 80, ), - if(authenticationViewModel.isFromLogin) - InkWell( - onTap: (){ - authenticationViewModel.setUnverified(false,isFromLogin: false); - authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); - }, - child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),) - - ), + if (authenticationViewModel.isFromLogin) + InkWell( + 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( @@ -96,290 +92,226 @@ class _VerificationMethodsScreenState extends State { ), 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: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - children: [ - - Text( - TranslationBase.of(context) - .lastLoginAt, - overflow: - TextOverflow.ellipsis, - style: TextStyle( - fontFamily: 'Poppins', - fontSize: 16, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700,), - + 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), ), - Row( - 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), - - fontWeight: FontWeight.w700, + 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, + ), + ), + Row( + 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), + fontWeight: FontWeight.w700, + ), + ], + ) + ], + 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, + ) ], - ) - ], - 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: 20, + ), + Row( + children: [ + AppText( + "Please Verify", + fontSize: 16, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ], ) ], - ), - ), - SizedBox( - height: 20, - ), - Row( - children: [ - AppText( - "Please Verify", - fontSize: 16, - color: Color(0xFF2B353E), - - fontWeight: FontWeight.w700, - ), - ], - ) - ], - ) + ) : 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, - ), - ]), + 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( - 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) - }, - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: SelectedAuthMethodTypesService - .getMethodsTypeService( - authenticationViewModel.user - .logInTypeID), - authenticateUser: - (AuthMethodTypes - authMethodType, - isActive) => - authenticateUser( - authMethodType, - isActive), - )), - ), - 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, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, 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), + 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: AuthMethodTypes.MoreOptions, + onShowMore: () { + setState(() { + isMoreOption = true; + }); + }, )) - ], - ) - : SizedBox(), - Row( - mainAxisAlignment: - MainAxisAlignment.center, + ]), + ]) + : Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, 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), - )) - ], - ), - ]), + 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), + )) + ], + ), + ]), // ) ], @@ -391,56 +323,59 @@ class _VerificationMethodsScreenState extends State { ), ), ), - 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); - // Navigator.pushAndRemoveUntil( - // AppGlobal.CONTEX, - // FadePage( - // page: RootPage(), - // ), - // (r) => false); - // Navigator.of(context).pushNamed(LOGIN); - }, + 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); + // Navigator.pushAndRemoveUntil( + // AppGlobal.CONTEX, + // FadePage( + // page: RootPage(), + // ), + // (r) => false); + // Navigator.of(context).pushNamed(LOGIN); + }, + ), + SizedBox( + height: 25, + ) + ], + ), ), - - SizedBox(height: 25,) - ], + ), ), - ), - ),), ); } - sendActivationCodeByOtpNotificationType( - AuthMethodTypes authMethodType) async { - if (authMethodType == AuthMethodTypes.SMS || - authMethodType == AuthMethodTypes.WhatsApp) { + sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async { + if (authMethodType == AuthMethodTypes.SMS || 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 { - authenticationViewModel.setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeForDoctorAppRes); - sharedPref.setString(PASSWORD, authenticationViewModel.userInfo.password); + authenticationViewModel + .setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeForDoctorAppRes); + sharedPref.setString(PASSWORD, authenticationViewModel.userInfo.password!); GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType); } @@ -454,16 +389,15 @@ class _VerificationMethodsScreenState extends State { sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { GifLoaderDialogUtils.showMyDialog(context); - await authenticationViewModel - .sendActivationCodeVerificationScreen(authMethodType); + await authenticationViewModel.sendActivationCodeVerificationScreen(authMethodType); if (authenticationViewModel.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); Helpers.showErrorToast(authenticationViewModel.error); } else { - authenticationViewModel.setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeVerificationScreenRes); - if (authMethodType == AuthMethodTypes.SMS || - authMethodType == AuthMethodTypes.WhatsApp) { + authenticationViewModel + .setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeVerificationScreenRes); + if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType); } else { @@ -473,12 +407,10 @@ class _VerificationMethodsScreenState extends State { } authenticateUser(AuthMethodTypes authMethodType, isActive) { - if (authMethodType == AuthMethodTypes.Fingerprint || - authMethodType == AuthMethodTypes.FaceID) { + if (authMethodType == AuthMethodTypes.Fingerprint || authMethodType == AuthMethodTypes.FaceID) { fingerPrintBefore = authMethodType; } - this.selectedOption = - fingerPrintBefore != null ? fingerPrintBefore : authMethodType; + this.selectedOption = fingerPrintBefore != null ? fingerPrintBefore : authMethodType; switch (authMethodType) { case AuthMethodTypes.SMS: @@ -488,8 +420,7 @@ class _VerificationMethodsScreenState extends State { sendActivationCode(authMethodType); break; case AuthMethodTypes.Fingerprint: - this.loginWithFingerPrintOrFaceID( - AuthMethodTypes.Fingerprint, isActive); + this.loginWithFingerPrintOrFaceID(AuthMethodTypes.Fingerprint, isActive); break; case AuthMethodTypes.FaceID: this.loginWithFingerPrintOrFaceID(AuthMethodTypes.FaceID, isActive); @@ -512,7 +443,9 @@ class _VerificationMethodsScreenState extends State { 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, @@ -522,23 +455,21 @@ class _VerificationMethodsScreenState extends State { this.checkActivationCode(value: value); }, - () => - { + () => { 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 || - SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) { + (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == + AuthMethodTypes.Fingerprint || + SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == + AuthMethodTypes.FaceID)) { this.sendActivationCode(authMethodTypes); } else { setState(() { @@ -568,7 +499,4 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel.setAppStatus(APP_STATUS.AUTHENTICATED); } } - - - } diff --git a/lib/screens/base/base_view.dart b/lib/screens/base/base_view.dart index 7a5c93e6..0cf174c7 100644 --- a/lib/screens/base/base_view.dart +++ b/lib/screens/base/base_view.dart @@ -5,11 +5,11 @@ import 'package:provider/provider.dart'; import '../../locator.dart'; class BaseView extends StatefulWidget { - final Widget Function(BuildContext context, T model, Widget child) builder; - final Function(T) onModelReady; + final Widget Function(BuildContext context, T model, Widget? child) builder; + final Function(T)? onModelReady; BaseView({ - this.builder, + required this.builder, this.onModelReady, }); @@ -18,14 +18,14 @@ class BaseView extends StatefulWidget { } class _BaseViewState extends State> { - T model = locator(); + T? model = locator(); bool isLogin = false; @override void initState() { if (widget.onModelReady != null) { - widget.onModelReady(model); + widget.onModelReady!(model!); } super.initState(); @@ -34,7 +34,7 @@ class _BaseViewState extends State> { @override Widget build(BuildContext context) { return ChangeNotifierProvider.value( - value: model, + value: model!, child: Consumer(builder: widget.builder), ); } diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 14e446e8..9b4017a4 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -12,13 +12,14 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:url_launcher/url_launcher.dart'; class DoctorReplayChat extends StatelessWidget { - final ListGtMyPatientsQuestions reply; TextEditingController msgController = TextEditingController(); - final DoctorReplayViewModel previousModel; - DoctorReplayChat( - {Key key, this.reply, this.previousModel, - }); + final DoctorReplayViewModel previousModel; + DoctorReplayChat({ + Key? key, + required this.reply, + required this.previousModel, + }); @override Widget build(BuildContext context) { @@ -37,33 +38,27 @@ class DoctorReplayChat extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, ), height: 115, child: Container( - padding: EdgeInsets.only( - left: 10, right: 10), + padding: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(top: 40), child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( child: RichText( text: TextSpan( style: TextStyle( - fontSize: 1.6 * - SizeConfig.textMultiplier, - color: Colors.black), + fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( - text: reply.patientName - .toString(), + text: reply.patientName.toString(), style: TextStyle( color: Color(0xFF2B353E), fontWeight: FontWeight.bold, @@ -77,9 +72,7 @@ class DoctorReplayChat extends StatelessWidget { onTap: () { Navigator.pop(context); }, - child: Icon(FontAwesomeIcons.times, - size: 30, - color: Color(0xFF2B353E))) + child: Icon(FontAwesomeIcons.times, size: 30, color: Color(0xFF2B353E))) ], ), ], @@ -93,8 +86,9 @@ class DoctorReplayChat extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - - SizedBox(height: 30,), + SizedBox( + height: 30, + ), Container( // color: Color(0xFF2B353E), width: MediaQuery.of(context).size.width * 0.9, @@ -104,9 +98,7 @@ class DoctorReplayChat extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: HexColor('#707070') , - width: 0.30), + border: Border.all(color: HexColor('#707070'), width: 0.30), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -132,12 +124,13 @@ class DoctorReplayChat extends StatelessWidget { ), ), Divider(), - SizedBox(width: 10,), + SizedBox( + width: 10, + ), Container( width: MediaQuery.of(context).size.width * 0.35, child: AppText( - reply.patientName - .toString(), + reply.patientName.toString(), fontSize: 14, fontFamily: 'Poppins', color: Colors.white, @@ -149,7 +142,7 @@ class DoctorReplayChat extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" +reply.mobileNumber); + launch("tel://" + reply.mobileNumber!); }, child: Icon( Icons.phone, @@ -161,18 +154,23 @@ class DoctorReplayChat extends StatelessWidget { ), Column( crossAxisAlignment: CrossAxisAlignment.center, - children: [ AppText( - reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), - fontWeight: FontWeight - .w600, + reply.createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.getDateTimeFromServerFormat( + reply.createdOn ?? "")) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), + fontWeight: FontWeight.w600, color: Colors.white, fontSize: 14, ), AppText( - reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()), - fontSize: 14, + reply.createdOn != null + ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat( + reply.createdOn ?? "")) + : AppDateUtils.getHour(DateTime.now()), + fontSize: 14, fontFamily: 'Poppins', color: Colors.white, // fontSize: 18 @@ -210,7 +208,9 @@ class DoctorReplayChat extends StatelessWidget { ], ), ), - SizedBox(height: 30,), + SizedBox( + height: 30, + ), ], ), ), @@ -276,8 +276,6 @@ class DoctorReplayChat extends StatelessWidget { // ), // ) ], - - ), ), )); diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index f522561f..38bc801c 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -16,10 +16,9 @@ import 'package:flutter/material.dart'; *@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service */ class DoctorReplyScreen extends StatelessWidget { - final Function changeCurrentTab; - const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key); + const DoctorReplyScreen({Key? key, required this.changeCurrentTab}) : super(key: key); @override Widget build(BuildContext context) { @@ -28,16 +27,16 @@ class DoctorReplyScreen extends StatelessWidget { model.getDoctorReply(); }, builder: (_, model, w) => WillPopScope( - onWillPop: ()async{ + onWillPop: () async { changeCurrentTab(); return false; }, child: AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty - ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem ?? "") : Container( padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), child: ListView( @@ -45,19 +44,17 @@ class DoctorReplyScreen extends StatelessWidget { Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: - model.listDoctorWorkingHoursTable.map((reply) { + children: model.listDoctorWorkingHoursTable.map((reply) { return InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - DoctorReplayChat( - reply: reply, - previousModel: model, - ))); - }, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => DoctorReplayChat( + reply: reply, + previousModel: model, + ))); + }, child: DoctorReplyWidget(reply: reply), ); }).toList(), @@ -68,6 +65,5 @@ class DoctorReplyScreen extends StatelessWidget { ), ), ); - } } diff --git a/lib/screens/doctor/my_referral_patient_screen.dart b/lib/screens/doctor/my_referral_patient_screen.dart index 960bbdd9..7f648b0e 100644 --- a/lib/screens/doctor/my_referral_patient_screen.dart +++ b/lib/screens/doctor/my_referral_patient_screen.dart @@ -21,7 +21,7 @@ class _MyReferralPatientState extends State { onModelReady: (model) => model.getMyReferralPatient(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).myReferralPatient, + appBarTitle: TranslationBase.of(context).myReferralPatient ?? "", body: model.listMyReferralPatientModel.length == 0 ? Center( child: AppText( @@ -45,21 +45,18 @@ class _MyReferralPatientState extends State { ...List.generate( model.listMyReferralPatientModel.length, (index) => MyReferralPatientWidget( - myReferralPatientModel: model - .listMyReferralPatientModel[index], + myReferralPatientModel: model.listMyReferralPatientModel[index], model: model, expandClick: () { setState(() { - if (widget.expandedItemIndex == - index) { + if (widget.expandedItemIndex == index) { widget.expandedItemIndex = -1; } else { widget.expandedItemIndex = index; } }); }, - isExpand: - widget.expandedItemIndex == index, + isExpand: widget.expandedItemIndex == index, ), ) ], diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 5ef8b617..23117bb8 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -14,9 +14,8 @@ class PatientArrivalScreen extends StatefulWidget { _PatientArrivalScreen createState() => _PatientArrivalScreen(); } -class _PatientArrivalScreen extends State - with SingleTickerProviderStateMixin { - TabController _tabController; +class _PatientArrivalScreen extends State with SingleTickerProviderStateMixin { + late TabController _tabController; var _patientSearchFormValues = PatientModel( FirstName: "0", MiddleName: "0", @@ -24,10 +23,8 @@ class _PatientArrivalScreen extends State PatientMobileNumber: "0", PatientIdentificationID: "0", PatientID: 0, - From: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - To: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), + From: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd').toString(), + To: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd').toString(), LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", @@ -54,7 +51,7 @@ class _PatientArrivalScreen extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).arrivalpatient, + appBarTitle: TranslationBase.of(context).arrivalpatient ?? "", body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -66,9 +63,7 @@ class _PatientArrivalScreen extends State width: MediaQuery.of(context).size.width * 0.92, // 0.9, decoration: BoxDecoration( border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.9), //width: 0.7 + bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.9), //width: 0.7 ), color: Colors.white), child: Center( @@ -78,22 +73,19 @@ class _PatientArrivalScreen extends State indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: AppText( - TranslationBase.of(context).arrivalpatient), + child: AppText(TranslationBase.of(context).arrivalpatient), ), ), Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: AppText( - TranslationBase.of(context).rescheduleLeaves), + child: AppText(TranslationBase.of(context).rescheduleLeaves), ), ), ], diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 4b7c4f46..92089f4c 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -27,9 +27,8 @@ class DashboardSliderItemWidget extends StatelessWidget { height: 110, child: ListView( scrollDirection: Axis.horizontal, - children: - List.generate(item.summaryoptions.length, (int index) { - return GetActivityButton(item.summaryoptions[index]); + children: List.generate(item.summaryoptions!.length, (int index) { + return GetActivityButton(item.summaryoptions![index]); }))) ], ); diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index de5cc05f..2e7815ba 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -45,8 +45,7 @@ class _DashboardSwipeWidgetState extends State { }, itemCount: 3, // itemHeight: 300, - pagination: new SwiperCustomPagination( - builder: (BuildContext context, SwiperPluginConfig config) { + pagination: new SwiperCustomPagination(builder: (BuildContext context, SwiperPluginConfig config) { return new Stack( alignment: Alignment.bottomCenter, children: [ @@ -59,15 +58,9 @@ class _DashboardSwipeWidgetState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - config.activeIndex == 0 - ? SwiperRoundedPagination(true) - : SwiperRoundedPagination(false), - config.activeIndex == 1 - ? SwiperRoundedPagination(true) - : SwiperRoundedPagination(false), - config.activeIndex == 2 - ? SwiperRoundedPagination(true) - : SwiperRoundedPagination(false), + config.activeIndex == 0 ? SwiperRoundedPagination(true) : SwiperRoundedPagination(false), + config.activeIndex == 1 ? SwiperRoundedPagination(true) : SwiperRoundedPagination(false), + config.activeIndex == 2 ? SwiperRoundedPagination(true) : SwiperRoundedPagination(false), ], ), ), @@ -94,9 +87,7 @@ class _DashboardSwipeWidgetState extends State { shadowSpreadRadius: 3, shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: GetOutPatientStack(dashboardItemList[1]))); + child: Padding(padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[1]))); if (index == 0) return RoundedContainer( raduis: 16, @@ -106,9 +97,7 @@ class _DashboardSwipeWidgetState extends State { shadowSpreadRadius: 3, shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: GetOutPatientStack(dashboardItemList[0]))); + child: Padding(padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[0]))); if (index == 2) return RoundedContainer( raduis: 16, @@ -118,8 +107,7 @@ class _DashboardSwipeWidgetState extends State { shadowSpreadRadius: 3, shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( flex: 1, child: Row( @@ -135,21 +123,17 @@ class _DashboardSwipeWidgetState extends State { Padding( padding: EdgeInsets.all(8), child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .patients, + TranslationBase.of(context).patients, fontSize: 12, fontWeight: FontWeight.bold, fontHeight: 0.5, ), AppText( - TranslationBase.of(context) - .referral, + TranslationBase.of(context).referral, fontSize: 22, fontWeight: FontWeight.bold, ), @@ -162,34 +146,16 @@ class _DashboardSwipeWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[0] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[0] - .value, - Colors.black), + child: RowCounts(dashboardItemList[2].summaryoptions![0].kPIParameter, + dashboardItemList[2].summaryoptions![0].value!, Colors.black), ), Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[1] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[1] - .value, - Colors.grey), + child: RowCounts(dashboardItemList[2].summaryoptions![1].kPIParameter, + dashboardItemList[2].summaryoptions![1].value!, Colors.grey), ), Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[2] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[2] - .value, - Colors.red), + child: RowCounts(dashboardItemList[2].summaryoptions![2].kPIParameter, + dashboardItemList[2].summaryoptions![2].value!, Colors.red), ), ], ), @@ -200,17 +166,13 @@ class _DashboardSwipeWidgetState extends State { Expanded( flex: 3, child: Stack(children: [ - Container( - child: GaugeChart( - _createReferralData(widget.dashboardItemList))), + Container(child: GaugeChart(_createReferralData(widget.dashboardItemList))), Positioned( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ AppText( - widget.model - .getPatientCount(dashboardItemList[2]) - .toString(), + widget.model.getPatientCount(dashboardItemList[2]).toString(), fontSize: SizeConfig.textMultiplier * 3.0, fontWeight: FontWeight.bold, ) @@ -227,21 +189,14 @@ class _DashboardSwipeWidgetState extends State { return Container(); } - static List> _createReferralData( - List dashboardItemList) { + static List> _createReferralData(List dashboardItemList) { final data = [ - new GaugeSegment( - dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), - charts.MaterialPalette.black), - new GaugeSegment( - dashboardItemList[2].summaryoptions[1].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[1].value), - charts.MaterialPalette.gray.shadeDefault), - new GaugeSegment( - dashboardItemList[2].summaryoptions[2].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[2].value), - charts.MaterialPalette.red.shadeDefault), + new GaugeSegment(dashboardItemList[2].summaryoptions![0].kPIParameter!, + getValue(dashboardItemList[1].summaryoptions![0].value), charts.MaterialPalette.black), + new GaugeSegment(dashboardItemList[2].summaryoptions![1].kPIParameter!, + getValue(dashboardItemList[1].summaryoptions![1].value), charts.MaterialPalette.gray.shadeDefault), + new GaugeSegment(dashboardItemList[2].summaryoptions![2].kPIParameter!, + getValue(dashboardItemList[1].summaryoptions![2].value), charts.MaterialPalette.red.shadeDefault), ]; return [ diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 503bbe60..383e7a9e 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -5,15 +5,15 @@ class HomePageCard extends StatelessWidget { const HomePageCard( {this.hasBorder = false, this.imageName, - @required this.child, - this.onTap, - Key key, - this.color, + required this.child, + required this.onTap, + Key? key, + required this.color, this.opacity = 0.4, - this.margin}) + required this.margin}) : super(key: key); final bool hasBorder; - final String imageName; + final String? imageName; final Widget child; final Function onTap; final Color color; @@ -22,12 +22,10 @@ class HomePageCard extends StatelessWidget { @override Widget build(BuildContext context) { return InkWell( - onTap: onTap, + onTap: onTap(), child: Container( width: 120, - height: MediaQuery.of(context).orientation == Orientation.portrait - ? 100 - : 200, + height: MediaQuery.of(context).orientation == Orientation.portrait ? 100 : 200, margin: this.margin, decoration: BoxDecoration( color: !hasBorder @@ -43,8 +41,7 @@ class HomePageCard extends StatelessWidget { ? DecorationImage( image: AssetImage('assets/images/dashboard/$imageName'), fit: BoxFit.cover, - colorFilter: new ColorFilter.mode( - Colors.black.withOpacity(0.2), BlendMode.dstIn), + colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn), ) : null, ), diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index bdaac7a7..63b998bc 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -12,12 +12,12 @@ class HomePatientCard extends StatelessWidget { final Function onTap; HomePatientCard({ - @required this.backgroundColor, - @required this.backgroundIconColor, - @required this.cardIcon, - @required this.text, - @required this.textColor, - @required this.onTap, + required this.backgroundColor, + required this.backgroundIconColor, + required this.cardIcon, + required this.text, + required this.textColor, + required this.onTap, }); @override diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index c305b752..e5c08cbc 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -36,9 +36,9 @@ import 'package:sticky_headers/sticky_headers/widget.dart'; import '../../widgets/shared/app_texts_widget.dart'; class HomeScreen extends StatefulWidget { - HomeScreen({Key key, this.title}) : super(key: key); + HomeScreen({Key? key, this.title}) : super(key: key); - final String title; + final String? title; final String iconURL = 'assets/images/dashboard_icon/'; @override @@ -47,14 +47,14 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { bool isLoading = false; - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; var _isInit = true; - DoctorProfileModel profile; + late DoctorProfileModel profile; bool isExpanded = false; bool isInpatient = false; int sliderActiveIndex = 0; var clinicId; - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; int colorIndex = 0; @override @@ -69,8 +69,7 @@ class _HomeScreenState extends State { return BaseView( onModelReady: (model) async { - await model.setFirebaseNotification( - projectsProvider, authenticationViewModel); + await model.setFirebaseNotification(projectsProvider, authenticationViewModel); await model.getDashboard(); await model.getDoctorProfile(isGetProfile: true); await model.checkDoctorHasLiveCare(); @@ -86,8 +85,7 @@ class _HomeScreenState extends State { padding: EdgeInsets.only(top: 10), child: Stack(children: [ IconButton( - icon: Image.asset('assets/images/menu.png', - height: 50, width: 50), + icon: Image.asset('assets/images/menu.png', height: 50, width: 50), iconSize: 18, color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), @@ -99,8 +97,7 @@ class _HomeScreenState extends State { children: [ Container( width: MediaQuery.of(context).size.width * .6, - child: projectsProvider.doctorClinicsList.length > - 0 + child: projectsProvider.doctorClinicsList.length > 0 ? Stack( children: [ DropdownButtonHideUnderline( @@ -109,61 +106,36 @@ class _HomeScreenState extends State { iconEnabledColor: Colors.black, isExpanded: true, value: clinicId == null - ? projectsProvider - .doctorClinicsList[0].clinicID + ? projectsProvider.doctorClinicsList[0].clinicID : clinicId, iconSize: 25, elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return projectsProvider - .doctorClinicsList - .map((item) { + selectedItemBuilder: (BuildContext context) { + return projectsProvider.doctorClinicsList.map((item) { return Row( mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, children: [ Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - padding: - EdgeInsets.all(2), - margin: - EdgeInsets.all(2), - decoration: - new BoxDecoration( - color: - Colors.red[800], - borderRadius: - BorderRadius - .circular( - 20), + padding: EdgeInsets.all(2), + margin: EdgeInsets.all(2), + decoration: new BoxDecoration( + color: Colors.red[800], + borderRadius: BorderRadius.circular(20), ), - constraints: - BoxConstraints( + constraints: BoxConstraints( minWidth: 20, minHeight: 20, ), child: Center( child: AppText( - projectsProvider - .doctorClinicsList - .length - .toString(), - color: - Colors.white, - fontSize: - projectsProvider - .isArabic - ? 10 - : 11, - textAlign: - TextAlign - .center, + projectsProvider.doctorClinicsList.length.toString(), + color: Colors.white, + fontSize: projectsProvider.isArabic ? 10 : 11, + textAlign: TextAlign.center, ), )), ], @@ -171,8 +143,7 @@ class _HomeScreenState extends State { AppText(item.clinicName, fontSize: 12, color: Colors.black, - fontWeight: - FontWeight.bold, + fontWeight: FontWeight.bold, textAlign: TextAlign.end), ], ); @@ -180,21 +151,14 @@ class _HomeScreenState extends State { }, onChanged: (newValue) async { clinicId = newValue; - GifLoaderDialogUtils.showMyDialog( - context); - await model.changeClinic(newValue, - authenticationViewModel); - GifLoaderDialogUtils.hideDialog( - context); - if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + GifLoaderDialogUtils.showMyDialog(context); + await model.changeClinic(clinicId, authenticationViewModel); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } }, - items: projectsProvider - .doctorClinicsList - .map((item) { + items: projectsProvider.doctorClinicsList.map((item) { return DropdownMenuItem( child: AppText( item.clinicName, @@ -206,8 +170,7 @@ class _HomeScreenState extends State { )), ], ) - : AppText( - TranslationBase.of(context).noClinic), + : AppText(TranslationBase.of(context).noClinic), ), ], ), @@ -233,21 +196,16 @@ class _HomeScreenState extends State { ? FractionallySizedBox( widthFactor: 0.90, child: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - sliderActiveIndex == 1 - ? DashboardSliderItemWidget( - model.dashboardItemsList[4]) - : sliderActiveIndex == 0 - ? DashboardSliderItemWidget( - model.dashboardItemsList[3]) - : DashboardSliderItemWidget( - model.dashboardItemsList[6]), - ]))) + child: Column(mainAxisAlignment: MainAxisAlignment.start, children: [ + SizedBox( + height: 10, + ), + sliderActiveIndex == 1 + ? DashboardSliderItemWidget(model.dashboardItemsList[4]) + : sliderActiveIndex == 0 + ? DashboardSliderItemWidget(model.dashboardItemsList[3]) + : DashboardSliderItemWidget(model.dashboardItemsList[6]), + ]))) : SizedBox(), FractionallySizedBox( // widthFactor: 0.90, @@ -289,11 +247,9 @@ class _HomeScreenState extends State { ), Container( height: 120, - child: ListView( - scrollDirection: Axis.horizontal, - children: [ - ...homePatientsCardsWidget(model), - ])), + child: ListView(scrollDirection: Axis.horizontal, children: [ + ...homePatientsCardsWidget(model), + ])), SizedBox( height: 20, ), @@ -313,20 +269,21 @@ class _HomeScreenState extends State { List homePatientsCardsWidget(DashboardViewModel model) { colorIndex = 0; - List backgroundColors = List(3); - backgroundColors[0] = Color(0xffD02127); - backgroundColors[1] = Colors.grey[300]; - backgroundColors[2] = Color(0xff2B353E); - List backgroundIconColors = List(3); - backgroundIconColors[0] = Colors.white12; - backgroundIconColors[1] = Colors.white38; - backgroundIconColors[2] = Colors.white10; - List textColors = List(3); - textColors[0] = Colors.white; - textColors[1] = Colors.black; - textColors[2] = Colors.white; + List backgroundColors = []; + backgroundColors.add(Color(0xffD02127)); + backgroundColors.add(Colors.grey[300]!); + backgroundColors.add(Color(0xff2B353E)); + + List backgroundIconColors = []; + backgroundIconColors.add(Colors.white12); + backgroundIconColors.add(Colors.white38); + backgroundIconColors.add(Colors.white10); - List patientCards = List(); + List textColors = []; + textColors.add(Colors.white); + textColors.add(Colors.black); + textColors.add(Colors.white); + List patientCards = []; if (model.hasVirtualClinic) { patientCards.add(HomePatientCard( @@ -334,8 +291,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.livecare, textColor: textColors[colorIndex], - text: - "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", + text: "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", onTap: () { Navigator.push( context, @@ -353,7 +309,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.inpatient, textColor: textColors[colorIndex], - text: TranslationBase.of(context).myInPatient, + text: TranslationBase.of(context).myInPatient!, onTap: () { Navigator.push( context, @@ -370,22 +326,17 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.arrival_patients, textColor: textColors[colorIndex], - text: TranslationBase.of(context).myOutPatient_2lines, + text: TranslationBase.of(context).myOutPatient_2lines!, onTap: () { String date = AppDateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); + DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); Navigator.push( context, MaterialPageRoute( builder: (context) => OutPatientsScreen( patientSearchRequestModel: PatientSearchRequestModel( - from: date, - to: date, - doctorID: - authenticationViewModel.doctorProfile.doctorID)), + from: date, to: date, doctorID: authenticationViewModel.doctorProfile!.doctorID)), )); }, )); @@ -396,14 +347,12 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.referral_1, textColor: textColors[colorIndex], - text: TranslationBase.of(context) - .myPatientsReferral, + text: TranslationBase.of(context).myPatientsReferral!, onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => - PatientReferralScreen(), + builder: (context) => PatientReferralScreen(), ), ); }, @@ -415,14 +364,12 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search, textColor: textColors[colorIndex], - text: TranslationBase.of(context) - .searchPatientDashBoard, + text: TranslationBase.of(context).searchPatientDashBoard!, onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => - PatientSearchScreen(), + builder: (context) => PatientSearchScreen(), )); }, )); @@ -433,23 +380,18 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search_medicines, textColor: textColors[colorIndex], - text: TranslationBase.of(context) - .searchMedicineDashboard, + text: TranslationBase.of(context).searchMedicineDashboard!, onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => - MedicineSearchScreen(), + builder: (context) => MedicineSearchScreen(), )); }, )); changeColorIndex(); - return [ - ...List.generate(patientCards.length, (index) => patientCards[index]) - .toList() - ]; + return [...List.generate(patientCards.length, (index) => patientCards[index]).toList()]; } changeColorIndex() { diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index d4e9120e..38d0089a 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -24,7 +24,7 @@ import 'package:hexcolor/hexcolor.dart'; class EndCallScreen extends StatefulWidget { final PatiantInformtion patient; - const EndCallScreen({Key key, this.patient}) : super(key: key); + const EndCallScreen({Key? key, required this.patient}) : super(key: key); @override _EndCallScreenState createState() => _EndCallScreenState(); @@ -35,57 +35,61 @@ class _EndCallScreenState extends State { bool isDischargedPatient = false; bool isSearchAndOut = false; - String patientType; - String arrivalType; - String from; - String to; + late String patientType; + late String arrivalType; + late String from; + late String to; - LiveCarePatientViewModel liveCareModel; + late LiveCarePatientViewModel liveCareModel; @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).resume, - TranslationBase.of(context).theCall, '', 'patient/vital_signs.png', + PatientProfileCardModel( + TranslationBase.of(context).resume!, TranslationBase.of(context).theCall!, '', 'patient/vital_signs.png', isInPatient: isInpatient, onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel - .startCall(isReCall: false, vCID: widget.patient.vcId) - .then((value) async{ + await liveCareModel.startCall(isReCall: false, vCID: widget.patient.vcId!).then((value) async { await liveCareModel.getDoctorProfile(); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); - }else - await VideoChannel.openVideoCallScreen( - kToken: liveCareModel.startCallRes.openTokenID, - kSessionId: liveCareModel.startCallRes.openSessionID, - kApiKey: '46209962', - vcId: widget.patient.vcId, - tokenID: await liveCareModel.getToken(), - generalId: GENERAL_ID, - doctorId: liveCareModel.doctorProfile.doctorID, - onFailure: (String error) { - DrAppToastMsg.showErrorToast(error); - }, - onCallEnd: () async{ - GifLoaderDialogUtils.showMyDialog(context); - GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.endCall(widget.patient.vcId, false,); - GifLoaderDialogUtils.hideDialog(context); - if (liveCareModel.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(liveCareModel.error); - } - }, - onCallNotRespond: (SessionStatusModel sessionStatusModel) async{ - GifLoaderDialogUtils.showMyDialog(context); - GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.endCall(widget.patient.vcId, sessionStatusModel.sessionStatus == 3,); - GifLoaderDialogUtils.hideDialog(context); - if (liveCareModel.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(liveCareModel.error); - } - }); + } else + await VideoChannel.openVideoCallScreen( + kToken: liveCareModel.startCallRes.openTokenID, + kSessionId: liveCareModel.startCallRes.openSessionID, + kApiKey: '46209962', + vcId: widget.patient.vcId, + tokenID: await liveCareModel.getToken(), + generalId: GENERAL_ID, + doctorId: liveCareModel.doctorProfile!.doctorID, + onFailure: (String error) { + DrAppToastMsg.showErrorToast(error); + }, + onCallEnd: () async { + GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context); + await liveCareModel.endCall( + widget.patient.vcId!, + false, + ); + GifLoaderDialogUtils.hideDialog(context); + if (liveCareModel.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(liveCareModel.error); + } + }, + onCallNotRespond: (SessionStatusModel sessionStatusModel) async { + GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context); + await liveCareModel.endCall( + widget.patient.vcId!, + sessionStatusModel.sessionStatus == 3, + ); + GifLoaderDialogUtils.hideDialog(context); + if (liveCareModel.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(liveCareModel.error); + } + }); }); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { @@ -93,17 +97,14 @@ class _EndCallScreenState extends State { } }, isDartIcon: true, dartIcon: DoctorApp.call), PatientProfileCardModel( - TranslationBase.of(context).endLC, - TranslationBase.of(context).consultation, - '', - 'patient/vital_signs.png', + TranslationBase.of(context).endLC!, TranslationBase.of(context).consultation!, '', 'patient/vital_signs.png', isInPatient: isInpatient, onTap: () { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?", () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.endCallWithCharge(widget.patient.vcId); + await liveCareModel.endCallWithCharge(widget.patient.vcId!); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -113,10 +114,7 @@ class _EndCallScreenState extends State { } }); }, isDartIcon: true, dartIcon: DoctorApp.end_consultaion), - PatientProfileCardModel( - TranslationBase.of(context).sendLC, - TranslationBase.of(context).instruction, - "", + PatientProfileCardModel(TranslationBase.of(context).sendLC!, TranslationBase.of(context).instruction!, "", 'patient/health_summary.png', onTap: () {}, isInPatient: isInpatient, @@ -124,19 +122,11 @@ class _EndCallScreenState extends State { isDisable: true, dartIcon: DoctorApp.send_instruction), PatientProfileCardModel( - TranslationBase.of(context).transferTo, - TranslationBase.of(context).admin, - '', - 'patient/health_summary.png', onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - LivaCareTransferToAdmin(patient: widget.patient))); - }, - isInPatient: isInpatient, - isDartIcon: true, - dartIcon: DoctorApp.transfer_to_admin), + TranslationBase.of(context).transferTo!, TranslationBase.of(context).admin!, '', 'patient/health_summary.png', + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: widget.patient))); + }, isInPatient: isInpatient, isDartIcon: true, dartIcon: DoctorApp.transfer_to_admin), ]; return BaseView( @@ -145,14 +135,12 @@ class _EndCallScreenState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).patientProfile, + appBarTitle: TranslationBase.of(context).patientProfile!, backgroundColor: Theme.of(context).scaffoldBackgroundColor, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - widget.patient, arrivalType ?? '7', '1', + appBar: PatientProfileHeaderNewDesignAppBar(widget.patient, arrivalType ?? '7', '1', isInpatient: isInpatient, - height: (widget.patient.patientStatusType != null && - widget.patient.patientStatusType == 43) + height: (widget.patient.patientStatusType != null && widget.patient.patientStatusType == 43) ? 210 : isDischargedPatient ? 240 @@ -167,8 +155,7 @@ class _EndCallScreenState extends State { child: ListView( children: [ Padding( - padding: - const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -193,8 +180,7 @@ class _EndCallScreenState extends State { crossAxisCount: 3, itemCount: cardsList.length, staggeredTileBuilder: (int index) => StaggeredTile.fit(1), - itemBuilder: (BuildContext context, int index) => - PatientProfileButton( + itemBuilder: (BuildContext context, int index) => PatientProfileButton( patient: widget.patient, patientType: patientType, arrivalType: arrivalType, @@ -205,8 +191,7 @@ class _EndCallScreenState extends State { route: cardsList[index].route, icon: cardsList[index].icon, isInPatient: cardsList[index].isInPatient, - isDischargedPatient: - cardsList[index].isDischargedPatient, + isDischargedPatient: cardsList[index].isDischargedPatient, isDisable: cardsList[index].isDisable, onTap: cardsList[index].onTap, isLoading: cardsList[index].isLoading, @@ -246,7 +231,7 @@ class _EndCallScreenState extends State { fontWeight: FontWeight.w700, color: Colors.red[600], title: "Close", //TranslationBase.of(context).close, - onPressed: () { + onPressed: () { Navigator.of(context).pop(); }, ), diff --git a/lib/screens/live_care/live-care_transfer_to_admin.dart b/lib/screens/live_care/live-care_transfer_to_admin.dart index c5bcf304..89247b10 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -23,21 +23,20 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class LivaCareTransferToAdmin extends StatefulWidget { final PatiantInformtion patient; - const LivaCareTransferToAdmin({Key key, this.patient}) : super(key: key); + const LivaCareTransferToAdmin({Key? key, required this.patient}) : super(key: key); @override - _LivaCareTransferToAdminState createState() => - _LivaCareTransferToAdminState(); + _LivaCareTransferToAdminState createState() => _LivaCareTransferToAdminState(); } class _LivaCareTransferToAdminState extends State { stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; TextEditingController noteController = TextEditingController(); - String noteError; + late String noteError; void initState() { requestPermissions(); @@ -59,8 +58,7 @@ class _LivaCareTransferToAdminState extends State { onModelReady: (model) {}, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: - "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", + appBarTitle: "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", backgroundColor: Theme.of(context).scaffoldBackgroundColor, isShowAppBar: true, body: Container( @@ -84,17 +82,13 @@ class _LivaCareTransferToAdminState extends State { ), Positioned( top: -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, + right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, child: Column( children: [ IconButton( - icon: Icon(DoctorApp.speechtotext, - color: Colors.black, size: 35), + icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ], @@ -105,31 +99,30 @@ class _LivaCareTransferToAdminState extends State { ), ), ButtonBottomSheet( - title: - "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", + title: "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", onPressed: () { setState(() { if (noteController.text.isEmpty) { - noteError = TranslationBase.of(context).emptyMessage; + noteError = TranslationBase.of(context).emptyMessage!; } else { - noteError = null; + noteError = null!; } if (noteController.text.isNotEmpty) { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?", - () async { - Navigator.of(context).pop(); - GifLoaderDialogUtils.showMyDialog(context); - model.endCallWithCharge(widget.patient.vcId); - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } else { - Navigator.of(context).pop(); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - } - }); + () async { + Navigator.of(context).pop(); + GifLoaderDialogUtils.showMyDialog(context); + model.endCallWithCharge(widget.patient.vcId!); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + Navigator.of(context).pop(); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + }); } }); }, @@ -144,8 +137,7 @@ class _LivaCareTransferToAdminState extends State { onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -189,8 +181,7 @@ class _LivaCareTransferToAdminState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index 43afd4c1..11007718 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -24,13 +24,13 @@ class LiveCarePatientScreen extends StatefulWidget { class _LiveCarePatientScreenState extends State { final _controller = TextEditingController(); - Timer timer; - LiveCarePatientViewModel _liveCareViewModel; + late Timer timer; + late LiveCarePatientViewModel _liveCareViewModel; @override void initState() { super.initState(); timer = Timer.periodic(Duration(seconds: 10), (Timer t) { - if(_liveCareViewModel != null){ + if (_liveCareViewModel != null) { _liveCareViewModel.getPendingPatientERForDoctorApp(isFromTimer: true); } }); @@ -38,7 +38,7 @@ class _LiveCarePatientScreenState extends State { @override void dispose() { - _liveCareViewModel = null; + _liveCareViewModel = null!; timer?.cancel(); super.dispose(); } @@ -49,7 +49,6 @@ class _LiveCarePatientScreenState extends State { onModelReady: (model) async { _liveCareViewModel = model; await model.getPendingPatientERForDoctorApp(); - }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -82,7 +81,9 @@ class _LiveCarePatientScreenState extends State { ]), ), ), - SizedBox(height: 20,), + SizedBox( + height: 20, + ), Center( child: FractionallySizedBox( widthFactor: .9, @@ -90,44 +91,36 @@ class _LiveCarePatientScreenState extends State { width: double.maxFinite, height: 75, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), + borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( width: 1.0, color: Color(0xffCCCCCC), ), color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - left: 10, top: 10), - child: AppText( - TranslationBase.of( - context) - .searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), - ), - onChanged: (String str) { - model.searchData(str); - }), - ])), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + onPressed: () {}, + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: EdgeInsets.only(bottom: 30), + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), ), ), model.state == ViewState.Idle @@ -136,44 +129,44 @@ class _LiveCarePatientScreenState extends State { child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, + error: TranslationBase.of(context).youDontHaveAnyPatient!, ), ) : ListView.builder( scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.filterData.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: PatientCard( - patientInfo: model.filterData[index], - patientType: "0", - arrivalType: "0", - isFromSearch: false, - isInpatient: false, - isFromLiveCare:true, - onTap: () { - // TODO change the parameter to daynamic - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model.filterData[index], - "patientType": "0", - "isSearch": false, - "isInpatient": false, - "arrivalType": "0", - "isSearchAndOut": false, - "isFromLiveCare":true, - }); - }, - // isFromSearch: widget.isSearch, - ), - ); - })), - ) : Expanded( - child: AppLoaderWidget(containerColor: Colors.transparent,)), + itemCount: model.filterData.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: PatientCard( + patientInfo: model.filterData[index], + patientType: "0", + arrivalType: "0", + isFromSearch: false, + isInpatient: false, + isFromLiveCare: true, + onTap: () { + // TODO change the parameter to daynamic + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filterData[index], + "patientType": "0", + "isSearch": false, + "isInpatient": false, + "arrivalType": "0", + "isSearchAndOut": false, + "isFromLiveCare": true, + }); + }, + // isFromSearch: widget.isSearch, + ), + ); + })), + ) + : Expanded( + child: AppLoaderWidget( + containerColor: Colors.transparent, + )), ], ), ), diff --git a/lib/screens/live_care/panding_list.dart b/lib/screens/live_care/panding_list.dart index f081479c..a503ae74 100644 --- a/lib/screens/live_care/panding_list.dart +++ b/lib/screens/live_care/panding_list.dart @@ -21,7 +21,7 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class LiveCarePandingListScreen extends StatefulWidget { // In the constructor, require a item id. - LiveCarePandingListScreen({Key key}) : super(key: key); + LiveCarePandingListScreen({Key? key}) : super(key: key); @override _LiveCarePandingListState createState() => _LiveCarePandingListState(); @@ -31,7 +31,7 @@ class _LiveCarePandingListState extends State { List _data = []; Helpers helpers = new Helpers(); bool _isInit = true; - LiveCareViewModel _liveCareProvider; + late LiveCareViewModel _liveCareProvider; @override void didChangeDependencies() { super.didChangeDependencies(); @@ -45,7 +45,7 @@ class _LiveCarePandingListState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).livecare, + appBarTitle: TranslationBase.of(context).livecare!, body: Container( child: ListView(scrollDirection: Axis.vertical, @@ -61,13 +61,11 @@ class _LiveCarePandingListState extends State { ? Center( child: Text( _liveCareProvider.errorMsg, - style: TextStyle( - color: Theme.of(context).errorColor), + style: TextStyle(color: Theme.of(context).errorColor), ), ) : Column( - children: _liveCareProvider.liveCarePendingList - .map((item) { + children: _liveCareProvider.liveCarePendingList.map((item) { return Container( decoration: myBoxDecoration(), child: InkWell( @@ -86,47 +84,28 @@ class _LiveCarePandingListState extends State { Column( children: [ Container( - decoration: - BoxDecoration( + decoration: BoxDecoration( gradient: LinearGradient( - begin: Alignment( - -1, - -1), - end: Alignment( - 1, 1), + begin: Alignment(-1, -1), + end: Alignment(1, 1), colors: [ - Colors.grey[ - 100], - Colors.grey[ - 200], + Colors.grey[100]!, + Colors.grey[200]!, ]), boxShadow: [ BoxShadow( - color: Color.fromRGBO( - 0, - 0, - 0, - 0.08), - offset: Offset( - 0.0, - 5.0), - blurRadius: - 16.0) + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) ], - borderRadius: - BorderRadius.all( - Radius.circular( - 50.0)), + borderRadius: BorderRadius.all(Radius.circular(50.0)), ), width: 80, height: 80, child: Icon( - item.gender == - "1" - ? DoctorApp - .male - : DoctorApp - .female_icon, + item.gender == "1" + ? DoctorApp.male + : DoctorApp.female_icon, size: 80, )), ], @@ -135,48 +114,28 @@ class _LiveCarePandingListState extends State { width: 20, ), Column( - crossAxisAlignment: - CrossAxisAlignment - .start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( item.patientName, - fontSize: 2.0 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight - .bold, + fontSize: 2.0 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), SizedBox( height: 8, ), AppText( - TranslationBase.of( - context) - .fileNo + - item.patientID - .toString(), - fontSize: 2.0 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight - .bold, + TranslationBase.of(context).fileNo! + + item.patientID.toString(), + fontSize: 2.0 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), AppText( - TranslationBase.of( - context) - .age + + TranslationBase.of(context).age! + ' ' + - item.age - .toString(), - fontSize: 2.0 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight - .bold, + item.age.toString(), + fontSize: 2.0 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), SizedBox( height: 8, @@ -193,8 +152,7 @@ class _LiveCarePandingListState extends State { Icons.video_call, size: 40, ), - color: Colors - .green, //Colors.black, + color: Colors.green, //Colors.black, onPressed: () => { _isInit = true, // sharedPref.setObj( @@ -255,9 +213,9 @@ class _LiveCarePandingListState extends State { MyGlobals myGlobals = new MyGlobals(); class MyGlobals { - GlobalKey _scaffoldKey; + GlobalKey? _scaffoldKey; MyGlobals() { _scaffoldKey = GlobalKey(); } - GlobalKey get scaffoldKey => _scaffoldKey; + GlobalKey get scaffoldKey => _scaffoldKey!; } diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index c6f9a885..aecccac7 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -18,7 +18,7 @@ class VideoCallPage extends StatefulWidget { final PatiantInformtion patientData; final listContext; final LiveCarePatientViewModel model; - VideoCallPage({this.patientData, this.listContext, this.model}); + VideoCallPage({required this.patientData, this.listContext, required this.model}); @override _VideoCallPageState createState() => _VideoCallPageState(); @@ -27,10 +27,10 @@ class VideoCallPage extends StatefulWidget { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class _VideoCallPageState extends State { - Timer _timmerInstance; + late Timer _timmerInstance; int _start = 0; String _timmer = ''; - LiveCareViewModel _liveCareProvider; + late LiveCareViewModel _liveCareProvider; bool _isInit = true; var _tokenData; bool isTransfer = false; @@ -75,13 +75,13 @@ class _VideoCallPageState extends State { }, onCallEnd: () { //TODO handling onCallEnd - WidgetsBinding.instance.addPostFrameCallback((_) { + WidgetsBinding.instance!.addPostFrameCallback((_) { changeRoute(context); }); }, onCallNotRespond: (SessionStatusModel sessionStatusModel) { //TODO handling onCalNotRespondEnd - WidgetsBinding.instance.addPostFrameCallback((_) { + WidgetsBinding.instance!.addPostFrameCallback((_) { changeRoute(context); }); }); @@ -96,8 +96,7 @@ class _VideoCallPageState extends State { }); connectOpenTok(result); - }).catchError((error) => - {Helpers.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } @override @@ -125,20 +124,14 @@ class _VideoCallPageState extends State { ), Text( _start == 0 ? 'Dailing' : 'Connected', - style: TextStyle( - color: Colors.deepPurpleAccent, - fontWeight: FontWeight.w300, - fontSize: 15), + style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w300, fontSize: 15), ), SizedBox( height: MediaQuery.of(context).size.height * 0.02, ), Text( - widget.patientData.fullName, - style: TextStyle( - color: Colors.deepPurpleAccent, - fontWeight: FontWeight.w900, - fontSize: 20), + widget.patientData.fullName!, + style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, fontSize: 20), ), SizedBox( height: MediaQuery.of(context).size.height * 0.02, @@ -146,10 +139,7 @@ class _VideoCallPageState extends State { Container( child: Text( _start == 0 ? 'Connecting...' : _timmer.toString(), - style: TextStyle( - color: Colors.deepPurpleAccent, - fontWeight: FontWeight.w300, - fontSize: 15), + style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w300, fontSize: 15), )), SizedBox( height: MediaQuery.of(context).size.height * 0.02, @@ -196,8 +186,8 @@ class _VideoCallPageState extends State { _showAlert(BuildContext context) async { await showDialog( context: context, - builder: (dialogContex) => AlertDialog(content: StatefulBuilder( - builder: (BuildContext context, StateSetter setState) { + builder: (dialogContex) => + AlertDialog(content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { return Container( height: MediaQuery.of(context).size.height * 0.7, width: MediaQuery.of(context).size.width * .9, @@ -210,8 +200,7 @@ class _VideoCallPageState extends State { top: -40.0, child: InkResponse( onTap: () { - Navigator.of(context, rootNavigator: true) - .pop('dialog'); + Navigator.of(context, rootNavigator: true).pop('dialog'); Navigator.of(context).pop(); }, child: CircleAvatar( @@ -229,8 +218,7 @@ class _VideoCallPageState extends State { padding: EdgeInsets.all(8.0), child: RaisedButton( onPressed: () => {endCall()}, - child: - Text(TranslationBase.of(context).endcall), + child: Text(TranslationBase.of(context).endcall!), color: Colors.red, textColor: Colors.white, )), @@ -238,8 +226,7 @@ class _VideoCallPageState extends State { padding: EdgeInsets.all(8.0), child: RaisedButton( onPressed: () => {resumeCall()}, - child: - Text(TranslationBase.of(context).resumecall), + child: Text(TranslationBase.of(context).resumecall!), color: Colors.green[900], textColor: Colors.white, ), @@ -248,8 +235,7 @@ class _VideoCallPageState extends State { padding: EdgeInsets.all(8.0), child: RaisedButton( onPressed: () => {endCallWithCharge()}, - child: Text(TranslationBase.of(context) - .endcallwithcharge), + child: Text(TranslationBase.of(context).endcallwithcharge!), textColor: Colors.white, ), ), @@ -259,8 +245,7 @@ class _VideoCallPageState extends State { onPressed: () => { setState(() => {isTransfer = true}) }, - child: Text( - TranslationBase.of(context).transfertoadmin), + child: Text(TranslationBase.of(context).transfertoadmin!), color: Colors.yellow[900], ), ), @@ -274,14 +259,11 @@ class _VideoCallPageState extends State { child: TextField( maxLines: 3, controller: notes, - decoration: InputDecoration.collapsed( - hintText: - "Enter your notes here"), + decoration: InputDecoration.collapsed(hintText: "Enter your notes here"), )), Center( child: RaisedButton( - onPressed: () => - {this.transferToAdmin(notes)}, + onPressed: () => {this.transferToAdmin(notes)}, child: Text('Transfer'), color: Colors.yellow[900], )) @@ -303,33 +285,24 @@ class _VideoCallPageState extends State { transferToAdmin(notes) { closeRoute(); - _liveCareProvider - .transfterToAdmin(widget.patientData, notes) - .then((result) { + _liveCareProvider.transfterToAdmin(widget.patientData, notes).then((result) { connectOpenTok(result); - }).catchError((error) => - {Helpers.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } endCall() { closeRoute(); - _liveCareProvider - .endCall(widget.patientData, false, doctorprofile['DoctorID']) - .then((result) { + _liveCareProvider.endCall(widget.patientData, false, doctorprofile['DoctorID']).then((result) { print(result); - }).catchError((error) => - {Helpers.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } endCallWithCharge() { - _liveCareProvider - .endCallWithCharge(widget.patientData.vcId, doctorprofile['DoctorID']) - .then((result) { + _liveCareProvider.endCallWithCharge(widget.patientData.vcId, doctorprofile['DoctorID']).then((result) { closeRoute(); print('end callwith charge'); print(result); - }).catchError((error) => - {Helpers.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } closeRoute() { diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index ad7f13cb..4a0020e1 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -17,19 +17,17 @@ class HealthSummaryPage extends StatefulWidget { } class _HealthSummaryPageState extends State { - PatiantInformtion patient; + late PatiantInformtion patient; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), - builder: - (BuildContext context, MedicalFileViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType.toString() ?? "0", @@ -37,7 +35,7 @@ class _HealthSummaryPageState extends State { isInpatient: isInpatient, ), isShowAppBar: true, - appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), + appBarTitle: TranslationBase.of(context).medicalReport!.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -45,8 +43,7 @@ class _HealthSummaryPageState extends State { child: Column( children: [ Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), + padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), child: Container( child: Padding( padding: const EdgeInsets.all(8.0), @@ -76,112 +73,65 @@ class _HealthSummaryPageState extends State { ), ), ), - (model.medicalFileList != null && - model.medicalFileList.length != 0) + (model.medicalFileList != null && model.medicalFileList.length != 0) ? ListView.builder( //physics: , physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList[0] - .timelines.length, + itemCount: model.medicalFileList[0].entityList![0].timelines!.length, itemBuilder: (BuildContext ctxt, int index) { return InkWell( onTap: () { - if (model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .length != + if (model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0] + .consulations!.length != 0) Navigator.push( context, MaterialPageRoute( builder: (context) => MedicalFileDetails( - age: patient.age is String - ? patient.age ?? "" - : "${patient.age}", - firstName: patient.firstName, - lastName: patient.lastName, - gender: patient.genderDescription, + age: patient.age is String ? patient.age ?? "" : "${patient.age}", + firstName: patient.firstName ?? "", + lastName: patient.lastName ?? "", + gender: patient.genderDescription ?? "", encounterNumber: index, pp: patient.patientId, patient: patient, - doctorName: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .isNotEmpty - ? model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorName + doctorName: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.isNotEmpty + ? model.medicalFileList[0].entityList![0].timelines![index].doctorName : "", - clinicName: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .isNotEmpty - ? model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .clinicName + clinicName: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.isNotEmpty + ? model.medicalFileList[0].entityList![0].timelines![index].clinicName : "", - doctorImage: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .isNotEmpty - ? model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorImage + doctorImage: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.isNotEmpty + ? model.medicalFileList[0].entityList![0].timelines![index].doctorImage : "", - episode: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations.isNotEmpty - ? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations[0].episodeID.toString() + episode: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.isNotEmpty + ? model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations![0].episodeID + .toString() : "", - vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString())), + vistDate: model.medicalFileList[0].entityList![0].timelines![index].date + .toString())), ); }, child: DoctorCard( - doctorName: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorName, - clinic: model.medicalFileList[0].entityList[0] - .timelines[index].clinicName, - branch: model.medicalFileList[0].entityList[0] - .timelines[index].projectName, - profileUrl: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorImage, - appointmentDate: - AppDateUtils.getDateTimeFromServerFormat( - model.medicalFileList[0].entityList[0] - .timelines[index].date, + doctorName: + model.medicalFileList[0].entityList![0].timelines![index].doctorName ?? "", + clinic: model.medicalFileList[0].entityList![0].timelines![index].clinicName ?? "", + branch: model.medicalFileList[0].entityList![0].timelines![index].projectName ?? "", + profileUrl: + model.medicalFileList[0].entityList![0].timelines![index].doctorImage ?? "", + appointmentDate: AppDateUtils.getDateTimeFromServerFormat( + model.medicalFileList[0].entityList![0].timelines![index].date ?? "", ), isPrescriptions: true, - isShowEye: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .length != + isShowEye: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.length != 0 ? true : false), @@ -197,8 +147,7 @@ class _HealthSummaryPageState extends State { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .noMedicalFileFound), + child: AppText(TranslationBase.of(context).noMedicalFileFound), ) ], ), diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 9bfde511..a5f5b385 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -21,24 +21,24 @@ class MedicalFileDetails extends StatefulWidget { int encounterNumber; int pp; PatiantInformtion patient; - String clinicName; + String? clinicName; String episode; - String doctorName; + String? doctorName; String vistDate; - String doctorImage; + String? doctorImage; MedicalFileDetails( - {this.age, - this.firstName, - this.lastName, - this.gender, - this.encounterNumber, - this.pp, - this.patient, + {required this.age, + required this.firstName, + required this.lastName, + required this.gender, + required this.encounterNumber, + required this.pp, + required this.patient, this.doctorName, - this.vistDate, + required this.vistDate, this.clinicName, - this.episode, + required this.episode, this.doctorImage}); @override @@ -50,11 +50,11 @@ class MedicalFileDetails extends StatefulWidget { encounterNumber: encounterNumber, pp: pp, patient: patient, - clinicName: clinicName, - doctorName: doctorName, + clinicName: clinicName!, + doctorName: doctorName!, episode: episode, vistDate: vistDate, - doctorImage: doctorImage, + doctorImage: doctorImage!, ); } @@ -73,18 +73,18 @@ class _MedicalFileDetailsState extends State { String doctorImage; _MedicalFileDetailsState( - {this.age, - this.firstName, - this.lastName, - this.gender, - this.encounterNumber, - this.pp, - this.patient, - this.doctorName, - this.vistDate, - this.clinicName, - this.episode, - this.doctorImage}); + {required this.age, + required this.firstName, + required this.lastName, + required this.gender, + required this.encounterNumber, + required this.pp, + required this.patient, + required this.doctorName, + required this.vistDate, + required this.clinicName, + required this.episode, + required this.doctorImage}); bool isPhysicalExam = true; bool isProcedureExpand = true; bool isHistoryExpand = true; @@ -99,26 +99,23 @@ class _MedicalFileDetailsState extends State { model.getMedicalFile(mrn: pp); } }, - builder: - (BuildContext context, MedicalFileViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold( appBar: PatientProfileHeaderWhitAppointmentAppBar( patient: patient, patientType: patient.patientType.toString() ?? "0", - arrivalType: patient.arrivedOn.toString() ?? 0, + arrivalType: patient.arrivedOn.toString()!, doctorName: doctorName, profileUrl: doctorImage, clinic: clinicName, isPrescriptions: true, isMedicalFile: true, episode: episode, - vistDate: - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( - vistDate, - ), isArabic: projectViewModel.isArabic)}', + vistDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( + vistDate, + ), isArabic: projectViewModel.isArabic)}', ), isShowAppBar: true, - appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), + appBarTitle: TranslationBase.of(context).medicalReport!.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -127,13 +124,8 @@ class _MedicalFileDetailsState extends State { child: Column( children: [ model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != + model.medicalFileList[0].entityList![0].timelines![encounterNumber].timeLineEvents![0] + .consulations!.length != 0 ? Padding( padding: EdgeInsets.all(10.0), @@ -142,109 +134,81 @@ class _MedicalFileDetailsState extends State { children: [ SizedBox(height: 25.0), if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ AppText( - TranslationBase.of( - context) - .historyOfPresentIllness + TranslationBase.of(context) + .historyOfPresentIllness! .toUpperCase(), - variant: isHistoryExpand - ? "bodyText" - : '', - bold: isHistoryExpand - ? true - : true, + variant: isHistoryExpand ? "bodyText" : '', + bold: isHistoryExpand ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isHistoryExpand = - !isHistoryExpand; + isHistoryExpand = !isHistoryExpand; }); }, - child: Icon(isHistoryExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstCheifComplaint + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstCheifComplaint! .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ Expanded( child: AppText( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstCheifComplaint[ - index] - .hOPI + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstCheifComplaint![index] + .hOPI! .trim(), ), ), - SizedBox( - width: 35.0), + SizedBox(width: 35.0), ], ), ], @@ -264,86 +228,62 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText( - TranslationBase.of( - context) - .assessment - .toUpperCase(), - variant: - isAssessmentExpand - ? "bodyText" - : '', - bold: isAssessmentExpand - ? true - : true, + AppText(TranslationBase.of(context).assessment!.toUpperCase(), + variant: isAssessmentExpand ? "bodyText" : '', + bold: isAssessmentExpand ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isAssessmentExpand = - !isAssessmentExpand; + isAssessmentExpand = !isAssessmentExpand; }); }, - child: Icon(isAssessmentExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: + Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments! .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ @@ -353,58 +293,39 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .iCD10 + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .iCD10! .trim(), fontSize: 13.5, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), - SizedBox( - width: 15.0), + SizedBox(width: 15.0), ], ), Row( children: [ AppText( - TranslationBase.of( - context) - .condition + - ": ", + TranslationBase.of(context).condition! + ": ", fontSize: 12.5, ), Expanded( child: AppText( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .condition + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .condition! .trim(), fontSize: 13.0, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ), ], @@ -414,22 +335,14 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] .description, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, fontSize: 15.0, ), ) @@ -438,32 +351,21 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - TranslationBase.of( - context) - .type + - ": ", + TranslationBase.of(context).type! + ": ", fontSize: 15.5, ), Expanded( child: AppText( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] .type, fontSize: 16.0, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ), ], @@ -473,16 +375,13 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .remarks + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .remarks! .trim(), ), Divider( @@ -507,85 +406,62 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText( - TranslationBase.of( - context) - .test - .toUpperCase(), - variant: isProcedureExpand - ? "bodyText" - : '', - bold: isProcedureExpand - ? true - : true, + AppText(TranslationBase.of(context).test!.toUpperCase(), + variant: isProcedureExpand ? "bodyText" : '', + bold: isProcedureExpand ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isProcedureExpand = - !isProcedureExpand; + isProcedureExpand = !isProcedureExpand; }); }, - child: Icon(isProcedureExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: + Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure! .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ @@ -596,63 +472,39 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .procedureId + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] + .procedureId! .trim(), - fontSize: - 13.5, - fontWeight: - FontWeight - .w700, + fontSize: 13.5, + fontWeight: FontWeight.w700, ), ], ), - SizedBox( - width: 35.0), + SizedBox(width: 35.0), Column( children: [ AppText( - TranslationBase.of( - context) - .orderDate + - ": ", + TranslationBase.of(context).orderDate! + ": ", ), AppText( - AppDateUtils.getDateFormatted( - DateTime - .parse( + AppDateUtils.getDateFormatted(DateTime.parse( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .orderDate + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] + .orderDate! .trim(), )), - fontSize: - 13.5, - fontWeight: - FontWeight - .w700, + fontSize: 13.5, + fontWeight: FontWeight.w700, ), ], ), @@ -666,22 +518,14 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] .procName, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ) ], @@ -693,22 +537,15 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] .patientID .toString(), - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ], ), @@ -737,78 +574,59 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ AppText( - TranslationBase.of( - context) - .physicalSystemExamination + TranslationBase.of(context) + .physicalSystemExamination! .toUpperCase(), - variant: isPhysicalExam - ? "bodyText" - : '', - bold: isPhysicalExam - ? true - : true, + variant: isPhysicalExam ? "bodyText" : '', + bold: isPhysicalExam ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isPhysicalExam = - !isPhysicalExam; + isPhysicalExam = !isPhysicalExam; }); }, - child: Icon(isPhysicalExam - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam! .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( @@ -816,27 +634,17 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - AppText(TranslationBase.of( - context) - .examType + - ": "), + AppText(TranslationBase.of(context).examType! + ": "), AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] .examDesc, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ], ), @@ -844,47 +652,30 @@ class _MedicalFileDetailsState extends State { children: [ AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] .examDesc, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ) ], ), Row( children: [ - AppText(TranslationBase.of( - context) - .abnormal + - ": "), + AppText(TranslationBase.of(context).abnormal! + ": "), AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] .abnormal, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ], ), @@ -893,15 +684,12 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] .remarks, ), Divider( diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index eeea51c5..b5027c33 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -31,7 +31,7 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg { MedicineSearchScreen({this.changeLoadingState}); - final Function changeLoadingState; + final Function? changeLoadingState; @override _MedicineSearchState createState() => _MedicineSearchState(); @@ -46,17 +46,16 @@ class _MedicineSearchState extends State { bool _isInit = true; final SpeechToText speech = SpeechToText(); String lastStatus = ''; - GetMedicationResponseModel _selectedMedication; - GlobalKey key = - new GlobalKey>(); + late GetMedicationResponseModel _selectedMedication; + GlobalKey key = new GlobalKey>(); // String lastWords; List _localeNames = []; - String lastError; + late String lastError; double level = 0.0; double minSoundLevel = 50000; double maxSoundLevel = -50000; - String reconizedWord; + late String reconizedWord; @override void didChangeDependencies() { @@ -70,15 +69,13 @@ class _MedicineSearchState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); // if (hasSpeech) { // _localeNames = await speech.locales(); // var systemLocale = await speech.systemLocale(); - _currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' - ? 'en-GB' - : 'ar-SA'; // systemLocale.localeId; + _currentLocaleId = + TranslationBase.of(context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId; // } if (!mounted) return; @@ -88,9 +85,7 @@ class _MedicineSearchState extends State { }); } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -123,7 +118,7 @@ class _MedicineSearchState extends State { return AppScaffold( // baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).searchMedicine, + appBarTitle: TranslationBase.of(context).searchMedicine!, body: SingleChildScrollView( child: FractionallySizedBox( widthFactor: 0.97, @@ -141,13 +136,11 @@ class _MedicineSearchState extends State { child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(10), child: AppTextFormField( borderColor: Colors.white, - hintText: - TranslationBase.of(context).searchMedicineNameHere, + hintText: TranslationBase.of(context).searchMedicineNameHere, controller: myController, onSaved: (value) {}, onFieldSubmitted: (value) { @@ -178,18 +171,15 @@ class _MedicineSearchState extends State { ), ), Container( - margin: - EdgeInsets.only(left: SizeConfig.heightMultiplier * 2), + margin: EdgeInsets.only(left: SizeConfig.heightMultiplier * 2), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).youCanFind + - (myController.text != '' - ? model.pharmacyItemsList.length.toString() - : '0') + + TranslationBase.of(context).youCanFind! + + (myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') + " " + - TranslationBase.of(context).itemsInSearch, + TranslationBase.of(context).itemsInSearch!, fontWeight: FontWeight.bold, ), ], @@ -206,26 +196,20 @@ class _MedicineSearchState extends State { scrollDirection: Axis.vertical, // shrinkWrap: true, - itemCount: model.pharmacyItemsList == null - ? 0 - : model.pharmacyItemsList.length, + itemCount: model.pharmacyItemsList == null ? 0 : model.pharmacyItemsList.length, itemBuilder: (BuildContext context, int index) { return InkWell( child: MedicineItemWidget( - label: model.pharmacyItemsList[index] - ["ItemDescription"], - url: model.pharmacyItemsList[index] - ["ImageSRCUrl"], + label: model.pharmacyItemsList[index]["ItemDescription"], + url: model.pharmacyItemsList[index]["ImageSRCUrl"], ), onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => PharmaciesListScreen( - itemID: model.pharmacyItemsList[index] - ["ItemID"], - url: model.pharmacyItemsList[index] - ["ImageSRCUrl"]), + itemID: model.pharmacyItemsList[index]["ItemID"], + url: model.pharmacyItemsList[index]["ImageSRCUrl"]), ), ); }, diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 49c39c53..764a19f6 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -23,8 +23,7 @@ class PharmaciesListScreen extends StatefulWidget { final String url; - PharmaciesListScreen({Key key, @required this.itemID, this.url}) - : super(key: key); + PharmaciesListScreen({Key? key, required this.itemID, required this.url}) : super(key: key); @override _PharmaciesListState createState() => _PharmaciesListState(); @@ -32,8 +31,7 @@ class PharmaciesListScreen extends StatefulWidget { class _PharmaciesListState extends State { Helpers helpers = new Helpers(); - ProjectViewModel projectsProvider; - + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { @@ -42,7 +40,7 @@ class _PharmaciesListState extends State { onModelReady: (model) => model.getPharmaciesList(widget.itemID), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).pharmaciesList, + appBarTitle: TranslationBase.of(context).pharmaciesList!, body: Container( height: SizeConfig.screenHeight, child: ListView( @@ -52,71 +50,64 @@ class _PharmaciesListState extends State { children: [ model.pharmaciesList.length > 0 ? RoundedContainer( - child: Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), - child: widget.url != null - ? Image.network( - widget.url, - height: - SizeConfig.imageSizeMultiplier * - 21, - width: - SizeConfig.imageSizeMultiplier * - 20, - fit: BoxFit.cover, - ): Container(), + child: Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(7)), + child: widget.url != null + ? Image.network( + widget.url, + height: SizeConfig.imageSizeMultiplier * 21, + width: SizeConfig.imageSizeMultiplier * 20, + fit: BoxFit.cover, + ) + : Container(), + ), ), - ), - Expanded( - flex: 3, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - AppText( - TranslationBase.of(context) - .description, - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - model.pharmaciesList[0]["ItemDescription"], - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - AppText( - TranslationBase.of(context).price, - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - model.pharmaciesList[0]["SellingPrice"] - .toString(), - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - ], - ), - ) - ], - )): Container(), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + AppText( + TranslationBase.of(context).description, + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + model.pharmaciesList[0]["ItemDescription"], + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + AppText( + TranslationBase.of(context).price, + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + model.pharmaciesList[0]["SellingPrice"].toString(), + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + ], + ), + ) + ], + )) + : Container(), Container( margin: EdgeInsets.only( top: SizeConfig.widthMultiplier * 2, @@ -131,18 +122,15 @@ class _PharmaciesListState extends State { fontWeight: FontWeight.bold, ), ), - alignment: projectsProvider.isArabic - ? Alignment.topRight - : Alignment.topLeft, + alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, ), Container( width: SizeConfig.screenWidth * 0.99, - margin: EdgeInsets.only(left: 10,right: 10), + margin: EdgeInsets.only(left: 10, right: 10), child: ListView.builder( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemCount: model.pharmaciesList == null ? 0 : model - .pharmaciesList.length, + itemCount: model.pharmaciesList == null ? 0 : model.pharmaciesList.length, itemBuilder: (BuildContext context, int index) { return RoundedContainer( margin: EdgeInsets.only(top: 5), @@ -151,15 +139,11 @@ class _PharmaciesListState extends State { Expanded( flex: 1, child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), + borderRadius: BorderRadius.all(Radius.circular(7)), child: Image.network( - model - .pharmaciesList[index]["ProjectImageURL"], - height: - SizeConfig.imageSizeMultiplier * 15, - width: - SizeConfig.imageSizeMultiplier * 15, + model.pharmaciesList[index]["ProjectImageURL"], + height: SizeConfig.imageSizeMultiplier * 15, + width: SizeConfig.imageSizeMultiplier * 15, fit: BoxFit.cover, ), ), @@ -167,8 +151,7 @@ class _PharmaciesListState extends State { Expanded( flex: 4, child: AppText( - model - .pharmaciesList[index]["LocationDescription"], + model.pharmaciesList[index]["LocationDescription"], margin: 10, ), ), @@ -186,10 +169,7 @@ class _PharmaciesListState extends State { Icons.call, color: Colors.red, ), - onTap: () => - launch("tel://" + - model - .pharmaciesList[index]["PhoneNumber"]), + onTap: () => launch("tel://" + model.pharmaciesList[index]["PhoneNumber"]), ), ), Padding( @@ -201,14 +181,9 @@ class _PharmaciesListState extends State { ), onTap: () { MapsLauncher.launchCoordinates( - double.parse( - model - .pharmaciesList[index]["Latitude"]), - double.parse( - model - .pharmaciesList[index]["Longitude"]), - model.pharmaciesList[index] - ["LocationDescription"]); + double.parse(model.pharmaciesList[index]["Latitude"]), + double.parse(model.pharmaciesList[index]["Longitude"]), + model.pharmaciesList[index]["LocationDescription"]); }, ), ), @@ -221,18 +196,18 @@ class _PharmaciesListState extends State { }), ) ]), - ),),); + ), + ), + ); } - Image imageFromBase64String(String base64String) { return Image.memory(base64Decode(base64String)); } //TODO CHECK THE URL IS NULL OR NOT - Uint8List dataFromBase64String(String base64String) { - if(base64String !=null) - return base64Decode(base64String); + Uint8List? dataFromBase64String(String base64String) { + if (base64String != null) return base64Decode(base64String); } String base64String(Uint8List data) { diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 7f314c0e..b1e3c754 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -24,322 +24,309 @@ class _DischargedPatientState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getDischargedPatient(), - builder: (_, model, w) => AppScaffold( - //appBarTitle: 'Discharged Patient', - //subtitle: "Last Three Months", - backgroundColor: Colors.grey[200], - isShowAppBar: false, - baseViewModel: model, - body: model.myDischargedPatient.isEmpty? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - 'No Discharged Patient', - color: Theme.of(context).errorColor, - ), - ) - ], - ), - ):Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - SizedBox(height: 12,), - Container( - width: double.maxFinite, - height: 75, - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: Color(0xffCCCCCC), - ), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - left: 10, top: 10), + onModelReady: (model) => model.getDischargedPatient(), + builder: (_, model, w) => AppScaffold( + //appBarTitle: 'Discharged Patient', + //subtitle: "Last Three Months", + backgroundColor: Colors.grey[200]!, + isShowAppBar: false, + baseViewModel: model, + body: model.myDischargedPatient.isEmpty + ? Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), child: AppText( - TranslationBase.of( - context) - .searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), + 'No Discharged Patient', + color: Theme.of(context).errorColor, ), - onChanged: (String str) { - model.searchData(str); - }), - ])), - SizedBox(height: 5,), - Expanded(child: SingleChildScrollView( - child: Column( - children: [ - ...List.generate(model.filterData.length, (index) => InkWell( - onTap: () { - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model.filterData[index], - "patientType": "1", - "isSearch": false, - "isInpatient":true, - "isDischargedPatient":true - }); - - }, - child: Container( - width: double.maxFinite, - margin: EdgeInsets.all(8), - padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - color: Colors.white, - ), - child: Column( - children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row(children: [ - Container( - width: 170, - child: AppText( - (Helpers.capitalize(model - .filterData[index] - .firstName) + - " " + - Helpers.capitalize(model - .filterData[index] - .lastName)), - fontSize: 16, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - textOverflow: TextOverflow.ellipsis, - ), - ), - model.filterData[index].gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - ]), - Row( - children: [ - AppText( - model.filterData[index].nationalityName != null - ? model.filterData[index].nationalityName.trim() - : model.filterData[index].nationality != null - ? model.filterData[index].nationality.trim() - : model.filterData[index].nationalityId != null - ? model.filterData[index].nationalityId - : "", - fontWeight: FontWeight.bold, - fontSize: 14, - textOverflow: TextOverflow.ellipsis, - ), - model.filterData[index] - .nationality != - null || - model.filterData[index] - .nationalityId != - null - ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), - child: Image.network( - model.filterData[index].nationalityFlagURL != null ? - model.filterData[index].nationalityFlagURL - : '', - height: 25, - width: 30, - errorBuilder: - (BuildContext context, - Object exception, - StackTrace stackTrace) { - return AppText( - '', - fontSize: 10, - ); - }, - )) - : SizedBox() - ], - ) - ], - )), - Row( - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - model.filterData[index].gender == - 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), + ) + ], + ), + ) + : Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), + SizedBox( + height: 12, + ), + Container( + width: double.maxFinite, + height: 75, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: Color(0xffCCCCCC), + ), + color: Colors.white), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + onPressed: () {}, + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, ), + iconSize: 20, + padding: EdgeInsets.only(bottom: 30), ), - ], - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context) - .fileNumber, - style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), - new TextSpan( - text: model - .filterData[index] - .patientId - .toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], - ), - ), - ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: model.filterData[index].admissionDate == null ? "" : - TranslationBase.of(context).admissionDate + " : ", - style: TextStyle(fontSize: 14)), - new TextSpan( - text: model.filterData[index].admissionDate == null ? "" - : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 15)), - ], - ), - ), - ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', + onChanged: (String str) { + model.searchData(str); + }), + ])), + SizedBox( + height: 5, + ), + Expanded( + child: SingleChildScrollView( + child: Column( + children: [ + ...List.generate( + model.filterData.length, + (index) => InkWell( + onTap: () { + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filterData[index], + "patientType": "1", + "isSearch": false, + "isInpatient": true, + "isDischargedPatient": true + }); + }, + child: Container( + width: double.maxFinite, + margin: EdgeInsets.all(8), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row(children: [ + Container( + width: 170, + child: AppText( + (Helpers.capitalize(model.filterData[index].firstName) + + " " + + Helpers.capitalize( + model.filterData[index].lastName)), + fontSize: 16, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, + ), + ), + model.filterData[index].gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + Row( + children: [ + AppText( + model.filterData[index].nationalityName != null + ? model.filterData[index].nationalityName!.trim() + : model.filterData[index].nationality != null + ? model.filterData[index].nationality!.trim() + : model.filterData[index].nationalityId != null + ? model.filterData[index].nationalityId + : "", + fontWeight: FontWeight.bold, + fontSize: 14, + textOverflow: TextOverflow.ellipsis, + ), + model.filterData[index].nationality != null || + model.filterData[index].nationalityId != null + ? ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + model.filterData[index].nationalityFlagURL != + null + ? model + .filterData[index].nationalityFlagURL! + : '', + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, StackTrace? stackTrace) { + return AppText( + '', + fontSize: 10, + ); + }, + )) + : SizedBox() + ], + ) + ], + )), + Row( + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + model.filterData[index].gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + ], + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 14, fontFamily: 'Poppins')), + new TextSpan( + text: model.filterData[index].patientId + .toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], + ), + ), + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: model.filterData[index].admissionDate == + null + ? "" + : TranslationBase.of(context) + .admissionDate! + + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: model.filterData[index].admissionDate == + null + ? "" + : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle( + fontWeight: FontWeight.w700, fontSize: 15)), + ], + ), + ), + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: model.filterData[index].dischargeDate == + null + ? "" + : "Discharge Date : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: model.filterData[index].dischargeDate == + null + ? "" + : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle( + fontWeight: FontWeight.w700, fontSize: 15)), + ], + ), + ), + ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).numOfDays}: ", + fontSize: 14, + fontWeight: FontWeight.w300, + ), + AppText( + "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate ?? "")).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700), + ], + ), + ], + ), + ) + ], + ) + ], + ), ), - children: [ - new TextSpan( - text: model.filterData[index].dischargeDate == null ? "" - : "Discharge Date : ", - style: TextStyle(fontSize: 14)), - new TextSpan( - text: model.filterData[index].dischargeDate == null ? "" - : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 15)), - ], - ), - ), - ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).numOfDays}: ", - fontSize: 14,fontWeight: FontWeight.w300, - ), - AppText( - "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", - fontSize: 15, - fontWeight: FontWeight.w700), - ], - ), - ], - ), - ) - ], - ) - ], - ), + )), + ], + ), + ), + ), + ], ), - )), - ], - ), - - - ), - ),], - ), - ),) - ); + ), + )); } - - } diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index 33692628..1ea723fc 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -17,21 +17,19 @@ import 'package:url_launcher/url_launcher.dart'; class ECGPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patient-type']; String arrivalType = routeArgs['arrival-type']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getECGPatient( - patientType: patient.patientType, - patientOutSA: 0, - patientID: patient.patientId), + onModelReady: (model) => + model.getECGPatient(patientType: patient.patientType, patientOutSA: 0, patientID: patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, backgroundColor: Color(0xffF8F8F8), - appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), + appBar: PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType), body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(8.0), @@ -39,84 +37,105 @@ class ECGPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ // PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), - SizedBox(height: 12,), - AppText('Service',style: "caption2",color: Colors.black,), - AppText('ECG',bold: true,fontSize: 22,), - SizedBox(height: 12,), - ...List.generate(model.patientMuseResultsModelList.length, (index) => InkWell( - onTap: () async { - await launch( - model.patientMuseResultsModelList[index].imageURL); - }, - child: Container( - width: double.infinity, - height: 120, - margin: EdgeInsets.only(top: 5,bottom: 5), - padding: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all(color: Colors.white,width: 2), - color: Colors.white, - borderRadius: BorderRadius.circular(8) - ), - child: Column( - children: [ - Row( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText('ECG Report',fontWeight: FontWeight.w700,fontSize: 17,), - SizedBox(height:3), - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 1.6 * - SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: - TranslationBase.of(context).orderNo, - style: TextStyle( - fontSize: 12, - fontFamily: - 'Poppins')), - new TextSpan( - text: '${/*model.patientMuseResultsModelList[index].orderNo?? */'3455'}', - style: TextStyle( - fontWeight: FontWeight.w600, - fontFamily: - 'Poppins', - fontSize: 14)), - ], + SizedBox( + height: 12, + ), + AppText( + 'Service', + style: "caption2", + color: Colors.black, + ), + AppText( + 'ECG', + bold: true, + fontSize: 22, + ), + SizedBox( + height: 12, + ), + ...List.generate( + model.patientMuseResultsModelList.length, + (index) => InkWell( + onTap: () async { + await launch(model.patientMuseResultsModelList[index].imageURL ?? ""); + }, + child: Container( + width: double.infinity, + height: 120, + margin: EdgeInsets.only(top: 5, bottom: 5), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all(color: Colors.white, width: 2), + color: Colors.white, + borderRadius: BorderRadius.circular(8)), + child: Column( + children: [ + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'ECG Report', + fontWeight: FontWeight.w700, + fontSize: 17, + ), + SizedBox(height: 3), + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).orderNo, + style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), + new TextSpan( + text: + '${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}', + style: TextStyle( + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + fontSize: 14)), + ], + ), + ) + ], + ), ), - ) - ], - ), - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText('${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), - AppText('${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), - ], - ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime ?? DateTime.now(), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + '${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime ?? DateTime.now())}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ), + ], + ), + SizedBox( + height: 15, + ), + Align( + alignment: Alignment.topRight, + child: Icon(DoctorApp.external_link), + ) + ], ), - ], - ), - SizedBox(height: 15,), - Align( - alignment: Alignment.topRight, - child: Icon(DoctorApp.external_link), - ) - ], - ), - ), - )), - + ), + )), ], ), ), diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index 1b42d305..0942c253 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -68,73 +68,56 @@ class _InPatientPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ...List.generate( - model.filteredInPatientItems.length, (index) { + ...List.generate(model.filteredInPatientItems.length, (index) { if (!widget.isMyInPatient) return PatientCard( - patientInfo: - model.filteredInPatientItems[index], + patientInfo: model.filteredInPatientItems[index], patientType: "1", arrivalType: "1", isInpatient: true, - isMyPatient: model - .filteredInPatientItems[index] - .doctorId == - model.doctorProfile.doctorID, + isMyPatient: + model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, onTap: () { - FocusScopeNode currentFocus = - FocusScope.of(context); + FocusScopeNode currentFocus = FocusScope.of(context); if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model - .filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); }, ); - else if (model.filteredInPatientItems[index] - .doctorId == - model.doctorProfile.doctorID && + else if (model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID && widget.isMyInPatient) return PatientCard( - patientInfo: - model.filteredInPatientItems[index], + patientInfo: model.filteredInPatientItems[index], patientType: "1", arrivalType: "1", isInpatient: true, - isMyPatient: model - .filteredInPatientItems[index] - .doctorId == - model.doctorProfile.doctorID, + isMyPatient: + model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, onTap: () { - FocusScopeNode currentFocus = - FocusScope.of(context); + FocusScopeNode currentFocus = FocusScope.of(context); if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model - .filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); }, ); else @@ -150,10 +133,7 @@ class _InPatientPageState extends State { ) : Expanded( child: SingleChildScrollView( - child: Container( - child: ErrorMessage( - error: - TranslationBase.of(context).noDataAvailable)), + child: Container(child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable ?? "")), ), ), ], diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 60446887..927db334 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -16,9 +16,8 @@ class PatientInPatientScreen extends StatefulWidget { _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); } -class _PatientInPatientScreenState extends State - with SingleTickerProviderStateMixin { - TabController _tabController; +class _PatientInPatientScreenState extends State with SingleTickerProviderStateMixin { + late TabController _tabController; int _activeTab = 0; @override @@ -85,15 +84,12 @@ class _PatientInPatientScreenState extends State child: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( - preferredSize: Size.fromHeight( - MediaQuery.of(context).size.height * 0.070), + preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: BoxDecoration( border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.5), //width: 0.7 + bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.5), //width: 0.7 ), color: Colors.white), child: Center( @@ -104,18 +100,14 @@ class _PatientInPatientScreenState extends State indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only( - top: 0, left: 0, right: 0, bottom: 0), + labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ - tabWidget(screenSize, _activeTab == 0, - TranslationBase.of(context).inPatientAll, + tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll ?? "", counter: model.inPatientList.length), - tabWidget( - screenSize, _activeTab == 1, "My InPatients", + tabWidget(screenSize, _activeTab == 1, "My InPatients", counter: model.myIinPatientList.length), - tabWidget(screenSize, _activeTab == 2, - TranslationBase.of(context).discharged), + tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged ?? ""), ], ), ), @@ -144,8 +136,7 @@ class _PatientInPatientScreenState extends State ); } - Widget tabWidget(Size screenSize, bool isActive, String title, - {int counter = -1}) { + Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}) { return Center( child: Container( height: screenSize.height * 0.070, diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index f78752ec..68d8c319 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -49,8 +49,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - (Helpers.capitalize( - "${referredPatient.firstName} ${referredPatient.lastName}")), + (Helpers.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -67,20 +66,15 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = - model.getPatientFromDischargeReferralPatient( - referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromDischargeReferralPatient(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "arrivalType": "1", "isDischargedPatient": true, - "from": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Icon( @@ -111,11 +105,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", + "${model.getReferralStatusNameByCode(referredPatient.referralStatus!, context)}", fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, @@ -127,7 +120,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), AppText( AppDateUtils.getDayMonthYearDateFormatted( - referredPatient.referralDate, + referredPatient.referralDate!, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -150,12 +143,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.admissionDate, - "dd MMM,yyyy"), + referredPatient.admissionDate ?? "", "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -175,12 +166,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.dischargeDate, - "dd MMM,yyyy"), + referredPatient.dischargeDate ?? "", "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -199,11 +188,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - "${AppDateUtils.convertStringToDate(referredPatient.dischargeDate).difference(AppDateUtils.convertStringToDate(referredPatient.admissionDate)).inDays + 1}", + "${AppDateUtils.convertStringToDate(referredPatient.dischargeDate ?? "").difference(AppDateUtils.convertStringToDate(referredPatient.admissionDate ?? "")).inDays + 1}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -225,36 +213,30 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.referringDoctorName, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .fileNumber, + TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( "${referredPatient.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -262,60 +244,48 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( - referredPatient - .referringClinicDescription, + referredPatient.referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * - SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .frequency + - ": ", + TranslationBase.of(context).frequency! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient - .frequencyDescription, + referredPatient.frequencyDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * - SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -331,8 +301,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + - ": ", + TranslationBase.of(context).priority! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -343,8 +312,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.priorityDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -363,12 +331,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - referredPatient - .referringClinicDescription, + referredPatient.referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -390,8 +356,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.frequency.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -413,8 +378,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.frequency.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -425,9 +389,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .maxResponseTime + - ": ", + TranslationBase.of(context).maxResponseTime! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -436,12 +398,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime, - "dd MMM,yyyy"), + referredPatient.mAXResponseTime ?? "", "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -451,8 +411,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: - EdgeInsets.only(left: 10, right: 0), + margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( 'assets/images/patient/ic_ref_arrow_left.png', height: 50, @@ -496,30 +455,22 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, - top: 30, - right: 10, - bottom: 0), + margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.5 * - SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Colors.black, ), AppText( - referredPatient - .referringClinicDescription, + referredPatient.referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.3 * - SizeConfig.textMultiplier, + fontSize: 1.3 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart index 92f92f87..1e001799 100644 --- a/lib/screens/patients/ReferralDischargedPatientPage.dart +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -17,81 +17,88 @@ class ReferralDischargedPatientPage extends StatefulWidget { } class _ReferralDischargedPatientPageState extends State { - @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.gtMyDischargeReferralPatient(), builder: (_, model, w) => AppScaffold( appBarTitle: 'Referral Discharged ', - backgroundColor: Colors.grey[200], + backgroundColor: Colors.grey[200]!, isShowAppBar: false, baseViewModel: model, - body: model.myDischargeReferralPatient.isEmpty?Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - 'No Discharged Patient', - color: Theme.of(context).errorColor, + body: model.myDischargeReferralPatient.isEmpty + ? Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + 'No Discharged Patient', + color: Theme.of(context).errorColor, + ), + ) + ], ), ) - ], - ), - ):Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: 5,), - Expanded( - child: ListView.builder( - itemCount: model.myDischargeReferralPatient.length, - itemBuilder: (context,index)=>InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: ReferralDischargedPatientDetails(model.myDischargeReferralPatient[index]), - ), - ); - }, - child: PatientReferralItemWidget( - referralStatus: model.getReferralStatusNameByCode(model.myDischargeReferralPatient[index].referralStatus,context), - referralStatusCode: model.myDischargeReferralPatient[index].referralStatus, - patientName: model.myDischargeReferralPatient[index].firstName+" "+model.myDischargeReferralPatient[index].lastName, - patientGender: model.myDischargeReferralPatient[index].gender, - referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myDischargeReferralPatient[index].referralDate), - referredTime: AppDateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate), - patientID: "${model.myDischargeReferralPatient[index].patientID}", - isSameBranch: false, - isReferral: true, - isReferralClinic: true, - referralClinic:"${model.myDischargeReferralPatient[index].referringClinicDescription}", - remark: model.myDischargeReferralPatient[index].referringDoctorRemarks, - nationality: model.myDischargeReferralPatient[index].nationalityName, - nationalityFlag: '',//model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend - doctorAvatar: '',//model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend - referralDoctorName: model.myDischargeReferralPatient[index].referringDoctorName, - clinicDescription: model.myDischargeReferralPatient[index].referringClinicDescription, - infoIcon: Icon(FontAwesomeIcons.arrowRight, - size: 25, color: Colors.black), - ), - )), + : Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 5, + ), + Expanded( + child: ListView.builder( + itemCount: model.myDischargeReferralPatient.length, + itemBuilder: (context, index) => InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: ReferralDischargedPatientDetails(model.myDischargeReferralPatient[index]), + ), + ); + }, + child: PatientReferralItemWidget( + referralStatus: model.getReferralStatusNameByCode( + model.myDischargeReferralPatient[index].referralStatus!, context), + referralStatusCode: model.myDischargeReferralPatient[index].referralStatus, + patientName: model.myDischargeReferralPatient[index].firstName! + + " " + + model.myDischargeReferralPatient[index].lastName!, + patientGender: model.myDischargeReferralPatient[index].gender, + referredDate: AppDateUtils.getDayMonthYearDateFormatted( + model.myDischargeReferralPatient[index].referralDate!), + referredTime: + AppDateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate!), + patientID: "${model.myDischargeReferralPatient[index].patientID}", + isSameBranch: false, + isReferral: true, + isReferralClinic: true, + referralClinic: + "${model.myDischargeReferralPatient[index].referringClinicDescription}", + remark: model.myDischargeReferralPatient[index].referringDoctorRemarks, + nationality: model.myDischargeReferralPatient[index].nationalityName, + nationalityFlag: + '', //model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend + doctorAvatar: + '', //model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend + referralDoctorName: model.myDischargeReferralPatient[index].referringDoctorName, + clinicDescription: model.myDischargeReferralPatient[index].referringClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), + ), + )), + ), + ], + ), ), - - ], - ), - ), ), ); } - - } diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 2bffdda5..172cf355 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -15,21 +15,19 @@ import 'package:provider/provider.dart'; import '../base/base_view.dart'; class InsuranceApprovalScreenNew extends StatefulWidget { - final int appointmentNo; + final int? appointmentNo; InsuranceApprovalScreenNew({this.appointmentNo}); @override - _InsuranceApprovalScreenNewState createState() => - _InsuranceApprovalScreenNewState(); + _InsuranceApprovalScreenNewState createState() => _InsuranceApprovalScreenNewState(); } -class _InsuranceApprovalScreenNewState - extends State { +class _InsuranceApprovalScreenNewState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; @@ -39,11 +37,9 @@ class _InsuranceApprovalScreenNewState ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient?.appointmentNo, - projectId: patient.projectId) + appointmentNo: patient?.appointmentNo, projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient), - builder: (BuildContext context, InsuranceViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType.toString() ?? "0", @@ -52,7 +48,7 @@ class _InsuranceApprovalScreenNewState ), isShowAppBar: true, baseViewModel: model, - appBarTitle: TranslationBase.of(context).approvals, + appBarTitle: TranslationBase.of(context).approvals ?? "", body: patient.admissionNo != null ? SingleChildScrollView( child: Container( @@ -98,8 +94,7 @@ class _InsuranceApprovalScreenNewState Navigator.push( context, MaterialPageRoute( - builder: (context) => - InsuranceApprovalsDetails( + builder: (context) => InsuranceApprovalsDetails( patient: patient, indexInsurance: index, patientType: patientType, @@ -108,27 +103,14 @@ class _InsuranceApprovalScreenNewState }, child: DoctorCardInsurance( patientOut: "In Patient", - profileUrl: model - .insuranceApprovalInPatient[index] - .doctorImage, - clinic: model - .insuranceApprovalInPatient[index] - .clinicName, - doctorName: model - .insuranceApprovalInPatient[index] - .doctorName, - branch: model - .insuranceApprovalInPatient[index] - .approvalNo - .toString(), + profileUrl: model.insuranceApprovalInPatient[index].doctorImage, + clinic: model.insuranceApprovalInPatient[index].clinicName, + doctorName: model.insuranceApprovalInPatient[index].doctorName, + branch: model.insuranceApprovalInPatient[index].approvalNo.toString(), isPrescriptions: true, - approvalStatus: model - .insuranceApprovalInPatient[index] - .approvalStatusDescption ?? - '', - branch2: model - .insuranceApprovalInPatient[index] - .projectName, + approvalStatus: + model.insuranceApprovalInPatient[index].approvalStatusDescption ?? '', + branch2: model.insuranceApprovalInPatient[index].projectName, ), ), ), @@ -145,8 +127,7 @@ class _InsuranceApprovalScreenNewState Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .noInsuranceApprovalFound), + child: AppText(TranslationBase.of(context).noInsuranceApprovalFound), ), SizedBox( height: 150.0, @@ -173,8 +154,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - TranslationBase.of(context) - .insurance22, + TranslationBase.of(context).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -184,8 +164,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - TranslationBase.of(context) - .approvals22, + TranslationBase.of(context).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -202,8 +181,7 @@ class _InsuranceApprovalScreenNewState Navigator.push( context, MaterialPageRoute( - builder: (context) => - InsuranceApprovalsDetails( + builder: (context) => InsuranceApprovalsDetails( patient: patient, indexInsurance: index, patientType: patientType, @@ -211,24 +189,14 @@ class _InsuranceApprovalScreenNewState ); }, child: DoctorCardInsurance( - patientOut: model.insuranceApproval[index] - .patientDescription, - profileUrl: model - .insuranceApproval[index].doctorImage, - clinic: model - .insuranceApproval[index].clinicName, - doctorName: model - .insuranceApproval[index].doctorName, - branch: model - .insuranceApproval[index].approvalNo - .toString(), + patientOut: model.insuranceApproval[index].patientDescription, + profileUrl: model.insuranceApproval[index].doctorImage, + clinic: model.insuranceApproval[index].clinicName, + doctorName: model.insuranceApproval[index].doctorName, + branch: model.insuranceApproval[index].approvalNo.toString(), isPrescriptions: true, - approvalStatus: model - .insuranceApproval[index] - .approvalStatusDescption ?? - '', - branch2: model - .insuranceApproval[index].projectName, + approvalStatus: model.insuranceApproval[index].approvalStatusDescption ?? '', + branch2: model.insuranceApproval[index].projectName, ), ), ), @@ -245,8 +213,7 @@ class _InsuranceApprovalScreenNewState Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .noInsuranceApprovalFound), + child: AppText(TranslationBase.of(context).noInsuranceApprovalFound), ) ], ), diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 92910394..c47ca5dc 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -17,14 +17,10 @@ class InsuranceApprovalsDetails extends StatefulWidget { int indexInsurance; String patientType; - InsuranceApprovalsDetails( - {this.patient, this.indexInsurance, this.patientType}); + InsuranceApprovalsDetails({required this.patient, required this.indexInsurance, required this.patientType}); @override _InsuranceApprovalsDetailsState createState() => - _InsuranceApprovalsDetailsState( - patient: patient, - indexInsurance: indexInsurance, - patientType: patientType); + _InsuranceApprovalsDetailsState(patient: patient, indexInsurance: indexInsurance, patientType: patientType); } class _InsuranceApprovalsDetailsState extends State { @@ -32,13 +28,12 @@ class _InsuranceApprovalsDetailsState extends State { int indexInsurance; String patientType; - _InsuranceApprovalsDetailsState( - {this.patient, this.indexInsurance, this.patientType}); + _InsuranceApprovalsDetailsState({required this.patient, required this.indexInsurance, required this.patientType}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; return BaseView( onModelReady: (model) => model.insuranceApprovalInPatient.length == 0 @@ -46,776 +41,602 @@ class _InsuranceApprovalsDetailsState extends State { ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient.appointmentNo, - projectId: patient.projectId) + appointmentNo: patient.appointmentNo, projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient) : null, - builder: (BuildContext context, InsuranceViewModel model, Widget child) => - AppScaffold( - isShowAppBar: true, - baseViewModel: model, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString(), patient.arrivedOn), - body: patient.admissionNo != null - ? SingleChildScrollView( - child: Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patient.patientType.toString(), patient.arrivedOn ?? ""), + body: patient.admissionNo != null + ? SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).insurance22, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvals22, - fontSize: 30.0, - fontWeight: FontWeight.w700, - ), - ], + AppText( + TranslationBase.of(context).insurance22, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), ], ), - ), - Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(15.0), + Row( + children: [ + AppText( + TranslationBase.of(context).approvals22, + fontSize: 30.0, + fontWeight: FontWeight.w700, ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( children: [ - Row( - children: [ - AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .approvalStatusDescption != - null - ? model - .insuranceApprovalInPatient[ - indexInsurance] - .approvalStatusDescption ?? - "" - : "", - color: model - .insuranceApprovalInPatient[ - indexInsurance] - .approvalStatusDescption != - null - ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == - "Approved" || - "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == - "تمت الموافقة" - ? Color(0xff359846) - : Color(0xffD02127) - : Color(0xffD02127), - ), - ], - ), - Row( - children: [ - AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .doctorName - .toUpperCase(), - color: Colors.black, - fontSize: 18, - fontWeight: FontWeight.bold, - ) - ], + AppText( + model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption != null + ? model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption ?? + "" + : "", + color: model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption != + null + ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "Approved" || + "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "تمت الموافقة" + ? Color(0xff359846) + : Color(0xffD02127) + : Color(0xffD02127), ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Row( + ], + ), + Row( + children: [ + AppText( + model.insuranceApprovalInPatient[indexInsurance].doctorName!.toUpperCase(), + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Column( children: [ - Column( - children: [ - Container( - height: 85.0, - width: 85.0, - child: CircleAvatar( - radius: SizeConfig - .imageSizeMultiplier * - 12, - // radius: (52) - child: ClipRRect( - borderRadius: - BorderRadius.circular( - 50), - child: Image.network( - model - .insuranceApprovalInPatient[ - indexInsurance] - .doctorImage, - fit: BoxFit.fill, - width: 700, - ), - ), - backgroundColor: - Colors.transparent, + Container( + height: 85.0, + width: 85.0, + child: CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(50), + child: Image.network( + model.insuranceApprovalInPatient[indexInsurance].doctorImage ?? "", + fit: BoxFit.fill, + width: 700, ), ), - ], + backgroundColor: Colors.transparent, + ), ), - Expanded( - child: Padding( - padding: - const EdgeInsets.symmetric( - horizontal: 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.center, + ], + ), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 25.0, + ), + Row( children: [ - SizedBox( - height: 25.0, + AppText( + TranslationBase.of(context).clinic! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .clinic + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - Expanded( - child: AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .clinicName, - fontSize: 14, - ), - ) - ], + Expanded( + child: AppText( + model.insuranceApprovalInPatient[indexInsurance].clinicName, + fontSize: 14, + ), + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).approvalNo! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .approvalNo + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .approvalNo - .toString(), - fontSize: 14, - ) - ], + AppText( + model.insuranceApprovalInPatient[indexInsurance].approvalNo + .toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + 'Unused Count:', + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - 'Unused Count:', - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .unUsedCount - .toString(), - fontSize: 14, - ) - ], + AppText( + model.insuranceApprovalInPatient[indexInsurance].unUsedCount + .toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).companyName! + ": ", + color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .companyName + - ": ", - color: Colors.grey[500], - ), - AppText('Sample') - ], + AppText('Sample') + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).receiptOn! + ": ", + color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .receiptOn + - ": ", - color: Colors.grey[500], - ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ), - ], + Expanded( + child: AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn ?? ""), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + ), ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .expiryDate + - ": ", - color: Colors.grey[500], - ), - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ], + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).expiryDate! + ": ", + color: Colors.grey[500], + ), + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate ?? ""), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, ), ], ), - ), + ], ), - ], + ), ), - ), - SizedBox( - height: 20.0, - ), - Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Row( - children: [ - Expanded( - child: AppText( - TranslationBase.of(context) - .procedure, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context) - .status, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context) - .usageStatus, - fontWeight: FontWeight.w700, - ), - ) - ], + ], + ), + ), + SizedBox( + height: 20.0, + ), + Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Expanded( + child: AppText( + TranslationBase.of(context).procedure, + fontWeight: FontWeight.w700, + ), ), - ), - Divider( - color: Colors.black, - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: model - .insuranceApprovalInPatient[ - indexInsurance] - .apporvalDetails - .length, - itemBuilder: - (BuildContext context, - int index) { - return Container( - child: Column( + Expanded( + child: AppText( + TranslationBase.of(context).status, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context).usageStatus, + fontWeight: FontWeight.w700, + ), + ) + ], + ), + ), + Divider( + color: Colors.black, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: model + .insuranceApprovalInPatient[indexInsurance].apporvalDetails!.length, + itemBuilder: (BuildContext context, int index) { + return Container( + child: Column( + children: [ + Row( children: [ - Row( - children: [ - Expanded( - child: Container( - child: AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.procedureName ?? - "", - textAlign: - TextAlign - .start, - ), - ), - ), - Expanded( - child: Container( - child: AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.status ?? - "", - textAlign: - TextAlign - .center, - ), - ), - ), - Expanded( - child: Container( - child: AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.isInvoicedDesc ?? - "", - textAlign: - TextAlign - .center, - ), - ), + Expanded( + child: Container( + child: AppText( + model.insuranceApprovalInPatient[indexInsurance] + ?.apporvalDetails![index]?.procedureName ?? + "", + textAlign: TextAlign.start, ), - ], + ), ), - SizedBox( - width: 5, + Expanded( + child: Container( + child: AppText( + model.insuranceApprovalInPatient[indexInsurance] + ?.apporvalDetails![index]?.status ?? + "", + textAlign: TextAlign.center, + ), + ), ), - Divider( - color: Colors.black38, + Expanded( + child: Container( + child: AppText( + model.insuranceApprovalInPatient[indexInsurance] + ?.apporvalDetails![index]?.isInvoicedDesc ?? + "", + textAlign: TextAlign.center, + ), + ), ), ], ), - ); - }), - ), - ], + SizedBox( + width: 5, + ), + Divider( + color: Colors.black38, + ), + ], + ), + ); + }), ), - ), - ], + ], + ), ), - ), + ], ), - ], + ), ), - ), - ) - : SingleChildScrollView( - child: Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + ], + ), + ), + ) + : SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).insurance22, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvals22, - fontSize: 30.0, - fontWeight: FontWeight.w700, - ), - ], + AppText( + TranslationBase.of(context).insurance22, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), ], ), - ), - Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(15.0), + Row( + children: [ + AppText( + TranslationBase.of(context).approvals22, + fontSize: 30.0, + fontWeight: FontWeight.w700, ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( children: [ - Row( - children: [ - AppText( - model - .insuranceApproval[ - indexInsurance] - .approvalStatusDescption != - null - ? model - .insuranceApproval[ - indexInsurance] - .approvalStatusDescption ?? - "" - : "", - color: model - .insuranceApproval[ - indexInsurance] - .approvalStatusDescption != - null - ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == - "Approved" - ? Color(0xff359846) - : Color(0xffD02127) - : Color(0xffD02127), - ), - ], + AppText( + model.insuranceApproval[indexInsurance].approvalStatusDescption != null + ? model.insuranceApproval[indexInsurance].approvalStatusDescption ?? "" + : "", + color: model.insuranceApproval[indexInsurance].approvalStatusDescption != null + ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == + "Approved" + ? Color(0xff359846) + : Color(0xffD02127) + : Color(0xffD02127), ), - Row( - children: [ - AppText( - model - .insuranceApproval[indexInsurance] - .doctorName - .toUpperCase(), - color: Colors.black, - fontSize: 18, - fontWeight: FontWeight.bold, - ) - ], - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Row( + ], + ), + Row( + children: [ + AppText( + model.insuranceApproval[indexInsurance].doctorName!.toUpperCase(), + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Column( children: [ - Column( - children: [ - Container( - height: 85.0, - width: 85.0, - child: CircleAvatar( - radius: SizeConfig - .imageSizeMultiplier * - 12, - // radius: (52) - child: ClipRRect( - borderRadius: - BorderRadius.circular( - 50), - child: Image.network( - model - .insuranceApproval[ - indexInsurance] - .doctorImage, - fit: BoxFit.fill, - width: 700, - ), - ), - backgroundColor: - Colors.transparent, + Container( + height: 85.0, + width: 85.0, + child: CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(50), + child: Image.network( + model.insuranceApproval[indexInsurance].doctorImage ?? "", + fit: BoxFit.fill, + width: 700, ), ), - ], + backgroundColor: Colors.transparent, + ), ), - Expanded( - child: Padding( - padding: - const EdgeInsets.symmetric( - horizontal: 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.center, + ], + ), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 25.0, + ), + Row( children: [ - SizedBox( - height: 25.0, + AppText( + TranslationBase.of(context).clinic! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .clinic + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - Expanded( - child: AppText( - model - .insuranceApproval[ - indexInsurance] - .clinicName, - fontSize: 14, - ), - ) - ], + Expanded( + child: AppText( + model.insuranceApproval[indexInsurance].clinicName, + fontSize: 14, + ), + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).approvalNo! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .approvalNo + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model - .insuranceApproval[ - indexInsurance] - .approvalNo - .toString(), - fontSize: 14, - ) - ], + AppText( + model.insuranceApproval[indexInsurance].approvalNo.toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).unusedCount! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .unusedCount + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model - .insuranceApproval[ - indexInsurance] - .unUsedCount - .toString(), - fontSize: 14, - ) - ], + AppText( + model.insuranceApproval[indexInsurance].unUsedCount.toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).companyName! + ": ", + color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .companyName + - ": ", - color: Colors.grey[500], - ), - AppText('Sample') - ], + AppText('Sample') + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).receiptOn! + ": ", + color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .receiptOn + - ": ", - color: Colors.grey[500], - ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ), - ], + Expanded( + child: AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn ?? ""), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + ), ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .expiryDate + - ": ", - color: Colors.grey[500], - ), - if (model - .insuranceApproval[ - indexInsurance] - .expiryDate != - null) - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ], + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).expiryDate! + ": ", + color: Colors.grey[500], ), + if (model.insuranceApproval[indexInsurance].expiryDate != null) + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate ?? ""), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + ), ], ), - ), + ], ), - ], + ), ), - ), - SizedBox( - height: 20.0, - ), - Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Row( - children: [ - Expanded( - child: AppText( - TranslationBase.of(context) - .procedure, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context) - .status, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context) - .usageStatus, - fontWeight: FontWeight.w700, - ), - ) - ], + ], + ), + ), + SizedBox( + height: 20.0, + ), + Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Expanded( + child: AppText( + TranslationBase.of(context).procedure, + fontWeight: FontWeight.w700, + ), ), - ), - Divider( - color: Colors.black, - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: model - .insuranceApproval[ - indexInsurance] - .apporvalDetails - .length, - itemBuilder: - (BuildContext context, - int index) { - return Container( - child: Column( + Expanded( + child: AppText( + TranslationBase.of(context).status, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context).usageStatus, + fontWeight: FontWeight.w700, + ), + ) + ], + ), + ), + Divider( + color: Colors.black, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: model.insuranceApproval[indexInsurance].apporvalDetails!.length, + itemBuilder: (BuildContext context, int index) { + return Container( + child: Column( + children: [ + Row( children: [ - Row( - children: [ - Expanded( - child: Container( - child: AppText( - model - .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.procedureName ?? - "", - textAlign: - TextAlign - .start, - ), - ), - ), - Expanded( - child: Container( - child: AppText( - model - .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.status ?? - "", - textAlign: - TextAlign - .center, - ), - ), + Expanded( + child: Container( + child: AppText( + model.insuranceApproval[indexInsurance] + ?.apporvalDetails![index]?.procedureName ?? + "", + textAlign: TextAlign.start, ), - Expanded( - child: Container( - child: AppText( - model - .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.isInvoicedDesc ?? - "", - textAlign: - TextAlign - .center, - ), - ), - ), - ], + ), ), - SizedBox( - width: 5, + Expanded( + child: Container( + child: AppText( + model.insuranceApproval[indexInsurance] + ?.apporvalDetails![index]?.status ?? + "", + textAlign: TextAlign.center, + ), + ), ), - Divider( - color: Colors.black38, + Expanded( + child: Container( + child: AppText( + model.insuranceApproval[indexInsurance] + ?.apporvalDetails![index]?.isInvoicedDesc ?? + "", + textAlign: TextAlign.center, + ), + ), ), ], ), - ); - }), - ), - ], + SizedBox( + width: 5, + ), + Divider( + color: Colors.black38, + ), + ], + ), + ); + }), ), - ), - ], + ], + ), ), - ), + ], ), - ], + ), ), - ), - )), + ], + ), + ), + )), ); } } diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 14ae707b..3636e698 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -16,8 +16,7 @@ class FilterDatePage extends StatefulWidget { final OutPatientFilterType outPatientFilterType; final PatientSearchViewModel patientSearchViewModel; - const FilterDatePage( - {Key key, this.outPatientFilterType, this.patientSearchViewModel}) + const FilterDatePage({Key? key, required this.outPatientFilterType, required this.patientSearchViewModel}) : super(key: key); @override @@ -46,8 +45,7 @@ class _FilterDatePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ BottomSheetTitle( - title: (OutPatientFilterType.Previous == - widget.outPatientFilterType) + title: (OutPatientFilterType.Previous == widget.outPatientFilterType) ? " Filter Previous Out Patient" : "Filter Nextweek Out Patient", ), @@ -63,16 +61,12 @@ class _FilterDatePageState extends State { color: Colors.white, child: InkWell( onTap: () => selectDate(context, - firstDate: - getFirstDate(widget.outPatientFilterType), - lastDate: - getLastDate(widget.outPatientFilterType)), + firstDate: getFirstDate(widget.outPatientFilterType), + lastDate: getLastDate(widget.outPatientFilterType)), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).fromDate, - widget.patientSearchViewModel - .selectedFromDate != - null + TranslationBase.of(context).fromDate!, + widget.patientSearchViewModel.selectedFromDate != null ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" : null, true, @@ -92,16 +86,12 @@ class _FilterDatePageState extends State { child: InkWell( onTap: () => selectDate(context, isFromDate: false, - firstDate: - getFirstDate(widget.outPatientFilterType), - lastDate: - getLastDate(widget.outPatientFilterType)), + firstDate: getFirstDate(widget.outPatientFilterType), + lastDate: getLastDate(widget.outPatientFilterType)), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).toDate, - widget.patientSearchViewModel - .selectedToDate != - null + TranslationBase.of(context).toDate!, + widget.patientSearchViewModel.selectedToDate != null ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" : null, true, @@ -146,41 +136,30 @@ class _FilterDatePageState extends State { padding: 10, color: Color(0xFF359846), onPressed: () async { - if (widget.patientSearchViewModel.selectedFromDate == - null || - widget.patientSearchViewModel.selectedToDate == - null) { - Helpers.showErrorToast( - "Please Select All The date Fields "); + if (widget.patientSearchViewModel.selectedFromDate == null || + widget.patientSearchViewModel.selectedToDate == null) { + Helpers.showErrorToast("Please Select All The date Fields "); } else { - Duration difference = widget - .patientSearchViewModel.selectedToDate - .difference(widget - .patientSearchViewModel.selectedFromDate); + Duration difference = widget.patientSearchViewModel.selectedToDate! + .difference(widget.patientSearchViewModel.selectedFromDate!); if (difference.inDays > 90) { Helpers.showErrorToast( "The difference between from date and end date must be less than 3 months"); } else { String dateTo = AppDateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedToDate, - 'yyyy-MM-dd'); + widget.patientSearchViewModel.selectedToDate!, 'yyyy-MM-dd'); String dateFrom = AppDateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedFromDate, - 'yyyy-MM-dd'); + widget.patientSearchViewModel.selectedFromDate!, 'yyyy-MM-dd'); - PatientSearchRequestModel currentModel = - PatientSearchRequestModel(); + PatientSearchRequestModel currentModel = PatientSearchRequestModel(); currentModel.to = dateTo; currentModel.from = dateFrom; GifLoaderDialogUtils.showMyDialog(context); - await widget.patientSearchViewModel - .getOutPatient(currentModel, isLocalBusy: true); + await widget.patientSearchViewModel.getOutPatient(currentModel, isLocalBusy: true); GifLoaderDialogUtils.hideDialog(context); - if (widget.patientSearchViewModel.state == - ViewState.ErrorLocal) { - Helpers.showErrorToast( - widget.patientSearchViewModel.error); + if (widget.patientSearchViewModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientSearchViewModel.error); } else { Navigator.of(context).pop(); } @@ -199,16 +178,15 @@ class _FilterDatePageState extends State { )); } - selectDate(BuildContext context, - {bool isFromDate = true, DateTime firstDate, lastDate}) async { + selectDate(BuildContext context, {bool isFromDate = true, DateTime? firstDate, lastDate}) async { Helpers.hideKeyboard(context); DateTime selectedDate = isFromDate ? this.widget.patientSearchViewModel.selectedFromDate ?? firstDate : this.widget.patientSearchViewModel.selectedToDate ?? lastDate; - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, - firstDate: firstDate, + firstDate: firstDate!, lastDate: lastDate, initialEntryMode: DatePickerEntryMode.calendar, ); @@ -232,27 +210,22 @@ class _FilterDatePageState extends State { getFirstDate(OutPatientFilterType outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { - return DateTime( - DateTime.now().year - 20, DateTime.now().month, DateTime.now().day); + return DateTime(DateTime.now().year - 20, DateTime.now().month, DateTime.now().day); } else { - return DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); + return DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); } } getLastDate(OutPatientFilterType outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { - return DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); + return DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); } else { - return DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day + 7); + return DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 7); } } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String? hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 30400c65..bb211329 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -35,13 +35,13 @@ class OutPatientsScreen extends StatefulWidget { final isAppbar; final arrivalType; final isView; - final PatientType selectedPatientType; - final PatientSearchRequestModel patientSearchRequestModel; + final PatientType? selectedPatientType; + final PatientSearchRequestModel? patientSearchRequestModel; final bool isSearchWithKeyInfo; final bool isSearch; final bool isInpatient; final bool isSearchAndOut; - final String searchKey; + final String? searchKey; OutPatientsScreen( {this.patientSearchForm, @@ -62,21 +62,21 @@ class OutPatientsScreen extends StatefulWidget { } class _OutPatientsScreenState extends State { - int clinicId; - AuthenticationViewModel authenticationViewModel; + late int clinicId; + late AuthenticationViewModel authenticationViewModel; List _times = []; int _activeLocation = 1; - String patientType; - String patientTypeTitle; + late String patientType; + late String patientTypeTitle; var selectedFilter = 1; - String arrivalType; - ProjectViewModel projectsProvider; + late String arrivalType; + late ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - PatientModel patient; + late PatientModel patient; OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; @@ -84,15 +84,15 @@ class _OutPatientsScreenState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); _times = [ - TranslationBase.of(context).previous, - TranslationBase.of(context).today, - TranslationBase.of(context).nextWeek, + TranslationBase.of(context).previous!, + TranslationBase.of(context).today!, + TranslationBase.of(context).nextWeek!, ]; final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - await model.getOutPatient(widget.patientSearchRequestModel); + await model.getOutPatient(widget.patientSearchRequestModel!); }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", @@ -106,15 +106,13 @@ class _OutPatientsScreenState extends State { Container( // color: Colors.red, height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), + decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), borderRadius: 4, borderWidth: 0), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: _times.map((item) { - bool _isActive = - _times[_activeLocation] == item ? true : false; + bool _isActive = _times[_activeLocation] == item ? true : false; return Expanded( child: InkWell( @@ -134,8 +132,7 @@ class _OutPatientsScreenState extends State { await model.getPatientBasedOnDate( item: item, selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: - widget.patientSearchRequestModel, + patientSearchRequestModel: widget.patientSearchRequestModel, isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType); GifLoaderDialogUtils.hideDialog(context); @@ -143,16 +140,11 @@ class _OutPatientsScreenState extends State { child: Center( child: Container( height: screenSize.height * 0.070, - decoration: - TextFieldsUtils.containerBorderDecoration( - _isActive - ? Color(0xFFD02127 /*B8382B*/) - : Color(0xFFEAEAEA), - _isActive - ? Color(0xFFD02127) - : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -160,22 +152,16 @@ class _OutPatientsScreenState extends State { AppText( item, fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive - ? Colors.white - : Color(0xFF2B353E), + color: _isActive ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, ), - _isActive && - _activeLocation != 0 && - model.state == ViewState.Idle + _isActive && _activeLocation != 0 && model.state == ViewState.Idle ? Container( padding: EdgeInsets.all(2), - margin: EdgeInsets.symmetric( - horizontal: 5), + margin: EdgeInsets.symmetric(horizontal: 5), decoration: new BoxDecoration( color: Colors.white, - borderRadius: - BorderRadius.circular(50), + borderRadius: BorderRadius.circular(50), ), constraints: BoxConstraints( minWidth: 20, @@ -183,9 +169,7 @@ class _OutPatientsScreenState extends State { ), child: new Text( model.filterData.length.toString(), - style: new TextStyle( - color: Colors.red, - fontSize: 10), + style: new TextStyle(color: Colors.red, fontSize: 10), textAlign: TextAlign.center, ), ) @@ -211,47 +195,40 @@ class _OutPatientsScreenState extends State { color: HexColor("#CCCCCC"), ), color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 10, top: 10), - child: AppText( - TranslationBase.of(context).searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - _activeLocation != 0 - ? DoctorApp.filter_1 - : FontAwesomeIcons.slidersH, - color: Colors.black, - ), - iconSize: 20, - padding: EdgeInsets.only(bottom: 30), - onPressed: _activeLocation != 0 - ? null - : () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - FilterDatePage( - outPatientFilterType: - outPatientFilterType, - patientSearchViewModel: - model, - ))); - }, - ), - onChanged: (String str) { - model.searchData(str); - }), - ])), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + _activeLocation != 0 ? DoctorApp.filter_1 : FontAwesomeIcons.slidersH, + color: Colors.black, + ), + iconSize: 20, + padding: EdgeInsets.only(bottom: 30), + onPressed: _activeLocation != 0 + ? null + : () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => FilterDatePage( + outPatientFilterType: outPatientFilterType, + patientSearchViewModel: model, + ))); + }, + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), SizedBox( height: 10.0, ), @@ -260,8 +237,7 @@ class _OutPatientsScreenState extends State { child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, + error: TranslationBase.of(context).youDontHaveAnyPatient ?? "", ), ) : ListView.builder( @@ -270,11 +246,8 @@ class _OutPatientsScreenState extends State { itemCount: model.filterData.length, itemBuilder: (BuildContext ctxt, int index) { if (_activeLocation != 0 || - (model.filterData[index].patientStatusType != - null && - model.filterData[index] - .patientStatusType == - 43)) + (model.filterData[index].patientStatusType != null && + model.filterData[index].patientStatusType == 43)) return Padding( padding: EdgeInsets.all(8.0), child: PatientCard( @@ -285,20 +258,16 @@ class _OutPatientsScreenState extends State { isInpatient: widget.isInpatient, onTap: () { // TODO change the parameter to daynamic - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model.filterData[index], - "patientType": "1", - "from": widget - .patientSearchRequestModel.from, - "to": widget - .patientSearchRequestModel.from, - "isSearch": false, - "isInpatient": false, - "arrivalType": "7", - "isSearchAndOut": false, - }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget.patientSearchRequestModel!.from, + "to": widget.patientSearchRequestModel!.from, + "isSearch": false, + "isInpatient": false, + "arrivalType": "7", + "isSearchAndOut": false, + }); }, // isFromSearch: widget.isSearch, ), diff --git a/lib/screens/patients/out_patient_prescription_details_screen.dart b/lib/screens/patients/out_patient_prescription_details_screen.dart index c7056ce3..cee49c6c 100644 --- a/lib/screens/patients/out_patient_prescription_details_screen.dart +++ b/lib/screens/patients/out_patient_prescription_details_screen.dart @@ -12,42 +12,38 @@ import 'package:flutter/material.dart'; class OutPatientPrescriptionDetailsScreen extends StatefulWidget { final PrescriptionResModel prescriptionResModel; - OutPatientPrescriptionDetailsScreen({Key key, this.prescriptionResModel}); + OutPatientPrescriptionDetailsScreen({Key? key, required this.prescriptionResModel}); @override - _OutPatientPrescriptionDetailsScreenState createState() => - _OutPatientPrescriptionDetailsScreenState(); + _OutPatientPrescriptionDetailsScreenState createState() => _OutPatientPrescriptionDetailsScreenState(); } -class _OutPatientPrescriptionDetailsScreenState - extends State { - - - getPrescriptionReport(BuildContext context,PatientViewModel model ){ - RequestPrescriptionReport prescriptionReqModel = - RequestPrescriptionReport( +class _OutPatientPrescriptionDetailsScreenState extends State { + getPrescriptionReport(BuildContext context, PatientViewModel model) { + RequestPrescriptionReport prescriptionReqModel = RequestPrescriptionReport( appointmentNo: widget.prescriptionResModel.appointmentNo, episodeID: widget.prescriptionResModel.episodeID, setupID: widget.prescriptionResModel.setupID, patientTypeID: widget.prescriptionResModel.patientID); model.getPrescriptionReport(prescriptionReqModel.toJson()); } + @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => getPrescriptionReport(context, model), builder: (_, model, w) => AppScaffold( - appBarTitle: TranslationBase.of(context).prescriptionDetails, - body: CardWithBgWidgetNew( - widget: ListView.builder( - itemCount: model.prescriptionReport.length, - itemBuilder: (BuildContext context, int index) { - return OutPatientPrescriptionDetailsItem( - prescriptionReport: - model.prescriptionReport[index], - ); - }), - ), - ),); + appBarTitle: TranslationBase.of(context).prescriptionDetails ?? "", + body: CardWithBgWidgetNew( + widget: ListView.builder( + itemCount: model.prescriptionReport.length, + itemBuilder: (BuildContext context, int index) { + return OutPatientPrescriptionDetailsItem( + prescriptionReport: model.prescriptionReport[index], + ); + }), + ), + ), + ); } } diff --git a/lib/screens/patients/patient_search/patient_search_header.dart b/lib/screens/patients/patient_search/patient_search_header.dart index b9afab7d..587550e3 100644 --- a/lib/screens/patients/patient_search/patient_search_header.dart +++ b/lib/screens/patients/patient_search/patient_search_header.dart @@ -5,11 +5,11 @@ import 'package:flutter/material.dart'; class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { final String title; - const PatientSearchHeader({Key key, this.title}) : super(key: key); + const PatientSearchHeader({Key? key, required this.title}) : super(key: key); @override Widget build(BuildContext context) { - return Container( + return Container( padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, @@ -38,6 +38,5 @@ class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { } @override - - Size get preferredSize => Size(double.maxFinite,65); + Size get preferredSize => Size(double.maxFinite, 65); } diff --git a/lib/screens/patients/patient_search/patient_search_result_screen.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart index 02bde8d0..ac28e26b 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -32,45 +32,41 @@ class PatientsSearchResultScreen extends StatefulWidget { final String searchKey; PatientsSearchResultScreen( - {this.selectedPatientType, - this.patientSearchRequestModel, + {required this.selectedPatientType, + required this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, this.isInpatient = false, - this.searchKey, + required this.searchKey, this.isSearchAndOut = false}); @override - _PatientsSearchResultScreenState createState() => - _PatientsSearchResultScreenState(); + _PatientsSearchResultScreenState createState() => _PatientsSearchResultScreenState(); } -class _PatientsSearchResultScreenState - extends State { - int clinicId; - AuthenticationViewModel authenticationViewModel; +class _PatientsSearchResultScreenState extends State { + late int clinicId; + late AuthenticationViewModel authenticationViewModel; - String patientType; - String patientTypeTitle; + late String patientType; + late String patientTypeTitle; var selectedFilter = 1; - String arrivalType; - ProjectViewModel projectsProvider; + late String arrivalType; + late ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - PatientModel patient; + late PatientModel patient; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { - if (!widget.isSearchWithKeyInfo && - widget.selectedPatientType == PatientType.OutPatient) { + if (!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { await model.getOutPatient(widget.patientSearchRequestModel); } else { - await model - .getPatientFileInformation(widget.patientSearchRequestModel); + await model.getPatientFileInformation(widget.patientSearchRequestModel); } }, builder: (_, model, w) => AppScaffold( @@ -93,31 +89,30 @@ class _PatientsSearchResultScreenState color: HexColor("#CCCCCC"), ), color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 10, top: 10), - child: AppText( - TranslationBase.of(context).searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - padding: EdgeInsets.only(bottom: 30), - ), - onChanged: (String str) { - model.searchData(str); - }), - ])), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: EdgeInsets.only(bottom: 30), + onPressed: () {}, + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), SizedBox( height: 10.0, ), @@ -126,8 +121,7 @@ class _PatientsSearchResultScreenState child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, + error: TranslationBase.of(context).youDontHaveAnyPatient ?? "", ), ) : ListView.builder( @@ -145,21 +139,16 @@ class _PatientsSearchResultScreenState isInpatient: widget.isInpatient, onTap: () { // TODO change the parameter to daynamic - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model.filterData[index], - "patientType": "1", - "from": widget - .patientSearchRequestModel.from, - "to": widget - .patientSearchRequestModel.from, - "isSearch": widget.isSearch, - "isInpatient": widget.isInpatient, - "arrivalType": "7", - "isSearchAndOut": - widget.isSearchAndOut, - }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget.patientSearchRequestModel.from, + "to": widget.patientSearchRequestModel.from, + "isSearch": widget.isSearch, + "isInpatient": widget.isInpatient, + "arrivalType": "7", + "isSearchAndOut": widget.isSearchAndOut, + }); }, // isFromSearch: widget.isSearch, ), diff --git a/lib/screens/patients/patient_search/patient_search_screen.dart b/lib/screens/patients/patient_search/patient_search_screen.dart index 2275cc09..b1be78ed 100644 --- a/lib/screens/patients/patient_search/patient_search_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -29,7 +29,7 @@ class _PatientSearchScreenState extends State { TextEditingController middleNameInfoController = TextEditingController(); TextEditingController lastNameFileInfoController = TextEditingController(); PatientType selectedPatientType = PatientType.inPatient; - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { @@ -44,58 +44,46 @@ class _PatientSearchScreenState extends State { child: Center( child: Column( children: [ - BottomSheetTitle( - title: TranslationBase.of(context).searchPatient), + BottomSheetTitle(title: TranslationBase.of(context).searchPatient!!), FractionallySizedBox( widthFactor: 0.9, child: Container( color: Theme.of(context).scaffoldBackgroundColor, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - SizedBox( - height: 10, - ), - Container( - margin: - EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .patpatientIDMobilenationalientID, - isTextFieldHasSuffix: false, - maxLines: 1, - minLines: 1, - inputType: TextInputType.number, - hasBorder: true, - controller: patientFileInfoController, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], - onChanged: (_) {}, - validationError: (isFormSubmitted && - (patientFileInfoController - .text.isEmpty && - firstNameInfoController - .text.isEmpty && - middleNameInfoController - .text.isEmpty && - lastNameFileInfoController - .text.isEmpty)) - ? TranslationBase.of(context).emptyMessage - : null, - ), - ), - SizedBox( - height: 5, - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.12, - ), - ])), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 16, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).patpatientIDMobilenationalientID, + isTextFieldHasSuffix: false, + maxLines: 1, + minLines: 1, + inputType: TextInputType.number, + hasBorder: true, + controller: patientFileInfoController, + inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))], + onChanged: (_) {}, + validationError: (isFormSubmitted && + (patientFileInfoController.text.isEmpty && + firstNameInfoController.text.isEmpty && + middleNameInfoController.text.isEmpty && + lastNameFileInfoController.text.isEmpty)) + ? TranslationBase.of(context).emptyMessage + : null, + ), + ), + SizedBox( + height: 5, + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.12, + ), + ])), ), ], ), @@ -147,41 +135,29 @@ class _PatientSearchScreenState extends State { isFormSubmitted = true; }); PatientSearchRequestModel patientSearchRequestModel = - PatientSearchRequestModel( - doctorID: authenticationViewModel.doctorProfile.doctorID); + PatientSearchRequestModel(doctorID: authenticationViewModel.doctorProfile!.doctorID); if (showOther) { patientSearchRequestModel.firstName = - firstNameInfoController.text.trim().isEmpty - ? "0" - : firstNameInfoController.text.trim(); + firstNameInfoController.text.trim().isEmpty ? "0" : firstNameInfoController.text.trim(); patientSearchRequestModel.middleName = - middleNameInfoController.text.trim().isEmpty - ? "0" - : middleNameInfoController.text.trim(); + middleNameInfoController.text.trim().isEmpty ? "0" : middleNameInfoController.text.trim(); patientSearchRequestModel.lastName = - lastNameFileInfoController.text.isEmpty - ? "0" - : lastNameFileInfoController.text.trim(); + lastNameFileInfoController.text.isEmpty ? "0" : lastNameFileInfoController.text.trim(); } if (patientFileInfoController.text.isNotEmpty) { if (patientFileInfoController.text.length == 10 && - (patientFileInfoController.text[0] == '2' || - patientFileInfoController.text[0] == '1')) { - patientSearchRequestModel.identificationNo = - patientFileInfoController.text; + (patientFileInfoController.text[0] == '2' || patientFileInfoController.text[0] == '1')) { + patientSearchRequestModel.identificationNo = patientFileInfoController.text; patientSearchRequestModel.searchType = 2; patientSearchRequestModel.patientID = 0; - } else if ((patientFileInfoController.text.length == 10 || - patientFileInfoController.text.length == 9) && - ((patientFileInfoController.text[0] == '0' && - patientFileInfoController.text[1] == '5') || + } else if ((patientFileInfoController.text.length == 10 || patientFileInfoController.text.length == 9) && + ((patientFileInfoController.text[0] == '0' && patientFileInfoController.text[1] == '5') || patientFileInfoController.text[0] == '5')) { patientSearchRequestModel.mobileNo = patientFileInfoController.text; patientSearchRequestModel.searchType = 0; } else { - patientSearchRequestModel.patientID = - int.parse(patientFileInfoController.text); + patientSearchRequestModel.patientID = int.parse(patientFileInfoController.text); patientSearchRequestModel.searchType = 1; } } @@ -201,8 +177,7 @@ class _PatientSearchScreenState extends State { builder: (BuildContext context) => PatientsSearchResultScreen( selectedPatientType: selectedPatientType, patientSearchRequestModel: patientSearchRequestModel, - isSearchWithKeyInfo: - patientFileInfoController.text.isNotEmpty ? true : false, + isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, isSearchAndOut: true, searchKey: patientFileInfoController.text, diff --git a/lib/screens/patients/patient_search/time_bar.dart b/lib/screens/patients/patient_search/time_bar.dart deleted file mode 100644 index a1ee2cab..00000000 --- a/lib/screens/patients/patient_search/time_bar.dart +++ /dev/null @@ -1,110 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/patient_type.dart'; -import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; -import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -class TimeBar extends StatefulWidget { - final PatientSearchViewModel model; - final PatientType selectedPatientType; - final PatientSearchRequestModel patientSearchRequestModel; - final bool isSearchWithKeyInfo; - - const TimeBar( - {Key key, - this.model, - this.selectedPatientType, - this.patientSearchRequestModel, - this.isSearchWithKeyInfo}) - : super(key: key); - @override - _TimeBarState createState() => _TimeBarState(); -} - -class _TimeBarState extends State { - @override - Widget build(BuildContext context) { - List _locations = [ - TranslationBase.of(context).today, - TranslationBase.of(context).tomorrow, - TranslationBase.of(context).nextWeek, - ]; - int _activeLocation = 0; - return Container( - height: MediaQuery.of(context).size.height * 0.0619, - width: SizeConfig.screenWidth * 0.94, - decoration: BoxDecoration( - color: Color(0Xffffffff), - borderRadius: BorderRadius.circular(12.5), - // border: Border.all( - // width: 0.5, - // ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item ? true : false; - return Column(mainAxisSize: MainAxisSize.min, children: [ - InkWell( - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.058, - width: SizeConfig.screenWidth * 0.2334, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(12.5), - topRight: Radius.circular(12.5), - topLeft: Radius.circular(9.5), - bottomLeft: Radius.circular(9.5)), - color: _isActive ? HexColor("#B8382B") : Colors.white, - ), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - - fontWeight: FontWeight.normal, - ), - ), - )), - ), - onTap: () async { - setState(() { - _activeLocation = _locations.indexOf(item); - }); - GifLoaderDialogUtils.showMyDialog(context); - await widget.model.getPatientBasedOnDate( - item: item, - selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: - widget.patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo); - GifLoaderDialogUtils.hideDialog(context); - }), - _isActive - ? Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(10), - topRight: Radius.circular(10)), - color: Colors.white), - alignment: Alignment.center, - height: 1, - width: SizeConfig.screenWidth * 0.23, - ) - : Container() - ]); - }).toList(), - ), - ); - } -} diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 6890d74f..be718c56 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -31,7 +31,7 @@ class _UcafDetailScreenState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -47,9 +47,8 @@ class _UcafDetailScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).ucaf, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), + appBarTitle: TranslationBase.of(context).ucaf ?? "", body: Column( children: [ Expanded( @@ -88,17 +87,14 @@ class _UcafDetailScreenState extends State { height: 10, ), Container( - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 16), + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), child: Column( children: [ - treatmentStepsBar( - context, model, screenSize, patient), + treatmentStepsBar(context, model, screenSize, patient), SizedBox( height: 16, ), - ...getSelectedTreatmentStepItem( - context, model), + ...getSelectedTreatmentStepItem(context, model), ], ), ), @@ -124,8 +120,7 @@ class _UcafDetailScreenState extends State { fontSize: 2.2, onPressed: () { Navigator.of(context).popUntil((route) { - return route.settings.name == - PATIENTS_PROFILE; + return route.settings.name == PATIENTS_PROFILE; }); }, ), @@ -148,12 +143,9 @@ class _UcafDetailScreenState extends State { onPressed: () async { await model.postUCAF(patient); if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) - .postUcafSuccessMsg); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).postUcafSuccessMsg); Navigator.of(context).popUntil((route) { - return route.settings.name == - PATIENTS_PROFILE; + return route.settings.name == PATIENTS_PROFILE; }); } else { DrAppToastMsg.showErrorToast(model.error); @@ -170,17 +162,15 @@ class _UcafDetailScreenState extends State { )); } - Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, - Size screenSize, PatiantInformtion patient) { + Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, Size screenSize, PatiantInformtion patient) { List __treatmentSteps = [ - TranslationBase.of(context).diagnosis.toUpperCase(), - TranslationBase.of(context).medications.toUpperCase(), - TranslationBase.of(context).procedures.toUpperCase(), + TranslationBase.of(context).diagnosis ?? "".toUpperCase(), + TranslationBase.of(context).medications ?? "".toUpperCase(), + TranslationBase.of(context).procedures ?? "".toUpperCase(), ]; return Container( height: screenSize.height * 0.070, - decoration: Helpers.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC)), + decoration: Helpers.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -192,16 +182,13 @@ class _UcafDetailScreenState extends State { child: Container( height: screenSize.height * 0.070, decoration: Helpers.containerBorderDecoration( - _isActive ? HexColor("#B8382B") : Colors.white, - _isActive ? HexColor("#B8382B") : Colors.white), + _isActive ? HexColor("#B8382B") : Colors.white, _isActive ? HexColor("#B8382B") : Colors.white), child: Center( child: Text( item, style: TextStyle( fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, + color: _isActive ? Colors.white : Colors.black, //Colors.black, fontWeight: FontWeight.bold, ), ), @@ -228,16 +215,13 @@ class _UcafDetailScreenState extends State { ); } - List getSelectedTreatmentStepItem( - BuildContext _context, UcafViewModel model) { + List getSelectedTreatmentStepItem(BuildContext _context, UcafViewModel model) { switch (_activeTap) { case 0: if (model.patientAssessmentList != null) { return [ - ...List.generate( - model.patientAssessmentList.length, - (index) => DiagnosisWidget( - model, model.patientAssessmentList[index])).toList() + ...List.generate(model.patientAssessmentList.length, + (index) => DiagnosisWidget(model, model.patientAssessmentList[index])).toList() ]; } else { return [ @@ -247,22 +231,15 @@ class _UcafDetailScreenState extends State { break; case 1: return [ - ...List.generate( - model.prescriptionList != null - ? model.prescriptionList.entityList.length - : 0, - (index) => MedicationWidget( - model, model.prescriptionList.entityList[index])).toList() + ...List.generate(model.prescriptionList != null ? model.prescriptionList!.entityList!.length : 0, + (index) => MedicationWidget(model, model.prescriptionList!.entityList![index])).toList() ]; break; case 2: if (model.orderProcedures != null) { return [ ...List.generate( - model.orderProcedures.length, - (index) => - ProceduresWidget(model, model.orderProcedures[index])) - .toList() + model.orderProcedures.length, (index) => ProceduresWidget(model, model.orderProcedures[index])).toList() ]; } else { return [ @@ -286,12 +263,10 @@ class DiagnosisWidget extends StatelessWidget { @override Widget build(BuildContext context) { - MasterKeyModel diagnosisType = model.findMasterDataById( - masterKeys: MasterKeysService.DiagnosisType, - id: diagnosis.diagnosisTypeID); - MasterKeyModel diagnosisCondition = model.findMasterDataById( - masterKeys: MasterKeysService.DiagnosisCondition, - id: diagnosis.conditionID); + MasterKeyModel? diagnosisType = + model.findMasterDataById(masterKeys: MasterKeysService.DiagnosisType, id: diagnosis.diagnosisTypeID); + MasterKeyModel? diagnosisCondition = + model.findMasterDataById(masterKeys: MasterKeysService.DiagnosisCondition, id: diagnosis.conditionID); return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -562,7 +537,7 @@ class ProceduresWidget extends StatelessWidget { AppText( "${procedure.isCovered}", fontWeight: FontWeight.normal, - color: procedure.isCovered ? Colors.green : Colors.red, + color: procedure.isCovered! ? Colors.green : Colors.red, fontSize: SizeConfig.textMultiplier * 2.0, ), SizedBox( diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 5f7b91f3..40024b6d 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -53,7 +53,7 @@ class _UCAFInputScreenState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -65,9 +65,8 @@ class _UCAFInputScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).ucaf, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), + appBarTitle: TranslationBase.of(context).ucaf ?? "", body: model.patientVitalSignsHistory.length > 0 && model.patientChiefComplaintList != null && model.patientChiefComplaintList.length > 0 @@ -105,8 +104,7 @@ class _UCAFInputScreenState extends State { screenSize: screenSize, ), Container( - margin: EdgeInsets.symmetric( - vertical: 0, horizontal: 16), + margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -160,8 +158,7 @@ class _UCAFInputScreenState extends State { height: 16, ),*/ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ @@ -175,8 +172,7 @@ class _UCAFInputScreenState extends State { ), AppText( "BP (H/L)", - fontSize: - SizeConfig.textMultiplier * 1.8, + fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.normal, ), @@ -185,8 +181,7 @@ class _UCAFInputScreenState extends State { ), AppText( "${model.bloodPressure}", - fontSize: - SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.w700, ), @@ -200,8 +195,7 @@ class _UCAFInputScreenState extends State { children: [ AppText( "${TranslationBase.of(context).temperature}", - fontSize: - SizeConfig.textMultiplier * 1.8, + fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.normal, ), @@ -211,8 +205,7 @@ class _UCAFInputScreenState extends State { Expanded( child: AppText( "${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)", - fontSize: - SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.w700, ), @@ -226,15 +219,13 @@ class _UCAFInputScreenState extends State { height: 2, ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ AppText( "${TranslationBase.of(context).pulseBeats}:", - fontSize: - SizeConfig.textMultiplier * 1.8, + fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.normal, ), @@ -243,8 +234,7 @@ class _UCAFInputScreenState extends State { ), AppText( "${model.hartRat}", - fontSize: - SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.w700, ), @@ -256,14 +246,13 @@ class _UCAFInputScreenState extends State { height: 16, ), AppText( - TranslationBase.of(context) - .chiefComplaintsAndSymptoms, + TranslationBase.of(context).chiefComplaintsAndSymptoms, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), ), - /* SizedBox( + /* SizedBox( height: 4, ), AppText( @@ -278,11 +267,9 @@ class _UCAFInputScreenState extends State { height: 8, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).instruction, - dropDownText: Helpers.parseHtmlString(model - .patientChiefComplaintList[0] - .chiefComplaint), + hintText: TranslationBase.of(context).instruction, + dropDownText: + Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint ?? ""), controller: _additionalComplaintsController, inputType: TextInputType.multiline, enabled: false, @@ -323,7 +310,7 @@ class _UCAFInputScreenState extends State { SizedBox( height: 8, ), - /* AppTextFieldCustom( + /* AppTextFieldCustom( hintText: TranslationBase.of(context).other, dropDownText: TranslationBase.of(context).none, enabled: false, @@ -407,11 +394,7 @@ class _UCAFInputScreenState extends State { color: HexColor("#D02127"), onPressed: () { Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, - arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType - }); + arguments: {'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType}); }, ), ), @@ -428,9 +411,9 @@ class _UCAFInputScreenState extends State { Padding( padding: const EdgeInsets.all(8.0), child: AppText( - model.patientVitalSignsHistory.length == 0 - ? TranslationBase.of(context).vitalSignEmptyMsg - : TranslationBase.of(context).chiefComplaintEmptyMsg, + model.patientVitalSignsHistory.length == 0 + ? TranslationBase.of(context).vitalSignEmptyMsg + : TranslationBase.of(context).chiefComplaintEmptyMsg, fontWeight: FontWeight.normal, textAlign: TextAlign.center, color: HexColor("#B8382B"), diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index da0381ed..7e25e300 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -17,7 +17,7 @@ class PageStepperWidget extends StatelessWidget { final int currentStepIndex; final Size screenSize; - PageStepperWidget({this.stepsCount, this.currentStepIndex, this.screenSize}); + PageStepperWidget({required this.stepsCount, required this.currentStepIndex, required this.screenSize}); @override Widget build(BuildContext context) { @@ -32,11 +32,9 @@ class PageStepperWidget extends StatelessWidget { children: [ for (int i = 1; i <= stepsCount; i++) if (i == currentStepIndex) - StepWidget(i, true, i == stepsCount, i < currentStepIndex, - dividerWidth) + StepWidget(i, true, i == stepsCount, i < currentStepIndex, dividerWidth) else - StepWidget(i, false, i == stepsCount, i < currentStepIndex, - dividerWidth) + StepWidget(i, false, i == stepsCount, i < currentStepIndex, dividerWidth) ], ) ], @@ -46,15 +44,13 @@ class PageStepperWidget extends StatelessWidget { } class StepWidget extends StatelessWidget { - final int index; final bool isInProgress; final bool isFinalStep; final bool isStepFinish; final double dividerWidth; - StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, - this.dividerWidth); + StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, this.dividerWidth); @override Widget build(BuildContext context) { @@ -62,9 +58,9 @@ class StepWidget extends StatelessWidget { if (isInProgress) { status = StepStatus.InProgress; } else { - if(isStepFinish){ + if (isStepFinish) { status = StepStatus.Completed; - }else { + } else { status = StepStatus.Locked; } } @@ -80,10 +76,18 @@ class StepWidget extends StatelessWidget { width: 30, height: 30, decoration: BoxDecoration( - color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), + color: status == StepStatus.InProgress + ? Color(0xFFCC9B14) + : status == StepStatus.Locked + ? Color(0xFFE3E3E3) + : Color(0xFF359846), shape: BoxShape.circle, border: Border.all( - color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), + color: status == StepStatus.InProgress + ? Color(0xFFCC9B14) + : status == StepStatus.Locked + ? Color(0xFFE3E3E3) + : Color(0xFF359846), width: 1), ), child: Center( @@ -124,11 +128,13 @@ class StepWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(4.0), ), - border: Border.all(color: status == StepStatus.InProgress - ? Color(0xFFF1E9D3) - : status == StepStatus.Locked - ? Color(0x29797979) - : Color(0xFFD8E8D8), width: 0.30), + border: Border.all( + color: status == StepStatus.InProgress + ? Color(0xFFF1E9D3) + : status == StepStatus.Locked + ? Color(0x29797979) + : Color(0xFFD8E8D8), + width: 0.30), ), child: AppText( status == StepStatus.InProgress @@ -143,8 +149,8 @@ class StepWidget extends StatelessWidget { color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked - ? Color(0xFF969696) - : Color(0xFF359846), + ? Color(0xFF969696) + : Color(0xFF359846), ), ) ], @@ -156,4 +162,4 @@ enum StepStatus { InProgress, Locked, Completed, -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index 08a69907..ab22cb6b 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -23,12 +23,10 @@ import '../../../../routes.dart'; class AdmissionRequestFirstScreen extends StatefulWidget { @override - _AdmissionRequestThirdScreenState createState() => - _AdmissionRequestThirdScreenState(); + _AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState(); } -class _AdmissionRequestThirdScreenState - extends State { +class _AdmissionRequestThirdScreenState extends State { final _dietTypeRemarksController = TextEditingController(); final _sickLeaveCommentsController = TextEditingController(); final _postMedicalHistoryController = TextEditingController(); @@ -41,16 +39,16 @@ class _AdmissionRequestThirdScreenState bool _isSickLeaveRequired = false; bool _patientPregnant = false; - String clinicError; - String doctorError; - String sickLeaveCommentError; - String dietTypeError; - String medicalHistoryError; - String surgicalHistoryError; + String? clinicError; + String? doctorError; + String? sickLeaveCommentError; + String? dietTypeError; + String? medicalHistoryError; + String? surgicalHistoryError; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -61,9 +59,8 @@ class _AdmissionRequestThirdScreenState builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).admissionRequest, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), + appBarTitle: TranslationBase.of(context).admissionRequest!, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -100,14 +97,12 @@ class _AdmissionRequestThirdScreenState ), ), Container( - margin: - EdgeInsets.symmetric(vertical: 0, horizontal: 16), + margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .specialityAndDoctorDetail, + TranslationBase.of(context).specialityAndDoctorDetail, color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, @@ -121,14 +116,15 @@ class _AdmissionRequestThirdScreenState isTextFieldHasSuffix: true, validationError: clinicError, dropDownText: _selectedClinic != null - ? projectViewModel.isArabic? _selectedClinic['clinicNameArabic'] : _selectedClinic['clinicNameEnglish'] + ? projectViewModel.isArabic + ? _selectedClinic['clinicNameArabic'] + : _selectedClinic['clinicNameEnglish'] : null, enabled: false, - onClick: model.clinicList != null && - model.clinicList.length > 0 + onClick: model.clinicList != null && model.clinicList.length > 0 ? () { openListDialogField( - projectViewModel.isArabic? 'clinicNameArabic' : 'clinicNameEnglish', + projectViewModel.isArabic ? 'clinicNameArabic' : 'clinicNameEnglish', 'clinicID', model.clinicList, (selectedValue) { setState(() { @@ -137,28 +133,21 @@ class _AdmissionRequestThirdScreenState }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getClinics().then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.clinicList.length > 0) { + GifLoaderDialogUtils.showMyDialog(context); + await model.getClinics().then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.clinicList.length > 0) { openListDialogField( - projectViewModel.isArabic? 'clinicNameArabic' : 'clinicNameEnglish', + projectViewModel.isArabic ? 'clinicNameArabic' : 'clinicNameEnglish', 'clinicID', model.clinicList, (selectedValue) { setState(() { _selectedClinic = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -169,17 +158,13 @@ class _AdmissionRequestThirdScreenState height: screenSize.height * 0.075, hintText: TranslationBase.of(context).doctor, isTextFieldHasSuffix: true, - dropDownText: _selectedDoctor != null - ? _selectedDoctor['DoctorName'] - : null, + dropDownText: _selectedDoctor != null ? _selectedDoctor['DoctorName'] : null, enabled: false, validationError: doctorError, onClick: _selectedClinic != null - ? model.doctorsList != null && - model.doctorsList.length > 0 + ? model.doctorsList != null && model.doctorsList.length > 0 ? () { - openListDialogField('DoctorName', - 'DoctorID', model.doctorsList, + openListDialogField('DoctorName', 'DoctorID', model.doctorsList, (selectedValue) { setState(() { _selectedDoctor = selectedValue; @@ -187,29 +172,21 @@ class _AdmissionRequestThirdScreenState }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); + GifLoaderDialogUtils.showMyDialog(context); await model - .getClinicDoctors( - _selectedClinic['clinicID']) - .then((_) => GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == ViewState.Idle && - model.doctorsList.length > 0) { - openListDialogField('DoctorName', - 'DoctorID', model.doctorsList, + .getClinicDoctors(_selectedClinic['clinicID']) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.doctorsList.length > 0) { + openListDialogField('DoctorName', 'DoctorID', model.doctorsList, (selectedValue) { setState(() { _selectedDoctor = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } } : null, @@ -226,7 +203,7 @@ class _AdmissionRequestThirdScreenState SizedBox( height: 10, ), - if(patient.gender != 1) + if (patient.gender != 1) CheckboxListTile( title: AppText( TranslationBase.of(context).patientPregnant, @@ -238,7 +215,7 @@ class _AdmissionRequestThirdScreenState activeColor: HexColor("#D02127"), onChanged: (newValue) { setState(() { - _patientPregnant = newValue; + _patientPregnant = newValue!; }); }, controlAffinity: ListTileControlAffinity.leading, @@ -255,15 +232,14 @@ class _AdmissionRequestThirdScreenState activeColor: HexColor("#D02127"), onChanged: (newValue) { setState(() { - _isSickLeaveRequired = newValue; + _isSickLeaveRequired = newValue!; }); }, controlAffinity: ListTileControlAffinity.leading, contentPadding: EdgeInsets.all(0), ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).sickLeaveComments, + hintText: TranslationBase.of(context).sickLeaveComments, controller: _sickLeaveCommentsController, minLines: 2, maxLines: 4, @@ -278,43 +254,31 @@ class _AdmissionRequestThirdScreenState hintText: TranslationBase.of(context).dietType, isTextFieldHasSuffix: true, validationError: dietTypeError, - dropDownText: _selectedDietType != null - ? _selectedDietType['nameEn'] - : null, + dropDownText: _selectedDietType != null ? _selectedDietType['nameEn'] : null, enabled: false, - onClick: model.dietTypesList != null && - model.dietTypesList.length > 0 + onClick: model.dietTypesList != null && model.dietTypesList.length > 0 ? () { - openListDialogField( - 'nameEn', 'id', model.dietTypesList, - (selectedValue) { + openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { setState(() { _selectedDietType = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getDietTypes(patient.patientId).then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.dietTypesList.length > 0) { - openListDialogField( - 'nameEn', 'id', model.dietTypesList, - (selectedValue) { + GifLoaderDialogUtils.showMyDialog(context); + await model + .getDietTypes(patient.patientId) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.dietTypesList.length > 0) { + openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { setState(() { _selectedDietType = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -322,8 +286,7 @@ class _AdmissionRequestThirdScreenState height: 10, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).dietTypeRemarks, + hintText: TranslationBase.of(context).dietTypeRemarks, controller: _dietTypeRemarksController, minLines: 4, maxLines: 6, @@ -370,75 +333,60 @@ class _AdmissionRequestThirdScreenState _sickLeaveCommentsController.text != "" && _postMedicalHistoryController.text != "" && _postSurgicalHistoryController.text != "") { - model.admissionRequestData.patientMRN = - patient.patientMRN; - model.admissionRequestData.appointmentNo = - patient.appointmentNo; + model.admissionRequestData.patientMRN = patient.patientMRN!; + model.admissionRequestData.appointmentNo = patient.appointmentNo; model.admissionRequestData.episodeID = patient.episodeNo; model.admissionRequestData.admissionRequestNo = 0; - model.admissionRequestData.admitToClinic = - _selectedClinic['clinicID']; - model.admissionRequestData.mrpDoctorID = - _selectedDoctor['DoctorID']; + model.admissionRequestData.admitToClinic = _selectedClinic['clinicID']; + model.admissionRequestData.mrpDoctorID = _selectedDoctor['DoctorID']; model.admissionRequestData.isPregnant = _patientPregnant; - model.admissionRequestData.isSickLeaveRequired = - _isSickLeaveRequired; - model.admissionRequestData.sickLeaveComments = - _sickLeaveCommentsController.text; - model.admissionRequestData.isDietType = - _selectedDietType != null ? true : false; - model.admissionRequestData.dietType = - _selectedDietType != null - ? _selectedDietType['id'] - : 0; - model.admissionRequestData.dietRemarks = - _dietTypeRemarksController.text; - model.admissionRequestData.pastMedicalHistory = - _postMedicalHistoryController.text; - model.admissionRequestData.pastSurgicalHistory = - _postSurgicalHistoryController.text; - Navigator.of(context) - .pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: { + model.admissionRequestData.isSickLeaveRequired = _isSickLeaveRequired; + model.admissionRequestData.sickLeaveComments = _sickLeaveCommentsController.text; + model.admissionRequestData.isDietType = _selectedDietType != null ? true : false; + model.admissionRequestData.dietType = _selectedDietType != null ? _selectedDietType['id'] : 0; + model.admissionRequestData.dietRemarks = _dietTypeRemarksController.text; + model.admissionRequestData.pastMedicalHistory = _postMedicalHistoryController.text; + model.admissionRequestData.pastSurgicalHistory = _postSurgicalHistoryController.text; + Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: { 'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType, 'admission-data': model.admissionRequestData }); } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseFill); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseFill); setState(() { - if(_selectedClinic == null){ + if (_selectedClinic == null) { clinicError = TranslationBase.of(context).fieldRequired; - }else { + } else { clinicError = null; } - if(_selectedDoctor == null){ + if (_selectedDoctor == null) { doctorError = TranslationBase.of(context).fieldRequired; - }else { + } else { doctorError = null; } - if(_sickLeaveCommentsController.text == ""){ + if (_sickLeaveCommentsController.text == "") { sickLeaveCommentError = TranslationBase.of(context).fieldRequired; - }else { + } else { sickLeaveCommentError = null; } - if(_selectedDietType == null){ + if (_selectedDietType == null) { dietTypeError = TranslationBase.of(context).fieldRequired; - }else { - dietTypeError = null; + } else { + dietTypeError = ""; } - if(_postMedicalHistoryController.text == ""){ + if (_postMedicalHistoryController.text == "") { medicalHistoryError = TranslationBase.of(context).fieldRequired; - }else { + } else { medicalHistoryError = null; } - if(_postSurgicalHistoryController.text == ""){ + if (_postSurgicalHistoryController.text == "") { surgicalHistoryError = TranslationBase.of(context).fieldRequired; - }else { + } else { surgicalHistoryError = null; } }); @@ -453,8 +401,8 @@ class _AdmissionRequestThirdScreenState ); } - void openListDialogField(String attributeName, String attributeValueId, - List list, Function(dynamic selectedValue) okFunction) { + void openListDialogField( + String attributeName, String attributeValueId, List list, Function(dynamic selectedValue) okFunction) { ListSelectDialog dialog = ListSelectDialog( list: list, attributeName: attributeName, diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index 120b6adf..547fa5cb 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -23,23 +23,21 @@ import '../../../../routes.dart'; class AdmissionRequestThirdScreen extends StatefulWidget { @override - _AdmissionRequestThirdScreenState createState() => - _AdmissionRequestThirdScreenState(); + _AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState(); } -class _AdmissionRequestThirdScreenState - extends State { +class _AdmissionRequestThirdScreenState extends State { dynamic _selectedDiagnosis; dynamic _selectedIcd; dynamic _selectedDiagnosisType; - String diagnosisError; - String icdError; - String diagnosisTypeError; + String? diagnosisError; + String? icdError; + String? diagnosisTypeError; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -52,9 +50,8 @@ class _AdmissionRequestThirdScreenState builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).admissionRequest, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), + appBarTitle: TranslationBase.of(context).admissionRequest!, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -106,18 +103,13 @@ class _AdmissionRequestThirdScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).diagnosis, - dropDownText: _selectedDiagnosis != null - ? _selectedDiagnosis['nameEn'] - : null, + dropDownText: _selectedDiagnosis != null ? _selectedDiagnosis['nameEn'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: diagnosisError, - onClick: model.diagnosisTypesList != null && - model.diagnosisTypesList.length > 0 + onClick: model.diagnosisTypesList != null && model.diagnosisTypesList.length > 0 ? () { - openListDialogField('nameEn', 'id', - model.diagnosisTypesList, - (selectedValue) { + openListDialogField('nameEn', 'id', model.diagnosisTypesList, (selectedValue) { setState(() { _selectedDiagnosis = selectedValue; }); @@ -125,24 +117,17 @@ class _AdmissionRequestThirdScreenState } : () async { GifLoaderDialogUtils.showMyDialog(context); - await model.getDiagnosis().then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.diagnosisTypesList.length > 0) { - openListDialogField('nameEn', 'id', - model.diagnosisTypesList, - (selectedValue) { + await model.getDiagnosis().then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.diagnosisTypesList.length > 0) { + openListDialogField('nameEn', 'id', model.diagnosisTypesList, (selectedValue) { setState(() { _selectedDiagnosis = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { + } else if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -152,18 +137,13 @@ class _AdmissionRequestThirdScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).icd, - dropDownText: _selectedIcd != null - ? _selectedIcd['description'] - : null, + dropDownText: _selectedIcd != null ? _selectedIcd['description'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: icdError, - onClick: model.icdCodes != null && - model.icdCodes.length > 0 + onClick: model.icdCodes != null && model.icdCodes.length > 0 ? () { - openListDialogField( - 'description', 'code', model.icdCodes, - (selectedValue) { + openListDialogField('description', 'code', model.icdCodes, (selectedValue) { setState(() { _selectedIcd = selectedValue; }); @@ -172,25 +152,18 @@ class _AdmissionRequestThirdScreenState : () async { GifLoaderDialogUtils.showMyDialog(context); await model - .getICDCodes(patient.patientMRN) - .then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.icdCodes.length > 0) { - openListDialogField( - 'description', 'code', model.icdCodes, - (selectedValue) { + .getICDCodes(patient.patientMRN!) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.icdCodes.length > 0) { + openListDialogField('description', 'code', model.icdCodes, (selectedValue) { setState(() { _selectedIcd = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { + } else if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -200,19 +173,14 @@ class _AdmissionRequestThirdScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).diagnoseType, - dropDownText: _selectedDiagnosisType != null - ? _selectedDiagnosisType['description'] - : null, + dropDownText: _selectedDiagnosisType != null ? _selectedDiagnosisType['description'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: diagnosisTypeError, - onClick: model.listOfDiagnosisSelectionTypes != - null && - model.listOfDiagnosisSelectionTypes.length > - 0 + onClick: model.listOfDiagnosisSelectionTypes != null && + model.listOfDiagnosisSelectionTypes.length > 0 ? () { - openListDialogField('description', 'code', - model.listOfDiagnosisSelectionTypes, + openListDialogField('description', 'code', model.listOfDiagnosisSelectionTypes, (selectedValue) { setState(() { _selectedDiagnosisType = selectedValue; @@ -222,29 +190,20 @@ class _AdmissionRequestThirdScreenState : () async { GifLoaderDialogUtils.showMyDialog(context); await model - .getMasterLookup(MasterKeysService - .DiagnosisSelectionType) - .then((_) => - GifLoaderDialogUtils.hideDialog( - context)); + .getMasterLookup(MasterKeysService.DiagnosisSelectionType) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); if (model.state == ViewState.Idle && - model.listOfDiagnosisSelectionTypes - .length > - 0) { - openListDialogField('description', 'code', - model.listOfDiagnosisSelectionTypes, + model.listOfDiagnosisSelectionTypes.length > 0) { + openListDialogField('description', 'code', model.listOfDiagnosisSelectionTypes, (selectedValue) { setState(() { - _selectedDiagnosisType = - selectedValue; + _selectedDiagnosisType = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { + } else if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -279,58 +238,48 @@ class _AdmissionRequestThirdScreenState title: TranslationBase.of(context).submit, color: HexColor("#359846"), onPressed: () async { - if (_selectedDiagnosis != null && - _selectedIcd != null && - _selectedDiagnosisType != null) { + if (_selectedDiagnosis != null && _selectedIcd != null && _selectedDiagnosisType != null) { model.admissionRequestData = admissionRequest; dynamic admissionRequestDiagnoses = [ { - 'diagnosisDescription': - _selectedDiagnosis['nameEn'], + 'diagnosisDescription': _selectedDiagnosis['nameEn'], 'diagnosisType': _selectedDiagnosis['id'], 'icdCode': _selectedIcd['code'], - 'icdCodeDescription': - _selectedIcd['description'], + 'icdCodeDescription': _selectedIcd['description'], 'type': _selectedDiagnosisType['code'], 'remarks': "", 'isActive': true, } ]; - model.admissionRequestData - .admissionRequestDiagnoses = - admissionRequestDiagnoses; + model.admissionRequestData.admissionRequestDiagnoses = admissionRequestDiagnoses; await model.makeAdmissionRequest(); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) - .admissionRequestSuccessMsg); - Navigator.popUntil(context, - ModalRoute.withName(PATIENTS_PROFILE)); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).admissionRequestSuccessMsg); + Navigator.popUntil(context, ModalRoute.withName(PATIENTS_PROFILE)); } } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseFill); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseFill); setState(() { - if(_selectedDiagnosis == null){ + if (_selectedDiagnosis == null) { diagnosisError = TranslationBase.of(context).fieldRequired; - }else { + } else { diagnosisError = null; } - if(_selectedIcd == null){ + if (_selectedIcd == null) { icdError = TranslationBase.of(context).fieldRequired; - }else { + } else { icdError = null; } - if(_selectedDiagnosisType == null){ + if (_selectedDiagnosisType == null) { diagnosisTypeError = TranslationBase.of(context).fieldRequired; - }else { + } else { diagnosisTypeError = null; } }); @@ -348,8 +297,8 @@ class _AdmissionRequestThirdScreenState ); } - void openListDialogField(String attributeName, String attributeValueId, - List list, Function(dynamic selectedValue) okFunction) { + void openListDialogField( + String attributeName, String attributeValueId, List list, Function(dynamic selectedValue) okFunction) { ListSelectDialog dialog = ListSelectDialog( list: list, attributeName: attributeName, diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index bea487f7..42fafd8e 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -26,12 +26,10 @@ import '../../../../routes.dart'; class AdmissionRequestSecondScreen extends StatefulWidget { @override - _AdmissionRequestSecondScreenState createState() => - _AdmissionRequestSecondScreenState(); + _AdmissionRequestSecondScreenState createState() => _AdmissionRequestSecondScreenState(); } -class _AdmissionRequestSecondScreenState - extends State { +class _AdmissionRequestSecondScreenState extends State { final _postPlansEstimatedCostController = TextEditingController(); final _estimatedCostController = TextEditingController(); final _expectedDaysController = TextEditingController(); @@ -40,28 +38,28 @@ class _AdmissionRequestSecondScreenState final _complicationsController = TextEditingController(); final _otherProceduresController = TextEditingController(); - DateTime _expectedAdmissionDate; + late DateTime _expectedAdmissionDate; dynamic _selectedFloor; dynamic _selectedWard; dynamic _selectedRoomCategory; dynamic _selectedAdmissionType; - String costError; - String plansError; - String otherInterventionsError; - String expectedDaysError; - String expectedDatesError; - String floorError; - String roomError; - String treatmentsError; - String complicationsError; - String proceduresError; - String admissionTypeError; + String? costError; + String? plansError; + String? otherInterventionsError; + String? expectedDaysError; + String? expectedDatesError; + String? floorError; + String? roomError; + String? treatmentsError; + String? complicationsError; + String? proceduresError; + String? admissionTypeError; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -74,9 +72,8 @@ class _AdmissionRequestSecondScreenState builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).admissionRequest, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), + appBarTitle: TranslationBase.of(context).admissionRequest!, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -112,14 +109,12 @@ class _AdmissionRequestSecondScreenState ), ), Container( - margin: - EdgeInsets.symmetric(vertical: 0, horizontal: 16), + margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .postPlansEstimatedCost, + TranslationBase.of(context).postPlansEstimatedCost, color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, @@ -129,15 +124,11 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: - TranslationBase.of(context).estimatedCost, + hintText: TranslationBase.of(context).estimatedCost, controller: _estimatedCostController, validationError: costError, inputType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], + inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))], ), SizedBox( height: 10, @@ -154,10 +145,8 @@ class _AdmissionRequestSecondScreenState height: 10, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .otherDepartmentsInterventions, - controller: - _otherDepartmentsInterventionsController, + hintText: TranslationBase.of(context).otherDepartmentsInterventions, + controller: _otherDepartmentsInterventionsController, inputType: TextInputType.multiline, validationError: otherInterventionsError, minLines: 2, @@ -177,23 +166,18 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: - TranslationBase.of(context).expectedDays, + hintText: TranslationBase.of(context).expectedDays, controller: _expectedDaysController, validationError: expectedDaysError, inputType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], + inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))], ), SizedBox( height: 10, ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context) - .expectedAdmissionDate, + hintText: TranslationBase.of(context).expectedAdmissionDate, dropDownText: _expectedAdmissionDate != null ? "${AppDateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" : null, @@ -201,16 +185,16 @@ class _AdmissionRequestSecondScreenState isTextFieldHasSuffix: true, validationError: expectedDatesError, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + Icons.calendar_today, + color: Colors.black, + )), onClick: () { if (_expectedAdmissionDate == null) { _expectedAdmissionDate = DateTime.now(); } - _selectDate(context, _expectedAdmissionDate, - (picked) { + _selectDate(context, _expectedAdmissionDate, (picked) { setState(() { _expectedAdmissionDate = picked; }); @@ -223,47 +207,32 @@ class _AdmissionRequestSecondScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).floor, - dropDownText: _selectedFloor != null - ? _selectedFloor['description'] - : null, + dropDownText: _selectedFloor != null ? _selectedFloor['description'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: floorError, - onClick: model.floorList != null && - model.floorList.length > 0 + onClick: model.floorList != null && model.floorList.length > 0 ? () { - openListDialogField( - 'description', - 'floorID', - model.floorList, (selectedValue) { + openListDialogField('description', 'floorID', model.floorList, (selectedValue) { setState(() { _selectedFloor = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getFloors().then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.floorList.length > 0) { - openListDialogField( - 'description', - 'floorID', - model.floorList, (selectedValue) { + GifLoaderDialogUtils.showMyDialog(context); + await model.getFloors().then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.floorList.length > 0) { + openListDialogField('description', 'floorID', model.floorList, + (selectedValue) { setState(() { _selectedFloor = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -273,46 +242,32 @@ class _AdmissionRequestSecondScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).ward, - dropDownText: _selectedWard != null - ? _selectedWard['description'] - : null, + dropDownText: _selectedWard != null ? _selectedWard['description'] : null, enabled: false, isTextFieldHasSuffix: true, - onClick: model.wardList != null && - model.wardList.length > 0 + onClick: model.wardList != null && model.wardList.length > 0 ? () { - openListDialogField( - 'description', - 'nursingStationID', - model.wardList, (selectedValue) { + openListDialogField('description', 'nursingStationID', model.wardList, + (selectedValue) { setState(() { _selectedWard = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getWards().then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.wardList.length > 0) { - openListDialogField( - 'description', - 'nursingStationID', - model.wardList, (selectedValue) { + GifLoaderDialogUtils.showMyDialog(context); + await model.getWards().then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.wardList.length > 0) { + openListDialogField('description', 'nursingStationID', model.wardList, + (selectedValue) { setState(() { _selectedWard = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -321,54 +276,37 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: - TranslationBase.of(context).roomCategory, - dropDownText: _selectedRoomCategory != null - ? _selectedRoomCategory['description'] - : null, + hintText: TranslationBase.of(context).roomCategory, + dropDownText: + _selectedRoomCategory != null ? _selectedRoomCategory['description'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: roomError, - onClick: model.roomCategoryList != null && - model.roomCategoryList.length > 0 + onClick: model.roomCategoryList != null && model.roomCategoryList.length > 0 ? () { - openListDialogField( - 'description', - 'categoryID', - model.roomCategoryList, + openListDialogField('description', 'categoryID', model.roomCategoryList, (selectedValue) { setState(() { - _selectedRoomCategory = - selectedValue; + _selectedRoomCategory = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getRoomCategories().then( - (_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.roomCategoryList.length > 0) { - openListDialogField( - 'description', - 'categoryID', - model.roomCategoryList, + GifLoaderDialogUtils.showMyDialog(context); + await model + .getRoomCategories() + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.roomCategoryList.length > 0) { + openListDialogField('description', 'categoryID', model.roomCategoryList, (selectedValue) { setState(() { - _selectedRoomCategory = - selectedValue; + _selectedRoomCategory = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -376,8 +314,7 @@ class _AdmissionRequestSecondScreenState height: 10, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).treatmentLine, + hintText: TranslationBase.of(context).treatmentLine, controller: _treatmentLineController, inputType: TextInputType.multiline, validationError: treatmentsError, @@ -388,8 +325,7 @@ class _AdmissionRequestSecondScreenState height: 10, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).complications, + hintText: TranslationBase.of(context).complications, controller: _complicationsController, inputType: TextInputType.multiline, validationError: complicationsError, @@ -400,8 +336,7 @@ class _AdmissionRequestSecondScreenState height: 10, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).otherProcedure, + hintText: TranslationBase.of(context).otherProcedure, controller: _otherProceduresController, inputType: TextInputType.multiline, validationError: proceduresError, @@ -413,53 +348,34 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: - TranslationBase.of(context).admissionType, - dropDownText: _selectedAdmissionType != null - ? _selectedAdmissionType['nameEn'] - : null, + hintText: TranslationBase.of(context).admissionType, + dropDownText: _selectedAdmissionType != null ? _selectedAdmissionType['nameEn'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: admissionTypeError, - onClick: model.admissionTypeList != null && - model.admissionTypeList.length > 0 + onClick: model.admissionTypeList != null && model.admissionTypeList.length > 0 ? () { - openListDialogField('nameEn', 'id', - model.admissionTypeList, - (selectedValue) { + openListDialogField('nameEn', 'id', model.admissionTypeList, (selectedValue) { setState(() { - _selectedAdmissionType = - selectedValue; + _selectedAdmissionType = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); + GifLoaderDialogUtils.showMyDialog(context); await model - .getMasterLookup(MasterKeysService - .AdmissionRequestType) - .then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.admissionTypeList.length > - 0) { - openListDialogField('nameEn', 'id', - model.admissionTypeList, - (selectedValue) { + .getMasterLookup(MasterKeysService.AdmissionRequestType) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.admissionTypeList.length > 0) { + openListDialogField('nameEn', 'id', model.admissionTypeList, (selectedValue) { setState(() { - _selectedAdmissionType = - selectedValue; + _selectedAdmissionType = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -496,140 +412,107 @@ class _AdmissionRequestSecondScreenState _postPlansEstimatedCostController.text != "" && _expectedDaysController.text != "" && _expectedAdmissionDate != null && - _otherDepartmentsInterventionsController.text != - "" && + _otherDepartmentsInterventionsController.text != "" && _selectedFloor != null && - _selectedRoomCategory != - null /*_selectedWard is not required*/ && + _selectedRoomCategory != null /*_selectedWard is not required*/ && _treatmentLineController.text != "" && _complicationsController.text != "" && _otherProceduresController.text != "" && _selectedAdmissionType != null) { model.admissionRequestData = admissionRequest; - model.admissionRequestData.estimatedCost = - int.parse(_estimatedCostController.text); - model.admissionRequestData - .elementsForImprovement = + model.admissionRequestData.estimatedCost = int.parse(_estimatedCostController.text); + model.admissionRequestData.elementsForImprovement = _postPlansEstimatedCostController.text; - model.admissionRequestData.expectedDays = - int.parse(_expectedDaysController.text); - model.admissionRequestData.admissionDate = - _expectedAdmissionDate.toIso8601String(); - model.admissionRequestData - .otherDepartmentInterventions = + model.admissionRequestData.expectedDays = int.parse(_expectedDaysController.text); + model.admissionRequestData.admissionDate = _expectedAdmissionDate.toIso8601String(); + model.admissionRequestData.otherDepartmentInterventions = _otherDepartmentsInterventionsController.text; - model.admissionRequestData.admissionLocationID = - _selectedFloor['floorID']; + model.admissionRequestData.admissionLocationID = _selectedFloor['floorID']; model.admissionRequestData.wardID = - _selectedWard != null - ? _selectedWard['nursingStationID'] - : 0; - model.admissionRequestData.roomCategoryID = - _selectedRoomCategory['categoryID']; + _selectedWard != null ? _selectedWard['nursingStationID'] : 0; + model.admissionRequestData.roomCategoryID = _selectedRoomCategory['categoryID']; - model.admissionRequestData - .admissionRequestProcedures = []; + model.admissionRequestData.admissionRequestProcedures = []; - model.admissionRequestData.mainLineOfTreatment = - _treatmentLineController.text; - model.admissionRequestData.complications = - _complicationsController.text; - model.admissionRequestData.otherProcedures = - _otherProceduresController.text; - model.admissionRequestData.admissionType = - _selectedAdmissionType['id']; + model.admissionRequestData.mainLineOfTreatment = _treatmentLineController.text; + model.admissionRequestData.complications = _complicationsController.text; + model.admissionRequestData.otherProcedures = _otherProceduresController.text; + model.admissionRequestData.admissionType = _selectedAdmissionType['id']; - Navigator.of(context).pushNamed( - PATIENT_ADMISSION_REQUEST_3, - arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'admission-data': model.admissionRequestData - }); + Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'admission-data': model.admissionRequestData + }); } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseFill); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseFill); setState(() { if (_estimatedCostController.text == "") { - costError = - TranslationBase.of(context).fieldRequired; + costError = TranslationBase.of(context).fieldRequired; } else { costError = null; } - if (_postPlansEstimatedCostController.text == - "") { - plansError = - TranslationBase.of(context).fieldRequired; + if (_postPlansEstimatedCostController.text == "") { + plansError = TranslationBase.of(context).fieldRequired; } else { plansError = null; } if (_expectedDaysController.text == "") { - expectedDaysError = - TranslationBase.of(context).fieldRequired; + expectedDaysError = TranslationBase.of(context).fieldRequired; } else { - expectedDaysError = null; + expectedDaysError = ""; } if (_expectedAdmissionDate == null) { - expectedDatesError = - TranslationBase.of(context).fieldRequired; + expectedDatesError = TranslationBase.of(context).fieldRequired; } else { expectedDatesError = null; } - if (_otherDepartmentsInterventionsController - .text == - "") { - otherInterventionsError = - TranslationBase.of(context).fieldRequired; + if (_otherDepartmentsInterventionsController.text == "") { + otherInterventionsError = TranslationBase.of(context).fieldRequired; } else { otherInterventionsError = null; } if (_selectedFloor == null) { - floorError = - TranslationBase.of(context).fieldRequired; + floorError = TranslationBase.of(context).fieldRequired; } else { floorError = null; } if (_selectedRoomCategory == null) { - roomError = - TranslationBase.of(context).fieldRequired; + roomError = TranslationBase.of(context).fieldRequired; } else { roomError = null; } if (_treatmentLineController.text == "") { - treatmentsError = - TranslationBase.of(context).fieldRequired; + treatmentsError = TranslationBase.of(context).fieldRequired; } else { treatmentsError = null; } if (_complicationsController.text == "") { - complicationsError = - TranslationBase.of(context).fieldRequired; + complicationsError = TranslationBase.of(context).fieldRequired; } else { complicationsError = null; } if (_otherProceduresController.text == "") { - proceduresError = - TranslationBase.of(context).fieldRequired; + proceduresError = TranslationBase.of(context).fieldRequired; } else { proceduresError = null; } if (_selectedAdmissionType == null) { - admissionTypeError = - TranslationBase.of(context).fieldRequired; + admissionTypeError = TranslationBase.of(context).fieldRequired; } else { admissionTypeError = null; } @@ -647,9 +530,8 @@ class _AdmissionRequestSecondScreenState ); } - Future _selectDate(BuildContext context, DateTime dateTime, - Function(DateTime picked) updateDate) async { - final DateTime picked = await showDatePicker( + Future _selectDate(BuildContext context, DateTime dateTime, Function(DateTime picked) updateDate) async { + final DateTime? picked = await showDatePicker( context: context, initialDate: dateTime, firstDate: DateTime.now(), @@ -661,8 +543,8 @@ class _AdmissionRequestSecondScreenState } } - void openListDialogField(String attributeName, String attributeValueId, - List list, Function(dynamic selectedValue) okFunction) { + void openListDialogField( + String attributeName, String attributeValueId, List list, Function(dynamic selectedValue) okFunction) { ListSelectDialog dialog = ListSelectDialog( list: list, attributeName: attributeName, diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index fcc9746a..d125336a 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -18,15 +18,14 @@ class FlowChartPage extends StatelessWidget { final PatiantInformtion patient; final bool isInpatient; - FlowChartPage({this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); + FlowChartPage( + {required this.patientLabOrder, required this.filterName, required this.patient, required this.isInpatient}); @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getPatientLabOrdersResults( - patientLabOrder: patientLabOrder, - procedure: filterName, - patient: patient), + onModelReady: (model) => + model.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: filterName, patient: patient), builder: (context, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: filterName, @@ -41,25 +40,25 @@ class FlowChartPage extends StatelessWidget { ), ) : Container( - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).noDataAvailable, - fontWeight: FontWeight.normal, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ) - ], + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).noDataAvailable, + fontWeight: FontWeight.normal, + color: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ) + ], + ), ), ), - ), ), ); } diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 0d059000..fd07bc07 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -18,14 +18,14 @@ class LabResultWidget extends StatelessWidget { final bool isInpatient; LabResultWidget( - {Key key, - this.filterName, - this.patientLabResultList, - this.patientLabOrder, - this.patient, - this.isInpatient}) + {Key? key, + required this.filterName, + required this.patientLabResultList, + required this.patientLabOrder, + required this.patient, + required this.isInpatient}) : super(key: key); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -37,32 +37,32 @@ class LabResultWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ // if (!isInpatient) - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(filterName), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: FlowChartPage( - filterName: filterName, - patientLabOrder: patientLabOrder, - patient: patient, - isInpatient: isInpatient, - ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(filterName), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: FlowChartPage( + filterName: filterName, + patientLabOrder: patientLabOrder, + patient: patient, + isInpatient: isInpatient, ), - ); - }, - child: AppText( - TranslationBase.of(context).showMoreBtn, - textDecoration: TextDecoration.underline, - color: Colors.blue, - ), + ), + ); + }, + child: AppText( + TranslationBase.of(context).showMoreBtn, + textDecoration: TextDecoration.underline, + color: Colors.blue, ), - ], - ), + ), + ], + ), Row( children: [ Expanded( @@ -123,7 +123,7 @@ class LabResultWidget extends StatelessWidget { child: Center( child: AppText( '${patientLabResultList[index].testCode}\n' + - patientLabResultList[index].description, + patientLabResultList[index].description!, textAlign: TextAlign.center, ), ), @@ -135,9 +135,8 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - patientLabResultList[index].resultValue ??""+ - " " + - "${patientLabResultList[index].uOM ?? ""}", + patientLabResultList[index].resultValue ?? + "" + " " + "${patientLabResultList[index].uOM ?? ""}", textAlign: TextAlign.center, ), ), @@ -228,7 +227,7 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - lab.resultValue + " " + lab.uOM, + lab.resultValue! + " " + lab.uOM!, textAlign: TextAlign.center, ), ), diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart index 697d16d2..c08d1514 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart @@ -12,7 +12,7 @@ class LabResultDetailsWidget extends StatefulWidget { final List labResult; LabResultDetailsWidget({ - this.labResult, + required this.labResult, }); @override @@ -24,7 +24,7 @@ class _VitalSignDetailsWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - /* decoration: BoxDecoration( + /* decoration: BoxDecoration( color: Colors.transparent, borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), @@ -74,7 +74,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder.symmetric( - inside: BorderSide(width: 1.0, color: Colors.grey[300]), + inside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -87,17 +87,16 @@ class _VitalSignDetailsWidgetState extends State { List fullData(ProjectViewModel projectViewModel) { List tableRow = []; widget.labResult.forEach((vital) { - var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime); + var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!); tableRow.add(TableRow(children: [ Container( child: Container( padding: EdgeInsets.all(8), color: Colors.white, child: AppText( - '${projectViewModel.isArabic? AppDateUtils.getWeekDayArabic(date.weekday): AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', + '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, - fontFamily: 'Poppins', ), ), @@ -110,7 +109,6 @@ class _VitalSignDetailsWidgetState extends State { '${vital.resultValue}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, - fontFamily: 'Poppins', ), ), diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart index 89860f44..4c27861e 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurved.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -10,15 +10,15 @@ class LineChartCurved extends StatefulWidget { final String title; final List labResult; - LineChartCurved({this.title, this.labResult}); + LineChartCurved({required this.title, required this.labResult}); @override State createState() => LineChartCurvedState(); } class LineChartCurvedState extends State { - bool isShowingMainData; - List xAxixs = List(); + bool? isShowingMainData; + List xAxixs = []; int indexes = 0; @override @@ -59,7 +59,6 @@ class LineChartCurvedState extends State { widget.title, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', textAlign: TextAlign.center, ), @@ -92,8 +91,7 @@ class LineChartCurvedState extends State { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData( - show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -102,27 +100,23 @@ class LineChartCurvedState extends State { fontSize: 11, ), margin: 28, - rotateAngle:-65, + rotateAngle: -65, getTitles: (value) { print(value); - DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); + DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime!); if (widget.labResult.length < 8) { if (widget.labResult.length > value.toInt()) { return '${date.day}/ ${date.year}'; } else return ''; } else { - if (value.toInt() == 0) - return '${date.day}/ ${date.year}'; - if (value.toInt() == widget.labResult.length - 1) - return '${date.day}/ ${date.year}'; + if (value.toInt() == 0) return '${date.day}/ ${date.year}'; + if (value.toInt() == widget.labResult.length - 1) return '${date.day}/ ${date.year}'; if (xAxixs.contains(value.toInt())) { return '${date.day}/ ${date.year}'; } } - - return ''; }, ), @@ -160,7 +154,7 @@ class LineChartCurvedState extends State { ), minX: 0, maxX: (widget.labResult.length - 1).toDouble(), - maxY: getMaxY()+2, + maxY: getMaxY() + 2, minY: getMinY(), lineBarsData: getData(), ); @@ -169,10 +163,10 @@ class LineChartCurvedState extends State { double getMaxY() { double max = 0; widget.labResult.forEach((element) { - try{ - double resultValueDouble = double.parse(element.resultValue); - if (resultValueDouble > max) max = resultValueDouble;} - catch(e){ + try { + double resultValueDouble = double.parse(element.resultValue!); + if (resultValueDouble > max) max = resultValueDouble; + } catch (e) { print(e); } }); @@ -182,13 +176,14 @@ class LineChartCurvedState extends State { double getMinY() { double min = 0; - try{ - min = double.parse(widget.labResult[0].resultValue); - - widget.labResult.forEach((element) { - double resultValueDouble = double.parse(element.resultValue); - if (resultValueDouble < min) min = resultValueDouble; - });}catch(e){ + try { + min = double.parse(widget.labResult[0].resultValue ?? ""); + + widget.labResult.forEach((element) { + double resultValueDouble = double.parse(element.resultValue ?? ""); + if (resultValueDouble < min) min = resultValueDouble; + }); + } catch (e) { print(e); } int value = min.toInt(); @@ -197,15 +192,14 @@ class LineChartCurvedState extends State { } List getData() { - List spots = List(); + List spots = []; for (int index = 0; index < widget.labResult.length; index++) { - try{ - var resultValueDouble = double.parse(widget.labResult[index].resultValue); - spots.add(FlSpot(index.toDouble(), resultValueDouble)); - }catch(e){ + try { + var resultValueDouble = double.parse(widget.labResult[index].resultValue ?? ""); + spots.add(FlSpot(index.toDouble(), resultValueDouble)); + } catch (e) { print(e); spots.add(FlSpot(index.toDouble(), 0.0)); - } } diff --git a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart index 6026c9e9..26018768 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart @@ -1,4 +1,3 @@ - import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -8,18 +7,16 @@ import 'package:flutter/material.dart'; import 'Lab_Result_details_wideget.dart'; import 'LineChartCurved.dart'; - class LabResultChartAndDetails extends StatelessWidget { LabResultChartAndDetails({ - Key key, - @required this.labResult, - @required this.name, + Key? key, + required this.labResult, + required this.name, }) : super(key: key); final List labResult; final String name; - @override Widget build(BuildContext context) { return Padding( @@ -29,19 +26,16 @@ class LabResultChartAndDetails extends StatelessWidget { children: [ Container( margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), + child: LineChartCurved( + title: name, + labResult: labResult, ), - child: LineChartCurved(title: name,labResult:labResult,), ), Container( margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) - ), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -51,7 +45,9 @@ class LabResultChartAndDetails extends StatelessWidget { fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), - SizedBox(height: 8,), + SizedBox( + height: 8, + ), LabResultDetailsWidget( labResult: labResult.reversed.toList(), ), @@ -62,5 +58,4 @@ class LabResultChartAndDetails extends StatelessWidget { ), ); } - } diff --git a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart index dd8ace01..a8b98be9 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart @@ -14,7 +14,7 @@ import 'package:flutter/material.dart'; class LabResult extends StatefulWidget { final LabOrdersResModel labOrders; - LabResult({Key key, this.labOrders}); + LabResult({Key? key, required this.labOrders}); @override _LabResultState createState() => _LabResultState(); @@ -27,13 +27,11 @@ class _LabResultState extends State { onModelReady: (model) => model.getLabResult(widget.labOrders), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).labOrders, + appBarTitle: TranslationBase.of(context).labOrders ?? "", body: model.labResultList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoLabOrders) + ? DrAppEmbeddedError(error: TranslationBase.of(context).errorNoLabOrders ?? "") : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, - 0, SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), child: ListView( children: [ CardWithBgWidgetNew( @@ -69,7 +67,6 @@ class _LabResultState extends State { ), ], ), - ], ), ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 5f79038f..7f581945 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -17,12 +17,12 @@ class LaboratoryResultPage extends StatefulWidget { final bool isInpatient; LaboratoryResultPage( - {Key key, - this.patientLabOrders, - this.patient, - this.patientType, - this.arrivalType, - this.isInpatient}); + {Key? key, + required this.patientLabOrders, + required this.patient, + required this.patientType, + required this.arrivalType, + required this.isInpatient}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -40,9 +40,7 @@ class _LaboratoryResultPageState extends State { // patient: widget.patient, // isInpatient: widget.patientType == "1"), onModelReady: (model) => model.getPatientLabResult( - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, - isInpatient: true), + patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: true), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBar: PatientProfileHeaderWhitAppointmentAppBar( @@ -65,11 +63,11 @@ class _LaboratoryResultPageState extends State { children: [ LaboratoryResultWidget( onTap: () async {}, - billNo: widget.patientLabOrders.invoiceNo, + billNo: widget.patientLabOrders.invoiceNo!, details: model.patientLabSpecialResult.length > 0 - ? model.patientLabSpecialResult[0].resultDataHTML + ? model.patientLabSpecialResult[0]!.resultDataHTML : null, - orderNo: widget.patientLabOrders.orderNo, + orderNo: widget.patientLabOrders.orderNo!, patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: widget.patientType == "1", diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 08c247ee..67d0c63b 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -16,21 +16,21 @@ import 'package:provider/provider.dart'; class LaboratoryResultWidget extends StatefulWidget { final GestureTapCallback onTap; final String billNo; - final String details; + final String? details; final String orderNo; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; final bool isInpatient; const LaboratoryResultWidget( - {Key key, - this.onTap, - this.billNo, - this.details, - this.orderNo, - this.patientLabOrder, - this.patient, - this.isInpatient}) + {Key? key, + required this.onTap, + required this.billNo, + required this.details, + required this.orderNo, + required this.patientLabOrder, + required this.patient, + required this.isInpatient}) : super(key: key); @override @@ -40,7 +40,7 @@ class LaboratoryResultWidget extends StatefulWidget { class _LaboratoryResultWidgetState extends State { bool _isShowMoreGeneral = true; bool _isShowMore = true; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -88,20 +88,16 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only( - left: 10, right: 10), + margin: EdgeInsets.only(left: 10, right: 10), child: AppText( - TranslationBase.of(context) - .generalResult, + TranslationBase.of(context).generalResult, bold: true, ))), Container( width: 25, height: 25, child: Icon( - _isShowMoreGeneral - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, + _isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.grey[800], size: 22, ), @@ -132,11 +128,8 @@ class _LaboratoryResultWidgetState extends State { model.labResultLists.length, (index) => LabResultWidget( patientLabOrder: widget.patientLabOrder, - filterName: model - .labResultLists[index].filterName, - patientLabResultList: model - .labResultLists[index] - .patientLabResultList, + filterName: model.labResultLists[index].filterName, + patientLabResultList: model.labResultLists[index].patientLabResultList, patient: widget.patient, isInpatient: widget.isInpatient, ), @@ -151,7 +144,7 @@ class _LaboratoryResultWidgetState extends State { SizedBox( height: 15, ), - if (widget.details != null && widget.details.isNotEmpty) + if (widget.details != null && widget.details!.isNotEmpty) Column( children: [ InkWell( @@ -173,20 +166,16 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only( - left: 10, right: 10), + margin: EdgeInsets.only(left: 10, right: 10), child: AppText( - TranslationBase.of(context) - .specialResult, + TranslationBase.of(context).specialResult, bold: true, ))), Container( width: 25, height: 25, child: Icon( - _isShowMore - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, + _isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.grey[800], size: 22, ), @@ -209,16 +198,12 @@ class _LaboratoryResultWidgetState extends State { duration: Duration(milliseconds: 7000), child: Container( width: double.infinity, - child: !Helpers.isTextHtml(widget.details) + child: !Helpers.isTextHtml(widget.details!) ? AppText( - widget.details ?? - TranslationBase.of(context) - .noDataAvailable, + widget.details ?? TranslationBase.of(context).noDataAvailable, ) : Html( - data: widget.details ?? - TranslationBase.of(context) - .noDataAvailable, + data: widget.details ?? TranslationBase.of(context).noDataAvailable, ), ), ), diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index d6f6fde2..a43ed52e 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -22,18 +22,17 @@ class LabsHomePage extends StatefulWidget { } class _LabsHomePageState extends State { - String patientType; - - String arrivalType; - PatiantInformtion patient; - bool isInpatient; - bool isFromLiveCare; + late String patientType; + late String arrivalType; + late PatiantInformtion patient; + late bool isInpatient; + late bool isFromLiveCare; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -50,7 +49,7 @@ class _LabsHomePageState extends State { onModelReady: (model) => model.getLabs(patient, isInpatient: false), builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, - backgroundColor: Colors.grey[100], + backgroundColor: Colors.grey[100]!, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, @@ -68,8 +67,7 @@ class _LabsHomePageState extends State { SizedBox( height: 12, ), - if (model.patientLabOrdersList.isNotEmpty && - patient.patientStatusType != 43) + if (model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -89,8 +87,7 @@ class _LabsHomePageState extends State { ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient.patientStatusType != null && patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -110,8 +107,7 @@ class _LabsHomePageState extends State { ], ), ), - if ((patient.patientStatusType != null && - patient.patientStatusType == 43) || + if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { @@ -124,7 +120,7 @@ class _LabsHomePageState extends State { )), ); }, - label: TranslationBase.of(context).applyForNewLabOrder, + label: TranslationBase.of(context).applyForNewLabOrder ?? "", ), ...List.generate( model.patientLabOrdersList.length, @@ -145,37 +141,26 @@ class _LabsHomePageState extends State { width: 20, height: 160, decoration: BoxDecoration( - color: model.patientLabOrdersList[index] - .isLiveCareAppointment + color: model.patientLabOrdersList[index].isLiveCareAppointment! ? Colors.red[900] - : !model.patientLabOrdersList[index] - .isInOutPatient + : !model.patientLabOrdersList[index].isInOutPatient! ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), - bottomLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), - topRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0), - bottomRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0) - ), + topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), + bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), ), child: RotatedBox( quarterTurns: 3, child: Center( child: Text( - model.patientLabOrdersList[index] - .isLiveCareAppointment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.patientLabOrdersList[index] - .isInOutPatient - ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + model.patientLabOrdersList[index].isLiveCareAppointment! + ? TranslationBase.of(context).liveCare!.toUpperCase() + : !model.patientLabOrdersList[index].isInOutPatient! + ? TranslationBase.of(context).inPatientLabel!.toUpperCase() + : TranslationBase.of(context).outpatient!.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -189,24 +174,18 @@ class _LabsHomePageState extends State { page: LaboratoryResultPage( patientLabOrders: model.patientLabOrdersList[index], patient: patient, - isInpatient:isInpatient, + isInpatient: isInpatient, arrivalType: arrivalType, patientType: patientType, ), ), ), - doctorName: - model.patientLabOrdersList[index].doctorName, - invoiceNO: - ' ${model.patientLabOrdersList[index].invoiceNo}', - profileUrl: model - .patientLabOrdersList[index].doctorImageURL, - branch: - model.patientLabOrdersList[index].projectName, - clinic: model - .patientLabOrdersList[index].clinicDescription, - appointmentDate: - model.patientLabOrdersList[index].orderDate.add(Duration(days: 1)), + doctorName: model.patientLabOrdersList[index].doctorName ?? "", + invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', + profileUrl: model.patientLabOrdersList[index].doctorImageURL ?? "", + branch: model.patientLabOrdersList[index].projectName ?? "", + clinic: model.patientLabOrdersList[index].clinicDescription ?? "", + appointmentDate: model.patientLabOrdersList[index].orderDate!.add(Duration(days: 1)), orderNo: model.patientLabOrdersList[index].orderNo, isShowTime: false, ), @@ -215,8 +194,7 @@ class _LabsHomePageState extends State { ), ), ), - if (model.patientLabOrdersList.isEmpty && - patient.patientStatusType != 43) + if (model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 3eb3660d..3d9411a0 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -21,16 +21,14 @@ class AddVerifyMedicalReport extends StatefulWidget { } class _AddVerifyMedicalReportState extends State { - HtmlEditorController _controller = HtmlEditorController(); + HtmlEditorController _controller = HtmlEditorController(); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; MedicalReportStatus status = routeArgs['status']; - MedicalReportModel medicalReport = routeArgs.containsKey("medicalReport") - ? routeArgs['medicalReport'] - : null; + MedicalReportModel medicalReport = routeArgs.containsKey("medicalReport") ? routeArgs['medicalReport'] : null; return BaseView( onModelReady: (model) => model.getMedicalReportTemplate(), @@ -38,8 +36,8 @@ class _AddVerifyMedicalReportState extends State { baseViewModel: model, isShowAppBar: true, appBarTitle: status == MedicalReportStatus.ADD - ? TranslationBase.of(context).medicalReportAdd - : TranslationBase.of(context).medicalReportVerify, + ? TranslationBase.of(context).medicalReportAdd! + : TranslationBase.of(context).medicalReportVerify!, backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: Column( children: [ @@ -56,7 +54,7 @@ class _AddVerifyMedicalReportState extends State { children: [ if (model.medicalReportTemplate.length > 0) HtmlRichEditor( - initialText: model.medicalReportTemplate[0].templateTextHtml, + initialText: model.medicalReportTemplate[0].templateTextHtml!, height: MediaQuery.of(context).size.height * 0.75, controller: _controller, ), @@ -84,13 +82,11 @@ class _AddVerifyMedicalReportState extends State { // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, onPressed: () async { - String txtOfMedicalReport = - await _controller.getText(); + String txtOfMedicalReport = await _controller.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - model.insertMedicalReport( - patient, txtOfMedicalReport); + model.insertMedicalReport(patient, txtOfMedicalReport); GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); @@ -112,8 +108,7 @@ class _AddVerifyMedicalReportState extends State { fontWeight: FontWeight.w700, onPressed: () async { GifLoaderDialogUtils.showMyDialog(context); - await model.verifyMedicalReport( - patient, medicalReport); + await model.verifyMedicalReport(patient, medicalReport); GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index 7bf6f1d9..1225eba4 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -20,7 +20,7 @@ class MedicalReportDetailPage extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -61,27 +61,29 @@ class MedicalReportDetailPage extends StatelessWidget { ], ), ), - medicalReport.reportDataHtml != null ? Container( - width: double.infinity, - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(8)), - border: Border.fromBorderSide( - BorderSide( - color: Colors.white, - width: 1.0, + medicalReport.reportDataHtml != null + ? Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide( + BorderSide( + color: Colors.white, + width: 1.0, + ), + ), + ), + child: Html(data: medicalReport.reportDataHtml ?? ""), + ) + : Container( + child: ErrorMessage( + error: "No Data", + ), ), - ), - ), - child: Html( - data: medicalReport.reportDataHtml ?? "" - ), - ) : Container( - child: ErrorMessage(error: "No Data",), - ), ], ), ), diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index e2da651b..1babfab2 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -26,7 +26,7 @@ import 'AddVerifyMedicalReport.dart'; class MedicalReportPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -75,15 +75,14 @@ class MedicalReportPage extends StatelessWidget { ), AddNewOrder( onTap: () { - Navigator.of(context) - .pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: { + Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: { 'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType, 'type': MedicalReportStatus.ADD }); }, - label: TranslationBase.of(context).createNewMedicalReport, + label: TranslationBase.of(context).createNewMedicalReport!, ), if (model.state != ViewState.ErrorLocal) ...List.generate( @@ -91,33 +90,27 @@ class MedicalReportPage extends StatelessWidget { (index) => InkWell( onTap: () { if (model.medicalReportList[index].status == 1) { - Navigator.of(context).pushNamed( - PATIENT_MEDICAL_REPORT_DETAIL, - arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'medicalReport': model.medicalReportList[index] - }); + Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'medicalReport': model.medicalReportList[index] + }); } else { - Navigator.of(context).pushNamed( - PATIENT_MEDICAL_REPORT_INSERT, - arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'type': MedicalReportStatus.ADD, - 'medicalReport': model.medicalReportList[index] - }); + Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'type': MedicalReportStatus.ADD, + 'medicalReport': model.medicalReportList[index] + }); } }, child: Container( margin: EdgeInsets.symmetric(horizontal: 8), child: CardWithBgWidget( hasBorder: false, - bgColor: model.medicalReportList[index].status == 1 - ? Colors.red[700] - : Colors.green[700], + bgColor: model.medicalReportList[index].status == 1 ? Colors.red[700]! : Colors.green[700]!, widget: Column( children: [ Row( @@ -129,11 +122,8 @@ class MedicalReportPage extends StatelessWidget { AppText( model.medicalReportList[index].status == 1 ? TranslationBase.of(context).onHold - : TranslationBase.of(context) - .verified, - color: model.medicalReportList[index] - .status == - 1 + : TranslationBase.of(context).verified, + color: model.medicalReportList[index].status == 1 ? Colors.red[700] : Colors.green[700], fontSize: 1.4 * SizeConfig.textMultiplier, @@ -141,10 +131,8 @@ class MedicalReportPage extends StatelessWidget { ), AppText( projectViewModel.isArabic - ? model.medicalReportList[index] - .doctorNameN - : model.medicalReportList[index] - .doctorName, + ? model.medicalReportList[index].doctorNameN + : model.medicalReportList[index].doctorName, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), @@ -155,13 +143,13 @@ class MedicalReportPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "dd MMM yyyy")}', + '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn ?? "", "dd MMM yyyy")}', color: Color(0xFF2E303A), fontWeight: FontWeight.w600, fontSize: 1.6 * SizeConfig.textMultiplier, ), AppText( - '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "hh:mm a")}', + '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn ?? "", "hh:mm a")}', color: Color(0xFF2E303A), fontWeight: FontWeight.w600, fontSize: 1.5 * SizeConfig.textMultiplier, @@ -174,16 +162,12 @@ class MedicalReportPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - margin: EdgeInsets.only( - left: 0, top: 4, right: 8, bottom: 0), + margin: EdgeInsets.only(left: 0, top: 4, right: 8, bottom: 0), child: LargeAvatar( name: projectViewModel.isArabic - ? model.medicalReportList[index] - .doctorNameN - : model.medicalReportList[index] - .doctorName, - url: model.medicalReportList[index] - .doctorImageURL, + ? model.medicalReportList[index].doctorNameN ?? "" + : model.medicalReportList[index].doctorName ?? "", + url: model.medicalReportList[index].doctorImageURL, ), width: 50, height: 50, @@ -191,27 +175,20 @@ class MedicalReportPage extends StatelessWidget { Expanded( child: Container( child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( projectViewModel.isArabic - ? model.medicalReportList[index] - .projectNameN - : model.medicalReportList[index] - .projectName, - fontSize: - 1.6 * SizeConfig.textMultiplier, + ? model.medicalReportList[index].projectNameN + : model.medicalReportList[index].projectName, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0xFF2E303A), ), AppText( projectViewModel.isArabic - ? model.medicalReportList[index] - .clinicNameN - : model.medicalReportList[index] - .clinicName, - fontSize: - 1.6 * SizeConfig.textMultiplier, + ? model.medicalReportList[index].clinicNameN + : model.medicalReportList[index].clinicName, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0xFF2E303A), ), ], @@ -224,10 +201,7 @@ class MedicalReportPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ Icon( - model.medicalReportList[index].status == - 1 - ? EvaIcons.eye - : DoctorApp.edit_1, + model.medicalReportList[index].status == 1 ? EvaIcons.eye : DoctorApp.edit_1, ), ], ), diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index be912a60..cb454172 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -30,22 +30,21 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class ProgressNoteScreen extends StatefulWidget { final int visitType; - const ProgressNoteScreen({Key key, this.visitType}) : super(key: key); + const ProgressNoteScreen({Key? key, required this.visitType}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - List notesList; + late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; - getProgressNoteList(BuildContext context, PatientViewModel model, - {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); @@ -54,15 +53,12 @@ class _ProgressNoteState extends State { ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( visitType: widget.visitType, // if equal 5 then this will return progress note - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient.admissionNo ?? ""), projectID: patient.projectId, tokenID: token, patientTypeID: patient.patientType, languageID: 2); - model - .getPatientProgressNote(progressNoteRequest.toJson(), - isLocalBusy: isLocalBusy) - .then((c) { + model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) { notesList = model.patientProgressNoteList; }); } @@ -71,172 +67,109 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute - .of(context) - .settings - .arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; - if (routeArgs.containsKey('isDischargedPatient')) - isDischargedPatient = routeArgs['isDischargedPatient']; + if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => getProgressNoteList(context, model), - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - backgroundColor: Theme - .of(context) - .scaffoldBackgroundColor, - // appBarTitle: TranslationBase.of(context).progressNote, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, - patient.patientType.toString() ?? '0', - arrivalType, - isInpatient: true, - ), - body: model.patientProgressNoteList == null || - model.patientProgressNoteList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase - .of(context) - .errorNoProgressNote) - : Container( - color: Colors.grey[200], - child: Column( - children: [ - if (!isDischargedPatient) - AddNewOrder( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - UpdateNoteOrder( - patientModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: false, - )), - ); - }, - label: widget.visitType == 3 - ? TranslationBase - .of(context) - .addNewOrderSheet - : TranslationBase - .of(context) - .addProgressNote, - ), - Expanded( - child: Container( - child: ListView.builder( - itemCount: model.patientProgressNoteList.length, - itemBuilder: (BuildContext ctxt, int index) { - return FractionallySizedBox( - widthFactor: 0.95, - child: CardWithBgWidget( - hasBorder: false, - bgColor: model.patientProgressNoteList[index] - .status == - 1 && - authenticationViewModel.doctorProfile.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy - ? Color(0xFFCC9B14) - : model.patientProgressNoteList[index] - .status == - 4 - ? Colors.red.shade700 - : model.patientProgressNoteList[index] - .status == - 2 - ? Colors.green[600] - : Color(0xFFCC9B14), - widget: Column( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - if (model - .patientProgressNoteList[ - index] - .status == - 1 && - authenticationViewModel - .doctorProfile.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy) - AppText( - TranslationBase - .of(context) - .notePending, - fontWeight: FontWeight.bold, - color: Color(0xFFCC9B14), - fontSize: 12, - ), - if (model - .patientProgressNoteList[ - index] - .status == - 4) + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + // appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, + patient.patientType.toString() ?? '0', + arrivalType, + isInpatient: true, + ), + body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 + ? DrAppEmbeddedError(error: TranslationBase.of(context).errorNoProgressNote ?? "") + : Container( + color: Colors.grey[200], + child: Column( + children: [ + if (!isDischargedPatient) + AddNewOrder( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateNoteOrder( + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: false, + )), + ); + }, + label: widget.visitType == 3 + ? TranslationBase.of(context).addNewOrderSheet! + : TranslationBase.of(context).addProgressNote!, + ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index].status == 1 && + authenticationViewModel.doctorProfile!.doctorID != + model.patientProgressNoteList[index].createdBy + ? Color(0xFFCC9B14) + : model.patientProgressNoteList[index].status == 4 + ? Colors.red.shade700 + : model.patientProgressNoteList[index].status == 2 + ? Colors.green[600]! + : Color(0xFFCC9B14)!, + widget: Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (model.patientProgressNoteList[index].status == 1 && + authenticationViewModel.doctorProfile!.doctorID != + model.patientProgressNoteList[index].createdBy) + AppText( + TranslationBase.of(context).notePending, + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status == 4) AppText( - TranslationBase - .of(context) - .noteCanceled, + TranslationBase.of(context).noteCanceled, fontWeight: FontWeight.bold, color: Colors.red.shade700, fontSize: 12, ), - if (model - .patientProgressNoteList[ - index] - .status == - 2) + if (model.patientProgressNoteList[index].status == 2) AppText( - TranslationBase - .of(context) - .noteVerified, + TranslationBase.of(context).noteVerified, fontWeight: FontWeight.bold, color: Colors.green[600], fontSize: 12, ), if (model.patientProgressNoteList[index].status != 2 && - model - .patientProgressNoteList[ - index] - .status != - 4 && - authenticationViewModel - .doctorProfile.doctorID == - model - .patientProgressNoteList[ - index] - .createdBy) + model.patientProgressNoteList[index].status != 4 && + authenticationViewModel.doctorProfile!.doctorID == + model.patientProgressNoteList[index].createdBy) Row( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ InkWell( onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => - UpdateNoteOrder( - note: model - .patientProgressNoteList[ - index], - patientModel: - model, - patient: - patient, - visitType: widget - .visitType, + builder: (context) => UpdateNoteOrder( + note: model.patientProgressNoteList[index], + patientModel: model, + patient: patient, + visitType: widget.visitType, isUpdate: true, )), ); @@ -244,9 +177,7 @@ class _ProgressNoteState extends State { child: Container( decoration: BoxDecoration( color: Colors.grey[600], - borderRadius: - BorderRadius.circular( - 10), + borderRadius: BorderRadius.circular(10), ), // color:Colors.red[600], @@ -261,10 +192,7 @@ class _ProgressNoteState extends State { width: 2, ), AppText( - TranslationBase - .of( - context) - .update, + TranslationBase.of(context).update, fontSize: 10, color: Colors.white, ), @@ -282,61 +210,33 @@ class _ProgressNoteState extends State { context: context, actionName: "verify", confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( - context); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: int - .parse(patient - .admissionNo), - cancelledNote: - false, - lineItemNo: model - .patientProgressNoteList[ - index] - .lineItemNo, - createdBy: model - .patientProgressNoteList[ - index] - .createdBy, - notes: model - .patientProgressNoteList[ - index] - .notes, + GifLoaderDialogUtils.showMyDialog(context); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo ?? ""), + cancelledNote: false, + lineItemNo: model.patientProgressNoteList[index].lineItemNo, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, verifiedNote: true, - patientTypeID: - patient - .patientType, + patientTypeID: patient.patientType, patientOutSA: false, ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, - isLocalBusy: - true); - GifLoaderDialogUtils - .hideDialog( - context); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); }); }, child: Container( decoration: BoxDecoration( color: Colors.green[600], - borderRadius: - BorderRadius.circular( - 10), + borderRadius: BorderRadius.circular(10), ), // color:Colors.red[600], child: Row( children: [ Icon( - FontAwesomeIcons - .check, + FontAwesomeIcons.check, size: 12, color: Colors.white, ), @@ -344,10 +244,7 @@ class _ProgressNoteState extends State { width: 2, ), AppText( - TranslationBase - .of( - context) - .noteVerify, + TranslationBase.of(context).noteVerify, fontSize: 10, color: Colors.white, ), @@ -363,67 +260,37 @@ class _ProgressNoteState extends State { onTap: () async { showMyDialog( context: context, - actionName: - TranslationBase - .of( - context) - .cancel, + actionName: TranslationBase.of(context).cancel!, confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( + GifLoaderDialogUtils.showMyDialog( context, ); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: int - .parse(patient - .admissionNo), + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo ?? ""), cancelledNote: true, - lineItemNo: model - .patientProgressNoteList[ - index] - .lineItemNo, - createdBy: model - .patientProgressNoteList[ - index] - .createdBy, - notes: model - .patientProgressNoteList[ - index] - .notes, + lineItemNo: model.patientProgressNoteList[index].lineItemNo, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, verifiedNote: false, - patientTypeID: - patient - .patientType, + patientTypeID: patient.patientType, patientOutSA: false, ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, - isLocalBusy: - true); - GifLoaderDialogUtils - .hideDialog( - context); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); }); }, child: Container( decoration: BoxDecoration( color: Colors.red[600], - borderRadius: - BorderRadius.circular( - 10), + borderRadius: BorderRadius.circular(10), ), // color:Colors.red[600], child: Row( children: [ Icon( - FontAwesomeIcons - .trash, + FontAwesomeIcons.trash, size: 12, color: Colors.white, ), @@ -449,41 +316,25 @@ class _ProgressNoteState extends State { height: 10, ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: MediaQuery.of(context) - .size - .width * - 0.60, + width: MediaQuery.of(context).size.width * 0.60, child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - crossAxisAlignment: - CrossAxisAlignment - .start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase - .of( - context) - .createdBy, + TranslationBase.of(context).createdBy, fontSize: 10, ), Expanded( child: AppText( - model - .patientProgressNoteList[ - index] - .doctorName ?? - '', - fontWeight: - FontWeight.w600, + model.patientProgressNoteList[index].doctorName ?? '', + fontWeight: FontWeight.w600, fontSize: 12, ), ), @@ -495,187 +346,149 @@ class _ProgressNoteState extends State { Column( children: [ AppText( - model - .patientProgressNoteList[ - index] - .createdOn != - null + model.patientProgressNoteList[index].createdOn != null ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .getDateTimeFromServerFormat( - model - .patientProgressNoteList[ - index] - .createdOn), - isArabic: - projectViewModel - .isArabic) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now(), - isArabic: - projectViewModel - .isArabic), + AppDateUtils.getDateTimeFromServerFormat( + model.patientProgressNoteList[index].createdOn ?? ""), + isArabic: projectViewModel.isArabic) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), + isArabic: projectViewModel.isArabic), fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - model - .patientProgressNoteList[ - index] - .createdOn != - null - ? AppDateUtils.getHour(AppDateUtils - .getDateTimeFromServerFormat( - model - .patientProgressNoteList[ - index] - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), + model.patientProgressNoteList[index].createdOn != null + ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat( + model.patientProgressNoteList[index].createdOn ?? "")) + : AppDateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, ), ], - crossAxisAlignment: - CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, ) ], ), SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - model - .patientProgressNoteList[ - index] - .notes, - fontSize: 10, - ), - ), - ]) - ], - ), - SizedBox( - height: 20, - ), - ], + Row(mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + child: AppText( + model.patientProgressNoteList[index].notes, + fontSize: 10, + ), + ), + ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), ), - ), - ); - }), + ); + }), + ), ), - ), - ], + ], + ), ), - ), ), ); } - showMyDialog({BuildContext context, Function confirmFun, String actionName}) { + showMyDialog({required BuildContext context, required Function confirmFun, required String actionName}) { showDialog( context: context, builder: (ctx) => Center( - child: Container( - width: MediaQuery - .of(context) - .size - .width * 0.8, - height: 200, - child: AppScaffold( - isShowAppBar: false, - body: Container( - color: Colors.white, - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - // SizedBox(height: 20,), - SizedBox( - height: 10, - ), - Row( + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + height: 200, + child: AppScaffold( + isShowAppBar: false, + body: Container( + color: Colors.white, + child: Center( + child: Column( mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - AppText( - TranslationBase - .of(context) - .noteConfirm, - fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16, + // SizedBox(height: 20,), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).noteConfirm, + fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16, + ), + ], + ), + SizedBox( + height: 10, + ), + DividerWithSpacesAround(), + SizedBox( + height: 12, ), - ], - ), - SizedBox( - height: 10, - ), - DividerWithSpacesAround(), - SizedBox( - height: 12, - ), - Container( - padding: EdgeInsets.all(20), - color: Colors.white, - child: AppText( - projectViewModel.isArabic?"هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟":'Are you sure you want $actionName this order?', - fontSize: 15, - textAlign: TextAlign.center, - ), - ), + Container( + padding: EdgeInsets.all(20), + color: Colors.white, + child: AppText( + projectViewModel.isArabic + ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" + : 'Are you sure you want $actionName this order?', + fontSize: 15, + textAlign: TextAlign.center, + ), + ), - SizedBox( - height: 8, + SizedBox( + height: 8, + ), + DividerWithSpacesAround(), + FractionallySizedBox( + widthFactor: 0.75, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + FlatButton( + child: AppText( + TranslationBase.of(context).cancel, + fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16, + ), //Text("Cancel"), + onPressed: () { + Navigator.of(context).pop(); + }), + FlatButton( + child: AppText( + TranslationBase.of(context).noteConfirm, + fontWeight: FontWeight.w600, + color: Colors.red.shade700, + fontSize: 16, + ), //Text("Confirm", ), + onPressed: () async { + await confirmFun(); + Navigator.of(context).pop(); + }) + ], + ), + ) + ], ), - DividerWithSpacesAround(), - FractionallySizedBox( - widthFactor: 0.75, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - FlatButton( - child: AppText( - TranslationBase - .of(context) - .cancel, - fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16, - ), //Text("Cancel"), - onPressed: () { - Navigator.of(context).pop(); - }), - FlatButton( - child: AppText( - TranslationBase - .of(context) - .noteConfirm, - fontWeight: FontWeight.w600, - color: Colors.red.shade700, - fontSize: 16, - ), //Text("Confirm", ), - onPressed: () async { - await confirmFun(); - Navigator.of(context).pop(); - }) - ], - ), - ) - ], + ), ), ), ), - ), - ), - ) - ); + )); } } diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 3fde4262..b2873fde 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -28,19 +28,19 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class UpdateNoteOrder extends StatefulWidget { - final NoteModel note; + final NoteModel? note; final PatientViewModel patientModel; final PatiantInformtion patient; final int visitType; final bool isUpdate; const UpdateNoteOrder( - {Key key, + {Key? key, this.note, - this.patientModel, - this.patient, - this.visitType, - this.isUpdate}) + required this.patientModel, + required this.patient, + required this.visitType, + required this.isUpdate}) : super(key: key); @override @@ -48,12 +48,12 @@ class UpdateNoteOrder extends StatefulWidget { } class _UpdateNoteOrderState extends State { - int selectedType; + int? selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - ProjectViewModel projectViewModel; + ProjectViewModel? projectViewModel; TextEditingController progressNoteController = TextEditingController(); @@ -81,7 +81,7 @@ class _UpdateNoteOrderState extends State { projectViewModel = Provider.of(context); if (widget.note != null) { - progressNoteController.text = widget.note.notes; + progressNoteController.text = widget.note!.notes!; } return AppScaffold( @@ -99,12 +99,12 @@ class _UpdateNoteOrderState extends State { title: widget.visitType == 3 ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).orderSheet! : (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).progressNote!, ), SizedBox( height: 10.0, @@ -119,17 +119,13 @@ class _UpdateNoteOrderState extends State { AppTextFieldCustom( hintText: widget.visitType == 3 ? (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).orderSheet + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).orderSheet! : (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).progressNote, + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).progressNote!, //TranslationBase.of(context).addProgressNote, controller: progressNoteController, maxLines: 35, @@ -137,26 +133,19 @@ class _UpdateNoteOrderState extends State { hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - progressNoteController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, + validationError: progressNoteController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, ), Positioned( - top: - -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, + top: -2, //MediaQuery.of(context).size.height * 0, + right: projectViewModel!.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, child: Column( children: [ IconButton( - icon: Icon(DoctorApp.speechtotext, - color: Colors.black, size: 35), + icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ], @@ -173,34 +162,34 @@ class _UpdateNoteOrderState extends State { ), ), bottomSheet: Container( - height: progressNoteController.text.isNotEmpty? 130:70, + height: progressNoteController.text.isNotEmpty ? 130 : 70, margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Column( children: [ - if(progressNoteController.text.isNotEmpty) - Container( - margin: EdgeInsets.all(5), - child: AppButton( - title: TranslationBase.of(context).clearText, - onPressed: () { - setState(() { - progressNoteController.text = ''; - }); - }, - ), - ), + if (progressNoteController.text.isNotEmpty) + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + progressNoteController.text = ''; + }); + }, + ), + ), Container( margin: EdgeInsets.all(5), child: AppButton( title: widget.visitType == 3 ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).orderSheet! : (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + ? TranslationBase.of(context).noteUpdate! + : TranslationBase.of(context).noteAdd!) + + TranslationBase.of(context).progressNote!, color: Color(0xff359846), // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, @@ -212,26 +201,23 @@ class _UpdateNoteOrderState extends State { GifLoaderDialogUtils.showMyDialog(context); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); if (widget.isUpdate) { UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient.admissionNo!), cancelledNote: false, - lineItemNo: widget.note.lineItemNo, - createdBy: widget.note.createdBy, + lineItemNo: widget.note!.lineItemNo, + createdBy: widget.note?.createdBy, notes: progressNoteController.text, verifiedNote: false, patientTypeID: widget.patient.patientType, patientOutSA: false, ); - await widget.patientModel - .updatePatientProgressNote(reqModel); + await widget.patientModel.updatePatientProgressNote(reqModel); } else { CreateNoteModel reqModel = CreateNoteModel( - admissionNo: - int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient.admissionNo!), createdBy: doctorProfile.doctorID, visitType: widget.visitType, patientID: widget.patient.patientId, @@ -240,28 +226,23 @@ class _UpdateNoteOrderState extends State { patientOutSA: false, notes: progressNoteController.text); - await widget.patientModel - .createPatientProgressNote(reqModel); + await widget.patientModel.createPatientProgressNote(reqModel); } if (widget.patientModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.patientModel.error); } else { - ProgressNoteRequest progressNoteRequest = - ProgressNoteRequest( - visitType: widget.visitType, - // if equal 5 then this will return progress note - admissionNo: - int.parse(widget.patient.admissionNo), - projectID: widget.patient.projectId, - patientTypeID: widget.patient.patientType, - languageID: 2); - await widget.patientModel.getPatientProgressNote( - progressNoteRequest.toJson()); + ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( + visitType: widget.visitType, + // if equal 5 then this will return progress note + admissionNo: int.parse(widget.patient.admissionNo!), + projectID: widget.patient.projectId, + patientTypeID: widget.patient.patientType, + languageID: 2); + await widget.patientModel.getPatientProgressNote(progressNoteRequest.toJson()); } GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - "Your Order added Successfully"); + DrAppToastMsg.showSuccesToast("Your Order added Successfully"); Navigator.of(context).pop(); } else { Helpers.showErrorToast("You cant add only spaces"); @@ -276,8 +257,7 @@ class _UpdateNoteOrderState extends State { onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -321,8 +301,7 @@ class _UpdateNoteOrderState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } diff --git a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart index ca8be2c0..51d9fae0 100644 --- a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart +++ b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart @@ -10,17 +10,15 @@ import 'package:flutter/material.dart'; class InpatientPrescriptionDetailsScreen extends StatefulWidget { @override - _InpatientPrescriptionDetailsScreenState createState() => - _InpatientPrescriptionDetailsScreenState(); + _InpatientPrescriptionDetailsScreenState createState() => _InpatientPrescriptionDetailsScreenState(); } -class _InpatientPrescriptionDetailsScreenState - extends State { +class _InpatientPrescriptionDetailsScreenState extends State { bool _showDetails = false; - String error; - TextEditingController answerController; + String? error; + TextEditingController? answerController; bool _isInit = true; - PrescriptionReportForInPatient prescription; + late PrescriptionReportForInPatient prescription; @override void initState() { @@ -31,7 +29,7 @@ class _InpatientPrescriptionDetailsScreenState void didChangeDependencies() { super.didChangeDependencies(); if (_isInit) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; prescription = routeArgs['prescription']; } _isInit = false; @@ -40,7 +38,7 @@ class _InpatientPrescriptionDetailsScreenState @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).prescriptionInfo, + appBarTitle: TranslationBase.of(context).prescriptionInfo ?? "", body: CardWithBgWidgetNew( widget: Container( child: ListView( @@ -59,9 +57,7 @@ class _InpatientPrescriptionDetailsScreenState _showDetails = !_showDetails; }); }, - child: Icon(_showDetails - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down)), + child: Icon(_showDetails ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), ], ), !_showDetails @@ -83,52 +79,25 @@ class _InpatientPrescriptionDetailsScreenState inside: BorderSide(width: 0.5), ), children: [ + buildTableRow(des: '${prescription.direction}', key: 'Direction'), + buildTableRow(des: '${prescription.refillID}', key: 'Refill'), + buildTableRow(des: '${prescription.dose}', key: 'Dose'), + buildTableRow(des: '${prescription.unitofMeasurement}', key: 'UOM'), buildTableRow( - des: '${prescription.direction}', - key: 'Direction'), + des: '${AppDateUtils.getDate(prescription.startDatetime!)}', key: 'Start Date'), buildTableRow( - des: '${prescription.refillID}', - key: 'Refill'), + des: '${AppDateUtils.getDate(prescription.stopDatetime!)}', key: 'Stop Date'), + buildTableRow(des: '${prescription.noOfDoses}', key: 'No of Doses'), + buildTableRow(des: '${prescription.route}', key: 'Route'), + buildTableRow(des: '${prescription.comments}', key: 'Comments'), + buildTableRow(des: '${prescription.pharmacyRemarks}', key: 'Pharmacy Remarks'), buildTableRow( - des: '${prescription.dose}', key: 'Dose'), - buildTableRow( - des: '${prescription.unitofMeasurement}', - key: 'UOM'), - buildTableRow( - des: - '${AppDateUtils.getDate(prescription.startDatetime)}', - key: 'Start Date'), - buildTableRow( - des: - '${AppDateUtils.getDate(prescription.stopDatetime)}', - key: 'Stop Date'), - buildTableRow( - des: '${prescription.noOfDoses}', - key: 'No of Doses'), - buildTableRow( - des: '${prescription.route}', key: 'Route'), - buildTableRow( - des: '${prescription.comments}', - key: 'Comments'), - buildTableRow( - des: '${prescription.pharmacyRemarks}', - key: 'Pharmacy Remarks'), - buildTableRow( - des: - '${AppDateUtils.getDate(prescription.prescriptionDatetime)}', + des: '${AppDateUtils.getDate(prescription.prescriptionDatetime!)}', key: 'Prescription Date'), - buildTableRow( - des: '${prescription.refillID}', - key: 'Status'), - buildTableRow( - des: '${prescription.refillID}', - key: 'Created By'), - buildTableRow( - des: '${prescription.refillID}', - key: 'Processed By'), - buildTableRow( - des: '${prescription.refillID}', - key: 'Authorized By'), + buildTableRow(des: '${prescription.refillID}', key: 'Status'), + buildTableRow(des: '${prescription.refillID}', key: 'Created By'), + buildTableRow(des: '${prescription.refillID}', key: 'Processed By'), + buildTableRow(des: '${prescription.refillID}', key: 'Authorized By'), ], ), Divider( @@ -168,8 +137,7 @@ class _InpatientPrescriptionDetailsScreenState ), Expanded( child: Container( - margin: - EdgeInsets.only(left: 4, top: 2.5, right: 2.5, bottom: 2.5), + margin: EdgeInsets.only(left: 4, top: 2.5, right: 2.5, bottom: 2.5), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart index 50585143..75300769 100644 --- a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart +++ b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; class OutPatientPrescriptionDetailsItem extends StatefulWidget { final PrescriptionReport prescriptionReport; - OutPatientPrescriptionDetailsItem({Key key, this.prescriptionReport}); + OutPatientPrescriptionDetailsItem({Key? key, required this.prescriptionReport}); @override _OutPatientPrescriptionDetailsItemState createState() => diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart index eb9a3eaa..c11f9ffc 100644 --- a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart +++ b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart @@ -8,23 +8,19 @@ class PatientProfileCardModel { final bool isInPatient; final bool isDisable; final bool isLoading; - final Function onTap; + final GestureTapCallback? onTap; final bool isDischargedPatient; final bool isSelectInpatient; final bool isDartIcon; - final IconData dartIcon; + final IconData? dartIcon; - PatientProfileCardModel( - this.nameLine1, - this.nameLine2, - this.route, - this.icon, { - this.isInPatient = false, - this.isDisable = false, - this.isLoading = false, - this.onTap, - this.isDischargedPatient = false, - this.isSelectInpatient = false, - this.isDartIcon = false,this.dartIcon - }); + PatientProfileCardModel(this.nameLine1, this.nameLine2, this.route, this.icon, + {this.isInPatient = false, + this.isDisable = false, + this.isLoading = false, + this.onTap, + this.isDischargedPatient = false, + this.isSelectInpatient = false, + this.isDartIcon = false, + this.dartIcon}); } 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 55b2d6f9..ef65c1b0 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -28,9 +28,8 @@ class PatientProfileScreen extends StatefulWidget { _PatientProfileScreenState createState() => _PatientProfileScreenState(); } -class _PatientProfileScreenState extends State - with SingleTickerProviderStateMixin { - PatiantInformtion patient; +class _PatientProfileScreenState extends State with SingleTickerProviderStateMixin { + late PatiantInformtion patient; bool isFromSearch = false; bool isFromLiveCare = false; @@ -39,11 +38,11 @@ class _PatientProfileScreenState extends State bool isCallFinished = false; bool isDischargedPatient = false; bool isSearchAndOut = false; - String patientType; - String arrivalType; - String from; - String to; - TabController _tabController; + late String patientType; + late String arrivalType; + late String from; + late String to; + late TabController _tabController; int index = 0; int _activeTab = 0; @override @@ -61,7 +60,7 @@ class _PatientProfileScreenState extends State @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -79,7 +78,7 @@ class _PatientProfileScreenState extends State if (routeArgs.containsKey("isSearchAndOut")) { isSearchAndOut = routeArgs['isSearchAndOut']; } - if(routeArgs.containsKey("isFromLiveCare")) { + if (routeArgs.containsKey("isFromLiveCare")) { isFromLiveCare = routeArgs['isFromLiveCare']; } if (isInpatient) @@ -92,39 +91,37 @@ class _PatientProfileScreenState extends State Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; return BaseView( - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).patientProfile, - isShowAppBar: false, - body: Column( - children: [ - Stack( - children: [ - Column( - children: [ - PatientProfileHeaderNewDesignAppBar( - patient, arrivalType ?? '0', patientType, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).patientProfile ?? "", + isShowAppBar: false, + body: Column( + children: [ + Stack( + children: [ + Column( + children: [ + PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType, isInpatient: isInpatient, isFromLiveCare: isFromLiveCare, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) + height: (patient.patientStatusType != null && patient.patientStatusType == 43) ? 210 : isDischargedPatient ? 240 : 0, isDischargedPatient: isDischargedPatient), + Container( + height: !isSearchAndOut + ? isDischargedPatient + ? MediaQuery.of(context).size.height * 0.64 + : MediaQuery.of(context).size.height * 0.65 + : MediaQuery.of(context).size.height * 0.69, + child: ListView( + children: [ Container( - height: !isSearchAndOut - ? isDischargedPatient - ? MediaQuery.of(context).size.height * 0.64 - : MediaQuery.of(context).size.height * 0.65 - : MediaQuery.of(context).size.height * 0.69, - child: ListView( - children: [ - Container( - child: isSearchAndOut - ? ProfileGridForSearch( - patient: patient, + child: isSearchAndOut + ? ProfileGridForSearch( + patient: patient, patientType: patientType, arrivalType: arrivalType, isInpatient: isInpatient, @@ -139,8 +136,7 @@ class _PatientProfileScreenState extends State isInpatient: isInpatient, from: from, to: to, - isDischargedPatient: - isDischargedPatient, + isDischargedPatient: isDischargedPatient, isFromSearch: isFromSearch, ) : ProfileGridForOther( @@ -156,207 +152,190 @@ class _PatientProfileScreenState extends State SizedBox( height: MediaQuery.of(context).size.height * 0.05, ) - ], - ), - ), - ], ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => Positioned( - top: 180, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( - title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/create-episod.png", - color: Colors.white, - height: 30, - ), - onPressed: () async { - if (patient.patientStatusType == - 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = - model.episodeID; - Navigator.of(context).pushNamed( - CREATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: - patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], + ), + ], + ), + if (patient.patientStatusType != null && patient.patientStatusType == 43) + BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => Positioned( + top: 180, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == 43) { + PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( + appointmentNo: patient.appointmentNo, patientMRN: patient.patientMRN); + GifLoaderDialogUtils.showMyDialog(context); + await model.postEpisode(postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog(context); + patient.episodeNo = model.episodeID; + Navigator.of(context) + .pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); + } + }, ), - )), - ], - ), - ], - ), - bottomSheet: isFromLiveCare ? Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), + if (patient.episodeNo != 0) + AppButton( + title: + "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", + color: + patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/modilfy-episode.png", + color: Colors.white, + height: 30, + ), + onPressed: () { + if (patient.patientStatusType == 43) { + Navigator.of(context) + .pushNamed(UPDATE_EPISODE, arguments: {'patient': patient}); + } + }), + ], + ), + )), + ], ), - height: MediaQuery - .of(context) - .size - .height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, + ], + ), + bottomSheet: isFromLiveCare + ? Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - fontWeight: FontWeight.w700, - color: isCallFinished?Colors.red[600]:Colors.green[600], - title: isCallFinished? - TranslationBase.of(context).endCall: - TranslationBase.of(context).initiateCall, - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - if(isCallFinished) { - Navigator.push(context, MaterialPageRoute( - builder: (BuildContext context) => - EndCallScreen(patient:patient))); - } else { - GifLoaderDialogUtils.showMyDialog(context); - await model.startCall( isReCall : false, vCID: patient.vcId); + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + fontWeight: FontWeight.w700, + color: isCallFinished ? Colors.red[600] : Colors.green[600], + title: isCallFinished + ? TranslationBase.of(context).endCall + : TranslationBase.of(context).initiateCall, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + if (isCallFinished) { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => EndCallScreen(patient: patient))); + } else { + GifLoaderDialogUtils.showMyDialog(context); + await model.startCall(isReCall: false, vCID: patient.vcId!); - if(model.state == ViewState.ErrorLocal) { - GifLoaderDialogUtils.hideDialog(context); - Helpers.showErrorToast(model.error); - } else { - await model.getDoctorProfile(); - patient.appointmentNo = model.startCallRes.appointmentNo; - patient.episodeNo = 0; + if (model.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + Helpers.showErrorToast(model.error); + } else { + await model.getDoctorProfile(); + patient.appointmentNo = model.startCallRes.appointmentNo; + patient.episodeNo = 0; - GifLoaderDialogUtils.hideDialog(context); - await VideoChannel.openVideoCallScreen( - kToken: model.startCallRes.openTokenID, - kSessionId: model.startCallRes.openSessionID, - kApiKey: '46209962', - vcId: patient.vcId, - tokenID: await model.getToken(), - generalId: GENERAL_ID, - doctorId: model.doctorProfile.doctorID, - onFailure: (String error) { - DrAppToastMsg.showErrorToast(error); - }, - onCallEnd: () { - WidgetsBinding.instance.addPostFrameCallback((_) { - GifLoaderDialogUtils.showMyDialog(context); - model.endCall(patient.vcId, false,).then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - setState(() { - isCallFinished = true; + GifLoaderDialogUtils.hideDialog(context); + await VideoChannel.openVideoCallScreen( + kToken: model.startCallRes.openTokenID, + kSessionId: model.startCallRes.openSessionID, + kApiKey: '46209962', + vcId: patient.vcId, + tokenID: await model.getToken(), + generalId: GENERAL_ID, + doctorId: model.doctorProfile!.doctorID, + onFailure: (String error) { + DrAppToastMsg.showErrorToast(error); + }, + onCallEnd: () { + WidgetsBinding.instance!.addPostFrameCallback((_) { + GifLoaderDialogUtils.showMyDialog(context); + model + .endCall( + patient.vcId!, + false, + ) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + setState(() { + isCallFinished = true; + }); }); }); - }); - }, - onCallNotRespond: (SessionStatusModel sessionStatusModel) { - WidgetsBinding.instance.addPostFrameCallback((_) { - GifLoaderDialogUtils.showMyDialog(context); - model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - setState(() { - isCallFinished = true; - }); - }); - - }); - }); - } - } - - }, + }, + onCallNotRespond: (SessionStatusModel sessionStatusModel) { + WidgetsBinding.instance!.addPostFrameCallback((_) { + GifLoaderDialogUtils.showMyDialog(context); + model + .endCall( + patient.vcId!, + sessionStatusModel.sessionStatus == 3, + ) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + setState(() { + isCallFinished = true; + }); + }); + }); + }); + } + } + }, + ), + ), ), ), - ), - ), - SizedBox( - height: 5, + SizedBox( + height: 5, + ), + ], ), - ], - ), - ) : null, - ), - - + ) + : null, + ), ); } } @@ -370,12 +349,7 @@ class AvatarWidget extends StatelessWidget { Widget build(BuildContext context) { return Container( decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], + boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)], borderRadius: BorderRadius.all(Radius.circular(35.0)), color: Color(0xffCCCCCC), ), diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 49fa8012..a95f1c4a 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -12,7 +12,7 @@ class ProfileGridForInPatient extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - final double height; + final double? height; final bool isInpatient; final bool isDischargedPatient; final bool isFromSearch; @@ -20,102 +20,65 @@ class ProfileGridForInPatient extends StatelessWidget { String to; ProfileGridForInPatient( - {Key key, - this.patient, - this.patientType, - this.arrivalType, + {Key? key, + required this.patient, + required this.patientType, + required this.arrivalType, this.height, - this.isInpatient, - this.from, - this.to, - this.isDischargedPatient, - this.isFromSearch}) + required this.isInpatient, + required this.from, + required this.to, + required this.isDischargedPatient, + required this.isFromSearch}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, - VITAL_SIGN_DETAILS, - 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).vital ?? "", TranslationBase.of(context).signs ?? "", + VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, - LAB_RESULT, - 'patient/lab_results.png', + PatientProfileCardModel(TranslationBase.of(context).lab ?? "", TranslationBase.of(context).result ?? "", + LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).result, - RADIOLOGY_PATIENT, - 'patient/health_summary.png', + PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).result!, + RADIOLOGY_PATIENT, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, - 'patient/order_prescription.png', + PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).prescription!, + ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).progress, - TranslationBase.of(context).note, - PROGRESS_NOTE, + PatientProfileCardModel(TranslationBase.of(context).progress!, TranslationBase.of(context).note!, PROGRESS_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient), - PatientProfileCardModel( - TranslationBase.of(context).order, - TranslationBase.of(context).sheet, - ORDER_NOTE, + isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), + PatientProfileCardModel(TranslationBase.of(context).order!, TranslationBase.of(context).sheet!, ORDER_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, - ORDER_PROCEDURE, - 'patient/Order_Procedures.png', + isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), + PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, + ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, - HEALTH_SUMMARY, + PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).medical!, TranslationBase.of(context).report!, + PATIENT_MEDICAL_REPORT, 'patient/health_summary.png', + isInPatient: isInpatient, isDisable: false), PatientProfileCardModel( - TranslationBase.of(context).medical, - TranslationBase.of(context).report, - PATIENT_MEDICAL_REPORT, - 'patient/health_summary.png', - isInPatient: isInpatient, - isDisable: false), - PatientProfileCardModel( - TranslationBase.of(context).referral, - TranslationBase.of(context).patient, + TranslationBase.of(context).referral!, + TranslationBase.of(context).patient!, REFER_IN_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', isInPatient: isInpatient, isDisable: isDischargedPatient || isFromSearch, ), - PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).approvals, - PATIENT_INSURANCE_APPROVALS_NEW, - 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).approvals!, + PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).discharge, - TranslationBase.of(context).report, - null, + PatientProfileCardModel(TranslationBase.of(context).discharge!, TranslationBase.of(context).report!, null, 'patient/patient_sick_leave.png', - isInPatient: isInpatient, - isDisable: true), + isInPatient: isInpatient, isDisable: true), PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, + TranslationBase.of(context).patientSick!, + TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', isInPatient: isInpatient, 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 c01757c5..8e1e906d 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 @@ -12,133 +12,79 @@ class ProfileGridForOther extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - final double height; + final double? height; final bool isInpatient; final bool isFromLiveCare; String from; String to; ProfileGridForOther( - {Key key, - this.patient, - this.patientType, - this.arrivalType, + {Key? key, + required this.patient, + required this.patientType, + required this.arrivalType, this.height, - this.isInpatient, - this.from, - this.to, - this.isFromLiveCare}) + required this.isInpatient, + required this.from, + required this.to, + required this.isFromLiveCare}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, - VITAL_SIGN_DETAILS, - 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, + VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, - LAB_RESULT, - 'patient/lab_results.png', + TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).service, - RADIOLOGY_PATIENT, - 'patient/health_summary.png', + PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).service!, + RADIOLOGY_PATIENT, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, - 'patient/order_prescription.png', + PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).prescription!, + ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, - HEALTH_SUMMARY, + PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patient, - "ECG", - PATIENT_ECG, - 'patient/patient_sick_leave.png', + TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, - ORDER_PROCEDURE, - 'patient/Order_Procedures.png', + PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, + ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase - .of(context) - .insurance, - TranslationBase - .of(context) - .service, - PATIENT_INSURANCE_APPROVALS_NEW, - 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!, + PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase - .of(context) - .patientSick, - TranslationBase - .of(context) - .leave, - ADD_SICKLEAVE, - 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, + ADD_SICKLEAVE, 'patient/patient_sick_leave.png', isInPatient: isInpatient), - if (isFromLiveCare || - (patient.appointmentNo != null && patient.appointmentNo != 0)) - PatientProfileCardModel( - TranslationBase - .of(context) - .patient, - TranslationBase - .of(context) - .ucaf, - PATIENT_UCAF_REQUEST, - 'patient/ucaf.png', + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) + PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!, + PATIENT_UCAF_REQUEST, 'patient/ucaf.png', isInPatient: isInpatient, - isDisable: isFromLiveCare?patient.appointmentNo == null:patient.patientStatusType != 43 || - patient.appointmentNo == null ), - if (isFromLiveCare || - (patient.appointmentNo != null && patient.appointmentNo != 0)) + isDisable: isFromLiveCare + ? patient.appointmentNo == null + : patient.patientStatusType != 43 || patient.appointmentNo == null), + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel( - TranslationBase - .of(context) - .referral, - TranslationBase - .of(context) - .patient, - REFER_PATIENT_TO_DOCTOR, - 'patient/refer_patient.png', - isInPatient: isInpatient, - isDisable: isFromLiveCare?patient.appointmentNo == null:patient.patientStatusType != 43 || - patient.appointmentNo == null , + TranslationBase.of(context).referral!, + TranslationBase.of(context).patient!, + REFER_PATIENT_TO_DOCTOR, + 'patient/refer_patient.png', + isInPatient: isInpatient, + isDisable: isFromLiveCare + ? patient.appointmentNo == null + : patient.patientStatusType != 43 || patient.appointmentNo == null, ), - if (isFromLiveCare || - (patient.appointmentNo != null && patient.appointmentNo != 0)) - PatientProfileCardModel( - TranslationBase - .of(context) - .admission, - TranslationBase - .of(context) - .request, - PATIENT_ADMISSION_REQUEST, - 'patient/admission_req.png', + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) + PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!, + PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', isInPatient: isInpatient, - isDisable: isFromLiveCare?patient.appointmentNo == null:patient.patientStatusType != 43 || - patient.appointmentNo == null - ), + isDisable: isFromLiveCare + ? patient.appointmentNo == null + : patient.patientStatusType != 43 || patient.appointmentNo == null), ]; return Column( @@ -168,9 +114,7 @@ class ProfileGridForOther extends StatelessWidget { isDisable: cardsList[index].isDisable, onTap: cardsList[index].onTap, isLoading: cardsList[index].isLoading, - isFromLiveCare: isFromLiveCare - - ), + isFromLiveCare: isFromLiveCare), ), ), ], 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 9c9f7d36..a4e65543 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 @@ -11,101 +11,64 @@ class ProfileGridForSearch extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - final double height; + final double? height; final bool isInpatient; String from; String to; - ProfileGridForSearch( - {Key key, - this.patient, - this.patientType, - this.arrivalType, + ProfileGridForSearch( + {Key? key, + required this.patient, + required this.patientType, + required this.arrivalType, this.height, - this.isInpatient, this.from,this.to}) + required this.isInpatient, + required this.from, + required this.to}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, - VITAL_SIGN_DETAILS, - 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, + VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, - LAB_RESULT, - 'patient/lab_results.png', + TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).service, - RADIOLOGY_PATIENT, - 'patient/health_summary.png', + PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).service!, + RADIOLOGY_PATIENT, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, - 'patient/order_prescription.png', + PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).prescription!, + ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, - HEALTH_SUMMARY, + PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patient, - "ECG", - PATIENT_ECG, - 'patient/patient_sick_leave.png', + TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, - ORDER_PROCEDURE, - 'patient/Order_Procedures.png', + PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, + ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).service, - PATIENT_INSURANCE_APPROVALS_NEW, - 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!, + PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, - ADD_SICKLEAVE, - 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, + ADD_SICKLEAVE, 'patient/patient_sick_leave.png', isInPatient: isInpatient), if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).ucaf, - PATIENT_UCAF_REQUEST, - 'patient/ucaf.png', - isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), + PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!, + PATIENT_UCAF_REQUEST, 'patient/ucaf.png', + isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel( - TranslationBase.of(context).referral, - TranslationBase.of(context).patient, - REFER_PATIENT_TO_DOCTOR, - 'patient/refer_patient.png', - isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), + PatientProfileCardModel(TranslationBase.of(context).referral!, TranslationBase.of(context).patient!, + REFER_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', + isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel( - TranslationBase.of(context).admission, - TranslationBase.of(context).request, - PATIENT_ADMISSION_REQUEST, - 'patient/admission_req.png', - isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), + PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!, + PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', + isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), ]; return Column( diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index acc79d19..9bc0e8aa 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -14,15 +14,11 @@ import 'package:url_launcher/url_launcher.dart'; class RadiologyDetailsPage extends StatelessWidget { final FinalRadiology finalRadiology; final PatiantInformtion patient; - final String patientType; - final String arrivalType; + final String? patientType; + final String? arrivalType; RadiologyDetailsPage( - {Key key, - this.finalRadiology, - this.patient, - this.patientType, - this.arrivalType}); + {Key? key, required this.finalRadiology, required this.patient, this.patientType, this.arrivalType}); @override Widget build(BuildContext context) { @@ -66,9 +62,11 @@ class RadiologyDetailsPage extends StatelessWidget { ), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context).generalResult,color: Color(0xff2E303A),), + child: AppText( + TranslationBase.of(context).generalResult, + color: Color(0xff2E303A), + ), ), - Padding( padding: const EdgeInsets.all(8.0), child: AppText( @@ -92,8 +90,7 @@ class RadiologyDetailsPage extends StatelessWidget { height: 80, width: double.maxFinite, child: Container( - margin: - EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), + margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), child: SecondaryButton( color: Color(0xffD02127), disabled: finalRadiology.dIAPACSURL == "", @@ -101,7 +98,7 @@ class RadiologyDetailsPage extends StatelessWidget { onTap: () { launch(model.radImageURL); }, - label: TranslationBase.of(context).openRad, + label: TranslationBase.of(context).openRad ?? "", ), ), ) diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 4e969793..a35721b8 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -22,16 +22,16 @@ class RadiologyHomePage extends StatefulWidget { } class _RadiologyHomePageState extends State { - String patientType; - PatiantInformtion patient; - String arrivalType; - bool isInpatient; - bool isFromLiveCare; + String? patientType; + late PatiantInformtion patient; + late String arrivalType; + late bool isInpatient; + late bool isFromLiveCare; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -44,8 +44,7 @@ class _RadiologyHomePageState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientRadOrders(patient, - patientType: patientType, isInPatient: false), + onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], @@ -65,8 +64,7 @@ class _RadiologyHomePageState extends State { SizedBox( height: 12, ), - if (model.radiologyList.isNotEmpty && - patient.patientStatusType != 43) + if (model.radiologyList.isNotEmpty && patient.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -86,8 +84,7 @@ class _RadiologyHomePageState extends State { ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient.patientStatusType != null && patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -100,31 +97,27 @@ class _RadiologyHomePageState extends State { fontSize: 13, ), AppText( - TranslationBase - .of(context) - .result, + TranslationBase.of(context).result, bold: true, fontSize: 22, ), ], ), ), - if ((patient.patientStatusType != null && - patient.patientStatusType == 43) || + if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => - AddRadiologyScreen( + builder: (context) => AddRadiologyScreen( patient: patient, model: model, )), ); }, - label: TranslationBase.of(context).applyForRadiologyOrder, + label: TranslationBase.of(context).applyForRadiologyOrder ?? "", ), ...List.generate( model.radiologyList.length, @@ -146,36 +139,26 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index] - .isLiveCareAppodynamicment + color: model.radiologyList[index].isLiveCareAppodynamicment! ? Colors.red[900] - : !model.radiologyList[index].isInOutPatient + : !model.radiologyList[index].isInOutPatient! ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), - bottomLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), - topRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0), - bottomRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0) - ), + topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), + bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), ), child: RotatedBox( quarterTurns: 3, child: Center( child: Text( - model.radiologyList[index] - .isLiveCareAppodynamicment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.radiologyList[index] - .isInOutPatient - ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + model.radiologyList[index].isLiveCareAppodynamicment! + ? TranslationBase.of(context).liveCare!.toUpperCase() + : !model.radiologyList[index].isInOutPatient! + ? TranslationBase.of(context).inPatientLabel!.toUpperCase() + : TranslationBase.of(context).outpatient!.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -183,26 +166,19 @@ class _RadiologyHomePageState extends State { Expanded( child: DoctorCard( isNoMargin: true, - doctorName: - model.radiologyList[index].doctorName, - profileUrl: - model.radiologyList[index].doctorImageURL, - invoiceNO: - '${model.radiologyList[index].invoiceNo}', - branch: - '${model.radiologyList[index].projectName}', - clinic: model - .radiologyList[index].clinicDescription, + doctorName: model.radiologyList[index].doctorName, + profileUrl: model.radiologyList[index].doctorImageURL, + invoiceNO: '${model.radiologyList[index].invoiceNo}', + branch: '${model.radiologyList[index].projectName}', + clinic: model.radiologyList[index].clinicDescription, appointmentDate: - model.radiologyList[index].orderDate ?? - model.radiologyList[index].reportDate, + model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate!, onTap: () { Navigator.push( context, FadePage( page: RadiologyDetailsPage( - finalRadiology: - model.radiologyList[index], + finalRadiology: model.radiologyList[index], patient: patient, ), ), @@ -213,8 +189,7 @@ class _RadiologyHomePageState extends State { ], ), )), - if (model.radiologyList.isEmpty && - patient.patientStatusType != 43) + if (model.radiologyList.isEmpty && patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index e7714074..bf883517 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -11,12 +11,12 @@ class RadiologyReportScreen extends StatelessWidget { final String reportData; final String url; - RadiologyReportScreen({Key key, this.reportData, this.url}); + RadiologyReportScreen({Key? key, required this.reportData, required this.url}); @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).radiologyReport, + appBarTitle: TranslationBase.of(context).radiologyReport ?? "", body: SingleChildScrollView( child: Column( children: [ @@ -38,7 +38,9 @@ class RadiologyReportScreen extends StatelessWidget { fontSize: 2.5 * SizeConfig.textMultiplier, ), ), - SizedBox(height:MediaQuery.of(context).size.height * 0.13 ,) + SizedBox( + height: MediaQuery.of(context).size.height * 0.13, + ) ], ), ), diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index f54a18ac..e663dc64 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -24,16 +24,14 @@ class AddReplayOnReferralPatient extends StatefulWidget { final MyReferralPatientModel myReferralInPatientModel; const AddReplayOnReferralPatient( - {Key key, this.patientReferralViewModel, this.myReferralInPatientModel}) + {Key? key, required this.patientReferralViewModel, required this.myReferralInPatientModel}) : super(key: key); @override - _AddReplayOnReferralPatientState createState() => - _AddReplayOnReferralPatientState(); + _AddReplayOnReferralPatientState createState() => _AddReplayOnReferralPatientState(); } -class _AddReplayOnReferralPatientState - extends State { +class _AddReplayOnReferralPatientState extends State { bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; @@ -75,11 +73,9 @@ class _AddReplayOnReferralPatientState maxLines: 35, minLines: 25, hasBorder: true, - validationError: - replayOnReferralController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, + validationError: replayOnReferralController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, ), Positioned( top: 0, //MediaQuery.of(context).size.height * 0, @@ -137,17 +133,13 @@ class _AddReplayOnReferralPatientState }); if (replayOnReferralController.text.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - await widget.patientReferralViewModel.replay( - replayOnReferralController.text.trim(), - widget.myReferralInPatientModel); - if (widget.patientReferralViewModel.state == - ViewState.ErrorLocal) { - Helpers.showErrorToast( - widget.patientReferralViewModel.error); + await widget.patientReferralViewModel + .replay(replayOnReferralController.text.trim(), widget.myReferralInPatientModel); + if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientReferralViewModel.error); } else { GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - "Your Replay Added Successfully"); + DrAppToastMsg.showSuccesToast("Your Replay Added Successfully"); Navigator.of(context).pop(); Navigator.of(context).pop(); } @@ -167,8 +159,7 @@ class _AddReplayOnReferralPatientState onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 447a3739..5a33c00d 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -17,33 +17,29 @@ import 'package:hexcolor/hexcolor.dart'; // ignore: must_be_immutable class MyReferralDetailScreen extends StatelessWidget { - PendingReferral pendingReferral; + late PendingReferral pendingReferral; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; pendingReferral = routeArgs['referral']; return BaseView( onModelReady: (model) => model.getPatientDetails( AppDateUtils.convertStringToDateFormat( - DateTime.now() /*.subtract(Duration(days: 350))*/ .toString(), - "yyyy-MM-dd"), - AppDateUtils.convertStringToDateFormat( - DateTime.now().toString(), "yyyy-MM-dd"), - pendingReferral.patientID, - pendingReferral.sourceAppointmentNo), + DateTime.now() /*.subtract(Duration(days: 350))*/ .toString(), "yyyy-MM-dd"), + AppDateUtils.convertStringToDateFormat(DateTime.now().toString(), "yyyy-MM-dd"), + pendingReferral.patientID!, + pendingReferral.sourceAppointmentNo!), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient!, isShowAppBar: false, - body: model.patientArrivalList != null && - model.patientArrivalList.length > 0 + body: model.patientArrivalList != null && model.patientArrivalList.length > 0 ? Column( children: [ Container( - padding: - EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, ), @@ -62,18 +58,13 @@ class MyReferralDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - (Helpers.capitalize(model - .patientArrivalList[0] - .patientDetails - .fullName)), + (Helpers.capitalize(model.patientArrivalList[0].patientDetails!.fullName)), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), ), - model.patientArrivalList[0].patientDetails - .gender == - 1 + model.patientArrivalList[0].patientDetails!.gender == 1 ? Icon( DoctorApp.male_2, color: Colors.blue, @@ -93,7 +84,7 @@ class MyReferralDetailScreen extends StatelessWidget { width: 60, height: 60, child: Image.asset( - pendingReferral.patientDetails.gender == 1 + pendingReferral.patientDetails?.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -107,148 +98,106 @@ class MyReferralDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - pendingReferral.referralStatus != null - ? pendingReferral.referralStatus - : "", + pendingReferral.referralStatus != null ? pendingReferral.referralStatus : "", fontFamily: 'Poppins', - fontSize: - 1.9 * SizeConfig.textMultiplier, + fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, - color: pendingReferral - .referralStatus != - null - ? pendingReferral - .referralStatus == - 'Pending' + color: pendingReferral.referralStatus != null + ? pendingReferral.referralStatus == 'Pending' ? Color(0xffc4aa54) - : pendingReferral - .referralStatus == - 'Accepted' + : pendingReferral.referralStatus == 'Accepted' ? Colors.green[700] : Colors.red[700] : Colors.grey[500], ), AppText( - pendingReferral.referredOn - .split(" ")[0], + pendingReferral.referredOn!.split(" ")[0], fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 2.0 * SizeConfig.textMultiplier, + fontSize: 2.0 * SizeConfig.textMultiplier, color: Color(0XFF28353E), ) ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .fileNumber, + TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( "${pendingReferral.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * - SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), AppText( - pendingReferral.referredOn - .split(" ")[1], + pendingReferral.referredOn!.split(" ")[1], fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF575757), ) ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .referredFrom, + TranslationBase.of(context).referredFrom, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig - .textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( - pendingReferral - .isReferralDoctorSameBranch - ? TranslationBase.of( - context) - .sameBranch - : TranslationBase.of( - context) - .otherBranch, + pendingReferral.isReferralDoctorSameBranch! + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context).otherBranch, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * - SizeConfig - .textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .remarks + - " : ", + TranslationBase.of(context).remarks ?? "" + " : ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig - .textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - pendingReferral - .remarksFromSource, + pendingReferral.remarksFromSource, fontFamily: 'Poppins', - fontWeight: - FontWeight.w700, - fontSize: 1.8 * - SizeConfig - .textMultiplier, + fontWeight: FontWeight.w700, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -260,35 +209,22 @@ class MyReferralDetailScreen extends StatelessWidget { Row( children: [ AppText( - pendingReferral.patientDetails - .nationalityName != - null - ? pendingReferral - .patientDetails - .nationalityName + pendingReferral.patientDetails!.nationalityName != null + ? pendingReferral.patientDetails!.nationalityName : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: 1.4 * - SizeConfig.textMultiplier, + fontSize: 1.4 * SizeConfig.textMultiplier, ), - pendingReferral - .nationalityFlagUrl != - null + pendingReferral.nationalityFlagUrl != null ? ClipRRect( - borderRadius: - BorderRadius.circular( - 20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( - pendingReferral - .nationalityFlagUrl, + pendingReferral.nationalityFlagUrl ?? "", height: 25, width: 30, - errorBuilder: - (BuildContext context, - Object exception, - StackTrace - stackTrace) { + errorBuilder: (BuildContext context, Object exception, + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -298,12 +234,10 @@ class MyReferralDetailScreen extends StatelessWidget { ], ), Row( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only( - left: 10, right: 0), + margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( 'assets/images/patient/ic_ref_arrow_up.png', height: 50, @@ -311,43 +245,29 @@ class MyReferralDetailScreen extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only( - left: 0, - top: 25, - right: 0, - bottom: 0), - padding: EdgeInsets.only( - left: 4.0, right: 4.0), + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 4.0), child: Container( width: 40, height: 40, child: CircleAvatar( radius: 25.0, - backgroundImage: NetworkImage( - pendingReferral - .doctorImageUrl), - backgroundColor: - Colors.transparent, + backgroundImage: NetworkImage(pendingReferral.doctorImageUrl ?? ""), + backgroundColor: Colors.transparent, ), ), ), Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, - top: 25, - right: 10, - bottom: 0), + margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), child: Column( children: [ AppText( - pendingReferral - .referredByDoctorInfo, + pendingReferral.referredByDoctorInfo, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -375,14 +295,13 @@ class MyReferralDetailScreen extends StatelessWidget { height: 16, ), Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16), + padding: const EdgeInsets.symmetric(horizontal: 16), child: SizedBox( child: ProfileMedicalInfoWidgetSearch( patient: model.patientArrivalList[0], patientType: "7", - from: null, - to: null, + from: "", + to: "", ), ), ), @@ -404,14 +323,11 @@ class MyReferralDetailScreen extends StatelessWidget { hPadding: 8, vPadding: 12, onPressed: () async { - await model.responseReferral( - pendingReferral, true); + await model.responseReferral(pendingReferral, true); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) - .referralSuccessMsgAccept); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept); Navigator.pop(context); Navigator.pop(context); } @@ -430,14 +346,11 @@ class MyReferralDetailScreen extends StatelessWidget { hPadding: 8, vPadding: 12, onPressed: () async { - await model.responseReferral( - pendingReferral, true); + await model.responseReferral(pendingReferral, true); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) - .referralSuccessMsgReject); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject); Navigator.pop(context); Navigator.pop(context); } @@ -464,7 +377,6 @@ class MyReferralDetailScreen extends StatelessWidget { "", fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), ), diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart index fcbd11b7..40e263f3 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -11,7 +11,6 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class MyReferralInPatientScreen extends StatelessWidget { - @override Widget build(BuildContext context) { return BaseView( @@ -19,7 +18,7 @@ class MyReferralInPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient ?? "", body: model.myReferralPatients.isEmpty ? Center( child: Column( @@ -55,30 +54,31 @@ class MyReferralInPatientScreen extends StatelessWidget { Navigator.push( context, FadePage( - page: ReferralPatientDetailScreen(model.myReferralPatients[index],model), + page: ReferralPatientDetailScreen(model.myReferralPatients[index], model), ), ); }, child: PatientReferralItemWidget( - referralStatus: model.getReferralStatusNameByCode(model.myReferralPatients[index].referralStatus,context), + referralStatus: model.getReferralStatusNameByCode( + model.myReferralPatients[index].referralStatus!, context), referralStatusCode: model.myReferralPatients[index].referralStatus, patientName: model.myReferralPatients[index].patientName, patientGender: model.myReferralPatients[index].gender, - referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate), - referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), + referredDate: AppDateUtils.getDayMonthYearDateFormatted( + model.myReferralPatients[index].referralDate!), + referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate!), patientID: "${model.myReferralPatients[index].patientID}", isSameBranch: false, isReferral: true, isReferralClinic: true, - referralClinic:"${model.myReferralPatients[index].referringClinicDescription}", + referralClinic: "${model.myReferralPatients[index].referringClinicDescription}", remark: model.myReferralPatients[index].referringDoctorRemarks, nationality: model.myReferralPatients[index].nationalityName, nationalityFlag: model.myReferralPatients[index].nationalityFlagURL, doctorAvatar: model.myReferralPatients[index].doctorImageURL, referralDoctorName: model.myReferralPatients[index].referringDoctorName, clinicDescription: model.myReferralPatients[index].referringClinicDescription, - infoIcon: Icon(FontAwesomeIcons.arrowRight, - size: 25, color: Colors.black), + infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), ), ), ), diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index fe6fd2db..03488886 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -12,13 +12,12 @@ import '../../../../routes.dart'; class MyReferralPatientScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return BaseView( onModelReady: (model) => model.getPendingReferralPatients(), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient ?? "", body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( child: Column( @@ -51,49 +50,30 @@ class MyReferralPatientScreen extends StatelessWidget { model.pendingReferral.length, (index) => InkWell( onTap: () { - Navigator.of(context).pushNamed(MY_REFERRAL_DETAIL, - arguments: { - 'referral': model.pendingReferral[index] - }); + Navigator.of(context) + .pushNamed(MY_REFERRAL_DETAIL, arguments: {'referral': model.pendingReferral[index]}); }, child: PatientReferralItemWidget( - referralStatus: - model.pendingReferral[index].referralStatus, - patientName: - model.pendingReferral[index].patientName, - patientGender: model - .pendingReferral[index].patientDetails.gender, - referredDate: model - .pendingReferral[index].referredOn - .split(" ")[0], - referredTime: model - .pendingReferral[index].referredOn - .split(" ")[1], - patientID: - "${model.pendingReferral[index].patientID}", - isSameBranch: model.pendingReferral[index] - .isReferralDoctorSameBranch, + referralStatus: model.pendingReferral[index].referralStatus, + patientName: model.pendingReferral[index].patientName, + patientGender: model.pendingReferral[index].patientDetails?.gender, + referredDate: model.pendingReferral[index].referredOn!.split(" ")[0], + referredTime: model.pendingReferral[index].referredOn!.split(" ")[1], + patientID: "${model.pendingReferral[index].patientID}", + isSameBranch: model.pendingReferral[index].isReferralDoctorSameBranch, isReferral: true, - remark: - model.pendingReferral[index].remarksFromSource, - nationality: model.pendingReferral[index] - .patientDetails.nationalityName, - nationalityFlag: - model.pendingReferral[index].nationalityFlagUrl, - doctorAvatar: - model.pendingReferral[index].doctorImageUrl, - referralDoctorName: model - .pendingReferral[index].referredByDoctorInfo, + remark: model.pendingReferral[index].remarksFromSource, + nationality: model.pendingReferral[index].patientDetails!.nationalityName, + nationalityFlag: model.pendingReferral[index].nationalityFlagUrl, + doctorAvatar: model.pendingReferral[index].doctorImageUrl, + referralDoctorName: model.pendingReferral[index].referredByDoctorInfo, clinicDescription: null, infoIcon: InkWell( onTap: () { - Navigator.of(context) - .pushNamed(MY_REFERRAL_DETAIL, arguments: { - 'referral': model.pendingReferral[index] - }); + Navigator.of(context).pushNamed(MY_REFERRAL_DETAIL, + arguments: {'referral': model.pendingReferral[index]}); }, - child: Icon(FontAwesomeIcons.arrowRight, - size: 25, color: Colors.black), + child: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), ), ), ), diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index de1d5958..d87fdc39 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -18,9 +18,8 @@ class PatientReferralScreen extends StatefulWidget { } class _PatientReferralScreen extends State with SingleTickerProviderStateMixin { - - TabController _tabController; - int index=0; + late TabController _tabController; + int index = 0; @override void initState() { @@ -41,12 +40,11 @@ class _PatientReferralScreen extends State with SingleTic _tabController.dispose(); } - @override Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).patientsreferral, + appBarTitle: TranslationBase.of(context).patientsreferral!, body: Scaffold( extendBodyBehindAppBar: true, // backgroundColor: Colors.white, @@ -57,9 +55,7 @@ class _PatientReferralScreen extends State with SingleTic height: MediaQuery.of(context).size.height * 0.070, decoration: BoxDecoration( border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 1), //width: 0.7 + bottom: BorderSide(color: Theme.of(context).dividerColor, width: 1), //width: 0.7 ), color: Colors.white), child: Center( @@ -69,24 +65,20 @@ class _PatientReferralScreen extends State with SingleTic indicatorColor: Colors.transparent, indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0), + labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.33, height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), + decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), borderRadius: 4, borderWidth: 0), child: Center( child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - index == 0 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), + index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -103,17 +95,14 @@ class _PatientReferralScreen extends State with SingleTic ), Container( width: MediaQuery.of(context).size.width * 0.34, - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), child: Center( child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - index == 1 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), + index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -131,16 +120,13 @@ class _PatientReferralScreen extends State with SingleTic Container( width: MediaQuery.of(context).size.width * 0.33, height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), + decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), child: Center( child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - index == 2 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), + index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -155,7 +141,6 @@ class _PatientReferralScreen extends State with SingleTic ), ), ), - ], ), ), diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index cc491cf2..dc7da44d 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -25,14 +25,12 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class PatientMakeInPatientReferralScreen extends StatefulWidget { @override - _PatientMakeInPatientReferralScreenState createState() => - _PatientMakeInPatientReferralScreenState(); + _PatientMakeInPatientReferralScreenState createState() => _PatientMakeInPatientReferralScreenState(); } -class _PatientMakeInPatientReferralScreenState - extends State { - PatiantInformtion patient; - List referToList; +class _PatientMakeInPatientReferralScreenState extends State { + late PatiantInformtion patient; + late List referToList; dynamic _referTo; dynamic _selectedBranch; dynamic _selectedClinic; @@ -41,13 +39,13 @@ class _PatientMakeInPatientReferralScreenState final _remarksController = TextEditingController(); final _extController = TextEditingController(); int _activePriority = 1; - String appointmentDate; + late String appointmentDate; - String branchError; - String hospitalError; - String clinicError; - String doctorError; - String frequencyError; + late String branchError; + late String hospitalError; + late String clinicError; + late String doctorError; + late String frequencyError; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); @@ -68,8 +66,7 @@ class _PatientMakeInPatientReferralScreenState onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -113,28 +110,21 @@ class _PatientMakeInPatientReferralScreenState } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; - referToList = List(); - dynamic sameBranch = { - "id": 1, - "name": TranslationBase.of(context).sameBranch - }; - dynamic otherBranch = { - "id": 2, - "name": TranslationBase.of(context).otherBranch - }; + referToList = []; + dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch}; + dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch}; referToList.add(sameBranch); referToList.add(otherBranch); @@ -144,7 +134,7 @@ class _PatientMakeInPatientReferralScreenState onModelReady: (model) => model.getReferralFrequencyList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient!, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, @@ -188,8 +178,7 @@ class _PatientMakeInPatientReferralScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).branch, - dropDownText: - _referTo != null ? _referTo['name'] : null, + dropDownText: _referTo != null ? _referTo['name'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: branchError, @@ -206,23 +195,15 @@ class _PatientMakeInPatientReferralScreenState _selectedBranch = null; _selectedClinic = null; _selectedDoctor = null; - model - .getDoctorBranch() - .then((value) async { + model.getDoctorBranch().then((value) async { _selectedBranch = value; if (_referTo['id'] == 1) { - GifLoaderDialogUtils.showMyDialog( - context); + GifLoaderDialogUtils.showMyDialog(context); await model - .getClinics(_selectedBranch[ - 'facilityId']) - .then((_) => - GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + .getClinics(_selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } } else { _selectedBranch = null; @@ -247,9 +228,7 @@ class _PatientMakeInPatientReferralScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).hospital, - dropDownText: _selectedBranch != null - ? _selectedBranch['facilityName'] - : null, + dropDownText: _selectedBranch != null ? _selectedBranch['facilityName'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: hospitalError, @@ -268,17 +247,12 @@ class _PatientMakeInPatientReferralScreenState _selectedBranch = selectedValue; _selectedClinic = null; _selectedDoctor = null; - GifLoaderDialogUtils.showMyDialog( - context); + GifLoaderDialogUtils.showMyDialog(context); await model - .getClinics( - _selectedBranch['facilityId']) - .then((_) => GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + .getClinics(_selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } }); }, @@ -299,9 +273,7 @@ class _PatientMakeInPatientReferralScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).clinic, - dropDownText: _selectedClinic != null - ? _selectedClinic['ClinicDescription'] - : null, + dropDownText: _selectedClinic != null ? _selectedClinic['ClinicDescription'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: clinicError, @@ -314,27 +286,19 @@ class _PatientMakeInPatientReferralScreenState attributeName: 'ClinicDescription', attributeValueId: 'ClinicID', usingSearch: true, - hintSearchText: - TranslationBase.of(context) - .clinicSearch, + hintSearchText: TranslationBase.of(context).clinicSearch, okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() async { _selectedDoctor = null; _selectedClinic = selectedValue; - GifLoaderDialogUtils.showMyDialog( - context); + GifLoaderDialogUtils.showMyDialog(context); await model .getClinicDoctors( - patient, - _selectedClinic['ClinicID'], - _selectedBranch['facilityId']) - .then((_) => GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + patient, _selectedClinic['ClinicID'], _selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } }); }, @@ -355,49 +319,41 @@ class _PatientMakeInPatientReferralScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).doctor, - dropDownText: _selectedDoctor != null - ? _selectedDoctor['Name'] - : null, + dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: doctorError, - onClick: _selectedClinic != null && - model.doctorsList != null && - model.doctorsList.length > 0 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.doctorsList, - attributeName: 'Name', - attributeValueId: 'DoctorID', - usingSearch: true, - hintSearchText: - TranslationBase.of(context) - .doctorSearch, - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = selectedValue; - }); + onClick: + _selectedClinic != null && model.doctorsList != null && model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.doctorsList, + attributeName: 'Name', + attributeValueId: 'DoctorID', + usingSearch: true, + hintSearchText: TranslationBase.of(context).doctorSearch, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : () { + if (_selectedClinic == null) { + DrAppToastMsg.showErrorToast("You need to select a clinic first"); + } else if (model.doctorsList == null || model.doctorsList.length == 0) { + DrAppToastMsg.showErrorToast("There is no doctors for this clinic"); + } }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : () { - if (_selectedClinic == null) { - DrAppToastMsg.showErrorToast( - "You need to select a clinic first"); - } else if (model.doctorsList == null || - model.doctorsList.length == 0) { - DrAppToastMsg.showErrorToast( - "There is no doctors for this clinic"); - } - }, ), SizedBox( height: 10, @@ -425,11 +381,8 @@ class _PatientMakeInPatientReferralScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: - TranslationBase.of(context).referralFrequency, - dropDownText: _selectedFrequency != null - ? _selectedFrequency['Description'] - : null, + hintText: TranslationBase.of(context).referralFrequency, + dropDownText: _selectedFrequency != null ? _selectedFrequency['Description'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: frequencyError, @@ -439,8 +392,7 @@ class _PatientMakeInPatientReferralScreenState attributeName: 'Description', attributeValueId: 'ParameterCode', usingSearch: true, - hintSearchText: TranslationBase.of(context) - .selectReferralFrequency, + hintSearchText: TranslationBase.of(context).selectReferralFrequency, okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { @@ -478,8 +430,7 @@ class _PatientMakeInPatientReferralScreenState maxLines: 6, ), Positioned( - top: - 0, //MediaQuery.of(context).size.height * 0, + top: 0, //MediaQuery.of(context).size.height * 0, right: 15, child: IconButton( icon: Icon( @@ -488,8 +439,7 @@ class _PatientMakeInPatientReferralScreenState size: 35, ), onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ), @@ -524,34 +474,29 @@ class _PatientMakeInPatientReferralScreenState onPressed: () async { setState(() { if (_referTo == null) { - branchError = - TranslationBase.of(context).fieldRequired; + branchError = TranslationBase.of(context).fieldRequired!; } else { - branchError = null; + branchError = null!; } if (_selectedBranch == null) { - hospitalError = - TranslationBase.of(context).fieldRequired; + hospitalError = TranslationBase.of(context).fieldRequired!; } else { - hospitalError = null; + hospitalError = null!; } if (_selectedClinic == null) { - clinicError = - TranslationBase.of(context).fieldRequired; + clinicError = TranslationBase.of(context).fieldRequired!; } else { - clinicError = null; + clinicError = null!; } if (_selectedDoctor == null) { - doctorError = - TranslationBase.of(context).fieldRequired; + doctorError = TranslationBase.of(context).fieldRequired!; } else { - doctorError = null; + doctorError = null!; } if (_selectedFrequency == null) { - frequencyError = - TranslationBase.of(context).fieldRequired; + frequencyError = TranslationBase.of(context).fieldRequired!; } else { - frequencyError = null; + frequencyError = null!; } }); if (_selectedFrequency == null || @@ -566,8 +511,7 @@ class _PatientMakeInPatientReferralScreenState projectID: _selectedBranch['facilityId'], clinicID: _selectedClinic['ClinicID'], doctorID: _selectedDoctor['DoctorID'], - frequencyCode: - _selectedFrequency['ParameterCode'], + frequencyCode: _selectedFrequency['ParameterCode'], ext: _extController.text, remarks: _remarksController.text, priority: _activePriority, @@ -575,9 +519,7 @@ class _PatientMakeInPatientReferralScreenState if (model.state == ViewState.ErrorLocal) DrAppToastMsg.showErrorToast(model.error); else { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) - .referralSuccessMsg); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg); Navigator.pop(context); } } @@ -596,14 +538,13 @@ class _PatientMakeInPatientReferralScreenState Widget priorityBar(BuildContext _context, Size screenSize) { List _priorities = [ - TranslationBase.of(context).veryUrgent.toUpperCase(), - TranslationBase.of(context).urgent.toUpperCase(), - TranslationBase.of(context).routine.toUpperCase(), + TranslationBase.of(context).veryUrgent!.toUpperCase(), + TranslationBase.of(context).urgent!.toUpperCase(), + TranslationBase.of(context).routine!.toUpperCase(), ]; return Container( height: screenSize.height * 0.070, - decoration: - containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), + decoration: containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -615,16 +556,13 @@ class _PatientMakeInPatientReferralScreenState child: Container( height: screenSize.height * 0.070, decoration: containerBorderDecoration( - _isActive ? Color(0XFFB8382B) : Colors.white, - _isActive ? Color(0XFFB8382B) : Colors.white), + _isActive ? Color(0XFFB8382B) : Colors.white, _isActive ? Color(0XFFB8382B) : Colors.white), child: Center( child: Text( item, style: TextStyle( fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, + color: _isActive ? Colors.white : Colors.black, //Colors.black, fontWeight: FontWeight.bold, ), ), @@ -664,8 +602,7 @@ class _PatientMakeInPatientReferralScreenState return time; } - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 6a25b9a1..772f2f90 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -21,24 +21,23 @@ import 'package:hexcolor/hexcolor.dart'; class PatientMakeReferralScreen extends StatefulWidget { // previous design page is: ReferPatientScreen @override - _PatientMakeReferralScreenState createState() => - _PatientMakeReferralScreenState(); + _PatientMakeReferralScreenState createState() => _PatientMakeReferralScreenState(); } class _PatientMakeReferralScreenState extends State { - PatiantInformtion patient; - List referToList; + late PatiantInformtion patient; + late List referToList; dynamic _referTo; dynamic _selectedBranch; dynamic _selectedClinic; dynamic _selectedDoctor; - DateTime appointmentDate; + late DateTime appointmentDate; final _remarksController = TextEditingController(); - String branchError = null; - String hospitalError = null; - String clinicError = null; - String doctorError = null; + String? branchError = null; + String? hospitalError = null; + String? clinicError = null; + String? doctorError = null; @override void initState() { @@ -49,20 +48,14 @@ class _PatientMakeReferralScreenState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - referToList = List(); - dynamic sameBranch = { - "id": 1, - "name": TranslationBase.of(context).sameBranch - }; - dynamic otherBranch = { - "id": 2, - "name": TranslationBase.of(context).otherBranch - }; + referToList = []; + dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch}; + dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch}; referToList.add(sameBranch); referToList.add(otherBranch); @@ -72,10 +65,9 @@ class _PatientMakeReferralScreenState extends State { onModelReady: (model) => model.getPatientReferral(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient!, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), body: SingleChildScrollView( child: Container( child: Column( @@ -109,57 +101,25 @@ class _PatientMakeReferralScreenState extends State { model.patientReferral.length == 0 ? referralForm(model, screenSize) : PatientReferralItemWidget( - referralStatus: model - .patientReferral[ - model.patientReferral.length - 1] - .referralStatus, - patientName: model - .patientReferral[ - model.patientReferral.length - 1] - .patientName, - patientGender: model - .patientReferral[ - model.patientReferral.length - 1] - .patientDetails - .gender, - referredDate: model - .patientReferral[ - model.patientReferral.length - 1] - .referredOn - .split(" ")[0], - referredTime: model - .patientReferral[ - model.patientReferral.length - 1] - .referredOn - .split(" ")[1], - patientID: - "${model.patientReferral[model.patientReferral.length - 1].patientID}", - isSameBranch: model - .patientReferral[ - model.patientReferral.length - 1] - .isReferralDoctorSameBranch, + referralStatus: model.patientReferral[model.patientReferral.length - 1].referralStatus, + patientName: model.patientReferral[model.patientReferral.length - 1].patientName, + patientGender: + model.patientReferral[model.patientReferral.length - 1].patientDetails!.gender, + referredDate: + model.patientReferral[model.patientReferral.length - 1].referredOn!.split(" ")[0], + referredTime: + model.patientReferral[model.patientReferral.length - 1].referredOn!.split(" ")[1], + patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}", + isSameBranch: + model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch, isReferral: true, - remark: model - .patientReferral[ - model.patientReferral.length - 1] - .remarksFromSource, - nationality: model - .patientReferral[ - model.patientReferral.length - 1] - .patientDetails - .nationalityName, - nationalityFlag: model - .patientReferral[ - model.patientReferral.length - 1] - .nationalityFlagUrl, - doctorAvatar: model - .patientReferral[ - model.patientReferral.length - 1] - .doctorImageUrl, - referralDoctorName: model - .patientReferral[ - model.patientReferral.length - 1] - .referredByDoctorInfo, + remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource, + nationality: + model.patientReferral[model.patientReferral.length - 1].patientDetails!.nationalityName, + nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl, + doctorAvatar: model.patientReferral[model.patientReferral.length - 1].doctorImageUrl, + referralDoctorName: + model.patientReferral[model.patientReferral.length - 1].referredByDoctorInfo, clinicDescription: null, ), ], @@ -174,28 +134,24 @@ class _PatientMakeReferralScreenState extends State { onPressed: () { setState(() { if (_referTo == null) { - branchError = - TranslationBase.of(context).fieldRequired; + branchError = TranslationBase.of(context).fieldRequired!; } else { - branchError = null; + branchError = null!; } if (_selectedBranch == null) { - hospitalError = - TranslationBase.of(context).fieldRequired; + hospitalError = TranslationBase.of(context).fieldRequired!; } else { - hospitalError = null; + hospitalError = null!; } if (_selectedClinic == null) { - clinicError = - TranslationBase.of(context).fieldRequired; + clinicError = TranslationBase.of(context).fieldRequired!; } else { - clinicError = null; + clinicError = null!; } if (_selectedDoctor == null) { - doctorError = - TranslationBase.of(context).fieldRequired; + doctorError = TranslationBase.of(context).fieldRequired!; } else { - doctorError = null; + doctorError = null!; } }); if (appointmentDate == null || @@ -204,16 +160,10 @@ class _PatientMakeReferralScreenState extends State { _selectedDoctor == null || _remarksController.text == null) return; model - .makeReferral( - patient, - appointmentDate.toIso8601String(), - _selectedBranch['facilityId'], - _selectedClinic['ClinicID'], - _selectedDoctor['DoctorID'], - _remarksController.text) + .makeReferral(patient, appointmentDate.toIso8601String(), _selectedBranch['facilityId'], + _selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], _remarksController.text) .then((_) { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).referralSuccessMsg); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg); Navigator.pop(context); }); }, @@ -259,8 +209,7 @@ class _PatientMakeReferralScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); await model .getClinics(_selectedBranch['facilityId']) - .then((_) => - GifLoaderDialogUtils.hideDialog(context)); + .then((_) => GifLoaderDialogUtils.hideDialog(context)); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } @@ -287,47 +236,42 @@ class _PatientMakeReferralScreenState extends State { AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).hospital, - dropDownText: _selectedBranch != null - ? _selectedBranch['facilityName'] - : null, + dropDownText: _selectedBranch != null ? _selectedBranch['facilityName'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: hospitalError, - onClick: model.branchesList != null && - model.branchesList.length > 0 && - _referTo != null && - _referTo['id'] == 2 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.branchesList, - attributeName: 'facilityName', - attributeValueId: 'facilityId', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() async { - _selectedBranch = selectedValue; - _selectedClinic = null; - _selectedDoctor = null; - GifLoaderDialogUtils.showMyDialog(context); - await model - .getClinics(_selectedBranch['facilityId']) - .then((_) => - GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, + onClick: + model.branchesList != null && model.branchesList.length > 0 && _referTo != null && _referTo['id'] == 2 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.branchesList, + attributeName: 'facilityName', + attributeValueId: 'facilityId', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() async { + _selectedBranch = selectedValue; + _selectedClinic = null; + _selectedDoctor = null; + GifLoaderDialogUtils.showMyDialog(context); + await model + .getClinics(_selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, ), SizedBox( height: 10, @@ -335,15 +279,11 @@ class _PatientMakeReferralScreenState extends State { AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).clinic, - dropDownText: _selectedClinic != null - ? _selectedClinic['ClinicDescription'] - : null, + dropDownText: _selectedClinic != null ? _selectedClinic['ClinicDescription'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: clinicError, - onClick: _selectedBranch != null && - model.clinicsList != null && - model.clinicsList.length > 0 + onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0 ? () { ListSelectDialog dialog = ListSelectDialog( list: model.clinicsList, @@ -358,12 +298,8 @@ class _PatientMakeReferralScreenState extends State { _selectedClinic = selectedValue; GifLoaderDialogUtils.showMyDialog(context); await model - .getClinicDoctors( - patient, - _selectedClinic['ClinicID'], - _selectedBranch['facilityId']) - .then((_) => - GifLoaderDialogUtils.hideDialog(context)); + .getClinicDoctors(patient, _selectedClinic['ClinicID'], _selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } @@ -386,14 +322,11 @@ class _PatientMakeReferralScreenState extends State { AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).doctor, - dropDownText: - _selectedDoctor != null ? _selectedDoctor['Name'] : null, + dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: doctorError, - onClick: _selectedClinic != null && - model.doctorsList != null && - model.doctorsList.length > 0 + onClick: _selectedClinic != null && model.doctorsList != null && model.doctorsList.length > 0 ? () { ListSelectDialog dialog = ListSelectDialog( list: model.doctorsList, @@ -418,12 +351,9 @@ class _PatientMakeReferralScreenState extends State { } : () { if (_selectedClinic == null) { - DrAppToastMsg.showErrorToast( - "You need to select a clinic first"); - } else if (model.doctorsList == null || - model.doctorsList.length == 0) { - DrAppToastMsg.showErrorToast( - "There is no doctors for this clinic"); + DrAppToastMsg.showErrorToast("You need to select a clinic first"); + } else if (model.doctorsList == null || model.doctorsList.length == 0) { + DrAppToastMsg.showErrorToast("There is no doctors for this clinic"); } }, ), @@ -433,16 +363,16 @@ class _PatientMakeReferralScreenState extends State { AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).date, - dropDownText: appointmentDate != null - ? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" - : null, + dropDownText: + appointmentDate != null ? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" : null, enabled: false, isTextFieldHasSuffix: true, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + Icons.calendar_today, + color: Colors.black, + )), onClick: () { _selectDate(context, model); }, @@ -465,7 +395,7 @@ class _PatientMakeReferralScreenState extends State { _selectDate(BuildContext context, PatientReferralViewModel model) async { // https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference // https://stackoverflow.com/a/63147062/6246772 to customize a date picker - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: appointmentDate, firstDate: DateTime.now().add(Duration(hours: 2)), diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index a949036b..1e48aafd 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -19,8 +19,7 @@ import 'AddReplayOnReferralPatient.dart'; class ReferralPatientDetailScreen extends StatelessWidget { final MyReferralPatientModel referredPatient; final PatientReferralViewModel patientReferralViewModel; - ReferralPatientDetailScreen( - this.referredPatient, this.patientReferralViewModel); + ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel); @override Widget build(BuildContext context) { @@ -51,8 +50,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - (Helpers.capitalize( - "${referredPatient.firstName} ${referredPatient.lastName}")), + (Helpers.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -69,18 +67,14 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = model - .getPatientFromReferralO(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromReferralO(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Icon( @@ -97,18 +91,14 @@ class ReferralPatientDetailScreen extends StatelessWidget { children: [ InkWell( onTap: () { - PatiantInformtion patient = model - .getPatientFromReferralO(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromReferralO(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Padding( @@ -143,11 +133,10 @@ class ReferralPatientDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", + "${model.getReferralStatusNameByCode(referredPatient.referralStatus!, context)}", fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, @@ -159,7 +148,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.getDayMonthYearDateFormatted( - referredPatient.referralDate, + referredPatient.referralDate!, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -169,35 +158,30 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .fileNumber, + TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( "${referredPatient.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), AppText( AppDateUtils.getTimeHHMMA( - referredPatient.referralDate, + referredPatient.referralDate!, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -207,60 +191,48 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( - referredPatient - .referringClinicDescription, + referredPatient.referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * - SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .frequency + - ": ", + TranslationBase.of(context).frequency! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient - .frequencyDescription, + referredPatient.frequencyDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * - SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -272,29 +244,22 @@ class ReferralPatientDetailScreen extends StatelessWidget { Row( children: [ AppText( - referredPatient.nationalityName != - null + referredPatient.nationalityName != null ? referredPatient.nationalityName : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: - 1.4 * SizeConfig.textMultiplier, + fontSize: 1.4 * SizeConfig.textMultiplier, ), - referredPatient.nationalityFlagURL != - null + referredPatient.nationalityFlagURL != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient - .nationalityFlagURL, + referredPatient.nationalityFlagURL!, height: 25, width: 30, - errorBuilder: (BuildContext - context, - Object exception, - StackTrace stackTrace) { + errorBuilder: + (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -308,8 +273,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + - ": ", + TranslationBase.of(context).priority! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -320,8 +284,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { referredPatient.priorityDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -332,9 +295,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .maxResponseTime + - ": ", + TranslationBase.of(context).maxResponseTime! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -343,12 +304,10 @@ class ReferralPatientDetailScreen extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime, - "dd MMM,yyyy"), + referredPatient.mAXResponseTime!, "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -358,8 +317,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: - EdgeInsets.only(left: 10, right: 0), + margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( 'assets/images/patient/ic_ref_arrow_up.png', height: 50, @@ -367,26 +325,17 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only( - left: 0, - top: 25, - right: 0, - bottom: 0), - padding: EdgeInsets.only( - left: 4.0, right: 4.0), - child: referredPatient.doctorImageURL != - null + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 4.0), + child: referredPatient.doctorImageURL != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL, + referredPatient.doctorImageURL!, height: 25, width: 30, errorBuilder: - (BuildContext context, - Object exception, - StackTrace stackTrace) { + (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -402,30 +351,22 @@ class ReferralPatientDetailScreen extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, - top: 30, - right: 10, - bottom: 0), + margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.5 * - SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Colors.black, ), AppText( - referredPatient - .referringClinicDescription, + referredPatient.referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.3 * - SizeConfig.textMultiplier, + fontSize: 1.3 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index dc2bf798..4f9e0dcb 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -19,9 +19,8 @@ class ReferredPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referredPatient, - body: model.listMyReferredPatientModel == null || - model.listMyReferredPatientModel.length == 0 + appBarTitle: TranslationBase.of(context).referredPatient!, + body: model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0 ? Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -60,55 +59,31 @@ class ReferredPatientScreen extends StatelessWidget { Navigator.push( context, FadePage( - page: ReferredPatientDetailScreen( - model.getReferredPatientItem(index)), + page: ReferredPatientDetailScreen(model.getReferredPatientItem(index)), ), ); }, child: PatientReferralItemWidget( - referralStatus:model.getReferredPatientItem(index).referralStatusDesc, - referralStatusCode: model - .getReferredPatientItem(index) - .referralStatus, + referralStatus: model.getReferredPatientItem(index).referralStatusDesc, + referralStatusCode: model.getReferredPatientItem(index).referralStatus, patientName: "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", - patientGender: - model.getReferredPatientItem(index).gender, + patientGender: model.getReferredPatientItem(index).gender, referredDate: AppDateUtils.convertDateFromServerFormat( - model - .getReferredPatientItem(index) - .referralDate, - "dd/MM/yyyy"), + model.getReferredPatientItem(index).referralDate!, "dd/MM/yyyy"), referredTime: AppDateUtils.convertDateFromServerFormat( - model - .getReferredPatientItem(index) - .referralDate, - "hh:mm a"), - patientID: - "${model.getReferredPatientItem(index).patientID}", - isSameBranch: model - .getReferredPatientItem(index) - .isReferralDoctorSameBranch, + model.getReferredPatientItem(index).referralDate!, "hh:mm a"), + patientID: "${model.getReferredPatientItem(index).patientID}", + isSameBranch: model.getReferredPatientItem(index).isReferralDoctorSameBranch, isReferral: false, - remark: model - .getReferredPatientItem(index) - .referringDoctorRemarks, - nationality: model - .getReferredPatientItem(index) - .nationalityName, - nationalityFlag: model - .getReferredPatientItem(index) - .nationalityFlagURL, - doctorAvatar: model - .getReferredPatientItem(index) - .doctorImageURL, + remark: model.getReferredPatientItem(index).referringDoctorRemarks, + nationality: model.getReferredPatientItem(index).nationalityName, + nationalityFlag: model.getReferredPatientItem(index).nationalityFlagURL, + doctorAvatar: model.getReferredPatientItem(index).doctorImageURL, referralDoctorName: "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", - clinicDescription: model - .getReferredPatientItem(index) - .referralClinicDescription, - infoIcon: Icon(FontAwesomeIcons.arrowRight, - size: 25, color: Colors.black), + clinicDescription: model.getReferredPatientItem(index).referralClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), ), ), ), diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index b4e1ddc5..bd722b59 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -50,8 +50,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - (Helpers.capitalize( - "${referredPatient.firstName} ${referredPatient.lastName}")), + (Helpers.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -68,18 +67,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = - model.getPatientFromReferral(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromReferral(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Icon( @@ -93,19 +88,15 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ InkWell( - onTap: (){ - PatiantInformtion patient = - model.getPatientFromReferral(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + onTap: () { + PatiantInformtion patient = model.getPatientFromReferral(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Column( @@ -142,8 +133,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( referredPatient.referralStatusDesc, @@ -158,8 +148,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate, - "dd MMM,yyyy"), + referredPatient.referralDate ?? "", "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier, @@ -168,20 +157,16 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .fileNumber, + TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( @@ -195,8 +180,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate, - "hh:mm a"), + referredPatient.referralDate ?? "", "hh:mm a"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -205,29 +189,25 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient - .referralClinicDescription, + referredPatient.referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 13, @@ -237,25 +217,19 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .frequency + - ": ", + TranslationBase.of(context).frequency ?? "" + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient - .frequencyDescription, + referredPatient.frequencyDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 14, @@ -270,29 +244,22 @@ class ReferredPatientDetailScreen extends StatelessWidget { Row( children: [ AppText( - referredPatient.nationalityName != - null + referredPatient.nationalityName != null ? referredPatient.nationalityName : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: - 1.4 * SizeConfig.textMultiplier, + fontSize: 1.4 * SizeConfig.textMultiplier, ), - referredPatient.nationalityFlagURL != - null + referredPatient.nationalityFlagURL != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient - .nationalityFlagURL, + referredPatient.nationalityFlagURL ?? "", height: 25, width: 30, - errorBuilder: (BuildContext - context, - Object exception, - StackTrace stackTrace) { + errorBuilder: + (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -306,8 +273,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + - ": ", + TranslationBase.of(context).priority ?? "" + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -327,9 +293,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .maxResponseTime + - ": ", + TranslationBase.of(context).maxResponseTime ?? "" + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -338,12 +302,10 @@ class ReferredPatientDetailScreen extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime, - "dd MMM,yyyy"), + referredPatient.mAXResponseTime ?? "", "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -353,8 +315,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: - EdgeInsets.only(left: 10, right: 0), + margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( 'assets/images/patient/ic_ref_arrow_left.png', height: 50, @@ -362,26 +323,17 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only( - left: 0, - top: 25, - right: 0, - bottom: 0), - padding: EdgeInsets.only( - left: 4.0, right: 4.0), - child: referredPatient.doctorImageURL != - null + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 4.0), + child: referredPatient.doctorImageURL != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL, + referredPatient.doctorImageURL ?? "", height: 25, width: 30, errorBuilder: - (BuildContext context, - Object exception, - StackTrace stackTrace) { + (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -397,30 +349,22 @@ class ReferredPatientDetailScreen extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, - top: 30, - right: 10, - bottom: 0), + margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.5 * - SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Colors.black, ), AppText( - referredPatient - .referralClinicDescription, + referredPatient.referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.3 * - SizeConfig.textMultiplier, + fontSize: 1.3 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -477,19 +421,16 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only( - left: 0, top: 0, right: 4, bottom: 0), + margin: EdgeInsets.only(left: 0, top: 0, right: 4, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: referredPatient.doctorImageURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL, + referredPatient.doctorImageURL ?? "", height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -514,8 +455,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { color: Color(0XFF2E303A), ), AppText( - referredPatient - .referredDoctorRemarks.isNotEmpty + referredPatient.referredDoctorRemarks!.isNotEmpty ? referredPatient.referredDoctorRemarks : TranslationBase.of(context).notRepliedYet, fontFamily: 'Poppins', @@ -533,31 +473,28 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ), ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: AppButton( - title: TranslationBase.of(context).acknowledged, - color: Colors.red[700], - fontColor: Colors.white, - fontWeight: FontWeight.w700, - fontSize: 1.8, - hPadding: 8, - vPadding: 12, - disabled: referredPatient.referredDoctorRemarks.isNotEmpty - ? false - : true, - onPressed: () async { - await model.verifyReferralDoctorRemarks(referredPatient); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } else { - DrAppToastMsg.showSuccesToast( - "Referral is acknowledged"); - Navigator.pop(context); - } - }, - ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: AppButton( + title: TranslationBase.of(context).acknowledged, + color: Colors.red[700], + fontColor: Colors.white, + fontWeight: FontWeight.w700, + fontSize: 1.8, + hPadding: 8, + vPadding: 12, + disabled: referredPatient.referredDoctorRemarks!.isNotEmpty ? false : true, + onPressed: () async { + await model.verifyReferralDoctorRemarks(referredPatient); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast("Referral is acknowledged"); + Navigator.pop(context); + } + }, ), + ), ], ), ), diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index a30842f8..14702f81 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -28,17 +28,16 @@ import 'package:provider/provider.dart'; class AddAssessmentDetails extends StatefulWidget { final MySelectedAssessment mySelectedAssessment; final List mySelectedAssessmentList; - final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) - addSelectedAssessment; + final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment; final PatiantInformtion patientInfo; final bool isUpdate; AddAssessmentDetails( - {Key key, - this.mySelectedAssessment, - this.addSelectedAssessment, - this.patientInfo, + {Key? key, + required this.mySelectedAssessment, + required this.addSelectedAssessment, + required this.patientInfo, this.isUpdate = false, - this.mySelectedAssessmentList}); + required this.mySelectedAssessmentList}); @override _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); @@ -59,48 +58,37 @@ class _AddAssessmentDetailsState extends State { ProjectViewModel projectViewModel = Provider.of(context); remarkController.text = widget.mySelectedAssessment.remark ?? ""; - appointmentIdController.text = - widget.mySelectedAssessment.appointmentId.toString(); + appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); if (widget.isUpdate) { if (widget.mySelectedAssessment.selectedDiagnosisCondition != null) conditionController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr - : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; + ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr ?? "" + : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn ?? ""; if (widget.mySelectedAssessment.selectedDiagnosisType != null) typeController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr - : widget.mySelectedAssessment.selectedDiagnosisType.nameEn; + ? widget.mySelectedAssessment.selectedDiagnosisType!.nameAr ?? "" + : widget.mySelectedAssessment.selectedDiagnosisType!.nameEn ?? ""; if (widget.mySelectedAssessment.selectedICD != null) - icdNameController.text = widget.mySelectedAssessment.selectedICD.code; + icdNameController.text = widget.mySelectedAssessment.selectedICD!.code; } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon, String validationError}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {IconData? icon, String? validationError}) { return new InputDecoration( fillColor: Colors.white, contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: (validationError != null - ? Colors.red.shade700 - : Color(0xFFEFEFEF)), - width: 2.5), + borderSide: + BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: (validationError != null - ? Colors.red.shade700 - : Color(0xFFEFEFEF)), - width: 2.5), + borderSide: + BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: (validationError != null - ? Colors.red.shade700 - : Color(0xFFEFEFEF)), - width: 2.5), + borderSide: + BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, @@ -135,233 +123,178 @@ class _AddAssessmentDetailsState extends State { child: Center( child: Column( children: [ - BottomSheetTitle( - title: TranslationBase.of(context).addAssessmentDetails), + BottomSheetTitle(title: TranslationBase.of(context).addAssessmentDetails!), FractionallySizedBox( widthFactor: 0.9, child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - // height: 55.0, - hintText: - TranslationBase.of(context).appointmentNumber, - isTextFieldHasSuffix: false, - enabled: false, - controller: appointmentIdController, - ), - ), - SizedBox( - height: 10, - ), - Container( - child: InkWell( - onTap: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment - .selectedICD = null; - icdNameController.text = null; - }); - } - : null, - child: widget - .mySelectedAssessment.selectedICD == - null - ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && - widget.mySelectedAssessment - .selectedICD == - null, - child: AutoCompleteTextField< - MasterKeyModel>( - decoration: TextFieldsUtils - .textFieldSelectorDecoration( - TranslationBase.of(context) - .nameOrICD, - null, - true, - suffixIcon: Icons.search), - itemSubmitted: (item) => setState(() { - widget.mySelectedAssessment - .selectedICD = item; - icdNameController.text = - '${item.code.trim()}/${item.description}'; - }), - key: key, - suggestions: model.listOfICD10, - itemBuilder: (context, suggestion) => - new Padding( - child: AppText( - suggestion.description + - " / " + - suggestion.code - .toString()), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.code - .toLowerCase() - .startsWith( - input.toLowerCase()), - ), - ) - : AppTextFieldCustom( - onClick: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment - .selectedICD = null; - icdNameController.text = null; - }); - } - : null, - hintText: TranslationBase.of(context) - .nameOrICD, - maxLines: 2, - minLines: 1, - controller: icdNameController, - enabled: true, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.grey.shade600, - )), - )), - ), - SizedBox( - height: 7, - ), - AppTextFieldCustom( - onClick: model.listOfDiagnosisCondition != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisCondition, - okText: TranslationBase.of(context).ok, - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedDiagnosisCondition = - selectedValue; - conditionController - .text = projectViewModel - .isArabic - ? widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameAr - : widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).condition, - maxLines: 2, - minLines: 1, - controller: conditionController, - isTextFieldHasSuffix: true, - enabled: false, - hasBorder: true, - validationError: isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisCondition == - null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - onClick: model.listOfDiagnosisType != null + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 16, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + // height: 55.0, + hintText: TranslationBase.of(context).appointmentNumber, + isTextFieldHasSuffix: false, + enabled: false, + controller: appointmentIdController, + ), + ), + SizedBox( + height: 10, + ), + Container( + child: InkWell( + onTap: model.listOfICD10 != null ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisType, - okText: TranslationBase.of(context).ok, - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedDiagnosisType = - selectedValue; - typeController.text = - projectViewModel.isArabic - ? selectedValue.nameAr - : selectedValue.nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); + setState(() { + widget.mySelectedAssessment.selectedICD = null; + icdNameController.text = null!; + }); } : null, - hintText: TranslationBase.of(context).dType, - maxLines: 2, - minLines: 1, - enabled: false, - isTextFieldHasSuffix: true, - controller: typeController, - hasBorder: true, - validationError: isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisType == - null + child: widget.mySelectedAssessment.selectedICD == null + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null, + child: AutoCompleteTextField( + decoration: TextFieldsUtils.textFieldSelectorDecoration( + TranslationBase.of(context).nameOrICD!, "", true, + suffixIcon: Icons.search), + itemSubmitted: (item) => setState(() { + widget.mySelectedAssessment.selectedICD = item; + icdNameController.text = '${item.code.trim()}/${item.description}'; + }), + suggestions: model.listOfICD10, + itemBuilder: (context, suggestion) => new Padding( + child: AppText(suggestion.description + " / " + suggestion.code.toString()), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.code.toLowerCase().startsWith(input.toLowerCase()), + ), + ) + : AppTextFieldCustom( + onClick: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment.selectedICD = null; + icdNameController.text = null!; + }); + } + : null, + hintText: TranslationBase.of(context).nameOrICD, + maxLines: 2, + minLines: 1, + controller: icdNameController, + enabled: true, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + onPressed: () {}, + icon: Icon( + Icons.search, + color: Colors.grey.shade600, + )), + )), + ), + SizedBox( + height: 7, + ), + AppTextFieldCustom( + onClick: model.listOfDiagnosisCondition != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisCondition, + okText: TranslationBase.of(context).ok, + okFunction: (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue; + conditionController.text = projectViewModel.isArabic + ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr ?? "" + : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn ?? ""; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).condition, + maxLines: 2, + minLines: 1, + controller: conditionController, + isTextFieldHasSuffix: true, + enabled: false, + hasBorder: true, + validationError: + isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : null, - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).remarks, - maxLines: 18, - minLines: 5, - inputType: TextInputType.multiline, - controller: remarkController, - onChanged: (value) { - widget.mySelectedAssessment.remark = - remarkController.text; - }, - ), - ), - SizedBox( - height: 10, - ), - ])), + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + onClick: model.listOfDiagnosisType != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisType, + okText: TranslationBase.of(context).ok, + okFunction: (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment.selectedDiagnosisType = selectedValue; + typeController.text = + (projectViewModel.isArabic ? selectedValue.nameAr : selectedValue.nameEn)!; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).dType, + maxLines: 2, + minLines: 1, + enabled: false, + isTextFieldHasSuffix: true, + controller: typeController, + hasBorder: true, + validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).remarks, + maxLines: 18, + minLines: 5, + inputType: TextInputType.multiline, + controller: remarkController, + onChanged: (value) { + widget.mySelectedAssessment.remark = remarkController.text; + }, + ), + ), + SizedBox( + height: 10, + ), + ])), ), ], ), @@ -389,30 +322,21 @@ class _AddAssessmentDetailsState extends State { child: AppButton( fontWeight: FontWeight.w700, color: Colors.green, - title: (widget.isUpdate - ? 'Update Assessment Details' - : 'Add Assessment Details'), + title: (widget.isUpdate ? 'Update Assessment Details' : 'Add Assessment Details'), loading: model.state == ViewState.BusyLocal, onPressed: () async { setState(() { isFormSubmitted = true; }); - widget.mySelectedAssessment.remark = - remarkController.text; - widget.mySelectedAssessment.appointmentId = - int.parse(appointmentIdController.text); - if (widget.mySelectedAssessment - .selectedDiagnosisCondition != - null && - widget.mySelectedAssessment - .selectedDiagnosisType != - null && + widget.mySelectedAssessment.remark = remarkController.text; + widget.mySelectedAssessment.appointmentId = int.parse(appointmentIdController.text); + if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && + widget.mySelectedAssessment.selectedDiagnosisType != null && widget.mySelectedAssessment.selectedICD != null) { await submitAssessment( isUpdate: widget.isUpdate, model: model, - mySelectedAssessment: - widget.mySelectedAssessment); + mySelectedAssessment: widget.mySelectedAssessment); } }, ), @@ -431,9 +355,7 @@ class _AddAssessmentDetailsState extends State { } submitAssessment( - {SOAPViewModel model, - MySelectedAssessment mySelectedAssessment, - bool isUpdate = false}) async { + {required SOAPViewModel model, required MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { if (isUpdate) { PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( patientMRN: widget.patientInfo.patientMRN, @@ -441,25 +363,24 @@ class _AddAssessmentDetailsState extends State { appointmentNo: widget.patientInfo.appointmentNo, remarks: mySelectedAssessment.remark, complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: mySelectedAssessment.selectedICD.code, + conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, + icdcode10Id: mySelectedAssessment.selectedICD!.code, prevIcdCode10ID: mySelectedAssessment.icdCode10ID); await model.patchAssessment(patchAssessmentReqModel); } else { - PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - icdCodeDetails: [ + PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + icdCodeDetails: [ new IcdCodeDetails( remarks: mySelectedAssessment.remark, complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: mySelectedAssessment.selectedICD.code) + conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, + icdcode10Id: mySelectedAssessment.selectedICD!.code) ]); await model.postAssessment(postAssessmentRequestModel); @@ -471,7 +392,7 @@ class _AddAssessmentDetailsState extends State { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; + mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code; mySelectedAssessment.doctorName = doctorProfile.doctorName; if (!isUpdate) { diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 4f48ff27..91d42e96 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -29,13 +29,14 @@ class UpdateAssessmentPage extends StatefulWidget { List mySelectedAssessmentList; final PatiantInformtion patientInfo; final Function changeLoadingState; - final int currentIndex; + final int currentIndex; UpdateAssessmentPage( - {Key key, - this.changePageViewIndex, - this.mySelectedAssessmentList, - this.patientInfo, - this.changeLoadingState, this.currentIndex}); + {Key? key, + required this.changePageViewIndex, + required this.mySelectedAssessmentList, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); @@ -68,33 +69,30 @@ class _UpdateAssessmentPageState extends State { await model.getMasterLookup(MasterKeysService.ICD10); } model.patientAssessmentList.forEach((element) { - MasterKeyModel diagnosisType = model.getOneMasterKey( + MasterKeyModel? diagnosisType = model.getOneMasterKey( masterKeys: MasterKeysService.DiagnosisType, id: element.diagnosisTypeID, ); - MasterKeyModel selectedICD = model.getOneMasterKey( + MasterKeyModel? selectedICD = model.getOneMasterKey( masterKeys: MasterKeysService.ICD10, id: element.icdCode10ID, ); - MasterKeyModel diagnosisCondition = model.getOneMasterKey( + MasterKeyModel? diagnosisCondition = model.getOneMasterKey( masterKeys: MasterKeysService.DiagnosisCondition, id: element.conditionID, ); - if (diagnosisCondition != null && - diagnosisType != null && - diagnosisCondition != null) { - MySelectedAssessment temMySelectedAssessment = - MySelectedAssessment( - appointmentId: element.appointmentNo, - remark: element.remarks, - selectedDiagnosisType: diagnosisType, - selectedDiagnosisCondition: diagnosisCondition, - selectedICD: selectedICD, - doctorID: element.doctorID, - doctorName: element.doctorName, - createdBy: element.createdBy, - createdOn: element.createdOn, - icdCode10ID: element.icdCode10ID); + if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) { + MySelectedAssessment temMySelectedAssessment = MySelectedAssessment( + appointmentId: element.appointmentNo, + remark: element.remarks, + selectedDiagnosisType: diagnosisType, + selectedDiagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: element.doctorID, + doctorName: element.doctorName, + createdBy: element.createdBy, + createdOn: element.createdOn, + icdCode10ID: element.icdCode10ID); widget.mySelectedAssessmentList.add(temMySelectedAssessment); } @@ -104,229 +102,155 @@ class _UpdateAssessmentPageState extends State { widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - backgroundColor: Theme - .of(context) - .scaffoldBackgroundColor, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - - color: Theme - .of(context) - .scaffoldBackgroundColor, - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), - - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).assessment - , - onTap: () { - setState(() { - isAssessmentExpand = !isAssessmentExpand; - }); - }, - child: Column(children: [ - SizedBox( - height: 20, - ), - Column( - children: [ - - SOAPOpenItems(label: "${TranslationBase.of(context).addAssessment}",onTap: () { - openAssessmentDialog(context, - isUpdate: false, model: model); - },), - - SizedBox( - height: 20, - ), - Column( - children: widget.mySelectedAssessmentList - .map((assessment) { - return Container( - margin: EdgeInsets.only( - left: 5, right: 5, top: 15), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: "ICD : ".toUpperCase(), - ), - new TextSpan( - text: assessment - .selectedICD.code - .trim() - .toUpperCase() ?? - "", - ), - ], - ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.50, - child: RichText( + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SOAPStepHeader( + currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).assessment, + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + SOAPOpenItems( + label: "${TranslationBase.of(context).addAssessment}", + onTap: () { + openAssessmentDialog(context, isUpdate: false, model: model); + }, + ), + SizedBox( + height: 20, + ), + Column( + children: widget.mySelectedAssessmentList.map((assessment) { + return Container( + margin: EdgeInsets.only(left: 5, right: 5, top: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RichText( text: new TextSpan( style: new TextStyle( - fontSize: 16, + fontSize: 12, color: Color(0xFF2E303A), fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), + fontWeight: FontWeight.w600), children: [ new TextSpan( - text: assessment - .selectedICD.description - .toString(), + text: "ICD : ".toUpperCase(), + ), + new TextSpan( + text: assessment.selectedICD!.code.trim().toUpperCase() ?? "", ), ], ), ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .appointmentNo, - style: new TextStyle( - color: Color(0xFF575757), - ), - ), - new TextSpan( - text: assessment - .appointmentId.toString() - - ?? - "", + Container( + width: MediaQuery.of(context).size.width * 0.50, + child: RichText( + text: new TextSpan( style: new TextStyle( - fontSize: 14, - color: Color(0xFF2B353E), - ), + fontSize: 16, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: assessment.selectedICD!.description.toString(), + ), + ], ), - ], + ), ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .condition + - " : ", - style: new TextStyle( - color: Color(0xFF575757), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of(context).appointmentNo, + style: new TextStyle( + color: Color(0xFF575757), + ), ), - ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisCondition - .nameAr - : assessment - .selectedDiagnosisCondition - .nameEn, - style: new TextStyle( - fontSize: 14, - color: Color(0xFF2B353E), + new TextSpan( + text: assessment.appointmentId.toString() ?? "", + style: new TextStyle( + fontSize: 14, + color: Color(0xFF2B353E), + ), ), - ), - ], + ], + ), ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .dType + - ' : ', - style: new TextStyle( - color: Color(0xFF575757), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of(context).condition! + " : ", + style: new TextStyle( + color: Color(0xFF575757), + ), ), - ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisType - .nameAr - : assessment - .selectedDiagnosisType - .nameEn, - style: new TextStyle( - fontSize: 14, - color: Color(0xFF2B353E), + new TextSpan( + text: projectViewModel.isArabic + ? assessment.selectedDiagnosisCondition!.nameAr + : assessment.selectedDiagnosisCondition!.nameEn, + style: new TextStyle( + fontSize: 14, + color: Color(0xFF2B353E), + ), ), - ), - ], + ], + ), ), - ), - if (assessment.doctorName != null) RichText( text: new TextSpan( style: new TextStyle( fontSize: 12, color: Color(0xFF2E303A), fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), + fontWeight: FontWeight.w600), children: [ new TextSpan( - text: TranslationBase.of( - context) - .doc + - ' : ', + text: TranslationBase.of(context).dType! + ' : ', style: new TextStyle( color: Color(0xFF575757), ), ), new TextSpan( - text: - assessment.doctorName ?? - '', + text: projectViewModel.isArabic + ? assessment.selectedDiagnosisType!.nameAr + : assessment.selectedDiagnosisType!.nameEn, style: new TextStyle( fontSize: 14, color: Color(0xFF2B353E), @@ -335,203 +259,193 @@ class _UpdateAssessmentPageState extends State { ], ), ), - SizedBox( - height: 6, - ), - - Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - AppText( - (assessment.remark != null || - assessment.remark != - '') - ? TranslationBase.of( - context) - .remarks + - " : " - : '', - - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600 - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.38, - child: AppText( - assessment.remark ?? "", - fontSize: 11, - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, + if (assessment.doctorName != null) + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of(context).doc! + ' : ', + style: new TextStyle( + color: Color(0xFF575757), + ), + ), + new TextSpan( + text: assessment.doctorName ?? '', + style: new TextStyle( + fontSize: 14, + color: Color(0xFF2B353E), + ), + ), + ], ), ), - ], - ), - ], - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Row( - children: [ - Column( - children: [ - AppText( - assessment.createdOn != null - ? AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), - fontWeight: FontWeight - .w600, - fontSize: 14, - ), AppText( - assessment.createdOn != null - ? AppDateUtils.getHour( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight - .w600, - fontSize: 14, + SizedBox( + height: 6, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + AppText( + (assessment.remark != null || assessment.remark != '') + ? TranslationBase.of(context).remarks! + " : " + : '', + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + Container( + width: MediaQuery.of(context).size.width * 0.38, + child: AppText( + assessment.remark ?? "", + fontSize: 11, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, ), - ], + ), + ], + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Row( + children: [ + Column( + children: [ + AppText( + assessment.createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted( + DateTime.parse(assessment.createdOn ?? "")) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + assessment.createdOn != null + ? AppDateUtils.getHour( + DateTime.parse(assessment.createdOn ?? "")) + : AppDateUtils.getHour(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ], + ), + ], + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.05, + ), + InkWell( + onTap: () { + openAssessmentDialog(context, + isUpdate: true, assessment: assessment, model: model); + }, + child: Icon( + DoctorApp.edit, + size: 18, ), - ], - ), - SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.05, - ), - InkWell( - onTap: () { - openAssessmentDialog(context, - isUpdate: true, - assessment: assessment, - model: model); - }, - child: Icon( - DoctorApp.edit, size: 18,), - ) - ], - ), - ], - ), - ); - }).toList(), - ) - ], - ) - ]), - isExpanded: isAssessmentExpand, - ), - SizedBox( - height: 130, - ), - ], + ) + ], + ), + ], + ), + ); + }).toList(), + ) + ], + ) + ]), + isExpanded: isAssessmentExpand, + ), + SizedBox( + height: 130, + ), + ], + ), ), ), ), ), - ), - bottomSheet:Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all( - color: HexColor('#707070'), - width: 0), - ), - height: 80, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), ), - Container(child: - FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase - .of(context) - .previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - widget.changePageViewIndex(1); - }, - ) - , - ), - SizedBox(width: 5,), - Expanded( - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - if (widget.mySelectedAssessmentList.isEmpty) { - Helpers.showErrorToast( - TranslationBase - .of(context) - .assessmentErrorMsg); - } else { - widget.changePageViewIndex(3); - widget.changeLoadingState(true); - } - }, - ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: 80, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + widget.changePageViewIndex(1); + }, + ), + ), + SizedBox( + width: 5, + ), + Expanded( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + if (widget.mySelectedAssessmentList.isEmpty) { + Helpers.showErrorToast(TranslationBase.of(context).assessmentErrorMsg); + } else { + widget.changePageViewIndex(3); + widget.changeLoadingState(true); + } + }, + ), + ), + ], ), - ], + ), ), ), - ),), - SizedBox( - height: 5, - ), - ], - ),) - - ), + SizedBox( + height: 5, + ), + ], + ), + )), ); } openAssessmentDialog(BuildContext context, - {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { + {MySelectedAssessment? assessment, required bool isUpdate, required SOAPViewModel model}) { if (assessment == null) { - assessment = MySelectedAssessment( - remark: '', appointmentId: widget.patientInfo.appointmentNo); + assessment = MySelectedAssessment(remark: '', appointmentId: widget.patientInfo.appointmentNo); } showModalBottomSheet( backgroundColor: Colors.white, @@ -539,12 +453,11 @@ class _UpdateAssessmentPageState extends State { context: context, builder: (context) { return AddAssessmentDetails( - mySelectedAssessment: assessment, + mySelectedAssessment: assessment!, patientInfo: widget.patientInfo, isUpdate: isUpdate, mySelectedAssessmentList: widget.mySelectedAssessmentList, - addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, - bool isUpdate) async { + addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async { setState(() { widget.mySelectedAssessmentList.add(mySelectedAssessment); }); @@ -552,4 +465,3 @@ class _UpdateAssessmentPageState extends State { }); } } - diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index d98e17be..ddc6d10f 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -19,9 +19,7 @@ class AddExaminationPage extends StatefulWidget { final Function(MasterKeyModel) removeExamination; AddExaminationPage( - {this.mySelectedExamination, - this.addSelectedExamination, - this.removeExamination}); + {required this.mySelectedExamination, required this.addSelectedExamination, required this.removeExamination}); @override _AddExaminationPageState createState() => _AddExaminationPageState(); @@ -31,77 +29,74 @@ class _AddExaminationPageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) async { - if (model.physicalExaminationList.length == 0) { - await model.getMasterLookup(MasterKeysService.PhysicalExamination); - } - }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - backgroundColor: Color.fromRGBO(248, 248, 248, 1), - body: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - padding: - EdgeInsets.only(left: 16, top: 70, right: 16, bottom: 16), - color: Colors.white, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + onModelReady: (model) async { + if (model.physicalExaminationList.length == 0) { + await model.getMasterLookup(MasterKeysService.PhysicalExamination); + } + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + backgroundColor: Color.fromRGBO(248, 248, 248, 1), + body: Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).addExamination}", - fontSize: SizeConfig.textMultiplier * 3.3, - color: Colors.black, - fontWeight: FontWeight.w700, + Container( + padding: EdgeInsets.only(left: 16, top: 70, right: 16, bottom: 16), + color: Colors.white, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: AppText( + "${TranslationBase.of(context).addExamination}", + fontSize: SizeConfig.textMultiplier * 3.3, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + ), + InkWell( + onTap: () { + Navigator.of(context).pop(); + }, + child: Icon( + Icons.clear, + size: 40, + ), + ) + ], ), ), - InkWell( - onTap: () { - Navigator.of(context).pop(); - }, - child: Icon( - Icons.clear, - size: 40, - ), - ) - ], - ), - ), - Expanded( - child: SingleChildScrollView( - child: Column( - children: [ - Container( - margin: EdgeInsets.all(16.0), - padding: EdgeInsets.all(0.0), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.circular(12), - border: Border.fromBorderSide(BorderSide( - color: Colors.grey.shade400, - width: 0.4, - )), - ), + Expanded( + child: SingleChildScrollView( child: Column( children: [ - ExaminationsListSearchWidget( - masterList: model.physicalExaminationList, - isServiceSelected: (master) => - isServiceSelected(master), - removeHistory: (history) { - setState(() { - widget.removeExamination(history); - }); - }, - addHistory: (selectedExamination) { - setState(() { - widget.mySelectedExamination - .add(selectedExamination); + Container( + margin: EdgeInsets.all(16.0), + padding: EdgeInsets.all(0.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.fromBorderSide(BorderSide( + color: Colors.grey.shade400, + width: 0.4, + )), + ), + child: Column( + children: [ + ExaminationsListSearchWidget( + masterList: model.physicalExaminationList, + isServiceSelected: (master) => isServiceSelected(master), + removeHistory: (history) { + setState(() { + widget.removeExamination(history); + }); + }, + addHistory: (selectedExamination) { + setState(() { + widget.mySelectedExamination.add(selectedExamination); }); }, ), @@ -134,8 +129,7 @@ class _AddExaminationPageState extends State { widthFactor: .80, child: Center( child: AppButton( - title: - "${TranslationBase.of(context).addExamination}", + title: "${TranslationBase.of(context).addExamination}", padding: 10, color: Color(0xFF359846), onPressed: () { @@ -155,10 +149,8 @@ class _AddExaminationPageState extends State { } isServiceSelected(MasterKeyModel masterKey) { - Iterable exam = widget.mySelectedExamination.where( - (element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); + Iterable exam = widget.mySelectedExamination.where((element) => + masterKey.id == element.selectedExamination?.id && masterKey.typeId == element.selectedExamination?.typeId); if (exam.length > 0) { return true; } diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index e990be79..17ce9c8c 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -21,12 +21,12 @@ class AddExaminationWidget extends StatefulWidget { final Function expandClick; AddExaminationWidget({ - this.item, - this.removeHistory, - this.addHistory, - this.isServiceSelected, - this.isExpand, - this.expandClick, + required this.item, + required this.removeHistory, + required this.addHistory, + required this.isServiceSelected, + required this.isExpand, + required this.expandClick, }); @override @@ -89,10 +89,8 @@ class _AddExaminationWidgetState extends State { Container( margin: EdgeInsets.symmetric(horizontal: 8), child: InkWell( - onTap: widget.expandClick, - child: Icon(widget.isExpand - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down)), + onTap: widget.expandClick(), + child: Icon(widget.isExpand ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), ), ], ), @@ -136,9 +134,7 @@ class _AddExaminationWidgetState extends State { ), child: Container( decoration: BoxDecoration( - color: status == 1 - ? HexColor("#D02127") - : Colors.white, + color: status == 1 ? HexColor("#D02127") : Colors.white, shape: BoxShape.circle, ), ), @@ -176,9 +172,7 @@ class _AddExaminationWidgetState extends State { ), child: Container( decoration: BoxDecoration( - color: status == 2 - ? HexColor("#D02127") - : Colors.white, + color: status == 2 ? HexColor("#D02127") : Colors.white, shape: BoxShape.circle, ), ), @@ -216,9 +210,7 @@ class _AddExaminationWidgetState extends State { ), child: Container( decoration: BoxDecoration( - color: status == 3 - ? HexColor("#D02127") - : Colors.white, + color: status == 3 ? HexColor("#D02127") : Colors.white, shape: BoxShape.circle, ), ), diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index d40faea5..8094fa2f 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -29,11 +29,10 @@ class ExaminationItemCard extends StatelessWidget { child: Container( child: AppText( projectViewModel.isArabic - ? examination.selectedExamination.nameAr != null && - examination.selectedExamination.nameAr != "" - ? examination.selectedExamination.nameAr - : examination.selectedExamination.nameEn - : examination.selectedExamination.nameEn, + ? examination.selectedExamination!.nameAr != null && examination.selectedExamination!.nameAr != "" + ? examination.selectedExamination!.nameAr + : examination.selectedExamination!.nameEn + : examination.selectedExamination!.nameEn, fontWeight: FontWeight.w600, fontFamily: 'Poppins', color: Color(0xFF2B353E), @@ -50,7 +49,7 @@ class ExaminationItemCard extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 1.8, ), InkWell( - onTap: removeExamination, + onTap: removeExamination(), child: Icon( Icons.clear, size: 20, @@ -62,15 +61,15 @@ class ExaminationItemCard extends StatelessWidget { ], ), AppText( - !examination.isNormal - ? examination.isAbnormal + !examination.isNormal! + ? examination.isAbnormal! ? TranslationBase.of(context).abnormal : TranslationBase.of(context).notExamined : TranslationBase.of(context).normal, fontWeight: FontWeight.bold, fontFamily: 'Poppins', - color: !examination.isNormal - ? examination.isAbnormal + color: !examination.isNormal! + ? examination.isAbnormal! ? Colors.red.shade800 : Colors.grey.shade800 : Colors.green.shade800, diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index 36b65d4c..f6b1d379 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -14,20 +14,18 @@ class ExaminationsListSearchWidget extends StatefulWidget { final List masterList; ExaminationsListSearchWidget( - {this.removeHistory, - this.addHistory, - this.isServiceSelected, - this.masterList}); + {required this.removeHistory, + required this.addHistory, + required this.isServiceSelected, + required this.masterList}); @override - _ExaminationsListSearchWidgetState createState() => - _ExaminationsListSearchWidgetState(); + _ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState(); } -class _ExaminationsListSearchWidgetState - extends State { +class _ExaminationsListSearchWidgetState extends State { int expandedIndex = -1; - List items = List(); + List items = []; TextEditingController filteredSearchController = TextEditingController(); @override @@ -50,10 +48,11 @@ class _ExaminationsListSearchWidgetState filterSearchResults(value); }, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( - Icons.search, - color: Colors.black, - )), + Icons.search, + color: Colors.black, + )), ), DividerWithSpacesAround( height: 2, @@ -81,13 +80,13 @@ class _ExaminationsListSearchWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || - item.nameEn.toLowerCase().contains(query.toLowerCase())) { + if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || + item.nameEn!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 8fdfffc2..3dd28b01 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -32,11 +32,12 @@ class UpdateObjectivePage extends StatefulWidget { final PatiantInformtion patientInfo; UpdateObjectivePage( - {Key key, - this.changePageViewIndex, - this.mySelectedExamination, - this.patientInfo, - this.changeLoadingState, this.currentIndex}); + {Key? key, + required this.changePageViewIndex, + required this.mySelectedExamination, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); @@ -45,8 +46,7 @@ class UpdateObjectivePage extends StatefulWidget { class _UpdateObjectivePageState extends State { bool isSysExaminationExpand = false; - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -61,98 +61,89 @@ class _UpdateObjectivePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) async { - widget.mySelectedExamination.clear(); - GetPhysicalExamReqModel getPhysicalExamReqModel = - GetPhysicalExamReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo); + onModelReady: (model) async { + widget.mySelectedExamination.clear(); + GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + appointmentNo: widget.patientInfo.appointmentNo); - await model.getPatientPhysicalExam(getPhysicalExamReqModel); - if (model.patientPhysicalExamList.isNotEmpty) { - if (model.physicalExaminationList.length == 0) { - await model - .getMasterLookup(MasterKeysService.PhysicalExamination); - } - model.patientPhysicalExamList.forEach((element) { - MasterKeyModel examMaster = model.getOneMasterKey( - masterKeys: MasterKeysService.PhysicalExamination, - id: element.examId, - ); - MySelectedExamination tempEam = MySelectedExamination( - selectedExamination: examMaster, - remark: element.remarks, - isNormal: element.isNormal, - createdBy: element.createdBy, - notExamined: element.notExamined, - isNew: element.isNew, - isAbnormal: element.isAbnormal); - widget.mySelectedExamination.add(tempEam); - }); + await model.getPatientPhysicalExam(getPhysicalExamReqModel); + if (model.patientPhysicalExamList.isNotEmpty) { + if (model.physicalExaminationList.length == 0) { + await model.getMasterLookup(MasterKeysService.PhysicalExamination); } + model.patientPhysicalExamList.forEach((element) { + MasterKeyModel? examMaster = model.getOneMasterKey( + masterKeys: MasterKeysService.PhysicalExamination, + id: element.examId!, + ); + MySelectedExamination tempEam = MySelectedExamination( + selectedExamination: examMaster, + remark: element.remarks, + isNormal: element.isNormal, + createdBy: element.createdBy, + notExamined: element.notExamined, + isNew: element.isNew, + isAbnormal: element.isAbnormal); + widget.mySelectedExamination.add(tempEam); + }); + } - widget.changeLoadingState(false); - }, - builder: (_, model, w) => AppScaffold( + widget.changeLoadingState(false); + }, + builder: (_, model, w) => AppScaffold( isShowAppBar: false, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SOAPStepHeader( - currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex), - ExpandableSOAPWidget( - headerTitle: - TranslationBase.of(context).physicalSystemExamination, - onTap: () { - setState(() { - isSysExaminationExpand = !isSysExaminationExpand; - }); - }, - child: Column( - children: [ - SOAPOpenItems(label: "${TranslationBase.of(context).addExamination}",onTap: () { - openExaminationList(context); - },), - Column( - children: - widget.mySelectedExamination.map((examination) { - return ExaminationItemCard(examination, () { - removeExamination( - examination.selectedExamination); - }); - }).toList(), - ) - ], - + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).physicalSystemExamination, + onTap: () { + setState(() { + isSysExaminationExpand = !isSysExaminationExpand; + }); + }, + child: Column( + children: [ + SOAPOpenItems( + label: "${TranslationBase.of(context).addExamination}", + onTap: () { + openExaminationList(context); + }, + ), + Column( + children: widget.mySelectedExamination.map((examination) { + return ExaminationItemCard(examination, () { + removeExamination(examination.selectedExamination!); + }); + }).toList(), + ) + ], + ), + isExpanded: isSysExaminationExpand, ), - isExpanded: isSysExaminationExpand, - ), - SizedBox(height: MediaQuery - .of(context) - .size - .height * 0.12,) - ], + SizedBox( + height: MediaQuery.of(context).size.height * 0.12, + ) + ], + ), ), ), ), - ), - bottomSheet: - Container( + bottomSheet: Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(0.0), ), - border: Border.all( - color: HexColor('#707070'), - width: 0), + border: Border.all(color: HexColor('#707070'), width: 0), ), height: 80, width: double.infinity, @@ -161,50 +152,48 @@ class _UpdateObjectivePageState extends State { SizedBox( height: 10, ), - Container(child: - FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase.of(context).previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - onPressed: () { - widget.changePageViewIndex(0); - }, - ) - , - ), - SizedBox(width: 5,), - Expanded( - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - await submitUpdateObjectivePage(model); - }, + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + onPressed: () { + widget.changePageViewIndex(0); + }, + ), ), - ), - ], + SizedBox( + width: 5, + ), + Expanded( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + await submitUpdateObjectivePage(model); + }, + ), + ), + ], + ), ), ), - ),), + ), SizedBox( height: 5, ), ], - ),) - - - ), + ), + )), ); } @@ -213,40 +202,36 @@ class _UpdateObjectivePageState extends State { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - PostPhysicalExamRequestModel postPhysicalExamRequestModel = - new PostPhysicalExamRequestModel(); + PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); widget.mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == - null) - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = - []; + if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM - .add(ListHisProgNotePhysicalExaminationVM( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: exam.remark ?? '', - createdBy: exam.createdBy ?? doctorProfile.doctorID, - createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination.id, - examType: exam.selectedExamination.typeId, - isAbnormal: exam.isAbnormal, - isNormal: exam.isNormal, - notExamined: exam.notExamined, - examinationType: exam.isNormal - ? 1 - : exam.isAbnormal - ? 2 - : 3, - examinationTypeName: exam.isNormal - ? "Normal" - : exam.isAbnormal - ? 'AbNormal' - : "Not Examined", - isNew: exam.isNew)); + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!.add(ListHisProgNotePhysicalExaminationVM( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: exam.remark ?? '', + createdBy: exam.createdBy ?? doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + examId: exam.selectedExamination!.id, + examType: exam.selectedExamination!.typeId, + isAbnormal: exam.isAbnormal, + isNormal: exam.isNormal, + notExamined: exam.notExamined, + examinationType: exam.isNormal! + ? 1 + : exam.isAbnormal! + ? 2 + : 3, + examinationTypeName: exam.isNormal! + ? "Normal" + : exam.isAbnormal! + ? 'AbNormal' + : "Not Examined", + isNew: exam.isNew)); }); if (model.patientPhysicalExamList.isEmpty) { @@ -268,10 +253,8 @@ class _UpdateObjectivePageState extends State { } removeExamination(MasterKeyModel masterKey) { - Iterable history = widget.mySelectedExamination - .where((element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); + Iterable history = widget.mySelectedExamination.where((element) => + masterKey.id == element.selectedExamination?.id && masterKey.typeId == element.selectedExamination?.typeId); if (history.length > 0) setState(() { @@ -317,10 +300,10 @@ class AddExaminationDailog extends StatefulWidget { final Function(MasterKeyModel) removeExamination; const AddExaminationDailog( - {Key key, - this.mySelectedExamination, - this.addSelectedExamination, - this.removeExamination}) + {Key? key, + required this.mySelectedExamination, + required this.addSelectedExamination, + required this.removeExamination}) : super(key: key); @override @@ -335,8 +318,7 @@ class _AddExaminationDailogState extends State { child: BaseView( onModelReady: (model) async { if (model.physicalExaminationList.length == 0) { - await model - .getMasterLookup(MasterKeysService.PhysicalExamination); + await model.getMasterLookup(MasterKeysService.PhysicalExamination); } }, builder: (_, model, w) => AppScaffold( @@ -346,21 +328,19 @@ class _AddExaminationDailogState extends State { child: Container( child: FractionallySizedBox( widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).physicalSystemExamination, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - ]), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).physicalSystemExamination, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + ]), ))), )), ); diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 87ea1e4d..702752db 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -30,12 +30,12 @@ class UpdatePlanPage extends StatefulWidget { GetPatientProgressNoteResModel patientProgressNote; UpdatePlanPage( - {Key key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.patientProgressNote, - this.currentIndex}); + {Key? key, + required this.changePageViewIndex, + required this.patientInfo, + required this.changeLoadingState, + required this.patientProgressNote, + required this.currentIndex}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); @@ -45,11 +45,9 @@ class _UpdatePlanPageState extends State { bool isAddProgress = true; bool isProgressExpanded = true; - TextEditingController progressNoteController = - TextEditingController(text: null); + TextEditingController progressNoteController = TextEditingController(text: null); - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -64,33 +62,32 @@ class _UpdatePlanPageState extends State { @override void initState() { super.initState(); - if(widget.patientProgressNote.planNote !=null ){ + if (widget.patientProgressNote.planNote != null) { setState(() { isAddProgress = false; }); } } - @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - GetGetProgressNoteReqModel getGetProgressNoteReqModel = - GetGetProgressNoteReqModel( - appointmentNo: widget.patientInfo.appointmentNo, - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); + GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( + appointmentNo: widget.patientInfo.appointmentNo, + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); await model.getPatientProgressNote(getGetProgressNoteReqModel); if (model.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Helpers - .parseHtmlString(model.patientProgressNoteList[0].planNote); - widget.patientProgressNote.planNote = progressNoteController.text; - widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; - widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; - widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; - widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; + progressNoteController.text = Helpers.parseHtmlString(model.patientProgressNoteList[0].planNote ?? ""); + widget.patientProgressNote.planNote = progressNoteController.text; + widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; + widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; + widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; + widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; setState(() { isAddProgress = false; }); @@ -98,267 +95,254 @@ class _UpdatePlanPageState extends State { widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - backgroundColor: Theme - .of(context) - .scaffoldBackgroundColor, - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.90, - child: Column( - children: [ - SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), - - SizedBox(height: 10,), - - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).progressNote - , - onTap: () { - setState(() { - isProgressExpanded = !isProgressExpanded; - }); - }, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if(isAddProgress) - Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), - - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).progressNote, - controller: progressNoteController, - minLines: 2, - maxLines: 4, - inputType: TextInputType.multiline, - onChanged: (value){ - widget.patientProgressNote.planNote = value; - }, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.90, + child: Column( + children: [ + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), + SizedBox( + height: 10, + ), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).progressNote, + onTap: () { + setState(() { + isProgressExpanded = !isProgressExpanded; + }); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (isAddProgress) + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).progressNote, + controller: progressNoteController, + minLines: 2, + maxLines: 4, + inputType: TextInputType.multiline, + onChanged: (value) { + widget.patientProgressNote.planNote = value; + }, + ), ), + SizedBox( + height: 9, ), - SizedBox( - height: 9, - ), - if ( widget.patientProgressNote.planNote != null&& !isAddProgress) - Container( - margin: - EdgeInsets.only(left: 5, right: 5, ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - - - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText('Appointment No: ',fontSize: 12,), - AppText(widget.patientProgressNote.appointmentNo??'',fontWeight: FontWeight.w600,), - - ], - ), - AppText( - widget.patientProgressNote.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), - fontWeight: FontWeight - .w600, - fontSize: 14, - ) - - ], - ), - Row( - - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText('Condition: ', - fontSize: 12,), - AppText( - widget.patientProgressNote.mName??'',fontWeight: FontWeight.w600), - ], - ), - AppText( - widget.patientProgressNote.createdOn !=null?AppDateUtils.getHour(DateTime.parse(widget.patientProgressNote.createdOn)):AppDateUtils.getHour(DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ) - ], - ), - SizedBox(height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - progressNoteController.text, - fontSize: 10, + if (widget.patientProgressNote.planNote != null && !isAddProgress) + Container( + margin: EdgeInsets.only( + left: 5, + right: 5, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + 'Appointment No: ', + fontSize: 12, + ), + AppText( + widget.patientProgressNote.appointmentNo.toString(), + fontWeight: FontWeight.w600, + ), + ], ), - ), - InkWell( - onTap: (){ - setState(() { - isAddProgress = true; - widget.changePageViewIndex(3,isChangeState:false); - }); - }, - child: Icon(DoctorApp.edit,size: 18,)) - ], - ), - ], - ), - ) - ], - ), - - ], + AppText( + widget.patientProgressNote.createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted( + DateTime.parse(widget.patientProgressNote.createdOn ?? "")) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + 'Condition: ', + fontSize: 12, + ), + AppText(widget.patientProgressNote.mName ?? '', + fontWeight: FontWeight.w600), + ], + ), + AppText( + widget.patientProgressNote.createdOn != null + ? AppDateUtils.getHour( + DateTime.parse(widget.patientProgressNote.createdOn ?? "")) + : AppDateUtils.getHour(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: AppText( + progressNoteController.text, + fontSize: 10, + ), + ), + InkWell( + onTap: () { + setState(() { + isAddProgress = true; + widget.changePageViewIndex(3, isChangeState: false); + }); + }, + child: Icon( + DoctorApp.edit, + size: 18, + )) + ], + ), + ], + ), + ) + ], + ), + ], + ), + isExpanded: isProgressExpanded, ), - isExpanded: isProgressExpanded, - ), - - ], + ], + ), ), ), ), - ), - bottomSheet: - Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all( - color: HexColor('#707070'), - width: 0), - ), - height: 80, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container(child: - FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase - .of(context) - .previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - widget.changePageViewIndex(2); - }, - ) - , - ), - SizedBox(width: 5,), - Expanded( - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - loading: model.state == ViewState.BusyLocal, - disabled: progressNoteController.text.isEmpty, - onPressed: () async { - if (progressNoteController.text.isNotEmpty) { - if (isAddProgress) { - Map profile = - await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); - setState(() { - widget.patientProgressNote.createdByName = - widget.patientProgressNote - .createdByName ?? - doctorProfile.doctorName; - widget.patientProgressNote.editedByName = - doctorProfile.doctorName; - widget.patientProgressNote.createdOn = - DateTime.now().toString(); - widget.patientProgressNote.planNote = - progressNoteController.text; - isAddProgress = !isAddProgress; - }); - submitPlan(model); - } else { - Navigator.of(context).pop(); - } - } else { - Helpers.showErrorToast(TranslationBase.of(context) - .progressNoteErrorMsg); - } - }, - ), - ), - ], - ), - ), - ),), - SizedBox( - height: 5, - ), - ], - ),) - - ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: 80, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + widget.changePageViewIndex(2); + }, + ), + ), + SizedBox( + width: 5, + ), + Expanded( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + loading: model.state == ViewState.BusyLocal, + disabled: progressNoteController.text.isEmpty, + onPressed: () async { + if (progressNoteController.text.isNotEmpty) { + if (isAddProgress) { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + setState(() { + widget.patientProgressNote.createdByName = + widget.patientProgressNote.createdByName ?? doctorProfile.doctorName; + widget.patientProgressNote.editedByName = doctorProfile.doctorName; + widget.patientProgressNote.createdOn = DateTime.now().toString(); + widget.patientProgressNote.planNote = progressNoteController.text; + isAddProgress = !isAddProgress; + }); + submitPlan(model); + } else { + Navigator.of(context).pop(); + } + } else { + Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); + } + }, + ), + ), + ], + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + )), ); } - submitPlan(SOAPViewModel model) async { + submitPlan(SOAPViewModel model) async { if (progressNoteController.text.isNotEmpty) { PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, - planNote: widget.patientProgressNote.planNote, doctorID: '', editedBy: ''); + planNote: widget.patientProgressNote.planNote, + doctorID: '', + editedBy: ''); - if(model.patientProgressNoteList.isEmpty){ + if (model.patientProgressNoteList.isEmpty) { await model.postProgressNote(postProgressNoteRequestModel); - - }else { + } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - postProgressNoteRequestModel.editedBy =doctorProfile.doctorID; + postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; await model.patchProgressNote(postProgressNoteRequestModel); - } if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } else { - widget.changePageViewIndex(4,isChangeState:false); + widget.changePageViewIndex(4, isChangeState: false); } } else { Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); } } - - } diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart index 31a501ce..2e185819 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart @@ -6,46 +6,42 @@ class SOAPOpenItems extends StatelessWidget { final Function onTap; final String label; - const SOAPOpenItems({Key key, this.onTap, this.label}) : super(key: key); + const SOAPOpenItems({Key? key, required this.onTap, required this.label}) : super(key: key); @override Widget build(BuildContext context) { - return InkWell( - onTap: onTap, + return InkWell( + onTap: onTap(), child: Container( - padding: EdgeInsets.symmetric( - vertical: 8, horizontal: 8.0), + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8.0), margin: EdgeInsets.symmetric(vertical: 8), decoration: BoxDecoration( - border: Border.all( - color: Colors.grey.shade400, width: 0.5), + border: Border.all(color: Colors.grey.shade400, width: 0.5), borderRadius: BorderRadius.all( Radius.circular(8), ), color: Colors.white, ), child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - "$label", - fontSize:15, - color: Colors.black, - fontWeight: FontWeight.w600, - ), - AppText( - "${TranslationBase.of(context).searchHere}", - fontSize:13, - color: Colors.grey.shade700, - ), - ], - )), + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "$label", + fontSize: 15, + color: Colors.black, + fontWeight: FontWeight.w600, + ), + AppText( + "${TranslationBase.of(context).searchHere}", + fontSize: 13, + color: Colors.grey.shade700, + ), + ], + )), Icon( Icons.add_box_rounded, size: 25, @@ -56,6 +52,3 @@ class SOAPOpenItems extends StatelessWidget { ); } } - - - diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index 85614b6d..dbe7368d 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -5,8 +5,9 @@ import 'package:flutter/material.dart'; class SOAPStepHeader extends StatelessWidget { const SOAPStepHeader({ - Key key, - this.currentIndex, this.changePageViewIndex, + Key? key, + required this.currentIndex, + required this.changePageViewIndex, }) : super(key: key); final int currentIndex; @@ -18,13 +19,16 @@ class SOAPStepHeader extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox(height: 15,), + SizedBox( + height: 15, + ), AppText( TranslationBase.of(context).createNew, fontSize: 14, fontWeight: FontWeight.w500, ), - AppText(TranslationBase.of(context).episode, + AppText( + TranslationBase.of(context).episode, fontSize: 26, fontWeight: FontWeight.bold, ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart index 8f5ecf93..4d05dd74 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart @@ -3,37 +3,32 @@ import 'package:flutter/material.dart'; class BottomSheetTitle extends StatelessWidget { const BottomSheetTitle({ - Key key, this.title, + Key? key, + required this.title, }) : super(key: key); final String title; @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, ), height: 115, child: Container( - padding: EdgeInsets.only( - left: 10, right: 10), + padding: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(top: 60), child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ RichText( text: TextSpan( - style: TextStyle( - fontSize:20, - color: Colors.black), + style: TextStyle(fontSize: 20, color: Colors.black), children: [ new TextSpan( - text: title, style: TextStyle( color: Color(0xFF2B353E), @@ -47,9 +42,7 @@ class BottomSheetTitle extends StatelessWidget { onTap: () { Navigator.pop(context); }, - child: Icon(DoctorApp.close_1, - size:20, - color: Color(0xFF2B353E))) + child: Icon(DoctorApp.close_1, size: 20, color: Color(0xFF2B353E))) ], ), ], diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index d4666428..7205bfba 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -13,7 +13,12 @@ class ExpandableSOAPWidget extends StatelessWidget { final bool isRequired; const ExpandableSOAPWidget( - {Key key, this.isExpanded, this.child, this.onTap, this.headerTitle, this.isRequired= true}) + {Key? key, + required this.isExpanded, + required this.child, + required this.onTap, + this.headerTitle, + this.isRequired = true}) : super(key: key); @override @@ -25,36 +30,30 @@ class ExpandableSOAPWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: HexColor('#707070'), - width: 0.30), + border: Border.all(color: HexColor('#707070'), width: 0.30), ), child: HeaderBodyExpandableNotifier( - headerWidget: InkWell( - onTap: onTap, + headerWidget: InkWell( + onTap: onTap(), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ InkWell( - onTap: onTap, + onTap: onTap(), child: Row( children: [ - AppText(headerTitle, - variant: isExpanded ? "bodyText" : '', - fontSize: 15, - color: Colors.black), - if(isRequired) - Icon( - FontAwesomeIcons.asterisk, - size: 12, - ) + AppText(headerTitle, variant: isExpanded ? "bodyText" : '', fontSize: 15, color: Colors.black), + if (isRequired) + Icon( + FontAwesomeIcons.asterisk, + size: 12, + ) ], ), ), InkWell( - onTap: onTap, - child: Icon( - isExpanded ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline), + onTap: onTap(), + child: Icon(isExpanded ? EvaIcons.arrowIosUpwardOutline : EvaIcons.arrowIosDownwardOutline), ) ], ), @@ -64,4 +63,4 @@ class ExpandableSOAPWidget extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart index c5c2e8ca..351af5ca 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart @@ -11,7 +11,7 @@ class StepsWidget extends StatelessWidget { final Function changeCurrentTab; final double height; - StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0}); + StepsWidget({Key? key, required this.index, required this.changeCurrentTab, this.height = 0.0}); @override Widget build(BuildContext context) { @@ -25,21 +25,18 @@ class StepsWidget extends StatelessWidget { color: Colors.transparent, ), Positioned( - top: 30 - , + top: 30, child: Center( child: Container( - width: MediaQuery - .of(context) - .size - .width * 0.9, + width: MediaQuery.of(context).size.width * 0.9, child: Divider( color: Colors.grey, height: 0.75, thickness: 0.75, ), ), - ),), + ), + ), Positioned( top: 10, left: 0, @@ -56,8 +53,7 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 0 ? null - : Border.all( - color: Colors.black, width: 0.75), + : Border.all(color: Colors.black, width: 0.75), shape: BoxShape.circle, color: index == 0 ? Color(0xFFCC9B14) @@ -93,10 +89,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - left: MediaQuery - .of(context) - .size - .width * 0.25, + left: MediaQuery.of(context).size.width * 0.25, child: InkWell( onTap: () => index >= 1 ? changeCurrentTab(1) : null, child: Column( @@ -110,8 +103,7 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + : Border.all(color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 1 ? Color(0xFFCC9B14) @@ -149,10 +141,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - left: MediaQuery - .of(context) - .size - .width * 0.50, + left: MediaQuery.of(context).size.width * 0.50, child: InkWell( onTap: () { if (index >= 3) changeCurrentTab(2); @@ -168,8 +157,7 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + : Border.all(color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 2 ? Color(0xFFCC9B14) @@ -221,8 +209,7 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 3 ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + : Border.all(color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 3 ? Color(0xFFCC9B14) @@ -232,10 +219,10 @@ class StepsWidget extends StatelessWidget { ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( height: 5, @@ -268,21 +255,18 @@ class StepsWidget extends StatelessWidget { color: Colors.transparent, ), Positioned( - top: 30 - , + top: 30, child: Center( child: Container( - width: MediaQuery - .of(context) - .size - .width * 0.9, + width: MediaQuery.of(context).size.width * 0.9, child: Divider( color: Colors.grey, height: 0.75, thickness: 0.75, ), ), - ),), + ), + ), Positioned( top: 10, right: 0, @@ -299,21 +283,20 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 0 ? null - : Border.all( - color: Colors.black, width: 0.75), + : Border.all(color: Colors.black, width: 0.75), shape: BoxShape.circle, color: index == 0 ? Color(0xFFCC9B14) : index > 0 ? Color(0xFF359846) - : Color(0xFFCCCCCC), + : Color(0xFFCCCCCC), ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox(height: 3), Column( @@ -335,10 +318,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - right: MediaQuery - .of(context) - .size - .width * 0.28, + right: MediaQuery.of(context).size.width * 0.28, child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( @@ -352,21 +332,20 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + : Border.all(color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 1 ? Color(0xFFCC9B14) : index > 1 ? Color(0xFF359846) - : Color(0xFFCCCCCC), + : Color(0xFFCCCCCC), ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox(height: 5), Column( @@ -388,10 +367,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - right: MediaQuery - .of(context) - .size - .width * 0.52, + right: MediaQuery.of(context).size.width * 0.52, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Column( @@ -405,8 +381,7 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + : Border.all(color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 2 ? Color(0xFFCC9B14) @@ -460,8 +435,7 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 3 ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + : Border.all(color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 3 ? Color(0xFFCC9B14) @@ -506,9 +480,9 @@ class StepsWidget extends StatelessWidget { class StatusLabel extends StatelessWidget { const StatusLabel({ - Key key, - this.stepId, - this.selectedStepId, + Key? key, + required this.stepId, + required this.selectedStepId, }) : super(key: key); final int stepId; diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index fc7329e5..766f4ad1 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -19,20 +19,19 @@ class AddAllergies extends StatefulWidget { final Function addAllergiesFun; final List myAllergiesList; - const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) - : super(key: key); + const AddAllergies({Key? key, required this.addAllergiesFun, required this.myAllergiesList}) : super(key: key); @override _AddAllergiesState createState() => _AddAllergiesState(); } class _AddAllergiesState extends State { - List allergiesList; - List allergySeverityList; + late List allergiesList; + late List allergySeverityList; TextEditingController remarkController = TextEditingController(); TextEditingController severityController = TextEditingController(); TextEditingController allergyController = TextEditingController(); - List myAllergiesListLocal; + late List myAllergiesListLocal; @override initState() { @@ -43,9 +42,7 @@ class _AddAllergiesState extends State { GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon}) { return InputDecoration( contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), focusedBorder: OutlineInputBorder( @@ -62,10 +59,7 @@ class _AddAllergiesState extends State { ), hintText: selectedText != null ? selectedText : hintText, suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 10, - color: Theme.of(context).hintColor, - fontWeight: FontWeight.w700), + hintStyle: TextStyle(fontSize: 10, color: Theme.of(context).hintColor, fontWeight: FontWeight.w700), ); } @@ -83,105 +77,99 @@ class _AddAllergiesState extends State { } }, builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Center( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - BottomSheetTitle( - title: TranslationBase.of(context).addAllergies, - ), - SizedBox( - height: 10, - ), - SizedBox( - height: 16, - ), - Expanded( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Center( - child: NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchAllergiesWidget( - model: model, - masterList: model.allergiesList, - removeAllergy: (master) { - setState(() { - removeAllergyFromLocalList(master); - }); - }, - addAllergy: - (MySelectedAllergy mySelectedAllergy) { - addAllergyLocally(mySelectedAllergy); - }, - addSelectedAllergy: () => widget - .addAllergiesFun(myAllergiesListLocal), - isServiceSelected: (master) => - isServiceSelected(master), - getServiceSelectedAllergy: (master) => - getSelectedAllergy(master), - ), - ), - ), + baseViewModel: model, + isShowAppBar: false, + body: Center( + child: Container( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + BottomSheetTitle( + title: TranslationBase.of(context).addAllergies ?? "", + ), + SizedBox( + height: 10, + ), + SizedBox( + height: 16, + ), + Expanded( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Center( + child: NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchAllergiesWidget( + model: model, + masterList: model.allergiesList, + removeAllergy: (master) { + setState(() { + removeAllergyFromLocalList(master); + }); + }, + addAllergy: (MySelectedAllergy mySelectedAllergy) { + addAllergyLocally(mySelectedAllergy); + }, + addSelectedAllergy: () => widget.addAllergiesFun(myAllergiesListLocal), + isServiceSelected: (master) => isServiceSelected(master), + getServiceSelectedAllergy: (master) => getSelectedAllergy(master)!, ), ), ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.11, - ), - ]), - ), - ),bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), + ), + ), + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.11, + ), + ]), ), - border: Border.all(color: HexColor('#707070'), width: 0), ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: - TranslationBase.of(context).addAllergies, - padding: 10, - color: Color(0xFF359846), - onPressed: () { - widget.addAllergiesFun(myAllergiesListLocal); - }, + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase.of(context).addAllergies, + padding: 10, + color: Color(0xFF359846), + onPressed: () { + widget.addAllergiesFun(myAllergiesListLocal); + }, + ), ), ), ), - ), - SizedBox( - height: 5, - ), - ], + SizedBox( + height: 5, + ), + ], + ), ), - ),), + ), ), ); } isServiceSelected(MasterKeyModel masterKey) { - Iterable allergy = myAllergiesListLocal.where( - (element) => - masterKey.id == element.selectedAllergy.id && - masterKey.typeId == element.selectedAllergy.typeId && - element.isChecked); + Iterable allergy = myAllergiesListLocal.where((element) => + masterKey.id == element.selectedAllergy!.id && + masterKey.typeId == element.selectedAllergy!.typeId && + element.isChecked!); if (allergy.length > 0) { return true; } @@ -189,16 +177,14 @@ class _AddAllergiesState extends State { } removeAllergyFromLocalList(MasterKeyModel masterKey) { - myAllergiesListLocal - .removeWhere((element) => element.selectedAllergy.id == masterKey.id); + myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id); } - MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) { - Iterable allergy = myAllergiesListLocal.where( - (element) => - masterKey.id == element.selectedAllergy.id && - masterKey.typeId == element.selectedAllergy.typeId && - element.isChecked); + MySelectedAllergy? getSelectedAllergy(MasterKeyModel masterKey) { + Iterable allergy = myAllergiesListLocal.where((element) => + masterKey.id == element.selectedAllergy!.id && + masterKey.typeId == element.selectedAllergy!.typeId && + element.isChecked!); if (allergy.length > 0) { return allergy.first; } @@ -207,25 +193,20 @@ class _AddAllergiesState extends State { addAllergyLocally(MySelectedAllergy mySelectedAllergy) { if (mySelectedAllergy.selectedAllergy == null) { - Helpers.showErrorToast(TranslationBase - .of(context) - .requiredMsg); + Helpers.showErrorToast(TranslationBase.of(context).requiredMsg); } else { setState(() { List allergy = - // ignore: missing_return - myAllergiesListLocal - .where((element) => - mySelectedAllergy.selectedAllergy.id == - element.selectedAllergy.id) + // ignore: missing_return + myAllergiesListLocal + .where((element) => mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id) .toList(); if (allergy.isEmpty) { myAllergiesListLocal.add(mySelectedAllergy); } else { allergy.first.selectedAllergy = mySelectedAllergy.selectedAllergy; - allergy.first.selectedAllergySeverity = - mySelectedAllergy.selectedAllergySeverity; + allergy.first.selectedAllergySeverity = mySelectedAllergy.selectedAllergySeverity; allergy.first.remark = mySelectedAllergy.remark; allergy.first.isChecked = mySelectedAllergy.isChecked; } diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index 6f7439e6..3254cfdd 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -14,9 +14,9 @@ import 'add_allergies.dart'; // ignore: must_be_immutable class UpdateAllergiesWidget extends StatefulWidget { - List myAllergiesList; + List myAllergiesList; - UpdateAllergiesWidget({Key key, this.myAllergiesList}); + UpdateAllergiesWidget({Key? key, required this.myAllergiesList}); @override _UpdateAllergiesWidgetState createState() => _UpdateAllergiesWidgetState(); @@ -27,30 +27,28 @@ class _UpdateAllergiesWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); changeAllState() { - setState(() { - - }); + setState(() {}); } return Column( children: [ - - - SOAPOpenItems(label: "${TranslationBase.of(context).addAllergies}",onTap: () { - openAllergiesList(context, changeAllState); - },), + SOAPOpenItems( + label: "${TranslationBase.of(context).addAllergies}", + onTap: () { + openAllergiesList(context, changeAllState); + }, + ), SizedBox( height: 20, ), Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 15), + margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( children: widget.myAllergiesList.map((selectedAllergy) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -64,45 +62,33 @@ class _UpdateAllergiesWidgetState extends State { children: [ AppText( projectViewModel.isArabic - ? selectedAllergy.selectedAllergy.nameAr - : selectedAllergy.selectedAllergy.nameEn - .toUpperCase(), - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, + ? selectedAllergy.selectedAllergy!.nameAr + : selectedAllergy.selectedAllergy!.nameEn!.toUpperCase(), + textDecoration: selectedAllergy.isChecked! ? null : TextDecoration.lineThrough, bold: true, color: Color(0xFF2B353E)), AppText( projectViewModel.isArabic - ? selectedAllergy.selectedAllergySeverity - .nameAr - : selectedAllergy.selectedAllergySeverity - .nameEn - .toUpperCase(), - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, + ? selectedAllergy.selectedAllergySeverity!.nameAr + : selectedAllergy.selectedAllergySeverity!.nameEn!.toUpperCase(), + textDecoration: selectedAllergy.isChecked! ? null : TextDecoration.lineThrough, color: Color(0xFFCC9B14)), ], ), - width: MediaQuery - .of(context) - .size - .width * 0.5, + width: MediaQuery.of(context).size.width * 0.5, ), - - if (selectedAllergy.isChecked) + if (selectedAllergy.isChecked!) InkWell( child: Row( - children: [Container( - child: AppText( - TranslationBase - .of(context) - .remove, - fontSize: 15, - variant: "bodyText", - color: HexColor("#B8382C"),), - ), + children: [ + Container( + child: AppText( + TranslationBase.of(context).remove, + fontSize: 15, + variant: "bodyText", + color: HexColor("#B8382C"), + ), + ), Icon( FontAwesomeIcons.times, color: HexColor("#B8382C"), @@ -145,12 +131,12 @@ class _UpdateAllergiesWidgetState extends State { removeAllergy(MySelectedAllergy mySelectedAllergy) { List allergy = - // ignore: missing_return - widget.myAllergiesList.where((element) => - mySelectedAllergy.selectedAllergySeverity.id == - element.selectedAllergySeverity.id && - mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id - ).toList(); + // ignore: missing_return + widget.myAllergiesList + .where((element) => + mySelectedAllergy.selectedAllergySeverity!.id == element.selectedAllergySeverity!.id && + mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id) + .toList(); if (allergy.length > 0) { setState(() { @@ -158,7 +144,6 @@ class _UpdateAllergiesWidgetState extends State { }); } - print(allergy); } @@ -170,7 +155,7 @@ class _UpdateAllergiesWidgetState extends State { context: context, builder: (context) { return AddAllergies( - myAllergiesList: widget.myAllergiesList, + myAllergiesList: widget.myAllergiesList, addAllergiesFun: (List mySelectedAllergy) { bool isAllDataFilled = true; mySelectedAllergy.forEach((element) { @@ -180,25 +165,16 @@ class _UpdateAllergiesWidgetState extends State { }); if (isAllDataFilled) { mySelectedAllergy.forEach((element) { - if (!widget.myAllergiesList.contains(element.selectedAllergySeverity.id)) { + if (!widget.myAllergiesList.contains(element.selectedAllergySeverity!.id)) { widget.myAllergiesList.add(element); } }); changeParentState(); Navigator.of(context).pop(); } else { - Helpers.showErrorToast(TranslationBase - .of(context) - .requiredMsg); + Helpers.showErrorToast(TranslationBase.of(context).requiredMsg); } }); }); } - } - - - - - - diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index 0e5e6ec1..dd64365e 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -7,14 +7,14 @@ import '../medication/update_medication_widget.dart'; class UpdateChiefComplaints extends StatelessWidget { const UpdateChiefComplaints({ - Key key, - @required this.formKey, - @required this.complaintsController, - @required this.illnessController, - @required this.medicationController, - this.complaintsControllerError, - this.illnessControllerError, - this.medicationControllerError, + Key? key, + required this.formKey, + required this.complaintsController, + required this.illnessController, + required this.medicationController, + required this.complaintsControllerError, + required this.illnessControllerError, + required this.medicationControllerError, }) : super(key: key); final GlobalKey formKey; @@ -41,56 +41,43 @@ class UpdateChiefComplaints extends StatelessWidget { minLines: 7, hasBorder: true, inputType: TextInputType.multiline, - validationError: complaintsControllerError != '' - ? complaintsControllerError - : null, + validationError: complaintsControllerError != '' ? complaintsControllerError : null, ), - SizedBox( + SizedBox( height: 20, ), AppTextFieldCustom( - hintText: TranslationBase - .of(context) - .historyOfPresentIllness, + hintText: TranslationBase.of(context).historyOfPresentIllness, controller: illnessController, inputType: TextInputType.multiline, - maxLines: 25, minLines: 7, hasBorder: true, - validationError: illnessControllerError != '' - ? illnessControllerError - : null, - ), - SizedBox( - height: 10, - ), - UpdateMedicationWidget( - medicationController: medicationController, - ), - SizedBox( - height: 10, - ), + validationError: illnessControllerError != '' ? illnessControllerError : null, + ), + SizedBox( + height: 10, + ), + UpdateMedicationWidget( + medicationController: medicationController, + ), + SizedBox( + height: 10, + ), AppTextFieldCustom( - hintText: TranslationBase - .of(context) - .currentMedications, + hintText: TranslationBase.of(context).currentMedications, controller: medicationController, maxLines: 25, minLines: 7, hasBorder: true, inputType: TextInputType.multiline, - - validationError: medicationControllerError != '' - ? medicationControllerError - : null, - - ), - SizedBox( - height: 10, - ), - ]), + validationError: medicationControllerError != '' ? medicationControllerError : null, + ), + SizedBox( + height: 10, + ), + ]), ); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index 1da8db17..82d84ba4 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -19,10 +19,15 @@ class AddHistoryDialog extends StatefulWidget { final PageController controller; final List myHistoryList; final Function addSelectedHistories; - final Function (MasterKeyModel) removeHistory; + final Function(MasterKeyModel) removeHistory; const AddHistoryDialog( - {Key key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory}) + {Key? key, + required this.changePageViewIndex, + required this.controller, + required this.myHistoryList, + required this.addSelectedHistories, + required this.removeHistory}) : super(key: key); @override @@ -55,104 +60,100 @@ class _AddHistoryDialogState extends State { body: Center( child: Container( child: Column( - children: [ - BottomSheetTitle(title:TranslationBase.of(context).addHistory), - SizedBox( - height: 10, - ), - PriorityBar(onTap: (activePriority) async { - widget.changePageViewIndex(activePriority); - }), - SizedBox( - height: 20, - ), - Expanded( - child: FractionallySizedBox( - widthFactor: 0.9, - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: widget.controller, - onPageChanged: (index) { - setState(() { - }); - }, - scrollDirection: Axis.horizontal, - children: [ - NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.historyFamilyList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - createAndAddHistory( - history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) =>isServiceSelected(master), - ), - ), - NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.mergeHistorySurgicalWithHistorySportList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - createAndAddHistory( - history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) =>isServiceSelected(master), - ), - ), - NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.historyMedicalList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - createAndAddHistory( - history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) => - isServiceSelected(master), + children: [ + BottomSheetTitle(title: TranslationBase.of(context).addHistory!), + SizedBox( + height: 10, + ), + PriorityBar(onTap: (activePriority) async { + widget.changePageViewIndex(activePriority); + }), + SizedBox( + height: 20, + ), + Expanded( + child: FractionallySizedBox( + widthFactor: 0.9, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: widget.controller, + onPageChanged: (index) { + setState(() {}); + }, + scrollDirection: Axis.horizontal, + children: [ + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyFamilyList, + removeHistory: (history) { + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history) { + setState(() { + createAndAddHistory(history); + }); + }, + addSelectedHistories: () { + widget.addSelectedHistories(); + }, + isServiceSelected: (master) => isServiceSelected(master), + ), + ), + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.mergeHistorySurgicalWithHistorySportList, + removeHistory: (history) { + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history) { + setState(() { + createAndAddHistory(history); + }); + }, + addSelectedHistories: () { + widget.addSelectedHistories(); + }, + isServiceSelected: (master) => isServiceSelected(master), + ), + ), + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyMedicalList, + removeHistory: (history) { + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history) { + setState(() { + createAndAddHistory(history); + }); + }, + addSelectedHistories: () { + widget.addSelectedHistories(); + }, + isServiceSelected: (master) => isServiceSelected(master), ), ), ], ), ), ), - SizedBox(height:MediaQuery.of(context).size.height * 0.11 ,) + SizedBox( + height: MediaQuery.of(context).size.height * 0.11, + ) ], - ) - ), + )), ), bottomSheet: Container( decoration: BoxDecoration( @@ -174,8 +175,7 @@ class _AddHistoryDialogState extends State { widthFactor: .80, child: Center( child: AppButton( - title: - TranslationBase.of(context).addSelectedHistories, + title: TranslationBase.of(context).addSelectedHistories, padding: 10, color: Color(0xFF359846), onPressed: () { @@ -196,19 +196,15 @@ class _AddHistoryDialogState extends State { } createAndAddHistory(MasterKeyModel history) { - List myhistory = widget.myHistoryList.where((element) => - history.id == - element.selectedHistory.id && - history.typeId == - element.selectedHistory.typeId - ).toList(); + List myhistory = widget.myHistoryList + .where( + (element) => history.id == element.selectedHistory!.id && history.typeId == element.selectedHistory!.typeId) + .toList(); if (myhistory.isEmpty) { setState(() { - MySelectedHistory mySelectedHistory = MySelectedHistory( - remark: history.remarks ?? "", - selectedHistory: history, - isChecked: true); + MySelectedHistory mySelectedHistory = + MySelectedHistory(remark: history.remarks ?? "", selectedHistory: history, isChecked: true); widget.myHistoryList.add(mySelectedHistory); }); } else { @@ -217,18 +213,13 @@ class _AddHistoryDialogState extends State { } isServiceSelected(MasterKeyModel masterKey) { - Iterable history = - widget - .myHistoryList - .where((element) => - masterKey.id == element.selectedHistory.id && - masterKey.typeId == element.selectedHistory.typeId && - element.isChecked); + Iterable history = widget.myHistoryList.where((element) => + masterKey.id == element.selectedHistory!.id && + masterKey.typeId == element.selectedHistory!.typeId && + element.isChecked!); if (history.length > 0) { return true; } return false; } - } - diff --git a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart index ac6ec2c5..250fac6d 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart @@ -7,7 +7,7 @@ import 'package:provider/provider.dart'; class PriorityBar extends StatefulWidget { final Function onTap; - const PriorityBar({Key key, this.onTap}) : super(key: key); + const PriorityBar({Key? key, required this.onTap}) : super(key: key); @override _PriorityBarState createState() => _PriorityBarState(); @@ -27,8 +27,7 @@ class _PriorityBarState extends State { "طبي", ]; - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration(); } @@ -57,26 +56,26 @@ class _PriorityBarState extends State { children: [ Container( height: screenSize.height * 0.070, - decoration: containerBorderDecoration( - _isActive ? HexColor("#B8382B") : Colors.white, + decoration: containerBorderDecoration(_isActive ? HexColor("#B8382B") : Colors.white, _isActive ? HexColor("#B8382B") : Colors.white), child: Center( child: Text( - (projectViewModel.isArabic) - ? _prioritiesAr[index] - : item, + (projectViewModel.isArabic) ? _prioritiesAr[index] : item, textAlign: TextAlign.center, style: TextStyle( fontSize: 14, - color: Colors.black, fontWeight: FontWeight.bold, ), ), ), ), - if(_isActive) - Container(width: 120,height: 4,color: AppGlobal.appPrimaryColor,) + if (_isActive) + Container( + width: 120, + height: 4, + color: AppGlobal.appPrimaryColor, + ) ], ), ), diff --git a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart index f114702d..29071248 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart @@ -14,15 +14,14 @@ import 'add_history_dialog.dart'; class UpdateHistoryWidget extends StatefulWidget { final List myHistoryList; - const UpdateHistoryWidget({Key key, this.myHistoryList}) : super(key: key); + const UpdateHistoryWidget({Key? key, required this.myHistoryList}) : super(key: key); @override _UpdateHistoryWidgetState createState() => _UpdateHistoryWidgetState(); } -class _UpdateHistoryWidgetState extends State - with TickerProviderStateMixin { - PageController _controller; +class _UpdateHistoryWidgetState extends State with TickerProviderStateMixin { + late PageController _controller; changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); @@ -40,17 +39,17 @@ class _UpdateHistoryWidgetState extends State ProjectViewModel projectViewModel = Provider.of(context); return Column( children: [ - - SOAPOpenItems(label: "${TranslationBase.of(context).addHistory}",onTap: () { - openHistoryList(context); - - },), + SOAPOpenItems( + label: "${TranslationBase.of(context).addHistory}", + onTap: () { + openHistoryList(context); + }, + ), SizedBox( height: 20, ), Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 15), + margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( children: widget.myHistoryList.map((myHistory) { return Column( @@ -61,33 +60,25 @@ class _UpdateHistoryWidgetState extends State Container( child: AppText( projectViewModel.isArabic - ? myHistory.selectedHistory.nameAr - : myHistory.selectedHistory.nameEn, + ? myHistory.selectedHistory!.nameAr + : myHistory.selectedHistory!.nameEn, fontSize: 15, - textDecoration: myHistory.isChecked - ? null - : TextDecoration.lineThrough, + textDecoration: myHistory.isChecked! ? null : TextDecoration.lineThrough, color: Colors.black), - width: MediaQuery - .of(context) - .size - .width * 0.5, + width: MediaQuery.of(context).size.width * 0.5, ), - if (myHistory.isChecked) + if (myHistory.isChecked!) InkWell( child: Row( children: [ Container( child: AppText( - TranslationBase - .of(context) - .remove, + TranslationBase.of(context).remove, fontSize: 15, variant: "bodyText", - textDecoration: myHistory.isChecked - ? null - : TextDecoration.lineThrough, - color: HexColor("#B8382C"),), + textDecoration: myHistory.isChecked! ? null : TextDecoration.lineThrough, + color: HexColor("#B8382C"), + ), ), Icon( FontAwesomeIcons.times, @@ -96,7 +87,7 @@ class _UpdateHistoryWidgetState extends State ), ], ), - onTap: () => removeHistory(myHistory.selectedHistory), + onTap: () => removeHistory(myHistory.selectedHistory!), ) ], ), @@ -114,14 +105,11 @@ class _UpdateHistoryWidgetState extends State removeHistory(MasterKeyModel historyKey) { List history = - // ignore: missing_return - widget.myHistoryList.where((element) => - historyKey.id == - element.selectedHistory.id && - historyKey.typeId == - element.selectedHistory.typeId - ).toList(); - + // ignore: missing_return + widget.myHistoryList + .where((element) => + historyKey.id == element.selectedHistory!.id && historyKey.typeId == element.selectedHistory!.typeId) + .toList(); if (history.length > 0) setState(() { @@ -153,6 +141,3 @@ class _UpdateHistoryWidgetState extends State }); } } - - - diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 69475926..1d9e7890 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -25,27 +25,25 @@ class AddMedication extends StatefulWidget { final Function addMedicationFun; TextEditingController medicationController; - AddMedication({Key key, this.addMedicationFun, this.medicationController}) - : super(key: key); + AddMedication({Key? key, required this.addMedicationFun, required this.medicationController}) : super(key: key); @override _AddMedicationState createState() => _AddMedicationState(); } class _AddMedicationState extends State { - MasterKeyModel _selectedMedicationDose; - MasterKeyModel _selectedMedicationStrength; - MasterKeyModel _selectedMedicationRoute; - MasterKeyModel _selectedMedicationFrequency; + late MasterKeyModel _selectedMedicationDose; + late MasterKeyModel _selectedMedicationStrength; + late MasterKeyModel _selectedMedicationRoute; + late MasterKeyModel _selectedMedicationFrequency; TextEditingController doseController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); - GetMedicationResponseModel _selectedMedication; + late GetMedicationResponseModel _selectedMedication; - GlobalKey key = - new GlobalKey>(); + GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; @override @@ -69,316 +67,251 @@ class _AddMedicationState extends State { if (model.medicationRouteList.length == 0) { await model.getMasterLookup(MasterKeysService.MedicationRoute); } - if (model.allMedicationList.length == 0) - await model.getMedicationList(); + if (model.allMedicationList.length == 0) await model.getMedicationList(); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, body: Center( child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - BottomSheetTitle( - title: TranslationBase.of(context).addMedication, - ), - SizedBox( - height: 10, - ), - SizedBox( - height: 16, - ), - Expanded( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - SizedBox( - height: 16, - ), - SizedBox( - height: 16, - ), - Container( - // height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - setState(() { - _selectedMedication = null; - }); - } - : null, - child: _selectedMedication == null - ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && - _selectedMedication == null, - child: AutoCompleteTextField< - GetMedicationResponseModel>( - decoration: TextFieldsUtils - .textFieldSelectorDecoration( - TranslationBase.of( - context) - .searchMedicineNameHere, - null, - true, - suffixIcon: Icons.search), - itemSubmitted: (item) => setState( - () => _selectedMedication = - item), - key: key, - suggestions: - model.allMedicationList, - itemBuilder: (context, - suggestion) => - new Padding( - child: AppText(suggestion - .description + - '/' + - suggestion - .genericName), - padding: - EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.genericName.toLowerCase().startsWith( - input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith(input - .toLowerCase()) || - suggestion.keywords - .toLowerCase() - .startsWith( - input.toLowerCase()), - ), - ) - : AppTextFieldCustom( - hintText: _selectedMedication != - null - ? _selectedMedication - .description + - (' (${_selectedMedication.genericName} )') - : TranslationBase.of(context) - .searchMedicineNameHere, - minLines: 2, - maxLines: 2, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + BottomSheetTitle( + title: TranslationBase.of(context).addMedication ?? "", + ), + SizedBox( + height: 10, + ), + SizedBox( + height: 16, + ), + Expanded( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + SizedBox( + height: 16, + ), + SizedBox( + height: 16, + ), + Container( + // height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + setState(() { + _selectedMedication = null!; + }); + } + : null, + child: _selectedMedication == null + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && _selectedMedication == null, + child: AutoCompleteTextField( + decoration: TextFieldsUtils.textFieldSelectorDecoration( + TranslationBase.of(context).searchMedicineNameHere!, "", true, + suffixIcon: Icons.search), + itemSubmitted: (item) => setState(() => _selectedMedication = item), + suggestions: model.allMedicationList, + itemBuilder: (context, suggestion) => new Padding( + child: AppText(suggestion.description! + '/' + suggestion.genericName!), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.genericName!.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.description!.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.keywords!.toLowerCase().startsWith(input.toLowerCase()), + ), + ) + : AppTextFieldCustom( + hintText: _selectedMedication != null + ? _selectedMedication.description! + + (' (${_selectedMedication.genericName} )') + : TranslationBase.of(context).searchMedicineNameHere, + minLines: 2, + maxLines: 2, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + onPressed: () {}, + icon: Icon( Icons.search, color: Colors.grey.shade600, )), - enabled: false, - ), - ), - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - onClick: model.medicationDoseTimeList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationDoseTimeList, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationDose = - selectedValue; + enabled: false, + ), + ), + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + onClick: model.medicationDoseTimeList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationDoseTimeList, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationDose = selectedValue; - doseController - .text = projectViewModel - .isArabic - ? _selectedMedicationDose - .nameAr - : _selectedMedicationDose - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).doseTime, - maxLines: 2, - minLines: 2, - isTextFieldHasSuffix: true, - controller: doseController, - validationError: isFormSubmitted && - _selectedMedicationDose == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationStrengthList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationStrengthList, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationStrength = - selectedValue; + doseController.text = projectViewModel.isArabic + ? _selectedMedicationDose.nameAr! + : _selectedMedicationDose.nameEn!; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).doseTime, + maxLines: 2, + minLines: 2, + isTextFieldHasSuffix: true, + controller: doseController, + validationError: isFormSubmitted && _selectedMedicationDose == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationStrengthList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationStrengthList, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrength = selectedValue; - strengthController - .text = projectViewModel - .isArabic - ? _selectedMedicationStrength - .nameAr - : _selectedMedicationStrength - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).strength, - maxLines: 2, - minLines: 2, - controller: strengthController, - validationError: isFormSubmitted && - _selectedMedicationStrength == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationRouteList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationRouteList, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationRoute = - selectedValue; + strengthController.text = projectViewModel.isArabic + ? _selectedMedicationStrength.nameAr! + : _selectedMedicationStrength.nameEn!; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).strength, + maxLines: 2, + minLines: 2, + controller: strengthController, + validationError: isFormSubmitted && _selectedMedicationStrength == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationRouteList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationRouteList, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationRoute = selectedValue; - routeController - .text = projectViewModel - .isArabic - ? _selectedMedicationRoute - .nameAr - : _selectedMedicationRoute - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).route, - maxLines: 2, - minLines: 2, - controller: routeController, - validationError: isFormSubmitted && - _selectedMedicationRoute == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - onClick: model.medicationFrequencyList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationFrequencyList, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationFrequency = - selectedValue; + routeController.text = projectViewModel.isArabic + ? _selectedMedicationRoute.nameAr! + : _selectedMedicationRoute.nameEn!; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).route, + maxLines: 2, + minLines: 2, + controller: routeController, + validationError: isFormSubmitted && _selectedMedicationRoute == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + onClick: model.medicationFrequencyList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationFrequencyList, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationFrequency = selectedValue; - frequencyController - .text = projectViewModel - .isArabic - ? _selectedMedicationFrequency - .nameAr - : _selectedMedicationFrequency - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).frequency, - enabled: false, - maxLines: 2, - minLines: 2, - isTextFieldHasSuffix: true, - controller: frequencyController, - validationError: isFormSubmitted && - _selectedMedicationFrequency == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 30, - ), - ], - )), - ), - ), - ]), + frequencyController.text = projectViewModel.isArabic + ? _selectedMedicationFrequency.nameAr! + : _selectedMedicationFrequency.nameEn!; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).frequency, + enabled: false, + maxLines: 2, + minLines: 2, + isTextFieldHasSuffix: true, + controller: frequencyController, + validationError: isFormSubmitted && _selectedMedicationFrequency == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 30, + ), + ], + )), + ), + ), + ]), ), ), bottomSheet: Container( @@ -401,9 +334,7 @@ class _AddMedicationState extends State { widthFactor: .80, child: Center( child: AppButton( - title: TranslationBase.of(context) - .addMedication - .toUpperCase(), + title: TranslationBase.of(context).addMedication!.toUpperCase(), color: Color(0xFF359846), onPressed: () { setState(() { @@ -414,8 +345,7 @@ class _AddMedicationState extends State { _selectedMedicationStrength != null && _selectedMedicationRoute != null && _selectedMedicationFrequency != null) { - widget.medicationController.text = widget - .medicationController.text + + widget.medicationController.text = widget.medicationController.text + '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; Navigator.of(context).pop(); } diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart index 7372e7ee..6aa3e1be 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart @@ -9,8 +9,8 @@ class UpdateMedicationWidget extends StatefulWidget { final TextEditingController medicationController; UpdateMedicationWidget({ - Key key, - this.medicationController, + Key? key, + required this.medicationController, }); @override @@ -22,11 +22,12 @@ class _UpdateMedicationWidgetState extends State { Widget build(BuildContext context) { return Column( children: [ - - SOAPOpenItems(label: "${TranslationBase.of(context).addMedication}",onTap: () { - openMedicationList(context); - - },), + SOAPOpenItems( + label: "${TranslationBase.of(context).addMedication}", + onTap: () { + openMedicationList(context); + }, + ), SizedBox( height: 20, ) @@ -34,7 +35,6 @@ class _UpdateMedicationWidgetState extends State { ); } - openMedicationList(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, @@ -49,6 +49,3 @@ class _UpdateMedicationWidgetState extends State { }); } } - - - diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index b0db0414..11972a72 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -33,14 +33,16 @@ class UpdateSubjectivePage extends StatefulWidget { final List myAllergiesList; final List myHistoryList; final PatiantInformtion patientInfo; - final int currentIndex; + final int currentIndex; UpdateSubjectivePage( - {Key key, - this.changePageViewIndex, - this.myAllergiesList, - this.myHistoryList, - this.patientInfo, this.changeLoadingState, this.currentIndex}); + {Key? key, + required this.changePageViewIndex, + required this.myAllergiesList, + required this.myHistoryList, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); @@ -67,7 +69,7 @@ class _UpdateSubjectivePageState extends State { doctorID: '', editedBy: ''); - await model.getPatientHistories(getHistoryReqModel,isFirst: true); + await model.getPatientHistories(getHistoryReqModel, isFirst: true); if (model.patientHistoryList.isNotEmpty) { if (model.historyFamilyList.isEmpty) { @@ -84,62 +86,50 @@ class _UpdateSubjectivePageState extends State { } model.patientHistoryList.forEach((element) { - if (element.historyType == - MasterKeysService.HistoryFamily.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryFamily, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: element.isChecked, - remark: element.remarks); + MySelectedHistory mySelectedHistory = + MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); widget.myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistoryMedical.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryMedical, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: element.isChecked, - remark: element.remarks); + MySelectedHistory mySelectedHistory = + MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); widget.myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistorySports.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySports, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: element.isChecked, - remark: element.remarks); + MySelectedHistory mySelectedHistory = + MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); widget.myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistorySurgical.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySurgical, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: element.isChecked, - remark: element.remarks); + MySelectedHistory mySelectedHistory = + MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); widget.myHistoryList.add(mySelectedHistory); } @@ -157,26 +147,21 @@ class _UpdateSubjectivePageState extends State { editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); if (model.patientAllergiesList.isNotEmpty) { - if (model.allergiesList.isEmpty) - await model.getMasterLookup(MasterKeysService.Allergies); - if (model.allergySeverityList.isEmpty) - await model.getMasterLookup(MasterKeysService.AllergySeverity); + if (model.allergiesList.isEmpty) await model.getMasterLookup(MasterKeysService.Allergies); + if (model.allergySeverityList.isEmpty) await model.getMasterLookup(MasterKeysService.AllergySeverity); model.patientAllergiesList.forEach((element) { - MasterKeyModel selectedAllergy = model.getOneMasterKey( - masterKeys: MasterKeysService.Allergies, - id: element.allergyDiseaseId, - typeId: element.allergyDiseaseType); + MasterKeyModel? selectedAllergy = model.getOneMasterKey( + masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); MasterKeyModel selectedAllergySeverity; if (element.severity == 0) { selectedAllergySeverity = MasterKeyModel( - id: 0, - typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); + id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); } else { - selectedAllergySeverity = model.getOneMasterKey( + selectedAllergySeverity = model.getOneMasterKey( masterKeys: MasterKeysService.AllergySeverity, id: element.severity, - ); + )!; } MySelectedAllergy mySelectedAllergy = MySelectedAllergy( @@ -185,8 +170,7 @@ class _UpdateSubjectivePageState extends State { createdBy: element.createdBy, remark: element.remarks, selectedAllergySeverity: selectedAllergySeverity); - if (selectedAllergy != null && selectedAllergySeverity != null) - widget.myAllergiesList.add(mySelectedAllergy); + if (selectedAllergy != null && selectedAllergySeverity != null) widget.myAllergiesList.add(mySelectedAllergy); }); } } @@ -198,33 +182,30 @@ class _UpdateSubjectivePageState extends State { widget.myAllergiesList.clear(); widget.myHistoryList.clear(); - GetChiefComplaintReqModel getChiefComplaintReqModel = - GetChiefComplaintReqModel( - patientMRN: widget.patientInfo.patientMRN, - appointmentNo: widget.patientInfo.appointmentNo, - episodeId: widget.patientInfo.episodeNo, - episodeID: widget.patientInfo.episodeNo, - doctorID: ''); + GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( + patientMRN: widget.patientInfo.patientMRN, + appointmentNo: widget.patientInfo.appointmentNo, + episodeId: widget.patientInfo.episodeNo, + episodeID: widget.patientInfo.episodeNo, + doctorID: ''); await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; - complaintsController.text = Helpers.parseHtmlString( - model.patientChiefComplaintList[0].chiefComplaint); - illnessController.text = model.patientChiefComplaintList[0].hopi; - medicationController.text =!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty ? model.patientChiefComplaintList[0].currentMedication + '\n \n':model.patientChiefComplaintList[0].currentMedication; + complaintsController.text = Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint!); + illnessController.text = model.patientChiefComplaintList[0].hopi!; + medicationController.text = !(model.patientChiefComplaintList[0].currentMedication)!.isNotEmpty + ? model.patientChiefComplaintList[0].currentMedication! + '\n \n' + : model.patientChiefComplaintList[0].currentMedication!; } await getHistory(model); await getAllergies(model); widget.changeLoadingState(false); - }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, - backgroundColor: Theme - .of(context) - .scaffoldBackgroundColor, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -234,12 +215,9 @@ class _UpdateSubjectivePageState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - - SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context) - .chiefComplaints - , + headerTitle: TranslationBase.of(context).chiefComplaints, onTap: () { setState(() { isChiefExpand = !isChiefExpand; @@ -259,12 +237,8 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 30, ), - - ExpandableSOAPWidget( - headerTitle: TranslationBase - .of(context) - .histories, + headerTitle: TranslationBase.of(context).histories, isRequired: false, onTap: () { setState(() { @@ -272,22 +246,15 @@ class _UpdateSubjectivePageState extends State { }); }, child: Column( - children: [ - UpdateHistoryWidget(myHistoryList: widget.myHistoryList) - ], + children: [UpdateHistoryWidget(myHistoryList: widget.myHistoryList)], ), isExpanded: isHistoryExpand, ), SizedBox( height: 30, ), - - ExpandableSOAPWidget( - headerTitle: TranslationBase - .of(context) - .allergiesSoap - , + headerTitle: TranslationBase.of(context).allergiesSoap, isRequired: false, onTap: () { setState(() { @@ -296,8 +263,9 @@ class _UpdateSubjectivePageState extends State { }, child: Column( children: [ - UpdateAllergiesWidget(myAllergiesList: widget - .myAllergiesList,), + UpdateAllergiesWidget( + myAllergiesList: widget.myAllergiesList, + ), SizedBox( height: 30, ), @@ -306,7 +274,7 @@ class _UpdateSubjectivePageState extends State { isExpanded: isAllergiesExpand, ), SizedBox( - height:MediaQuery.of(context).size.height * 0.16, + height: MediaQuery.of(context).size.height * 0.16, ), ], ), @@ -319,9 +287,7 @@ class _UpdateSubjectivePageState extends State { borderRadius: BorderRadius.all( Radius.circular(0.0), ), - border: Border.all( - color: HexColor('#707070'), - width: 0), + border: Border.all(color: HexColor('#707070'), width: 0), ), height: 80, width: double.infinity, @@ -330,40 +296,39 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 10, ), - Container(child: - FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color:Colors.red[700], - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - addSubjectiveInfo( - model: model, - myAllergiesList: widget.myAllergiesList, - myHistoryList: widget.myHistoryList); - }, + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + addSubjectiveInfo( + model: model, myAllergiesList: widget.myAllergiesList, myHistoryList: widget.myHistoryList); + }, + ), ), ), - ),), + ), SizedBox( height: 5, ), ], - ),), + ), + ), ), ); } - addSubjectiveInfo({SOAPViewModel model, - List myAllergiesList, - List myHistoryList}) async { - formKey.currentState.save(); - formKey.currentState.validate(); + addSubjectiveInfo( + {required SOAPViewModel model, + required List myAllergiesList, + required List myHistoryList}) async { + formKey.currentState!.save(); + formKey.currentState!.validate(); complaintsControllerError = ''; medicationControllerError = ''; @@ -391,66 +356,49 @@ class _UpdateSubjectivePageState extends State { widget.changeLoadingState(true); widget.changePageViewIndex(1); - } else { setState(() { if (complaintsController.text.isEmpty) { - complaintsControllerError = TranslationBase - .of(context) - .emptyMessage; + complaintsControllerError = TranslationBase.of(context).emptyMessage!; } else if (complaintsController.text.length < 25) { - complaintsControllerError = TranslationBase - .of(context) - .chiefComplaintLength; + complaintsControllerError = TranslationBase.of(context).chiefComplaintLength!; } if (illnessController.text.isEmpty) { - illnessControllerError = TranslationBase - .of(context) - .emptyMessage; + illnessControllerError = TranslationBase.of(context).emptyMessage!; } if (medicationController.text.isEmpty) { - medicationControllerError = TranslationBase - .of(context) - .emptyMessage; + medicationControllerError = TranslationBase.of(context).emptyMessage!; } }); - Helpers.showErrorToast(TranslationBase - .of(context) - .chiefComplaintErrorMsg); + Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg); } - - } - postAllergy( - {List myAllergiesList, SOAPViewModel model}) async { - PostAllergyRequestModel postAllergyRequestModel = - new PostAllergyRequestModel(); + postAllergy({required List myAllergiesList, required SOAPViewModel model}) async { + PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); widget.myAllergiesList.forEach((allergy) { - if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == - null) + if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( - ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - severity: allergy.selectedAllergySeverity.id, - remarks: allergy.remark, - createdBy: allergy.createdBy??doctorProfile.doctorID, - createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - isChecked: allergy.isChecked, - isUpdatedByNurse: false)); + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy!.id, + allergyDiseaseType: allergy.selectedAllergy!.typeId, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + severity: allergy.selectedAllergySeverity!.id, + remarks: allergy.remark, + createdBy: allergy.createdBy ?? doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + isChecked: allergy.isChecked, + isUpdatedByNurse: false)); }); if (model.patientAllergiesList.isEmpty) { await model.postAllergy(postAllergyRequestModel); @@ -464,60 +412,53 @@ class _UpdateSubjectivePageState extends State { appointmentNo: widget.patientInfo.appointmentNo, doctorID: '', editedBy: ''); - await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy : true); + await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy: true); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } } - postHistories( - {List myHistoryList, SOAPViewModel model}) async { - PostHistoriesRequestModel postHistoriesRequestModel = - new PostHistoriesRequestModel(doctorID: ''); + postHistories({required List myHistoryList, required SOAPViewModel model}) async { + PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); widget.myHistoryList.forEach((history) { - if (postHistoriesRequestModel.listMedicalHistoryVM == null) - postHistoriesRequestModel.listMedicalHistoryVM = []; - postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( + if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; + postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM( patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, remarks: "", - historyId: history.selectedHistory.id, - historyType: history.selectedHistory.typeId, + historyId: history.selectedHistory!.id, + historyType: history.selectedHistory!.typeId, isChecked: history.isChecked, )); }); - if (model.patientHistoryList.isEmpty) { await model.postHistories(postHistoriesRequestModel); } else { await model.patchHistories(postHistoriesRequestModel); } - if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } } - postChiefComplaint({SOAPViewModel model}) async { - formKey.currentState.save(); - if(formKey.currentState.validate()){ - PostChiefComplaintRequestModel postChiefComplaintRequestModel = - new PostChiefComplaintRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - chiefComplaint: complaintsController.text, - currentMedication: medicationController.text, - hopi: illnessController.text, - isLactation: false, - ispregnant: false, - doctorID: '', - - numberOfWeeks: 0); + postChiefComplaint({required SOAPViewModel model}) async { + formKey.currentState!.save(); + if (formKey.currentState!.validate()) { + PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + chiefComplaint: complaintsController.text, + currentMedication: medicationController.text, + hopi: illnessController.text, + isLactation: false, + ispregnant: false, + doctorID: '', + numberOfWeeks: 0); if (model.patientChiefComplaintList.isEmpty) { postChiefComplaintRequestModel.editedBy = ''; await model.postChiefComplaint(postChiefComplaintRequestModel); @@ -527,8 +468,3 @@ class _UpdateSubjectivePageState extends State { } } } - - - - - diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index d9af7457..93fcff50 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -19,28 +19,25 @@ import 'plan/update_plan_page.dart'; class UpdateSoapIndex extends StatefulWidget { final bool isUpdate; - const UpdateSoapIndex({Key key, this.isUpdate}) : super(key: key); + const UpdateSoapIndex({Key? key, required this.isUpdate}) : super(key: key); @override _UpdateSoapIndexState createState() => _UpdateSoapIndexState(); } -class _UpdateSoapIndexState extends State - with TickerProviderStateMixin { - PageController _controller; +class _UpdateSoapIndexState extends State with TickerProviderStateMixin { + PageController? _controller; int _currentIndex = 0; - List myAllergiesList = List(); - List myHistoryList = List(); - List mySelectedExamination = List(); - List mySelectedAssessment = List(); + List myAllergiesList = []; + List myHistoryList = []; + List mySelectedExamination = []; + List mySelectedAssessment = []; - GetPatientProgressNoteResModel patientProgressNote = - GetPatientProgressNoteResModel(); + GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); - changePageViewIndex(pageIndex,{isChangeState = true}) { - if (pageIndex != _currentIndex && isChangeState) - changeLoadingState(true); - _controller.jumpToPage(pageIndex); + changePageViewIndex(pageIndex, {isChangeState = true}) { + if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); + _controller?.jumpToPage(pageIndex); setState(() { _currentIndex = pageIndex; }); @@ -63,80 +60,82 @@ class _UpdateSoapIndexState extends State @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; return BaseView( - builder: (_, model, w) => AppScaffold( - isLoading: _isLoading, - isShowAppBar: false, - body: SingleChildScrollView( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - boxShadow: [], - color: Theme.of(context).scaffoldBackgroundColor), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - PatientProfileHeaderNewDesign(patient, '7', '7',), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - - Container( - color: Theme.of(context).scaffoldBackgroundColor, - height: MediaQuery.of(context).size.height * 0.73, - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - UpdateSubjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - myAllergiesList: myAllergiesList, - myHistoryList: myHistoryList, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateObjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - mySelectedExamination: mySelectedExamination, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateAssessmentPage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - mySelectedAssessmentList: mySelectedAssessment, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdatePlanPage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - patientProgressNote: patientProgressNote, - changeLoadingState: changeLoadingState) - ], + builder: (_, model, w) => AppScaffold( + isLoading: _isLoading, + isShowAppBar: false, + body: SingleChildScrollView( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: + BoxDecoration(boxShadow: [], color: Theme.of(context).scaffoldBackgroundColor), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign( + patient, + '7', + '7', + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + Container( + color: Theme.of(context).scaffoldBackgroundColor, + height: MediaQuery.of(context).size.height * 0.73, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + UpdateSubjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + myAllergiesList: myAllergiesList, + myHistoryList: myHistoryList, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateObjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + mySelectedExamination: mySelectedExamination, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateAssessmentPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + mySelectedAssessmentList: mySelectedAssessment, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdatePlanPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + patientProgressNote: patientProgressNote, + changeLoadingState: changeLoadingState) + ], + ), + ) + ], + ), ), - ) - ], + ], + ), ), ), - ], - ), - ), - ), - )); + )); } } diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart index 7c766158..ec33ccf0 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -10,7 +10,7 @@ class LineChartCurved extends StatelessWidget { final List timeSeries; final int indexes; - LineChartCurved({this.title, this.timeSeries, this.indexes}); + LineChartCurved({required this.title, required this.timeSeries, required this.indexes}); List xAxixs = []; List yAxixs = []; @@ -105,8 +105,7 @@ class LineChartCurved extends StatelessWidget { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData( - show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -130,9 +129,7 @@ class LineChartCurved extends StatelessWidget { return ''; } } else { - if (value.toInt() == 0 || - value.toInt() == timeSeries.length - 1 || - xAxixs.contains(value.toInt())) { + if (value.toInt() == 0 || value.toInt() == timeSeries.length - 1 || xAxixs.contains(value.toInt())) { DateTime dateTime = timeSeries[value.toInt()].time; if (isDatesSameYear) { return monthFormat.format(dateTime); @@ -238,9 +235,7 @@ class LineChartCurved extends StatelessWidget { int previousDateYear = 0; for (int index = 0; index < timeSeries.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); - if (isDatesSameYear == false || - (previousDateYear != 0 && - previousDateYear != timeSeries[index].time.year)) { + if (isDatesSameYear == false || (previousDateYear != 0 && previousDateYear != timeSeries[index].time.year)) { isDatesSameYear = false; } previousDateYear = timeSeries[index].time.year; diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index 1c387c9a..197e517f 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -13,10 +13,14 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final bool isOX; LineChartCurvedBloodPressure( - {this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX= false}); + {required this.title, + required this.timeSeries1, + required this.indexes, + required this.timeSeries2, + this.isOX = false}); - List xAxixs = List(); - List yAxixs = List(); + List xAxixs = []; + List yAxixs = []; @override Widget build(BuildContext context) { @@ -43,7 +47,6 @@ class LineChartCurvedBloodPressure extends StatelessWidget { title, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', textAlign: TextAlign.center, ), @@ -55,8 +58,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), Expanded( child: Padding( - padding: - const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), child: LineChart( sampleData1(context), swapAnimationDuration: const Duration(milliseconds: 250), @@ -75,26 +77,30 @@ class LineChartCurvedBloodPressure extends StatelessWidget { Container( width: 20, height: 20, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Theme.of(context).primaryColor), + decoration: BoxDecoration(shape: BoxShape.rectangle, color: Theme.of(context).primaryColor), + ), + SizedBox( + width: 5, ), - SizedBox(width: 5,), - AppText(isOX? "SAO2":TranslationBase.of(context).systolicLng) + AppText(isOX ? "SAO2" : TranslationBase.of(context).systolicLng) ], ), - SizedBox(width: 15,), + SizedBox( + width: 15, + ), Row( children: [ Container( width: 20, height: 20, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.red), + decoration: BoxDecoration(shape: BoxShape.rectangle, color: Colors.red), + ), + SizedBox( + width: 5, ), - SizedBox(width: 5,), - AppText(isOX? "FIO2":TranslationBase.of(context).diastolicLng,) + AppText( + isOX ? "FIO2" : TranslationBase.of(context).diastolicLng, + ) ], ), ], @@ -123,8 +129,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData( - show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -223,12 +228,12 @@ class LineChartCurvedBloodPressure extends StatelessWidget { } List getData(context) { - List spots = List(); + List spots = []; for (int index = 0; index < timeSeries1.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); } - List spots2 = List(); + List spots2 = []; for (int index = 0; index < timeSeries2.length; index++) { spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); } @@ -260,11 +265,11 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), ); - List lineChartData = List(); - if(spots.isNotEmpty){ + List lineChartData = []; + if (spots.isNotEmpty) { lineChartData.add(lineChartBarData1); } - if(spots2.isNotEmpty){ + if (spots2.isNotEmpty) { lineChartData.add(lineChartBarData2); } return lineChartData; diff --git a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart deleted file mode 100644 index 0bf2197b..00000000 --- a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart +++ /dev/null @@ -1,1074 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -class PatientVitalSignScreen extends StatelessWidget { - @override - Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String from = routeArgs['from']; - String to = routeArgs['to']; - - return BaseView( - onModelReady: (model) => model.getPatientVitalSign(patient), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).vitalSign, - body: model.patientVitalSigns != null - ? SingleChildScrollView( - child: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - PatientPageHeaderWidget(patient), - SizedBox( - height: 16, - ), - Container( - margin: - EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).weight} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.weightKg} ${TranslationBase.of(context).kg}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).idealBodyWeight} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.idealBodyWeightLbs} ${TranslationBase.of(context).kg}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).height} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.heightCm} ${TranslationBase.of(context).cm}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - /*Row( - children: [ - AppText( - "${TranslationBase.of(context).waistSize} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.waistSizeInch} ${TranslationBase.of(context).inch}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ),*/ - Row( - children: [ - AppText( - "${TranslationBase.of(context).headCircum} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.headCircumCm} ${TranslationBase.of(context).cm}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - SizedBox( - height: 16, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).leanBodyWeight} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.leanBodyWeightLbs} ${TranslationBase.of(context).kg}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).bodyMassIndex} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.bodyMassIndex}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - SizedBox( - width: 8, - ), - Container( - color: Colors.green, - child: Padding( - padding: EdgeInsets.symmetric( - vertical: 2, horizontal: 8), - child: AppText( - "${model.getBMI(model.patientVitalSigns.bodyMassIndex)}", - fontSize: - SizeConfig.textMultiplier * 2, - color: Colors.white, - fontWeight: FontWeight.bold, - ), - ), - ) - ], - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "G.C.S :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "N/A", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - TemperatureWidget(model, model.patientVitalSigns), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - PulseWidget(model.patientVitalSigns), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - RespirationWidget(model.patientVitalSigns), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - BloodPressureWidget(model.patientVitalSigns), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - OxygenationWidget(model.patientVitalSigns), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - PainScaleWidget(model.patientVitalSigns), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - ], - ), - ) - ], - ), - ), - ) - : Center( - child: AppText( - "${TranslationBase.of(context).vitalSignEmptyMsg}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: HexColor("#B8382B"), - fontWeight: FontWeight.normal, - ), - ), - ), - ); - } -} - -class TemperatureWidget extends StatefulWidget { - final VitalSignsViewModel model; - final VitalSignData vitalSign; - - TemperatureWidget(this.model, this.vitalSign); - - @override - _TemperatureWidgetState createState() => _TemperatureWidgetState(); -} - -class _TemperatureWidgetState extends State { - bool isExpand = false; - - @override - Widget build(BuildContext context) { - return Container( - child: HeaderBodyExpandableNotifier( - headerWidget: Container( - margin: EdgeInsets.symmetric(vertical: 16.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - "${TranslationBase.of(context).temperature}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.black, - fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, - ), - InkWell( - onTap: () { - setState(() { - isExpand = !isExpand; - }); - }, - child: Icon(isExpand ? Icons.remove : Icons.add), - ), - ], - ), - ), - bodyWidget: Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).temperature} (C):", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.temperatureCelcius}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).temperature} (F):", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.temperatureCelcius * (9 / 5) + 32}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).method} :", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.model.getTempratureMethod(widget.vitalSign.temperatureCelciusMethod)}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - ], - ), - ), - isExpand: isExpand, - ), - ); - } -} - -class PulseWidget extends StatefulWidget { - final VitalSignData vitalSign; - - PulseWidget(this.vitalSign); - - @override - _PulseWidgetState createState() => _PulseWidgetState(); -} - -class _PulseWidgetState extends State { - bool isExpand = false; - - @override - Widget build(BuildContext context) { - return Container( - child: HeaderBodyExpandableNotifier( - headerWidget: Container( - margin: EdgeInsets.symmetric(vertical: 16.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - "${TranslationBase.of(context).pulse}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.black, - fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, - ), - InkWell( - onTap: () { - setState(() { - isExpand = !isExpand; - }); - }, - child: Icon(isExpand ? Icons.remove : Icons.add), - ), - ], - ), - ), - bodyWidget: Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).pulseBeats}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.pulseBeatPerMinute}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).rhythm}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.pulseRhythm}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - ], - ), - ], - ), - ), - isExpand: isExpand, - ), - ); - } -} - -class RespirationWidget extends StatefulWidget { - final VitalSignData vitalSign; - - RespirationWidget(this.vitalSign); - - @override - _RespirationWidgetState createState() => _RespirationWidgetState(); -} - -class _RespirationWidgetState extends State { - bool isExpand = false; - - @override - Widget build(BuildContext context) { - return Container( - child: HeaderBodyExpandableNotifier( - headerWidget: Container( - margin: EdgeInsets.symmetric(vertical: 16.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - "${TranslationBase.of(context).respiration}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.black, - fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, - ), - InkWell( - onTap: () { - setState(() { - isExpand = !isExpand; - }); - }, - child: Icon(isExpand ? Icons.remove : Icons.add), - ), - ], - ), - ), - bodyWidget: Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).respBeats}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.respirationBeatPerMinute}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).patternOfRespiration}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.respirationPattern}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - ], - ), - ], - ), - ), - isExpand: isExpand, - ), - ); - } -} - -class BloodPressureWidget extends StatefulWidget { - final VitalSignData vitalSign; - - BloodPressureWidget(this.vitalSign); - - @override - _BloodPressureWidgetState createState() => _BloodPressureWidgetState(); -} - -class _BloodPressureWidgetState extends State { - bool isExpand = false; - - @override - Widget build(BuildContext context) { - return Container( - child: HeaderBodyExpandableNotifier( - headerWidget: Container( - margin: EdgeInsets.symmetric(vertical: 16.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - "${TranslationBase.of(context).bloodPressure}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.black, - fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, - ), - InkWell( - onTap: () { - setState(() { - isExpand = !isExpand; - }); - }, - child: Icon(isExpand ? Icons.remove : Icons.add), - ), - ], - ), - ), - bodyWidget: Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).bloodPressureDiastoleAndSystole}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.bloodPressureHigher}, ${widget.vitalSign.bloodPressureLower}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).cuffLocation}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.bloodPressureCuffLocation}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).patientPosition}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.bloodPressurePatientPosition}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - Expanded( - child: Row( - children: [ - AppText( - "${TranslationBase.of(context).cuffSize}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.bloodPressureCuffSize}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ), - ], - ), - ], - ), - ), - isExpand: isExpand, - ), - ); - } -} - -class OxygenationWidget extends StatefulWidget { - final VitalSignData vitalSign; - - OxygenationWidget(this.vitalSign); - - @override - _OxygenationWidgetState createState() => _OxygenationWidgetState(); -} - -class _OxygenationWidgetState extends State { - bool isExpand = false; - - @override - Widget build(BuildContext context) { - return Container( - child: HeaderBodyExpandableNotifier( - headerWidget: Container( - margin: EdgeInsets.symmetric(vertical: 16.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - "${TranslationBase.of(context).oxygenation}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.black, - fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, - ), - InkWell( - onTap: () { - setState(() { - isExpand = !isExpand; - }); - }, - child: Icon(isExpand ? Icons.remove : Icons.add), - ), - ], - ), - ), - bodyWidget: Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).sao2}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.sao2}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).fio2}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.fio2}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - ], - ), - ), - isExpand: isExpand, - ), - ); - } -} - -class PainScaleWidget extends StatefulWidget { - final VitalSignData vitalSign; - - PainScaleWidget(this.vitalSign); - - @override - _PainScaleWidgetState createState() => _PainScaleWidgetState(); -} - -class _PainScaleWidgetState extends State { - bool isExpand = false; - - @override - Widget build(BuildContext context) { - return Container( - child: HeaderBodyExpandableNotifier( - headerWidget: Container( - margin: EdgeInsets.symmetric(vertical: 16.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - "${TranslationBase.of(context).painScale}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.black, - fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, - ), - InkWell( - onTap: () { - setState(() { - isExpand = !isExpand; - }); - }, - child: Icon(isExpand ? Icons.remove : Icons.add), - ), - ], - ), - ), - bodyWidget: Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - children: [ - AppText( - "${TranslationBase.of(context).painScale}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.painScore}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ), - Expanded( - child: Row( - children: [ - AppText( - "${TranslationBase.of(context).painManagement}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.isPainManagementDone}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ), - ], - ), - ], - ), - ), - isExpand: isExpand, - ), - ); - } -} diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index 1e593af7..c9e08223 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -17,13 +17,13 @@ class VitalSignBloodPressureWidget extends StatefulWidget { final String viewKey2; VitalSignBloodPressureWidget( - {Key key, - this.vitalList, - this.title1, - this.title2, - this.viewKey1, - this.title3, - this.viewKey2}); + {Key? key, + required this.vitalList, + required this.title1, + required this.title2, + required this.viewKey1, + required this.title3, + required this.viewKey2}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -63,7 +63,6 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60, @@ -85,7 +84,6 @@ class _VitalSignDetailsWidgetState extends State { widget.title2, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60 @@ -107,7 +105,6 @@ class _VitalSignDetailsWidgetState extends State { widget.title3, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60 @@ -123,7 +120,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -153,8 +150,7 @@ class _VitalSignDetailsWidgetState extends State { ]));*/ widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey1]; - DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); + DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 37a7a60f..c2ff0c34 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -14,16 +14,15 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; class VitalSignDetailsScreen extends StatelessWidget { - int appointmentNo; - int projectID; + int? appointmentNo; + int? projectID; bool isNotOneAppointment; - VitalSignDetailsScreen( - {this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); + VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -34,15 +33,13 @@ class VitalSignDetailsScreen extends StatelessWidget { String assetBasePath = "${imageBasePath}patient/vital_signs/"; return BaseView( - onModelReady: (model) => - model.getPatientVitalSignHistory(patient, from, to, isInpatient), + onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to, isInpatient), builder: (_, mode, widget) => AppScaffold( baseViewModel: mode, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).vitalSign, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), + appBarTitle: TranslationBase.of(context).vitalSign!, body: mode.patientVitalSignsHistory.length > 0 ? Column( children: [ @@ -57,7 +54,7 @@ class VitalSignDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient?.patientDetails?.firstName?? patient.fullName?? ''}'s", + "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), @@ -75,8 +72,7 @@ class VitalSignDetailsScreen extends StatelessWidget { height: MediaQuery.of(context).size.height * 0.23, width: double.infinity, padding: EdgeInsets.all(12.0), - margin: EdgeInsets.symmetric( - horizontal: 16.0, vertical: 8.0), + margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), decoration: BoxDecoration( shape: BoxShape.rectangle, color: Colors.white, @@ -100,17 +96,13 @@ class VitalSignDetailsScreen extends StatelessWidget { children: [ Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 1 ? '${assetBasePath}underweight_BMI.png' : '${assetBasePath}underweight_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -118,38 +110,28 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiUnderWeight}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 - ? Color(0XFFD02127) - : null, + fontSize: SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, fontWeight: FontWeight.w700, ), AppText( "(<18.5)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 - ? Color(0XFFD02127) - : null, + fontSize: SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, fontWeight: FontWeight.w700, ), ], )), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 2 ? '${assetBasePath}health_BMI.png' : '${assetBasePath}health_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -158,40 +140,29 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).normal}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * - 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, ), ), AppText( "(18.5-24.9)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, ), ], )), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 3 ? '${assetBasePath}ovrweight_BMI.png' : '${assetBasePath}ovrweight_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -199,38 +170,28 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiOverWeight}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.155, + fontSize: SizeConfig.textMultiplier * 1.155, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, ), AppText( "(25-29.9)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.155, + fontSize: SizeConfig.textMultiplier * 1.155, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, ), ], )), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 4 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -238,38 +199,28 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiObese}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, ), AppText( "(30-34.9)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, ), ], )), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 5 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -279,24 +230,17 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).bmiObeseExtreme}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * - 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, ), ), AppText( "(35<)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, ), ], )), @@ -308,11 +252,9 @@ class VitalSignDetailsScreen extends StatelessWidget { Expanded( child: SingleChildScrollView( child: Container( - margin: EdgeInsets.symmetric( - horizontal: 16.0, vertical: 16), + margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ GridView.count( shrinkWrap: true, @@ -326,16 +268,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Height, - pageTitle: - TranslationBase.of( - context) - .height, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Height, + pageTitle: TranslationBase.of(context).height, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -345,13 +281,10 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context) - .height, - imagePath: - "${assetBasePath}height.png", + des: TranslationBase.of(context).height!, + imagePath: "${assetBasePath}height.png", lastVal: mode.heightCm, - unit: TranslationBase.of(context) - .cm, + unit: TranslationBase.of(context).cm!, ), ), ), @@ -360,16 +293,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Weight, - pageTitle: - TranslationBase.of( - context) - .weight, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Weight, + pageTitle: TranslationBase.of(context).weight, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -378,12 +305,9 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .weight, - imagePath: - "${assetBasePath}weight.png", - unit: - TranslationBase.of(context).kg, + des: TranslationBase.of(context).weight!, + imagePath: "${assetBasePath}weight.png", + unit: TranslationBase.of(context).kg!, lastVal: mode.weightKg, ), ), @@ -392,16 +316,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Temperature, - pageTitle: - TranslationBase.of( - context) - .temperature, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Temperature, + pageTitle: TranslationBase.of(context).temperature, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -411,13 +329,10 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context) - .temperature, - imagePath: - "${assetBasePath}temperature.png", + des: TranslationBase.of(context).temperature!, + imagePath: "${assetBasePath}temperature.png", lastVal: mode.temperatureCelcius, - unit: TranslationBase.of(context) - .tempC, + unit: TranslationBase.of(context).tempC!, ), ), ), @@ -426,16 +341,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .heart, - pageTitle: - TranslationBase.of( - context) - .heart, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.heart, + pageTitle: TranslationBase.of(context).heart, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -444,13 +353,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .heart, - imagePath: - "${assetBasePath}heart_rate.png", + des: TranslationBase.of(context).heart!, + imagePath: "${assetBasePath}heart_rate.png", lastVal: mode.hartRat, - unit: - TranslationBase.of(context).bpm, + unit: TranslationBase.of(context).bpm!, ), ), InkWell( @@ -458,16 +364,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Respiration, - pageTitle: - TranslationBase.of( - context) - .respirationRate, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Respiration, + pageTitle: TranslationBase.of(context).respirationRate, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -476,14 +376,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .respirationRate, - imagePath: - "${assetBasePath}respiration_rate.png", - lastVal: - mode.respirationBeatPerMinute, - unit: TranslationBase.of(context) - .respirationSigns, + des: TranslationBase.of(context).respirationRate!, + imagePath: "${assetBasePath}respiration_rate.png", + lastVal: mode.respirationBeatPerMinute, + unit: TranslationBase.of(context).respirationSigns!, ), ), InkWell( @@ -491,16 +387,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .BloodPressure, - pageTitle: - TranslationBase.of( - context) - .bloodPressure, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.BloodPressure, + pageTitle: TranslationBase.of(context).bloodPressure, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -509,13 +399,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .bloodPressure, - imagePath: - "${assetBasePath}blood_pressure.png", + des: TranslationBase.of(context).bloodPressure!, + imagePath: "${assetBasePath}blood_pressure.png", lastVal: mode.bloodPressure, - unit: TranslationBase.of(context) - .sysDias, + unit: TranslationBase.of(context).sysDias!, ), ), InkWell( @@ -523,16 +410,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Oxygenation, - pageTitle: - TranslationBase.of( - context) - .oxygenation, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Oxygenation, + pageTitle: TranslationBase.of(context).oxygenation, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -541,10 +422,8 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .oxygenation, - imagePath: - "${assetBasePath}oxg.png", + des: TranslationBase.of(context).oxygenation!, + imagePath: "${assetBasePath}oxg.png", lastVal: "${mode.oxygenation}%", unit: "", ), @@ -554,16 +433,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .PainScale, - pageTitle: - TranslationBase.of( - context) - .painScale, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.PainScale, + pageTitle: TranslationBase.of(context).painScale, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -572,12 +445,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .painScale, - imagePath: - "${assetBasePath}painScale.png", + des: TranslationBase.of(context).painScale!, + imagePath: "${assetBasePath}painScale.png", lastVal: mode.painScore, - unit: TranslationBase.of(context).severe, + unit: TranslationBase.of(context).severe!, ), ), ], @@ -588,19 +459,17 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), ], - ), - ), - ), - ], - ) + ), + ), + ), + ], + ) : Container( - color: Theme - .of(context) - .scaffoldBackgroundColor, - child: ErrorMessage(error: TranslationBase - .of(context) - .vitalSignEmptyMsg,)), + color: Theme.of(context).scaffoldBackgroundColor, + child: ErrorMessage( + error: TranslationBase.of(context).vitalSignEmptyMsg ?? "", + )), ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart index cec53580..5c83fd09 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart @@ -15,7 +15,7 @@ class VitalSignDetailsWidget extends StatefulWidget { final String viewKey; VitalSignDetailsWidget( - {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); + {Key? key, required this.vitalList, required this.title1, required this.title2, required this.viewKey}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -55,7 +55,6 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60, @@ -77,7 +76,6 @@ class _VitalSignDetailsWidgetState extends State { widget.title2, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60 @@ -93,7 +91,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -110,8 +108,7 @@ class _VitalSignDetailsWidgetState extends State { ]));*/ widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey]; - DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); + DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index 20d5b439..d051f98c 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -9,17 +9,17 @@ class VitalSignItem extends StatelessWidget { final String lastVal; final String unit; final String imagePath; - final double height; - final double width; + final double? height; + final double? width; const VitalSignItem( - {Key key, - @required this.des, + {Key? key, + required this.des, this.lastVal = 'N/A', this.unit = '', this.height, this.width, - @required this.imagePath}) + required this.imagePath}) : super(key: key); @override diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 49f82c2f..ad0dc1a7 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -14,20 +14,20 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class VitalSignItemDetailsScreen extends StatelessWidget { - final vitalSignDetails pageKey; - final String pageTitle; - List VSchart; + final vitalSignDetails? pageKey; + final String? pageTitle; + List? VSchart; PatiantInformtion patient; String patientType; String arrivalType; VitalSignItemDetailsScreen( - {this.vitalList, - this.pageKey, - this.pageTitle, - this.patient, - this.patientType, - this.arrivalType}); + {required this.vitalList, + required this.pageKey, + required this.pageTitle, + required this.patient, + required this.patientType, + required this.arrivalType}); final List vitalList; @@ -187,11 +187,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { default: } return AppScaffold( - appBarTitle: pageTitle, + appBarTitle: pageTitle ?? "", backgroundColor: Color.fromRGBO(248, 248, 248, 1), isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -202,7 +201,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient?.patientDetails?.firstName?? patient.fullName?? ''}'s", + "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, @@ -220,7 +219,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { child: ListView( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), - children: VSchart.map((chartInfo) { + children: VSchart!.map((chartInfo) { var vitalListTemp = vitalList.where( (element) => element.toJson()[chartInfo['viewKey']] != null, ); @@ -229,20 +228,14 @@ class VitalSignItemDetailsScreen extends StatelessWidget { return VitalSignDetailPainScale(vitalList); } - if (vitalListTemp.length != 0 && - chartInfo['viewKey'] == 'BloodPressure' || chartInfo['viewKey'] == 'O2') { + if (vitalListTemp.length != 0 && chartInfo['viewKey'] == 'BloodPressure' || + chartInfo['viewKey'] == 'O2') { return VitalSingChartBloodPressure( vitalList: vitalList, - name: projectViewModel.isArabic - ? chartInfo['nameAr'] - : chartInfo['name'], + name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'], title1: chartInfo['title1'], - title2: projectViewModel.isArabic - ? chartInfo['title2Ar'] - : chartInfo['title2'], - title3: projectViewModel.isArabic - ? chartInfo['title3Ar'] - : chartInfo['title3'], + title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'], + title3: projectViewModel.isArabic ? chartInfo['title3Ar'] : chartInfo['title3'], viewKey1: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureHigher' : 'SAO2', viewKey2: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureLower' : 'FIO2', ); @@ -251,13 +244,9 @@ class VitalSignItemDetailsScreen extends StatelessWidget { return vitalListTemp.length != 0 ? VitalSingChartAndDetials( vitalList: vitalList, - name: projectViewModel.isArabic - ? chartInfo['nameAr'] - : chartInfo['name'], + name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'], title1: chartInfo['title1'], - title2: projectViewModel.isArabic - ? chartInfo['title2Ar'] - : chartInfo['title2'], + title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'], viewKey: chartInfo['viewKey']) : Container(); }).toList(), diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index ef8049ce..0d3803b8 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -11,12 +11,12 @@ import 'LineChartCurved.dart'; class VitalSingChartAndDetials extends StatelessWidget { VitalSingChartAndDetials({ - Key key, - @required this.vitalList, - @required this.name, - @required this.viewKey, - @required this.title1, - @required this.title2, + Key? key, + required this.vitalList, + required this.name, + required this.viewKey, + required this.title1, + required this.title2, }) : super(key: key); final List vitalList; @@ -31,50 +31,45 @@ class VitalSingChartAndDetials extends StatelessWidget { generateData(); return timeSeriesData.length != 0 ? Padding( - padding: const EdgeInsets.all(10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) + padding: const EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), + child: LineChartCurved( + title: name, + timeSeries: timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, + ), ), - child: LineChartCurved( - title: name, - timeSeries: timeSeriesData, - indexes: timeSeriesData.length ~/ 5.5, + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).graphDetails, + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + SizedBox( + height: 8, + ), + VitalSignDetailsWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + viewKey: viewKey, + ), + ], + ), ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), - padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).graphDetails, - fontSize: SizeConfig.textMultiplier * 2.1, - fontWeight: FontWeight.bold, - - fontFamily: 'Poppins', - ), - SizedBox(height: 8,), - VitalSignDetailsWidget( - vitalList: vitalList, - title1: title1, - title2: title2, - viewKey: viewKey, - ), - ], - ), - ), - /*AppExpandableNotifier( + /*AppExpandableNotifier( // isExpand: true, headerWid: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/5.5,), bodyWid: VitalSignDetailsWidget( @@ -84,9 +79,9 @@ class VitalSingChartAndDetials extends StatelessWidget { viewKey: viewKey, ), ),*/ - ], - ), - ) + ], + ), + ) : Container( width: double.infinity, height: MediaQuery.of(context).size.height, @@ -100,14 +95,11 @@ class VitalSingChartAndDetials extends StatelessWidget { if (vitalList.length > 0) { vitalList.reversed.toList().forEach( (element) { - DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(element.createdOn); - if (element.toJson()[viewKey] != null && - element.toJson()[viewKey]?.toInt() != 0) + DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(element.createdOn); + if (element.toJson()[viewKey] != null && element.toJson()[viewKey]?.toInt() != 0) timeSeriesData.add( TimeSeriesSales2( - new DateTime( - elementDate.year, elementDate.month, elementDate.day), + new DateTime(elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey].toDouble(), ), ); diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index d0416539..ba75ed30 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -11,14 +11,14 @@ import 'LineChartCurvedBloodPressure.dart'; class VitalSingChartBloodPressure extends StatelessWidget { VitalSingChartBloodPressure({ - Key key, - @required this.vitalList, - @required this.name, - @required this.viewKey1, - @required this.viewKey2, - @required this.title1, - @required this.title2, - @required this.title3, + Key? key, + required this.vitalList, + required this.name, + required this.viewKey1, + required this.viewKey2, + required this.title1, + required this.title2, + required this.title3, }) : super(key: key); final List vitalList; @@ -42,12 +42,10 @@ class VitalSingChartBloodPressure extends StatelessWidget { children: [ Container( margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12)), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), child: LineChartCurvedBloodPressure( title: name, - isOX: title2=="SAO2", + isOX: title2 == "SAO2", timeSeries1: timeSeriesData1, timeSeries2: timeSeriesData2, indexes: timeSeriesData1.length ~/ 5.5, @@ -56,9 +54,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { Container( margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12)), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -115,21 +111,18 @@ class VitalSingChartBloodPressure extends StatelessWidget { if (vitalList.length > 0) { vitalList.reversed.toList().forEach( (element) { - DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(element.createdOn); + DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(element.createdOn); if (element.toJson()[viewKey1]?.toInt() != 0) timeSeriesData1.add( TimeSeriesSales2( - new DateTime( - elementDate.year, elementDate.month, elementDate.day), + new DateTime(elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey1].toDouble(), ), ); if (element.toJson()[viewKey2]?.toInt() != 0) timeSeriesData2.add( TimeSeriesSales2( - new DateTime( - elementDate.year, elementDate.month, elementDate.day), + new DateTime(elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey2].toDouble(), ), ); diff --git a/lib/screens/prescription/add_favourite_prescription.dart b/lib/screens/prescription/add_favourite_prescription.dart index 118df049..e3a5a654 100644 --- a/lib/screens/prescription/add_favourite_prescription.dart +++ b/lib/screens/prescription/add_favourite_prescription.dart @@ -14,27 +14,27 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; class AddFavPrescription extends StatefulWidget { - final PrescriptionViewModel model; - final PatiantInformtion patient; - final String categoryID; + final PrescriptionViewModel? model; + final PatiantInformtion? patient; + final String? categoryID; - const AddFavPrescription({Key key, this.model, this.patient, this.categoryID}) : super(key: key); + const AddFavPrescription({Key? key, this.model, this.patient, this.categoryID}) : super(key: key); @override _AddFavPrescriptionState createState() => _AddFavPrescriptionState(); } class _AddFavPrescriptionState extends State { - MedicineViewModel model; - PatiantInformtion patient; + late MedicineViewModel model; + late PatiantInformtion patient; - List entityList = List(); - ProcedureTempleteDetailsModel groupProcedures; + List entityList = []; + late ProcedureTempleteDetailsModel groupProcedures; @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.categoryID), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: false, baseViewModel: model, body: Column( @@ -90,8 +90,8 @@ class _AddFavPrescriptionState extends State { context, MaterialPageRoute( builder: (context) => PrescriptionCheckOutScreen( - patient: widget.patient, - model: widget.model, + patient: widget.patient!, + model: widget.model!, groupProcedures: groupProcedures, ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index f4761897..4f15871d 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -20,7 +20,7 @@ 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/medicine/medicine_item_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import '../../widgets/shared/text_fields/TextFields.dart'; 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/network_base_view.dart'; @@ -45,44 +45,44 @@ addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion pati } postPrescription( - {String duration, - String doseTimeIn, - String dose, - String drugId, - String strength, - String route, - String frequency, - String indication, - String instruction, - PrescriptionViewModel model, - DateTime doseTime, - String doseUnit, - String icdCode, - PatiantInformtion patient, - String patientType}) async { + {String? duration, + String? doseTimeIn, + String? dose, + String? drugId, + String? strength, + String? route, + String? frequency, + String? indication, + String? instruction, + PrescriptionViewModel? model, + DateTime? doseTime, + String? doseUnit, + String? icdCode, + PatiantInformtion? patient, + String? patientType}) async { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); - List prescriptionList = List(); + List prescriptionList = []; - postProcedureReqModel.appointmentNo = patient.appointmentNo; + postProcedureReqModel.appointmentNo = patient!.appointmentNo; postProcedureReqModel.clinicID = patient.clinicId; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; prescriptionList.add(PrescriptionRequestModel( covered: true, - dose: double.parse(dose), - itemId: drugId.isEmpty ? 1 : int.parse(drugId), - doseUnitId: int.parse(doseUnit), - route: route.isEmpty ? 1 : int.parse(route), - frequency: frequency.isEmpty ? 1 : int.parse(frequency), + dose: double.parse(dose ?? "0"), + itemId: drugId!.isEmpty ? 1 : int.parse(drugId ?? "0"), + doseUnitId: int.parse(doseUnit ?? "1"), + route: route!.isEmpty ? 1 : int.parse(route ?? "1"), + frequency: frequency!.isEmpty ? 1 : int.parse(frequency!), remarks: instruction, approvalRequired: true, icdcode10Id: icdCode.toString(), - doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), - duration: duration.isEmpty ? 1 : int.parse(duration), - doseStartDate: doseTime.toIso8601String())); + doseTime: doseTimeIn!.isEmpty ? 1 : int.parse(doseTimeIn), + duration: duration!.isEmpty ? 1 : int.parse(duration), + doseStartDate: doseTime!.toIso8601String())); postProcedureReqModel.prescriptionRequestModel = prescriptionList; - await model.postPrescription(postProcedureReqModel, patient.patientMRN); + await model!.postPrescription(postProcedureReqModel, patient.patientMRN!); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -104,14 +104,14 @@ class PrescriptionFormWidget extends StatefulWidget { } class _PrescriptionFormWidgetState extends State { - String routeError; - String frequencyError; - String doseTimeError; - String durationError; - String unitError; - String strengthError; + String? routeError; + String? frequencyError; + String? doseTimeError; + String? durationError; + String? unitError; + String? strengthError; - int selectedType; + late int selectedType; TextEditingController strengthController = TextEditingController(); TextEditingController indicationController = TextEditingController(); @@ -121,9 +121,9 @@ class _PrescriptionFormWidgetState extends State { bool visbiltySearch = true; final myController = TextEditingController(); - DateTime selectedDate; - int strengthChar; - GetMedicationResponseModel _selectedMedication; + late DateTime selectedDate; + late int strengthChar; + late GetMedicationResponseModel _selectedMedication; GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); @@ -237,7 +237,7 @@ class _PrescriptionFormWidgetState extends State { builder: ( BuildContext context, MedicineViewModel model, - Widget child, + Widget? child, ) => NetworkBaseView( baseViewModel: model, @@ -354,7 +354,7 @@ class _PrescriptionFormWidgetState extends State { child: MedicineItemWidget( label: model.allMedicationList[index].description), onTap: () { - model.getItem(itemID: model.allMedicationList[index].itemId); + model.getItem(itemID: model.allMedicationList[index].itemId!); visbiltyPrescriptionForm = true; visbiltySearch = false; _selectedMedication = model.allMedicationList[index]; @@ -391,11 +391,11 @@ class _PrescriptionFormWidgetState extends State { activeColor: Color(0xFFB9382C), value: 1, groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); + onChanged: (int? value) { + setSelectedType(value!); }, ), - Text(TranslationBase.of(context).regular), + Text(TranslationBase.of(context).regular ?? ""), ], ), ), @@ -434,7 +434,7 @@ class _PrescriptionFormWidgetState extends State { PrescriptionTextFiled( width: MediaQuery.of(context).size.width * 0.560, element: units, - elementError: unitError, + elementError: unitError ?? "", keyName: 'description', keyId: 'parameterCode', hintText: 'Select', @@ -453,7 +453,7 @@ class _PrescriptionFormWidgetState extends State { PrescriptionTextFiled( elementList: model.itemMedicineListRoute, element: route, - elementError: routeError, + elementError: routeError ?? "", keyId: 'parameterCode', keyName: 'description', okFunction: (selectedValue) { @@ -462,12 +462,12 @@ class _PrescriptionFormWidgetState extends State { route['isDefault'] = true; }); }, - hintText: TranslationBase.of(context).route, + hintText: TranslationBase.of(context).route ?? "", ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).frequency, - elementError: frequencyError, + hintText: TranslationBase.of(context).frequency ?? "", + elementError: frequencyError ?? "", element: frequency, elementList: model.itemMedicineList, keyId: 'parameterCode', @@ -483,7 +483,7 @@ class _PrescriptionFormWidgetState extends State { model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId, + itemCode: _selectedMedication.itemId!, strength: double.parse(strengthController.text)); return; @@ -492,8 +492,8 @@ class _PrescriptionFormWidgetState extends State { }), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).doseTime, - elementError: doseTimeError, + hintText: TranslationBase.of(context).doseTime ?? "", + elementError: doseTimeError ?? "", element: doseTime, elementList: model.medicationDoseTimeList, keyId: 'id', @@ -546,7 +546,7 @@ class _PrescriptionFormWidgetState extends State { onTap: () => selectDate(context, widget.model), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).date, + TranslationBase.of(context).date ?? "", selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, @@ -562,8 +562,8 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( element: duration, - elementError: durationError, - hintText: TranslationBase.of(context).duration, + elementError: durationError ?? "", + hintText: TranslationBase.of(context).duration ?? "", elementList: model.medicationDurationList, keyName: 'nameEn', keyId: 'id', @@ -577,7 +577,7 @@ class _PrescriptionFormWidgetState extends State { model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId, + itemCode: _selectedMedication.itemId!, strength: double.parse(strengthController.text), ); box = model.boxQuintity; @@ -604,9 +604,8 @@ class _PrescriptionFormWidgetState extends State { hintText: TranslationBase.of(context).boxQuantity, isTextFieldHasSuffix: false, dropDownText: box != null - ? TranslationBase.of(context).boxQuantity + - ": " + - model.boxQuintity.toString() + ? TranslationBase.of(context).boxQuantity ?? + "" + ": " + model.boxQuintity.toString() : null, enabled: false, ), @@ -679,7 +678,7 @@ class _PrescriptionFormWidgetState extends State { return; } - if (formKey.currentState.validate()) { + if (formKey.currentState!.validate()) { Navigator.pop(context); openDrugToDrug(model); { @@ -800,7 +799,7 @@ class _PrescriptionFormWidgetState extends State { }); } - formKey.currentState.save(); + formKey.currentState!.save(); }, ), ], @@ -829,7 +828,7 @@ class _PrescriptionFormWidgetState extends State { Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -843,8 +842,8 @@ class _PrescriptionFormWidgetState extends State { } } - InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String? hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -943,7 +942,7 @@ class _PrescriptionFormWidgetState extends State { getPriscriptionforDrug(List prescriptionList, MedicineViewModel model) { var prescriptionDetails = []; if (prescriptionList.length > 0) { - prescriptionList[0].entityList.forEach((element) { + prescriptionList[0].entityList!.forEach((element) { if (element.mediSpanGPICode != null) { prescriptionDetails.add({ 'DrugId': element.mediSpanGPICode, diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/drugtodrug.dart index 15abfeb6..6b1e0df0 100644 --- a/lib/screens/prescription/drugtodrug.dart +++ b/lib/screens/prescription/drugtodrug.dart @@ -54,45 +54,34 @@ class _DrugToDrug extends State { Widget build(BuildContext context) { return isLoaded == true ? BaseView( - onModelReady: (model3) => model3.getDrugToDrug( - model.patientVitalSigns, - widget.listAssessment, - model2.patientAllergiesList, - widget.patient, - widget.prescription), - builder: (BuildContext context, PrescriptionViewModel model3, - Widget child) => - NetworkBaseView( - baseViewModel: model3, - child: Container( - height: SizeConfig.realScreenHeight * .4, - child: new ListView.builder( - itemCount: expandableList.length, - itemBuilder: (context, i) { - return new ExpansionTile( - title: new AppText( - expandableList[i]['name'] + - ' ' + - '(' + - getDrugInfo(expandableList[i]['level'], - model3) - .length - .toString() + - ')', - fontSize: 20, - fontWeight: FontWeight.bold, - ), - children: getDrugInfo( - expandableList[i]['level'], model3) - .map((item) { - return Container( - padding: EdgeInsets.all(10), - child: AppText( - item['comment'], - color: Colors.red[900], - )); - }).toList()); - })))) + onModelReady: (model3) => model3.getDrugToDrug(model.patientVitalSigns!, widget.listAssessment, + model2.patientAllergiesList, widget.patient, widget.prescription), + builder: (BuildContext context, PrescriptionViewModel model3, Widget? child) => NetworkBaseView( + baseViewModel: model3, + child: Container( + height: SizeConfig.realScreenHeight * .4, + child: new ListView.builder( + itemCount: expandableList.length, + itemBuilder: (context, i) { + return new ExpansionTile( + title: new AppText( + expandableList[i]['name'] + + ' ' + + '(' + + getDrugInfo(expandableList[i]['level'], model3).length.toString() + + ')', + fontSize: 20, + fontWeight: FontWeight.bold, + ), + children: getDrugInfo(expandableList[i]['level'], model3).map((item) { + return Container( + padding: EdgeInsets.all(10), + child: AppText( + item['comment'], + color: Colors.red[900], + )); + }).toList()); + })))) : Container( height: SizeConfig.realScreenHeight * .45, child: Center( diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index 27905b2d..a631ab15 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -18,7 +18,7 @@ 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/shared/TextFields.dart'; +import '../../widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -32,12 +32,12 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class PrescriptionCheckOutScreen extends StatefulWidget { - final PrescriptionViewModel model; - final PatiantInformtion patient; - final List prescriptionList; - final ProcedureTempleteDetailsModel groupProcedures; + final PrescriptionViewModel? model; + final PatiantInformtion? patient; + final List? prescriptionList; + final ProcedureTempleteDetailsModel? groupProcedures; - const PrescriptionCheckOutScreen({Key key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) + const PrescriptionCheckOutScreen({Key? key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) : super(key: key); @override @@ -46,46 +46,46 @@ class PrescriptionCheckOutScreen extends StatefulWidget { class _PrescriptionCheckOutScreenState extends State { postPrescription( - {String duration, - String doseTimeIn, - String dose, - String drugId, - String strength, - String route, - String frequency, - String indication, - String instruction, - PrescriptionViewModel model, - DateTime doseTime, - String doseUnit, - String icdCode, - PatiantInformtion patient, - String patientType}) async { + {String? duration, + String? doseTimeIn, + String? dose, + String? drugId, + String? strength, + String? route, + String? frequency, + String? indication, + String? instruction, + PrescriptionViewModel? model, + DateTime? doseTime, + String? doseUnit, + String? icdCode, + PatiantInformtion? patient, + String? patientType}) async { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); - List prescriptionList = List(); + List prescriptionList = []; - postProcedureReqModel.appointmentNo = patient.appointmentNo; + postProcedureReqModel.appointmentNo = patient!.appointmentNo; postProcedureReqModel.clinicID = patient.clinicId; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; prescriptionList.add(PrescriptionRequestModel( covered: true, - dose: double.parse(dose), - itemId: drugId.isEmpty ? 1 : int.parse(drugId), - doseUnitId: int.parse(doseUnit), - route: route.isEmpty ? 1 : int.parse(route), - frequency: frequency.isEmpty ? 1 : int.parse(frequency), + dose: double.parse(dose!), + itemId: drugId!.isEmpty ? 1 : int.parse(drugId!), + doseUnitId: int.parse(doseUnit!), + route: route!.isEmpty ? 1 : int.parse(route!), + frequency: frequency!.isEmpty ? 1 : int.parse(frequency!), remarks: instruction, approvalRequired: true, icdcode10Id: icdCode.toString(), - doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), - duration: duration.isEmpty ? 1 : int.parse(duration), - doseStartDate: doseTime.toIso8601String())); + doseTime: doseTimeIn!.isEmpty ? 1 : int.parse(doseTimeIn), + duration: duration!.isEmpty ? 1 : int.parse(duration), + doseStartDate: doseTime!.toIso8601String())); postProcedureReqModel.prescriptionRequestModel = prescriptionList; - await model.postPrescription(postProcedureReqModel, patient.patientMRN); + await model!.postPrescription(postProcedureReqModel, patient.patientMRN!); - if (model.state == ViewState.ErrorLocal) { + if (model!.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { model.getPrescriptions(patient); @@ -93,14 +93,14 @@ class _PrescriptionCheckOutScreenState extends State } } - String routeError; - String frequencyError; - String doseTimeError; - String durationError; - String unitError; - String strengthError; + String? routeError; + String? frequencyError; + String? doseTimeError; + String? durationError; + String? unitError; + String? strengthError; - int selectedType; + late int selectedType; TextEditingController strengthController = TextEditingController(); TextEditingController indicationController = TextEditingController(); @@ -110,10 +110,10 @@ class _PrescriptionCheckOutScreenState extends State bool visbiltySearch = true; final myController = TextEditingController(); - DateTime selectedDate; - int strengthChar; - GetMedicationResponseModel _selectedMedication; - GlobalKey key = new GlobalKey>(); + late DateTime selectedDate; + late int strengthChar; + late GetMedicationResponseModel _selectedMedication; + late GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -202,17 +202,17 @@ class _PrescriptionCheckOutScreenState extends State final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - model.getItem(itemID: int.parse(widget.groupProcedures.aliasN.replaceAll("item code ;", ""))); + model.getItem(itemID: int.parse(widget.groupProcedures!.aliasN!.replaceAll("item code ;", ""))); x = model.patientAssessmentList.map((element) { return element.icdCode10ID; }); GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: widget.patient.patientMRN, - episodeID: widget.patient.episodeNo.toString(), + patientMRN: widget.patient!.patientMRN, + episodeID: widget.patient!.episodeNo.toString(), editedBy: '', doctorID: '', - appointmentNo: widget.patient.appointmentNo); + appointmentNo: widget.patient!.appointmentNo); if (model.medicationStrengthList.length == 0) { await model.getMedicationStrength(); } @@ -227,7 +227,7 @@ class _PrescriptionCheckOutScreenState extends State builder: ( BuildContext context, MedicineViewModel model, - Widget child, + Widget? child, ) => AppScaffold( backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), @@ -301,7 +301,7 @@ class _PrescriptionCheckOutScreenState extends State child: Column( children: [ AppText( - widget.groupProcedures.procedureName ?? "", + widget.groupProcedures!.procedureName ?? "", bold: true, ), Container( @@ -315,11 +315,11 @@ class _PrescriptionCheckOutScreenState extends State activeColor: Color(0xFFB9382C), value: 1, groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); + onChanged: (int? value) { + setSelectedType(value!); }, ), - Text(TranslationBase.of(context).regular), + Text(TranslationBase.of(context).regular!), ], ), ), @@ -358,7 +358,7 @@ class _PrescriptionCheckOutScreenState extends State PrescriptionTextFiled( width: MediaQuery.of(context).size.width * 0.560, element: units, - elementError: unitError, + elementError: unitError ?? "", keyName: 'description', keyId: 'parameterCode', hintText: 'Select', @@ -377,7 +377,7 @@ class _PrescriptionCheckOutScreenState extends State PrescriptionTextFiled( elementList: model.itemMedicineListRoute, element: route, - elementError: routeError, + elementError: routeError ?? "", keyId: 'parameterCode', keyName: 'description', okFunction: (selectedValue) { @@ -386,12 +386,12 @@ class _PrescriptionCheckOutScreenState extends State route['isDefault'] = true; }); }, - hintText: TranslationBase.of(context).route, + hintText: TranslationBase.of(context).route!, ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).frequency, - elementError: frequencyError, + hintText: TranslationBase.of(context).frequency!, + elementError: frequencyError ?? "", element: frequency, elementList: model.itemMedicineList, keyId: 'parameterCode', @@ -407,7 +407,7 @@ class _PrescriptionCheckOutScreenState extends State model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId, + itemCode: _selectedMedication.itemId!, strength: double.parse(strengthController.text)); return; @@ -416,8 +416,8 @@ class _PrescriptionCheckOutScreenState extends State }), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).doseTime, - elementError: doseTimeError, + hintText: TranslationBase.of(context).doseTime ?? "", + elementError: doseTimeError!, element: doseTime, elementList: model.medicationDoseTimeList, keyId: 'id', @@ -467,10 +467,10 @@ class _PrescriptionCheckOutScreenState extends State height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: () => selectDate(context, widget.model), + onTap: () => selectDate(context, widget.model!), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).date, + TranslationBase.of(context).date!, selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, @@ -486,8 +486,8 @@ class _PrescriptionCheckOutScreenState extends State SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( element: duration, - elementError: durationError, - hintText: TranslationBase.of(context).duration, + elementError: durationError ?? "", + hintText: TranslationBase.of(context).duration!, elementList: model.medicationDurationList, keyName: 'nameEn', keyId: 'id', @@ -501,7 +501,7 @@ class _PrescriptionCheckOutScreenState extends State model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId, + itemCode: _selectedMedication.itemId!, strength: double.parse(strengthController.text), ); box = model.boxQuintity; @@ -545,7 +545,7 @@ class _PrescriptionCheckOutScreenState extends State TextFields( maxLines: 6, minLines: 4, - hintText: TranslationBase.of(context).instruction, + hintText: TranslationBase.of(context).instruction!, controller: instructionController, //keyboardType: TextInputType.number, ), @@ -602,13 +602,13 @@ class _PrescriptionCheckOutScreenState extends State return; } - if (formKey.currentState.validate()) { + if (formKey.currentState!.validate()) { Navigator.pop(context); // openDrugToDrug(model); { postPrescription( icdCode: model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID.isEmpty + ? model.patientAssessmentList[0].icdCode10ID!.isEmpty ? "test" : model.patientAssessmentList[0].icdCode10ID.toString() : "test", @@ -623,9 +623,9 @@ class _PrescriptionCheckOutScreenState extends State doseUnit: model.itemMedicineListUnit.length == 1 ? model.itemMedicineListUnit[0]['parameterCode'].toString() : units['parameterCode'].toString(), - patient: widget.patient, + patient: widget.patient!, doseTimeIn: doseTime['id'].toString(), - model: widget.model, + model: widget.model!, duration: duration['id'].toString(), frequency: model.itemMedicineList.length == 1 ? model.itemMedicineList[0]['parameterCode'].toString() @@ -633,7 +633,7 @@ class _PrescriptionCheckOutScreenState extends State route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), - drugId: (widget.groupProcedures.aliasN + drugId: (widget!.groupProcedures!.aliasN! .replaceAll("item code ;", "")), strength: strengthController.text, indication: indicationController.text, @@ -665,19 +665,19 @@ class _PrescriptionCheckOutScreenState extends State frequencyError = null; } if (units == null) { - unitError = TranslationBase.of(context).fieldRequired; + unitError = TranslationBase.of(context).fieldRequired!; } else { unitError = null; } if (strengthController.text == "") { - strengthError = TranslationBase.of(context).fieldRequired; + strengthError = TranslationBase.of(context).fieldRequired!; } else { strengthError = null; } }); } - formKey.currentState.save(); + formKey.currentState!.save(); }, ), ], @@ -706,7 +706,7 @@ class _PrescriptionCheckOutScreenState extends State Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -720,8 +720,8 @@ class _PrescriptionCheckOutScreenState extends State } } - InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/prescription/prescription_details_page.dart b/lib/screens/prescription/prescription_details_page.dart index 623cee90..0c364c6d 100644 --- a/lib/screens/prescription/prescription_details_page.dart +++ b/lib/screens/prescription/prescription_details_page.dart @@ -8,13 +8,13 @@ import 'package:flutter/material.dart'; class PrescriptionDetailsPage extends StatelessWidget { final PrescriptionReport prescriptionReport; - PrescriptionDetailsPage({Key key, this.prescriptionReport}); + PrescriptionDetailsPage({required Key key, required this.prescriptionReport}); @override Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions, + appBarTitle: TranslationBase.of(context).prescriptions!, body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -28,14 +28,14 @@ class PrescriptionDetailsPage extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200], width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Row( children: [ ClipRRect( borderRadius: BorderRadius.all(Radius.circular(5)), child: Image.network( - prescriptionReport.imageSRCUrl, + prescriptionReport.imageSRCUrl!, fit: BoxFit.cover, width: 60, height: 70, @@ -45,10 +45,9 @@ class PrescriptionDetailsPage extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: AppText( - prescriptionReport.itemDescription.isNotEmpty - ? prescriptionReport.itemDescription - : prescriptionReport.itemDescriptionN), + child: AppText(prescriptionReport.itemDescription!.isNotEmpty + ? prescriptionReport.itemDescription + : prescriptionReport.itemDescriptionN), ), ), ) @@ -59,9 +58,7 @@ class PrescriptionDetailsPage extends StatelessWidget { color: Colors.white, margin: EdgeInsets.only(top: 10, left: 10, right: 10), child: Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 0.5), - outside: BorderSide(width: 0.5)), + border: TableBorder.symmetric(inside: BorderSide(width: 0.5), outside: BorderSide(width: 0.5)), children: [ TableRow( children: [ @@ -109,28 +106,22 @@ class PrescriptionDetailsPage extends StatelessWidget { color: Colors.white, height: 50, width: double.infinity, - child: - Center(child: Text(prescriptionReport.routeN))), + child: Center(child: Text(prescriptionReport.routeN ?? ""))), Container( color: Colors.white, height: 50, width: double.infinity, - child: Center( - child: - Text(prescriptionReport.frequencyN ?? ''))), + child: Center(child: Text(prescriptionReport.frequencyN ?? ''))), Container( color: Colors.white, height: 50, width: double.infinity, - child: Center( - child: Text( - '${prescriptionReport.doseDailyQuantity}'))), + child: Center(child: Text('${prescriptionReport.doseDailyQuantity}'))), Container( color: Colors.white, height: 50, width: double.infinity, - child: - Center(child: Text('${prescriptionReport.days}'))) + child: Center(child: Text('${prescriptionReport.days}'))) ], ), ], diff --git a/lib/screens/prescription/prescription_home_screen.dart b/lib/screens/prescription/prescription_home_screen.dart index 6bdfabb1..eeeb07ef 100644 --- a/lib/screens/prescription/prescription_home_screen.dart +++ b/lib/screens/prescription/prescription_home_screen.dart @@ -15,15 +15,15 @@ class PrescriptionHomeScreen extends StatefulWidget { final PrescriptionViewModel model; final PatiantInformtion patient; - const PrescriptionHomeScreen({Key key, this.model, this.patient}) : super(key: key); + const PrescriptionHomeScreen({Key? key, required this.model, required this.patient}) : super(key: key); @override _PrescriptionHomeScreenState createState() => _PrescriptionHomeScreenState(); } class _PrescriptionHomeScreenState extends State with SingleTickerProviderStateMixin { - PrescriptionViewModel model; - PatiantInformtion patient; - TabController _tabController; + late PrescriptionViewModel model; + late PatiantInformtion patient; + late TabController _tabController; int _activeTab = 0; @override void initState() { @@ -49,7 +49,7 @@ class _PrescriptionHomeScreenState extends State with Si final screenSize = MediaQuery.of(context).size; return BaseView( //onModelReady: (model) => model.getCategory(), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: false, body: NetworkBaseView( baseViewModel: model, diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index b6d27af6..ffb9cee1 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -22,14 +22,14 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { final int prescriptionIndex; PrescriptionItemsInPatientPage( - {Key key, - this.prescriptions, - this.patient, - this.patientType, - this.arrivalType, - this.stopOn, - this.startOn, - this.prescriptionIndex}); + {Key? key, + required this.prescriptions, + required this.patient, + required this.patientType, + required this.arrivalType, + required this.stopOn, + required this.startOn, + required this.prescriptionIndex}); @override Widget build(BuildContext context) { @@ -42,10 +42,9 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - backgroundColor: Colors.grey[100], + backgroundColor: Colors.grey[100]!, baseViewModel: model, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString(), patient.arrivedOn), + appBar: PatientProfileHeaderNewDesignAppBar(patient, patient.patientType.toString(), patient.arrivedOn ?? ""), body: SingleChildScrollView( child: Container( child: Column( @@ -64,8 +63,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Container( margin: EdgeInsets.only(left: 18, right: 18), child: AppText( - model.inPatientPrescription[prescriptionIndex] - .itemDescription, + model.inPatientPrescription[prescriptionIndex].itemDescription, bold: true, ), ), @@ -93,12 +91,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { color: Colors.grey, ), Expanded( - child: AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .direction ?? - '')), + child: AppText( + " " + model.inPatientPrescription[prescriptionIndex].direction! ?? '')), ], ), Row( @@ -107,13 +101,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).route, color: Colors.grey, ), - AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .route - .toString() ?? - ''), + AppText( + " " + model.inPatientPrescription[prescriptionIndex].route.toString() ?? ''), ], ), Row( @@ -123,12 +112,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { color: Colors.grey, ), Expanded( - child: AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .refillType ?? - '')), + child: AppText( + " " + model.inPatientPrescription[prescriptionIndex].refillType! ?? '')), ], ), Row( @@ -170,10 +155,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { color: Colors.grey, ), AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .unitofMeasurementDescription ?? + model.inPatientPrescription[prescriptionIndex] + .unitofMeasurementDescription! ?? ''), ], ), @@ -183,13 +166,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).dailyDoses, color: Colors.grey, ), - AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .dose - .toString() ?? - ''), + AppText( + " " + model.inPatientPrescription[prescriptionIndex].dose.toString() ?? ''), ], ), Row( @@ -199,10 +177,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { color: Colors.grey, ), AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .statusDescription + model.inPatientPrescription[prescriptionIndex].statusDescription .toString() ?? ''), ], @@ -213,12 +188,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).processed, color: Colors.grey, ), - AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .processedBy ?? - ''), + AppText(" " + model.inPatientPrescription[prescriptionIndex].processedBy! ?? ''), ], ), Row( @@ -227,23 +197,14 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).dailyDoses, color: Colors.grey, ), - AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .dose - .toString() ?? - ''), + AppText( + " " + model.inPatientPrescription[prescriptionIndex].dose.toString() ?? ''), ], ), SizedBox( height: 12, ), - AppText(model - .inPatientPrescription[ - prescriptionIndex] - .comments ?? - ''), + AppText(model.inPatientPrescription[prescriptionIndex].comments ?? ''), ], ), ) diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index a68f6f56..36434d43 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -17,25 +17,29 @@ class PrescriptionItemsPage extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - PrescriptionItemsPage({Key key, this.prescriptions, this.patient, this.patientType, this.arrivalType}); + PrescriptionItemsPage( + {Key? key, + required this.prescriptions, + required this.patient, + required this.patientType, + required this.arrivalType}); @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => - model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), + onModelReady: (model) => model.getPrescriptionReport(prescriptions: prescriptions, patient: patient), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - backgroundColor: Colors.grey[100], + backgroundColor: Colors.grey[100]!, baseViewModel: model, appBar: PatientProfileHeaderWhitAppointmentAppBar( patient: patient, - patientType: patientType??"0", - arrivalType: arrivalType??"0", + patientType: patientType ?? "0", + arrivalType: arrivalType ?? "0", clinic: prescriptions.clinicDescription, branch: prescriptions.name, isPrescriptions: true, - appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), + appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate!), doctorName: prescriptions.doctorName, profileUrl: prescriptions.doctorImageURL, ), @@ -43,11 +47,10 @@ class PrescriptionItemsPage extends StatelessWidget { child: Container( child: Column( children: [ - - if (!prescriptions.isInOutPatient) + if (!prescriptions.isInOutPatient!) ...List.generate( model.prescriptionReportList.length, - (index) => Container( + (index) => Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), color: Colors.white, @@ -59,179 +62,229 @@ class PrescriptionItemsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 18,right: 18), - child: AppText(model.prescriptionReportList[index].itemDescription.isNotEmpty ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)), - SizedBox(height: 12,), + margin: EdgeInsets.only(left: 18, right: 18), + child: AppText( + model.prescriptionReportList[index].itemDescription!.isNotEmpty + ? model.prescriptionReportList[index].itemDescription + : model.prescriptionReportList[index].itemDescriptionN, + bold: true, + )), + SizedBox( + height: 12, + ), Row( children: [ - SizedBox(width: 18,), + SizedBox( + width: 18, + ), Container( decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.all(width: 0.5,color: Colors.grey) - ), + shape: BoxShape.circle, border: Border.all(width: 0.5, color: Colors.grey)), height: 55, width: 55, child: InkWell( - onTap: (){ + onTap: () { showDialog( context: context, - builder: (ctx) => ShowImageDialog( - imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, - ) - ); + builder: (ctx) => ShowImageDialog( + imageUrl: + model.prescriptionReportEnhList[index].imageSRCUrl ?? "", + )); }, child: Padding( padding: const EdgeInsets.all(8.0), child: Image.network( - model.prescriptionReportList[index].imageSRCUrl, + model.prescriptionReportList[index].imageSRCUrl ?? "", fit: BoxFit.cover, ), ), ), ), - SizedBox(width: 10,), - Expanded(child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: AppText(" "+model.prescriptionReportList[index].routeN)), - ], - ), - Row( - children: [ - AppText(TranslationBase.of(context).frequency,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].frequencyN ?? ''), - ], - ), - Row( - children: [ - AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].doseDailyQuantity ?? ''), - ], - ), - Row( - children: [ - AppText(TranslationBase.of(context).duration,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), - ], - ), - SizedBox(height: 12,), - AppText(model.prescriptionReportList[index].remarks ?? ''), - ], - ),) - - + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).route, + color: Colors.grey, + ), + Expanded( + child: AppText(" " + model.prescriptionReportList[index].routeN!)), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).frequency, + color: Colors.grey, + ), + AppText(" " + model.prescriptionReportList[index].frequencyN! ?? ''), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).dailyDoses, + color: Colors.grey, + ), + AppText( + " " + model.prescriptionReportList[index].doseDailyQuantity ?? ''), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).duration, + color: Colors.grey, + ), + AppText( + " " + model.prescriptionReportList[index].days.toString() ?? ''), + ], + ), + SizedBox( + height: 12, + ), + AppText(model.prescriptionReportList[index].remarks ?? ''), + ], + ), + ) ], ) ], ), ), )) - else - ...List.generate( - model.prescriptionReportEnhList.length, - (index) => Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - margin: EdgeInsets.all(12), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(left: 18,right: 18), - child: AppText(model.prescriptionReportEnhList[index].itemDescription,bold: true,),), - SizedBox(height: 12,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(width: 18,), - Container( - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.all(width: 0.5,color: Colors.grey) - ), - height: 55, - width: 55, - child: InkWell( - onTap: (){ - showDialog( + ...List.generate( + model.prescriptionReportEnhList.length, + (index) => Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18, right: 18), + child: AppText( + model.prescriptionReportEnhList[index].itemDescription, + bold: true, + ), + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 18, + ), + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, border: Border.all(width: 0.5, color: Colors.grey)), + height: 55, + width: 55, + child: InkWell( + onTap: () { + showDialog( context: context, builder: (ctx) => ShowImageDialog( - imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, - ) - ); - }, - child: Stack( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Image.network( - model.prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, - - ), + imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl!, + )); + }, + child: Stack( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.network( + model.prescriptionReportEnhList[index].imageSRCUrl ?? "", + fit: BoxFit.cover, ), - Positioned( - top: 10, - right: 10, - child: Icon(EvaIcons.search,color: Colors.grey,size: 35,)) - ], - ), + ), + Positioned( + top: 10, + right: 10, + child: Icon( + EvaIcons.search, + color: Colors.grey, + size: 35, + )) + ], ), ), - SizedBox(width: 10,), - Expanded(child: Column( + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ - AppText(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: AppText(" "+model.prescriptionReportEnhList[index].route??'')), + AppText( + TranslationBase.of(context).route, + color: Colors.grey, + ), + Expanded( + child: + AppText(" " + model.prescriptionReportEnhList[index].route! ?? '')), ], ), Row( children: [ - AppText(TranslationBase.of(context).frequency,color: Colors.grey,), - AppText(" "+model.prescriptionReportEnhList[index].frequency ?? ''), + AppText( + TranslationBase.of(context).frequency, + color: Colors.grey, + ), + AppText(" " + model.prescriptionReportEnhList[index].frequency! ?? ''), ], ), Row( children: [ - AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), - AppText(" "+model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? ''), + AppText( + TranslationBase.of(context).dailyDoses, + color: Colors.grey, + ), + AppText(" " + + model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? + ''), ], ), Row( children: [ - AppText(TranslationBase.of(context).duration,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), + AppText( + TranslationBase.of(context).duration, + color: Colors.grey, + ), + AppText(" " + model.prescriptionReportList[index].days.toString() ?? ''), ], ), - SizedBox(height: 12,), - AppText(model.prescriptionReportEnhList[index].remarks?? ''), + SizedBox( + height: 12, + ), + AppText(model.prescriptionReportEnhList[index].remarks ?? ''), ], - ),) - - - ], - ) - ], - ), + ), + ) + ], + ) + ], ), ), - ), - - - + ), + ), ], ), ), @@ -240,6 +293,3 @@ class PrescriptionItemsPage extends StatelessWidget { ); } } - - - diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 6608f108..3a1a058d 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -17,12 +17,12 @@ class NewPrescriptionScreen extends StatefulWidget { } class _NewPrescriptionScreenState extends State { - PersistentBottomSheetController _controller; + late PersistentBottomSheetController _controller; final _scaffoldKey = GlobalKey(); TextEditingController strengthController = TextEditingController(); int testNum = 0; - int strengthChar; - PatiantInformtion patient; + late int strengthChar; + late PatiantInformtion patient; @override void initState() { @@ -31,705 +31,553 @@ class _NewPrescriptionScreenState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; return BaseView( onModelReady: (model) => model.getPrescription(mrn: patient.patientId), - builder: - (BuildContext context, PrescriptionViewModel model, Widget child) => - AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescription, - body: NetworkBaseView( - baseViewModel: model, - child: SingleChildScrollView( - child: Container( - color: Colors.white, - child: Column( - children: [ - PatientPageHeaderWidget(patient), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - (model.prescriptionList.length != 0) - ? SizedBox( - height: - model.prescriptionList[0].rowcount == 0 - ? 200.0 - : 10.0) - : SizedBox(height: 200.0), - //model.prescriptionList == null - (model.prescriptionList.length != 0) - ? model.prescriptionList[0].rowcount == 0 - ? Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - InkWell( - onTap: () { - addPrescriptionForm( - context, - model, - patient, - model.prescriptionList); - //model.postPrescription(); - }, - child: CircleAvatar( - radius: 65, - backgroundColor: - Color(0XFFB8382C), - child: CircleAvatar( - radius: 60, - backgroundColor: Colors.white, - child: Icon( - Icons.add, - color: Colors.black, - size: 45.0, + builder: (BuildContext context, PrescriptionViewModel model, Widget? child) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescription ?? "", + body: NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Container( + color: Colors.white, + child: Column( + children: [ + PatientPageHeaderWidget(patient), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + (model.prescriptionList.length != 0) + ? SizedBox(height: model.prescriptionList[0].rowcount == 0 ? 200.0 : 10.0) + : SizedBox(height: 200.0), + //model.prescriptionList == null + (model.prescriptionList.length != 0) + ? model.prescriptionList[0].rowcount == 0 + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + InkWell( + onTap: () { + addPrescriptionForm(context, model, patient, model.prescriptionList); + //model.postPrescription(); + }, + child: CircleAvatar( + radius: 65, + backgroundColor: Color(0XFFB8382C), + child: CircleAvatar( + radius: 60, + backgroundColor: Colors.white, + child: Icon( + Icons.add, + color: Colors.black, + size: 45.0, + ), + ), + ), + ), + SizedBox( + height: 15.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).noPrescriptionListed, + color: Colors.black, + fontWeight: FontWeight.w900, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).addNow, + color: Color(0XFFB8382C), + fontWeight: FontWeight.w900, + ), + ], + ), + ], + ) + : Padding( + padding: EdgeInsets.all(14.0), + child: NetworkBaseView( + baseViewModel: model, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + InkWell( + child: Container( + height: 50.0, + width: 450.0, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(10.0), + ), + child: Padding( + padding: EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + ' Add more medication', + fontWeight: FontWeight.w100, + fontSize: 12.5, ), - ), + Icon( + Icons.add, + color: Color(0XFFB8382C), + ) + ], ), ), - SizedBox( - height: 15.0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context) - .noPrescriptionListed, - color: Colors.black, - fontWeight: FontWeight.w900, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context) - .addNow, - color: Color(0XFFB8382C), - fontWeight: FontWeight.w900, - ), - ], - ), - ], - ) - : Padding( - padding: EdgeInsets.all(14.0), - child: NetworkBaseView( - baseViewModel: model, + ), + onTap: () { + addPrescriptionForm(context, model, patient, model.prescriptionList); + //model.postPrescription(); + }, + ), + SizedBox( + height: 10.0, + ), + ...List.generate( + model.prescriptionList[0].rowcount, + (index) => Container( + color: Colors.white, child: Column( - mainAxisAlignment: - MainAxisAlignment.start, children: [ - InkWell( - child: Container( - height: 50.0, - width: 450.0, - decoration: BoxDecoration( + SizedBox( + height: MediaQuery.of(context).size.height * 0.022, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: + // CrossAxisAlignment.start, + children: [ + Container( color: Colors.white, - border: Border.all( - color: Colors.grey), - borderRadius: - BorderRadius.circular( - 10.0), - ), - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, + height: MediaQuery.of(context).size.height * 0.21, + width: MediaQuery.of(context).size.width * 0.1, + child: Column( children: [ AppText( - ' Add more medication', - fontWeight: - FontWeight.w100, - fontSize: 12.5, + (DateTime.parse(model.prescriptionList[0].entityList![index] + .createdOn) != + null + ? (DateTime.parse(model.prescriptionList[0] + .entityList![index].createdOn) + .year) + .toString() + : DateTime.now().year) + .toString(), + color: Colors.green, + fontSize: 13.5, + ), + AppText( + AppDateUtils.getMonth(model.prescriptionList[0] + .entityList![index].createdOn != + null + ? (DateTime.parse(model.prescriptionList[0] + .entityList![index].createdOn) + .month) + : DateTime.now().month) + .toUpperCase(), + color: Colors.green, + ), + AppText( + DateTime.parse(model + .prescriptionList[0].entityList![index].createdOn) + .day + .toString(), + color: Colors.green, + ), + AppText( + AppDateUtils.getTimeFormated(DateTime.parse(model + .prescriptionList[0].entityList![index].createdOn)) + .toString(), + color: Colors.green, ), - Icon( - Icons.add, - color: - Color(0XFFB8382C), - ) ], ), ), - ), - onTap: () { - addPrescriptionForm( - context, - model, - patient, - model.prescriptionList); - //model.postPrescription(); - }, - ), - SizedBox( - height: 10.0, - ), - ...List.generate( - model.prescriptionList[0] - .rowcount, - (index) => Container( - color: Colors.white, - child: Column( - children: [ - SizedBox( - height: MediaQuery.of( - context) - .size - .height * - 0.022, - ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - // crossAxisAlignment: - // CrossAxisAlignment.start, - children: [ - Container( - color: Colors.white, - height: MediaQuery.of( - context) - .size - .height * - 0.21, - width: MediaQuery.of( - context) - .size - .width * - 0.1, - child: Column( - children: [ - AppText( - (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) != - null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year) - .toString() - : DateTime.now() - .year) - .toString(), - color: Colors - .green, - fontSize: - 13.5, - ), - AppText( - AppDateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != - null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) - .month) - : DateTime.now() - .month) - .toUpperCase(), - color: Colors - .green, - ), - AppText( - DateTime.parse(model - .prescriptionList[ - 0] - .entityList[ - index] - .createdOn) - .day - .toString(), - color: Colors - .green, - ), - AppText( - AppDateUtils.getTimeFormated(DateTime.parse(model - .prescriptionList[ - 0] - .entityList[ - index] - .createdOn)) - .toString(), - color: Colors - .green, - ), - ], + Container( + color: Colors.white, + // height: MediaQuery.of( + // context) + // .size + // .height * + // 0.3499, + width: MediaQuery.of(context).size.width * 0.77, + child: Column( + children: [ + Row( + children: [ + AppText( + 'Start Date:', + fontWeight: FontWeight.w700, + fontSize: 14.0, ), - ), - Container( - color: Colors.white, - // height: MediaQuery.of( - // context) - // .size - // .height * - // 0.3499, - width: MediaQuery.of( - context) - .size - .width * - 0.77, - child: Column( - children: [ - Row( - children: [ - AppText( - 'Start Date:', - fontWeight: - FontWeight - .w700, - fontSize: - 14.0, - ), - Expanded( - child: - AppText( - AppDateUtils.getDateFormatted(DateTime.parse(model - .prescriptionList[0] - .entityList[index] - .startDate)), - fontSize: - 13.5, - ), - ), - SizedBox( - width: - 6.0, - ), - AppText( - 'Order Type:', - fontWeight: - FontWeight - .w700, - fontSize: - 14.0, - ), - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .orderTypeDescription, - fontSize: - 13.0, - ), - ), - ], - ), - SizedBox( - height: 5.5, - ), - Row( - children: [ - Container( - color: Colors - .white, - child: - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .medicationName, - fontWeight: - FontWeight.w700, - fontSize: - 15.0, - ), - ), - ) - ], - ), - SizedBox( - height: 5.5, - ), - Row( - children: [ - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .doseDetail, - fontSize: - 15.0, - ), - ) - ], - ), - SizedBox( - height: 10.0, - ), - Row( - children: [ - AppText( - 'Indication: ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].indication), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'UOM: ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].uom), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'BOX Quantity: ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].quantity.toString() == null ? "" : model.prescriptionList[0].entityList[index].quantity.toString()), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'pharmacy Intervention ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].pharmacyInervention == null ? "" : model.prescriptionList[0].entityList[index].pharmacyInervention.toString()), - ), - ), - ], - ), - SizedBox( - height: - 5.0), - Row( - children: [ - AppText( - 'pharmacist Remarks : ', - fontWeight: - FontWeight - .w700, - fontSize: - 15.0, - ), - Expanded( - child: AppText( - // commening below code because there is an error coming in the model please fix it before pushing it - model.prescriptionList[0].entityList[index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList[index].pharmacistRemarks, - fontSize: 15.0), - ) - ], - ), - SizedBox( - height: 20.0, - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .doctorName + - ": ", - fontWeight: - FontWeight - .w600, - ), - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .doctorName, - fontWeight: - FontWeight.w700, - ), - ) - ], - ), - SizedBox( - height: 8.0, - ), - Row( - children: [ - AppText( - 'Doctor Remarks : ', - fontWeight: - FontWeight - .w700, - fontSize: - 13.0, - ), - Expanded( - child: - Container( - color: Colors - .white, - // height: MediaQuery.of(context).size.height * - // 0.038, - child: - RichText( - // maxLines: - // 2, - // overflow: - // TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 10.0), - text: - TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].remarks != null - ? model.prescriptionList[0].entityList[index].remarks - : "", - ), - ), - ), - ), - ], - ), - SizedBox( - height: 10.0, + Expanded( + child: AppText( + AppDateUtils.getDateFormatted(DateTime.parse(model + .prescriptionList[0].entityList![index].startDate)), + fontSize: 13.5, + ), + ), + SizedBox( + width: 6.0, + ), + AppText( + 'Order Type:', + fontWeight: FontWeight.w700, + fontSize: 14.0, + ), + Expanded( + child: AppText( + model.prescriptionList[0].entityList![index] + .orderTypeDescription, + fontSize: 13.0, + ), + ), + ], + ), + SizedBox( + height: 5.5, + ), + Row( + children: [ + Container( + color: Colors.white, + child: Expanded( + child: AppText( + model.prescriptionList[0].entityList![index] + .medicationName, + fontWeight: FontWeight.w700, + fontSize: 15.0, ), - - // SizedBox( - // height: 40, - // ), - ], + ), + ) + ], + ), + SizedBox( + height: 5.5, + ), + Row( + children: [ + Expanded( + child: AppText( + model.prescriptionList[0].entityList![index].doseDetail, + fontSize: 15.0, + ), + ) + ], + ), + SizedBox( + height: 10.0, + ), + Row( + children: [ + AppText( + 'Indication: ', + fontWeight: FontWeight.w700, + fontSize: 17.0, + ), + Expanded( + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 12.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList![index] + .indication), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'UOM: ', + fontWeight: FontWeight.w700, + fontSize: 17.0, + ), + Expanded( + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 12.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model + .prescriptionList[0].entityList![index].uom), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'BOX Quantity: ', + fontWeight: FontWeight.w700, + fontSize: 17.0, + ), + Expanded( + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 12.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList![index] + .quantity + .toString() == + null + ? "" + : model.prescriptionList[0].entityList![index] + .quantity + .toString()), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'pharmacy Intervention ', + fontWeight: FontWeight.w700, + fontSize: 17.0, + ), + Expanded( + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 12.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList![index] + .pharmacyInervention == + null + ? "" + : model.prescriptionList[0].entityList![index] + .pharmacyInervention + .toString()), + ), + ), + ], + ), + SizedBox(height: 5.0), + Row( + children: [ + AppText( + 'pharmacist Remarks : ', + fontWeight: FontWeight.w700, + fontSize: 15.0, + ), + Expanded( + child: AppText( + // commening below code because there is an error coming in the model please fix it before pushing it + model.prescriptionList[0].entityList![index] + .pharmacistRemarks == + null + ? "" + : model.prescriptionList[0].entityList![index] + .pharmacistRemarks, + fontSize: 15.0), + ) + ], + ), + SizedBox( + height: 20.0, + ), + Row( + children: [ + AppText( + TranslationBase.of(context).doctorName! + ": ", + fontWeight: FontWeight.w600, + ), + Expanded( + child: AppText( + model.prescriptionList[0].entityList![index].doctorName, + fontWeight: FontWeight.w700, + ), + ) + ], + ), + SizedBox( + height: 8.0, + ), + Row( + children: [ + AppText( + 'Doctor Remarks : ', + fontWeight: FontWeight.w700, + fontSize: 13.0, ), - ), - Container( - color: Colors.white, - height: MediaQuery.of( - context) - .size - .height * - 0.16, - width: MediaQuery.of( - context) - .size - .width * - 0.06, - child: Column( - children: [ - InkWell( - child: Icon( - Icons - .edit), - onTap: () { - updatePrescriptionForm( - box: model - .prescriptionList[ - 0] - .entityList[ - index] - .quantity, - uom: model - .prescriptionList[ - 0] - .entityList[ - index] - .uom, - drugNameGeneric: model - .prescriptionList[ - 0] - .entityList[ - index] - .medicationName, - doseUnit: model.prescriptionList[0].entityList[index].doseDailyUnitID - .toString(), - doseStreangth: model.prescriptionList[0].entityList[index].doseDailyQuantity - .toString(), - duration: - model.prescriptionList[0].entityList[index].doseDurationDays - .toString(), - startDate: - model.prescriptionList[0].entityList[index].startDate - .toString(), - dose: model - .prescriptionList[ - 0] - .entityList[ - index] - .doseTimingID - .toString(), - frequency: - model.prescriptionList[0].entityList[index].frequencyID - .toString(), - rouat: model - .prescriptionList[0] - .entityList[index] - .routeID - .toString(), - patient: patient, - drugId: model.prescriptionList[0].entityList[index].medicineCode, - drugName: model.prescriptionList[0].entityList[index].medicationName, - remarks: model.prescriptionList[0].entityList[index].remarks, - model: model, - enteredRemarks: model.prescriptionList[0].entityList[index].remarks, - context: context); - //model.postPrescription(); - }, + Expanded( + child: Container( + color: Colors.white, + // height: MediaQuery.of(context).size.height * + // 0.038, + child: RichText( + // maxLines: + // 2, + // overflow: + // TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 10.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList![index] + .remarks != + null + ? model.prescriptionList[0].entityList![index] + .remarks + : "", + ), ), - ], + ), ), - ), - ], - ), - Divider( - height: 0, - thickness: 1.0, - color: Colors.grey, - ), - ], + ], + ), + SizedBox( + height: 10.0, + ), + + // SizedBox( + // height: 40, + // ), + ], + ), ), - ), + Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.16, + width: MediaQuery.of(context).size.width * 0.06, + child: Column( + children: [ + InkWell( + child: Icon(Icons.edit), + onTap: () { + updatePrescriptionForm( + box: model + .prescriptionList[0].entityList![index].quantity, + uom: model.prescriptionList[0].entityList![index].uom, + drugNameGeneric: model.prescriptionList[0] + .entityList![index].medicationName, + doseUnit: model.prescriptionList[0].entityList![index] + .doseDailyUnitID + .toString(), + doseStreangth: model.prescriptionList[0] + .entityList![index].doseDailyQuantity + .toString(), + duration: model.prescriptionList[0].entityList![index] + .doseDurationDays + .toString(), + startDate: model + .prescriptionList[0].entityList![index].startDate + .toString(), + dose: model + .prescriptionList[0].entityList![index].doseTimingID + .toString(), + frequency: model + .prescriptionList[0].entityList![index].frequencyID + .toString(), + rouat: model.prescriptionList[0].entityList![index].routeID.toString(), + patient: patient, + drugId: model.prescriptionList[0].entityList![index].medicineCode, + drugName: model.prescriptionList[0].entityList![index].medicationName, + remarks: model.prescriptionList[0].entityList![index].remarks, + model: model, + enteredRemarks: model.prescriptionList[0].entityList![index].remarks, + context: context); + //model.postPrescription(); + }, + ), + ], + ), + ), + ], + ), + Divider( + height: 0, + thickness: 1.0, + color: Colors.grey, ), ], ), ), - ) - : Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - InkWell( - onTap: () { - addPrescriptionForm(context, model, - patient, model.prescriptionList); - //model.postPrescription(); - }, - child: CircleAvatar( - radius: 65, - backgroundColor: Color(0XFFB8382C), - child: CircleAvatar( - radius: 60, - backgroundColor: Colors.white, - child: Icon( - Icons.add, - color: Colors.black, - size: 45.0, - ), - ), - ), - ), - SizedBox( - height: 15.0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context) - .noPrescriptionListed, - color: Colors.black, - fontWeight: FontWeight.w900, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).addNow, - color: Color(0XFFB8382C), - fontWeight: FontWeight.w900, - ), - ], ), ], - ) - ], - ), - ), - ), - )), + ), + ), + ) + : Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + InkWell( + onTap: () { + addPrescriptionForm(context, model, patient, model.prescriptionList); + //model.postPrescription(); + }, + child: CircleAvatar( + radius: 65, + backgroundColor: Color(0XFFB8382C), + child: CircleAvatar( + radius: 60, + backgroundColor: Colors.white, + child: Icon( + Icons.add, + color: Colors.black, + size: 45.0, + ), + ), + ), + ), + SizedBox( + height: 15.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).noPrescriptionListed, + color: Colors.black, + fontWeight: FontWeight.w900, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).addNow, + color: Color(0XFFB8382C), + fontWeight: FontWeight.w900, + ), + ], + ), + ], + ) + ], + ), + ), + ), + )), ); } selectDate(BuildContext context, PrescriptionViewModel model) async { DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now().add(Duration(hours: 2)), diff --git a/lib/screens/prescription/prescription_screen_history.dart b/lib/screens/prescription/prescription_screen_history.dart index 5ce98c54..5d9a07e0 100644 --- a/lib/screens/prescription/prescription_screen_history.dart +++ b/lib/screens/prescription/prescription_screen_history.dart @@ -11,18 +11,16 @@ import 'package:flutter/material.dart'; class NewPrescriptionHistoryScreen extends StatefulWidget { @override - _NewPrescriptionHistoryScreenState createState() => - _NewPrescriptionHistoryScreenState(); + _NewPrescriptionHistoryScreenState createState() => _NewPrescriptionHistoryScreenState(); } -class _NewPrescriptionHistoryScreenState - extends State { - PersistentBottomSheetController _controller; +class _NewPrescriptionHistoryScreenState extends State { + late PersistentBottomSheetController _controller; final _scaffoldKey = GlobalKey(); TextEditingController strengthController = TextEditingController(); int testNum = 0; - int strengthChar; - PatiantInformtion patient; + late int strengthChar; + late PatiantInformtion patient; @override void initState() { @@ -31,476 +29,383 @@ class _NewPrescriptionHistoryScreenState Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; return BaseView( onModelReady: (model) => model.getPrescription(mrn: patient.patientId), - builder: - (BuildContext context, PrescriptionViewModel model, Widget child) => - AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescription, - body: NetworkBaseView( - baseViewModel: model, - child: SingleChildScrollView( - child: Container( - color: Colors.white, - child: Column( - children: [ - PatientPageHeaderWidget(patient), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - (model.prescriptionList.length != 0) - ? SizedBox( - height: - model.prescriptionList[0].rowcount == 0 - ? 200.0 - : 10.0) - : SizedBox(height: 200.0), - //model.prescriptionList == null - (model.prescriptionList.length != 0) - ? model.prescriptionList[0].rowcount == 0 - ? Container( - child: AppText( - 'Sorry , Theres no prescriptions for this patient', - color: Color(0xFFB9382C), - ), - ) - : Padding( - padding: EdgeInsets.all(14.0), - child: NetworkBaseView( - baseViewModel: model, + builder: (BuildContext context, PrescriptionViewModel model, Widget? child) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescription ?? "", + body: NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Container( + color: Colors.white, + child: Column( + children: [ + PatientPageHeaderWidget(patient), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + (model.prescriptionList.length != 0) + ? SizedBox(height: model.prescriptionList[0].rowcount == 0 ? 200.0 : 10.0) + : SizedBox(height: 200.0), + //model.prescriptionList == null + (model.prescriptionList.length != 0) + ? model.prescriptionList[0].rowcount == 0 + ? Container( + child: AppText( + 'Sorry , Theres no prescriptions for this patient', + color: Color(0xFFB9382C), + ), + ) + : Padding( + padding: EdgeInsets.all(14.0), + child: NetworkBaseView( + baseViewModel: model, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + ...List.generate( + model.prescriptionList[0].rowcount, + (index) => Container( + color: Colors.white, child: Column( - mainAxisAlignment: - MainAxisAlignment.start, children: [ - ...List.generate( - model.prescriptionList[0] - .rowcount, - (index) => Container( - color: Colors.white, - child: Column( - children: [ - SizedBox( - height: MediaQuery.of( - context) - .size - .height * - 0.022, - ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - // crossAxisAlignment: - // CrossAxisAlignment.start, - children: [ - Container( - height: MediaQuery.of( - context) - .size - .height * - 0.21, - width: MediaQuery.of( - context) - .size - .width * - 0.1, - child: Column( - children: [ - AppText( - (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) != - null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year) - .toString() - : DateTime.now() - .year) - .toString(), - color: Colors - .green, - fontSize: - 13.5, - ), - AppText( - AppDateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != - null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) - .month) - : DateTime.now() - .month) - .toUpperCase(), - color: Colors - .green, - ), - AppText( - DateTime.parse(model - .prescriptionList[ - 0] - .entityList[ - index] - .createdOn) - .day - .toString(), - color: Colors - .green, - ), - AppText( - AppDateUtils.getTimeFormated(DateTime.parse(model - .prescriptionList[ - 0] - .entityList[ - index] - .createdOn)) - .toString(), - color: Colors - .green, - ), - ], + SizedBox( + height: MediaQuery.of(context).size.height * 0.022, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: + // CrossAxisAlignment.start, + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.21, + width: MediaQuery.of(context).size.width * 0.1, + child: Column( + children: [ + AppText( + (DateTime.parse(model.prescriptionList[0].entityList![index] + .createdOn) != + null + ? (DateTime.parse(model.prescriptionList[0] + .entityList![index].createdOn) + .year) + .toString() + : DateTime.now().year) + .toString(), + color: Colors.green, + fontSize: 13.5, + ), + AppText( + AppDateUtils.getMonth(model.prescriptionList[0] + .entityList![index].createdOn != + null + ? (DateTime.parse(model.prescriptionList[0] + .entityList![index].createdOn) + .month) + : DateTime.now().month) + .toUpperCase(), + color: Colors.green, + ), + AppText( + DateTime.parse(model + .prescriptionList[0].entityList![index].createdOn) + .day + .toString(), + color: Colors.green, + ), + AppText( + AppDateUtils.getTimeFormated(DateTime.parse(model + .prescriptionList[0].entityList![index].createdOn)) + .toString(), + color: Colors.green, + ), + ], + ), + ), + Container( + // height: MediaQuery.of( + // context) + // .size + // .height * + // 0.3499, + width: MediaQuery.of(context).size.width * 0.77, + child: Column( + children: [ + Row( + children: [ + AppText( + 'Start Date:', + fontWeight: FontWeight.w700, + fontSize: 14.0, ), - ), - Container( - // height: MediaQuery.of( - // context) - // .size - // .height * - // 0.3499, - width: MediaQuery.of( - context) - .size - .width * - 0.77, - child: Column( - children: [ - Row( - children: [ - AppText( - 'Start Date:', - fontWeight: - FontWeight - .w700, - fontSize: - 14.0, - ), - Expanded( - child: - AppText( - AppDateUtils.getDateFormatted(DateTime.parse(model - .prescriptionList[0] - .entityList[index] - .startDate)), - fontSize: - 13.5, - ), - ), - SizedBox( - width: - 6.0, - ), - AppText( - 'Order Type:', - fontWeight: - FontWeight - .w700, - fontSize: - 14.0, - ), - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .orderTypeDescription, - fontSize: - 13.0, - ), - ), - ], - ), - SizedBox( - height: 5.5, - ), - Row( - children: [ - Container( - child: - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .medicationName, - fontWeight: - FontWeight.w700, - fontSize: - 15.0, - ), - ), - ) - ], - ), - SizedBox( - height: 5.5, - ), - Row( - children: [ - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .doseDetail, - fontSize: - 15.0, - ), - ) - ], - ), - SizedBox( - height: 10.0, - ), - Row( - children: [ - AppText( - 'Indication: ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].indication), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'UOM: ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].uom), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'BOX Quantity: ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].quantity.toString() == null ? "" : model.prescriptionList[0].entityList[index].quantity.toString()), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'pharmacy Intervention ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].pharmacyInervention == null ? "" : model.prescriptionList[0].entityList[index].pharmacyInervention.toString()), - ), - ), - ], - ), - SizedBox( - height: - 5.0), - Row( - children: [ - AppText( - 'pharmacist Remarks : ', - fontWeight: - FontWeight - .w700, - fontSize: - 15.0, - ), - Expanded( - child: AppText( - // commening below code because there is an error coming in the model please fix it before pushing it - model.prescriptionList[0].entityList[index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList[index].pharmacistRemarks, - fontSize: 15.0), - ) - ], - ), - SizedBox( - height: 20.0, - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .doctorName + - ": ", - fontWeight: - FontWeight - .w600, - ), - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .doctorName, - fontWeight: - FontWeight.w700, - ), - ) - ], - ), - SizedBox( - height: 8.0, - ), - Row( - children: [ - AppText( - 'Doctor Remarks : ', - fontWeight: - FontWeight - .w700, - fontSize: - 13.0, - ), - Expanded( - child: - Container( - // height: MediaQuery.of(context).size.height * - // 0.038, - child: - RichText( - // maxLines: - // 2, - // overflow: - // TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 10.0), - text: - TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].remarks != null - ? model.prescriptionList[0].entityList[index].remarks - : "", - ), - ), - ), - ), - ], + Expanded( + child: AppText( + AppDateUtils.getDateFormatted(DateTime.parse(model + .prescriptionList[0].entityList![index].startDate)), + fontSize: 13.5, + ), + ), + SizedBox( + width: 6.0, + ), + AppText( + 'Order Type:', + fontWeight: FontWeight.w700, + fontSize: 14.0, + ), + Expanded( + child: AppText( + model.prescriptionList[0].entityList![index] + .orderTypeDescription, + fontSize: 13.0, + ), + ), + ], + ), + SizedBox( + height: 5.5, + ), + Row( + children: [ + Container( + child: Expanded( + child: AppText( + model.prescriptionList[0].entityList![index] + .medicationName, + fontWeight: FontWeight.w700, + fontSize: 15.0, ), - SizedBox( - height: 10.0, + ), + ) + ], + ), + SizedBox( + height: 5.5, + ), + Row( + children: [ + Expanded( + child: AppText( + model.prescriptionList[0].entityList![index].doseDetail, + fontSize: 15.0, + ), + ) + ], + ), + SizedBox( + height: 10.0, + ), + Row( + children: [ + AppText( + 'Indication: ', + fontWeight: FontWeight.w700, + fontSize: 17.0, + ), + Expanded( + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 12.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList![index] + .indication), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'UOM: ', + fontWeight: FontWeight.w700, + fontSize: 17.0, + ), + Expanded( + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 12.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model + .prescriptionList[0].entityList![index].uom), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'BOX Quantity: ', + fontWeight: FontWeight.w700, + fontSize: 17.0, + ), + Expanded( + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 12.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList![index] + .quantity + .toString() == + null + ? "" + : model.prescriptionList[0].entityList![index] + .quantity + .toString()), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'pharmacy Intervention ', + fontWeight: FontWeight.w700, + fontSize: 17.0, + ), + Expanded( + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 12.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList![index] + .pharmacyInervention == + null + ? "" + : model.prescriptionList[0].entityList![index] + .pharmacyInervention + .toString()), + ), + ), + ], + ), + SizedBox(height: 5.0), + Row( + children: [ + AppText( + 'pharmacist Remarks : ', + fontWeight: FontWeight.w700, + fontSize: 15.0, + ), + Expanded( + child: AppText( + // commening below code because there is an error coming in the model please fix it before pushing it + model.prescriptionList[0].entityList![index] + .pharmacistRemarks == + null + ? "" + : model.prescriptionList[0].entityList![index] + .pharmacistRemarks, + fontSize: 15.0), + ) + ], + ), + SizedBox( + height: 20.0, + ), + Row( + children: [ + AppText( + TranslationBase.of(context).doctorName! + ": ", + fontWeight: FontWeight.w600, + ), + Expanded( + child: AppText( + model.prescriptionList[0].entityList![index].doctorName, + fontWeight: FontWeight.w700, + ), + ) + ], + ), + SizedBox( + height: 8.0, + ), + Row( + children: [ + AppText( + 'Doctor Remarks : ', + fontWeight: FontWeight.w700, + fontSize: 13.0, + ), + Expanded( + child: Container( + // height: MediaQuery.of(context).size.height * + // 0.038, + child: RichText( + // maxLines: + // 2, + // overflow: + // TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 10.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList![index] + .remarks != + null + ? model.prescriptionList[0].entityList![index] + .remarks + : "", + ), ), - - // SizedBox( - // height: 40, - // ), - ], + ), ), - ), - ], - ), - Divider( - height: 0, - thickness: 1.0, - color: Colors.grey, - ), - ], + ], + ), + SizedBox( + height: 10.0, + ), + + // SizedBox( + // height: 40, + // ), + ], + ), ), - ), + ], + ), + Divider( + height: 0, + thickness: 1.0, + color: Colors.grey, ), ], ), ), - ) - : Container( - child: AppText( - 'Sorry , theres no prescriptions listed for this patient', - color: Color(0xFFB9382C), - ), - ) - ], - ), - ), - ), - )), + ), + ], + ), + ), + ) + : Container( + child: AppText( + 'Sorry , theres no prescriptions listed for this patient', + color: Color(0xFFB9382C), + ), + ) + ], + ), + ), + ), + )), ); } selectDate(BuildContext context, PrescriptionViewModel model) async { DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now().add(Duration(hours: 2)), diff --git a/lib/screens/prescription/prescription_text_filed.dart b/lib/screens/prescription/prescription_text_filed.dart index 56020ca3..38b6f3c3 100644 --- a/lib/screens/prescription/prescription_text_filed.dart +++ b/lib/screens/prescription/prescription_text_filed.dart @@ -13,19 +13,19 @@ class PrescriptionTextFiled extends StatefulWidget { final String keyName; final String keyId; final String hintText; - final double width; + final double? width; final Function(dynamic) okFunction; PrescriptionTextFiled( - {Key key, - @required this.element, - @required this.elementError, + {Key? key, + required this.element, + required this.elementError, this.width, - this.elementList, - this.keyName, - this.keyId, - this.hintText, - this.okFunction}) + required this.elementList, + required this.keyName, + required this.keyId, + required this.hintText, + required this.okFunction}) : super(key: key); @override @@ -46,8 +46,7 @@ class _PrescriptionTextFiledState extends State { attributeName: '${widget.keyName}', attributeValueId: '${widget.keyId}', okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) => - widget.okFunction(selectedValue), + okFunction: (selectedValue) => widget.okFunction(selectedValue), ); showDialog( barrierDismissible: false, @@ -66,8 +65,7 @@ class _PrescriptionTextFiledState extends State { ? widget.element['${widget.keyName}'] : null, isTextFieldHasSuffix: true, - validationError: - widget.elementList.length != 1 ? widget.elementError : null, + validationError: widget.elementList.length != 1 ? widget.elementError : null, enabled: false, ), ), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index b56befdb..5bd469be 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart'; +import '../../widgets/shared/in_patient_doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -20,7 +20,7 @@ import 'package:flutter/material.dart'; class PrescriptionsPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -103,7 +103,7 @@ class PrescriptionsPage extends StatelessWidget { )), ); }, - label: TranslationBase.of(context).applyForNewPrescriptionsOrder, + label: TranslationBase.of(context).applyForNewPrescriptionsOrder ?? "", ), ...List.generate( model.prescriptionsList.length, @@ -120,13 +120,13 @@ class PrescriptionsPage extends StatelessWidget { ), ), child: DoctorCard( - doctorName: model.prescriptionsList[index].doctorName, - profileUrl: model.prescriptionsList[index].doctorImageURL, - branch: model.prescriptionsList[index].name, - clinic: model.prescriptionsList[index].clinicDescription, + doctorName: model.prescriptionsList[index].doctorName ?? "", + profileUrl: model.prescriptionsList[index].doctorImageURL ?? "", + branch: model.prescriptionsList[index].name ?? "", + clinic: model.prescriptionsList[index].clinicDescription ?? "", isPrescriptions: true, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - model.prescriptionsList[index].appointmentDate, + model.prescriptionsList[index].appointmentDate ?? "", ), ))), if (model.prescriptionsList.isEmpty && patient.patientStatusType != 43) @@ -170,10 +170,10 @@ class PrescriptionsPage extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, startOn: AppDateUtils.getDateTimeFromServerFormat( - model.inPatientPrescription[index].startDatetime, + model.inPatientPrescription[index].startDatetime ?? "", ), stopOn: AppDateUtils.getDateTimeFromServerFormat( - model.inPatientPrescription[index].stopDatetime, + model.inPatientPrescription[index].stopDatetime ?? "", ), ), ), @@ -185,7 +185,7 @@ class PrescriptionsPage extends StatelessWidget { clinic: 'basheer', isPrescriptions: true, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - model.inPatientPrescription[index].prescriptionDatetime, + model.inPatientPrescription[index].prescriptionDatetime ?? "", ), createdBy: model.inPatientPrescription[index].createdByName, ))), diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 01ba6a91..81cae799 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -12,7 +12,7 @@ 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/shared/TextFields.dart'; +import '../../widgets/shared/text_fields/TextFields.dart'; 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/dialogs/dailog-list-select.dart'; @@ -42,22 +42,22 @@ class UpdatePrescriptionForm extends StatefulWidget { final PrescriptionViewModel model; UpdatePrescriptionForm( - {this.drugName, - this.doseStreangth, - this.drugId, - this.remarks, - this.patient, - this.duration, - this.route, - this.dose, - this.startDate, - this.doseUnit, - this.enteredRemarks, - this.frequency, - this.model, - this.drugNameGeneric, - this.uom, - this.box}); + {required this.drugName, + required this.doseStreangth, + required this.drugId, + required this.remarks, + required this.patient, + required this.duration, + required this.route, + required this.dose, + required this.startDate, + required this.doseUnit, + required this.enteredRemarks, + required this.frequency, + required this.model, + required this.drugNameGeneric, + required this.uom, + required this.box}); @override _UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState(); } @@ -66,35 +66,31 @@ class _UpdatePrescriptionFormState extends State { TextEditingController strengthController = TextEditingController(); TextEditingController remarksController = TextEditingController(); int testNum = 0; - int strengthChar; - PatiantInformtion patient; + late int strengthChar; + late PatiantInformtion patient; dynamic route; dynamic doseTime; dynamic frequencyUpdate; dynamic updatedDuration; dynamic units; - GetMedicationResponseModel newSelectedMedication; - GlobalKey key = - new GlobalKey>(); - List indicationList; + late GetMedicationResponseModel newSelectedMedication; + GlobalKey key = new GlobalKey>(); + late List indicationList; dynamic indication; - DateTime selectedDate; + late DateTime selectedDate; @override void initState() { super.initState(); strengthController.text = widget.doseStreangth; remarksController.text = widget.remarks; - indicationList = List(); + indicationList = []; dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; dynamic indication4 = {"id": 548, "name": "Mild Dizziness"}; dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"}; - dynamic indication6 = { - "id": 550, - "name": "Phenytoin Hypersensitivity Syndrome" - }; + dynamic indication6 = {"id": 550, "name": "Phenytoin Hypersensitivity Syndrome"}; dynamic indication7 = {"id": 551, "name": "Asterixis"}; dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"}; dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; @@ -115,8 +111,7 @@ class _UpdatePrescriptionFormState extends State { @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return StatefulBuilder(builder: - (BuildContext context, StateSetter setState /*You can rename this!*/) { + return StatefulBuilder(builder: (BuildContext context, StateSetter setState /*You can rename this!*/) { return BaseView( onModelReady: (model) async { await model.getMedicationList(); @@ -127,20 +122,13 @@ class _UpdatePrescriptionFormState extends State { await model.getMedicationDoseTime(); await model.getItem(itemID: widget.drugId); //await model.getMedicationIndications(); - route = model.getLookupByIdFilter( - model.itemMedicineListRoute, widget.route); - doseTime = - model.getLookupById(model.medicationDoseTimeList, widget.dose); - updatedDuration = model.getLookupById( - model.medicationDurationList, widget.duration); - units = model.getLookupByIdFilter( - model.itemMedicineListUnit, widget.doseUnit); - frequencyUpdate = model.getLookupById( - model.medicationFrequencyList, widget.frequency); + route = model.getLookupByIdFilter(model.itemMedicineListRoute, widget.route); + doseTime = model.getLookupById(model.medicationDoseTimeList, widget.dose); + updatedDuration = model.getLookupById(model.medicationDurationList, widget.duration); + units = model.getLookupByIdFilter(model.itemMedicineListUnit, widget.doseUnit); + frequencyUpdate = model.getLookupById(model.medicationFrequencyList, widget.frequency); }, - builder: - (BuildContext context, MedicineViewModel model, Widget child) => - NetworkBaseView( + builder: (BuildContext context, MedicineViewModel model, Widget? child) => NetworkBaseView( baseViewModel: model, child: GestureDetector( onTap: () { @@ -150,15 +138,13 @@ class _UpdatePrescriptionFormState extends State { initialChildSize: 0.98, maxChildSize: 0.99, minChildSize: 0.6, - builder: - (BuildContext context, ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.5, child: Form( child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, vertical: 12.0), + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -244,25 +230,16 @@ class _UpdatePrescriptionFormState extends State { // height: 12, // ), Container( - height: - MediaQuery.of(context).size.height * - 0.060, + height: MediaQuery.of(context).size.height * 0.060, width: double.infinity, child: Row( children: [ Container( - width: MediaQuery.of(context) - .size - .width * - 0.4900, - height: MediaQuery.of(context) - .size - .height * - 0.55, + width: MediaQuery.of(context).size.width * 0.4900, + height: MediaQuery.of(context).size.height * 0.55, child: TextFields( inputFormatters: [ - LengthLimitingTextInputFormatter( - 5), + LengthLimitingTextInputFormatter(5), // WhitelistingTextInputFormatter // .digitsOnly ], @@ -270,8 +247,7 @@ class _UpdatePrescriptionFormState extends State { hintText: widget.doseStreangth, fontSize: 15.0, controller: strengthController, - keyboardType: TextInputType - .numberWithOptions( + keyboardType: TextInputType.numberWithOptions( decimal: true, ), onChanged: (String value) { @@ -279,8 +255,7 @@ class _UpdatePrescriptionFormState extends State { strengthChar = value.length; }); if (strengthChar >= 5) { - DrAppToastMsg.showErrorToast( - "Only 5 Digits allowed for strength"); + DrAppToastMsg.showErrorToast("Only 5 Digits allowed for strength"); } }, // validator: (value) { @@ -298,59 +273,34 @@ class _UpdatePrescriptionFormState extends State { width: 10.0, ), Container( - width: MediaQuery.of(context) - .size - .width * - 0.3700, + width: MediaQuery.of(context).size.width * 0.3700, child: InkWell( - onTap: - model.itemMedicineListUnit != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .itemMedicineListUnit, - attributeName: - 'description', - attributeValueId: - 'parameterCode', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - units = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, + onTap: model.itemMedicineListUnit != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.itemMedicineListUnit, + attributeName: 'description', + attributeValueId: 'parameterCode', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + units = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, child: TextField( - decoration: - textFieldSelectorDecoration( - 'UNIT Type', - units != null - ? units[ - 'description'] - : null, - true), + decoration: textFieldSelectorDecoration( + 'UNIT Type', units != null ? units['description'] : null, true), enabled: false, ), ), @@ -362,24 +312,16 @@ class _UpdatePrescriptionFormState extends State { height: 12, ), Container( - height: - MediaQuery.of(context).size.height * - 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.itemMedicineListRoute != - null + onTap: model.itemMedicineListRoute != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .itemMedicineListRoute, + ListSelectDialog dialog = ListSelectDialog( + list: model.itemMedicineListRoute, attributeName: 'description', - attributeValueId: - 'parameterCode', - okText: TranslationBase.of( - context) - .ok, + attributeValueId: 'parameterCode', + okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { route = selectedValue; @@ -392,21 +334,15 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: - (BuildContext context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - 'Route', - route != null - ? route['description'] - : null, - true), + decoration: textFieldSelectorDecoration( + 'Route', route != null ? route['description'] : null, true), enabled: false, ), ), @@ -415,23 +351,16 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: - MediaQuery.of(context).size.height * - 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationDoseTimeList != - null + onTap: model.medicationDoseTimeList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDoseTimeList, + ListSelectDialog dialog = ListSelectDialog( + list: model.medicationDoseTimeList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, + okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { doseTime = selectedValue; @@ -441,22 +370,15 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: - (BuildContext context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .doseTime, - doseTime != null - ? doseTime['nameEn'] - : null, - true), + decoration: textFieldSelectorDecoration(TranslationBase.of(context).doseTime!, + doseTime != null ? doseTime['nameEn'] : null, true), enabled: false, ), ), @@ -465,50 +387,36 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: - MediaQuery.of(context).size.height * - 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationFrequencyList != - null + onTap: model.medicationFrequencyList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationFrequencyList, + ListSelectDialog dialog = ListSelectDialog( + list: model.medicationFrequencyList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, + okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { - frequencyUpdate = - selectedValue; + frequencyUpdate = selectedValue; }); }, ); showDialog( barrierDismissible: false, context: context, - builder: - (BuildContext context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .frequency, - frequencyUpdate != null - ? frequencyUpdate[ - 'nameEn'] - : null, - true), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).frequency!, + frequencyUpdate != null ? frequencyUpdate['nameEn'] : null, + true), enabled: false, ), ), @@ -517,51 +425,36 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: - MediaQuery.of(context).size.height * - 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationDurationList != - null + onTap: model.medicationDurationList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDurationList, + ListSelectDialog dialog = ListSelectDialog( + list: model.medicationDurationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, + okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { - updatedDuration = - selectedValue; + updatedDuration = selectedValue; }); }, ); showDialog( barrierDismissible: false, context: context, - builder: - (BuildContext context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .duration, - updatedDuration != null - ? updatedDuration[ - 'nameEn'] - .toString() - : null, - true), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).duration!, + updatedDuration != null ? updatedDuration['nameEn'].toString() : null, + true), enabled: false, ), ), @@ -570,46 +463,26 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: model.patientAssessmentList - .isNotEmpty - ? screenSize.height * 0.070 - : 0.0, - width: model.patientAssessmentList - .isNotEmpty - ? double.infinity - : 0.0, - child: model.patientAssessmentList - .isNotEmpty + height: + model.patientAssessmentList.isNotEmpty ? screenSize.height * 0.070 : 0.0, + width: model.patientAssessmentList.isNotEmpty ? double.infinity : 0.0, + child: model.patientAssessmentList.isNotEmpty ? Row( children: [ Container( - width: - MediaQuery.of(context) - .size - .width * - 0.29, + width: MediaQuery.of(context).size.width * 0.29, child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, + onTap: indicationList != null + ? () { + Helpers.hideKeyboard(context); + } + : null, child: TextField( decoration: textFieldSelectorDecoration( - model.patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString() + model.patientAssessmentList.isNotEmpty + ? model.patientAssessmentList[0].icdCode10ID.toString() : '', - indication != null - ? indication[ - 'name'] - : null, + indication != null ? indication['name'] : null, true), enabled: true, readOnly: true, @@ -617,34 +490,20 @@ class _UpdatePrescriptionFormState extends State { ), ), Container( - width: - MediaQuery.of(context) - .size - .width * - 0.61, + width: MediaQuery.of(context).size.width * 0.61, child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, + onTap: indicationList != null + ? () { + Helpers.hideKeyboard(context); + } + : null, child: TextField( maxLines: 3, decoration: textFieldSelectorDecoration( - model.patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .asciiDesc - .toString() + model.patientAssessmentList.isNotEmpty + ? model.patientAssessmentList[0].asciiDesc.toString() : '', - indication != null - ? indication[ - 'name'] - : null, + indication != null ? indication['name'] : null, true), enabled: true, readOnly: true, @@ -660,22 +519,18 @@ class _UpdatePrescriptionFormState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: () => - selectDate(context, widget.model), + onTap: () => selectDate(context, widget.model), child: TextField( - decoration: Helpers - .textFieldSelectorDecoration( - AppDateUtils.getDateFormatted( - DateTime.parse( - widget.startDate)), - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + decoration: Helpers.textFieldSelectorDecoration( + AppDateUtils.getDateFormatted(DateTime.parse(widget.startDate)), + selectedDate != null + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), enabled: false, ), ), @@ -689,14 +544,11 @@ class _UpdatePrescriptionFormState extends State { onTap: model.allMedicationList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( + ListSelectDialog dialog = ListSelectDialog( list: model.allMedicationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, + okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { // duration = selectedValue; @@ -706,21 +558,15 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: - (BuildContext context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - "UOM", - widget.uom != null - ? widget.uom - : null, - true), + decoration: textFieldSelectorDecoration( + "UOM", widget.uom != null ? widget.uom : null, true), // enabled: false, readOnly: true, ), @@ -732,14 +578,11 @@ class _UpdatePrescriptionFormState extends State { onTap: model.allMedicationList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( + ListSelectDialog dialog = ListSelectDialog( list: model.allMedicationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, + okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { // duration = selectedValue; @@ -749,22 +592,17 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: - (BuildContext context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - 'Box Quantity', - widget.box != null - ? "Box Quantity: " + - widget.box.toString() - : null, - true), + decoration: textFieldSelectorDecoration( + 'Box Quantity', + widget.box != null ? "Box Quantity: " + widget.box.toString() : null, + true), // enabled: false, readOnly: true, ), @@ -775,11 +613,8 @@ class _UpdatePrescriptionFormState extends State { ), Container( decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), child: TextFields( controller: remarksController, maxLines: 7, @@ -790,59 +625,39 @@ class _UpdatePrescriptionFormState extends State { height: 10.0, ), SizedBox( - height: - MediaQuery.of(context).size.height * - 0.08, + height: MediaQuery.of(context).size.height * 0.08, ), Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 2), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( - title: 'update prescription' - .toUpperCase(), + title: 'update prescription'.toUpperCase(), onPressed: () { - if (double.parse( - strengthController.text) > - 1000.0) { - DrAppToastMsg.showErrorToast( - "1000 is the MAX for the strength"); + if (double.parse(strengthController.text) > 1000.0) { + DrAppToastMsg.showErrorToast("1000 is the MAX for the strength"); return; } - if (double.parse( - strengthController - .text) == - 0.0) { - DrAppToastMsg.showErrorToast( - "strength can't be zero"); + if (double.parse(strengthController.text) == 0.0) { + DrAppToastMsg.showErrorToast("strength can't be zero"); return; } - if (strengthController - .text.length > - 4) { - DrAppToastMsg.showErrorToast( - "strength can't be more then 4 digits "); + if (strengthController.text.length > 4) { + DrAppToastMsg.showErrorToast("strength can't be more then 4 digits "); return; } // if(units==null&& updatedDuration==null&&frequencyUpdate==null&&) updatePrescription( newStartDate: selectedDate, - newDoseStreangth: - strengthController - .text.isNotEmpty - ? strengthController - .text - : widget - .doseStreangth, + newDoseStreangth: strengthController.text.isNotEmpty + ? strengthController.text + : widget.doseStreangth, newUnit: units != null - ? units['parameterCode'] - .toString() + ? units['parameterCode'].toString() : widget.doseUnit, doseUnit: widget.doseUnit, - doseStreangth: - widget.doseStreangth, + doseStreangth: widget.doseStreangth, duration: widget.duration, startDate: widget.startDate, doseId: widget.dose, @@ -850,30 +665,18 @@ class _UpdatePrescriptionFormState extends State { routeId: widget.route, patient: widget.patient, model: widget.model, - newDuration: - updatedDuration != null - ? updatedDuration['id'] - .toString() - : widget.duration, + newDuration: updatedDuration != null + ? updatedDuration['id'].toString() + : widget.duration, drugId: widget.drugId, - remarks: remarksController - .text, - route: route != null - ? route['parameterCode'] - .toString() - : widget.route, - frequency: - frequencyUpdate != null - ? frequencyUpdate[ - 'id'] - .toString() - : widget.frequency, - dose: doseTime != null - ? doseTime['id'] - .toString() - : widget.dose, - enteredRemarks: - widget.enteredRemarks); + remarks: remarksController.text, + route: + route != null ? route['parameterCode'].toString() : widget.route, + frequency: frequencyUpdate != null + ? frequencyUpdate['id'].toString() + : widget.frequency, + dose: doseTime != null ? doseTime['id'].toString() : widget.dose, + enteredRemarks: widget.enteredRemarks); Navigator.pop(context); }, ), @@ -898,7 +701,7 @@ class _UpdatePrescriptionFormState extends State { Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -912,9 +715,8 @@ class _UpdatePrescriptionFormState extends State { } } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -945,30 +747,29 @@ class _UpdatePrescriptionFormState extends State { } updatePrescription( - {PrescriptionViewModel model, - int drugId, - String newDrugId, - String frequencyId, - String remarks, - String dose, - String doseId, - String frequency, - String route, - String routeId, - String startDate, - DateTime newStartDate, - String doseUnit, - String doseStreangth, - String newDoseStreangth, - String duration, - String newDuration, - String newUnit, - String enteredRemarks, - PatiantInformtion patient}) async { + {required PrescriptionViewModel model, + required int drugId, + String? newDrugId, + required String frequencyId, + required String remarks, + required String dose, + required String doseId, + required String frequency, + required String route, + required String routeId, + required String startDate, + required DateTime newStartDate, + required String doseUnit, + required String doseStreangth, + required String newDoseStreangth, + required String duration, + required String newDuration, + required String newUnit, + required String enteredRemarks, + required PatiantInformtion patient}) async { //PrescriptionViewModel model = PrescriptionViewModel(); - PostPrescriptionReqModel updatePrescriptionReqModel = - new PostPrescriptionReqModel(); - List sss = List(); + PostPrescriptionReqModel updatePrescriptionReqModel = new PostPrescriptionReqModel(); + List sss = []; updatePrescriptionReqModel.appointmentNo = patient.appointmentNo; updatePrescriptionReqModel.clinicID = patient.clinicId; @@ -977,31 +778,22 @@ class _UpdatePrescriptionFormState extends State { sss.add(PrescriptionRequestModel( covered: true, - dose: newDoseStreangth.isNotEmpty - ? double.parse(newDoseStreangth) - : double.parse(doseStreangth), + dose: newDoseStreangth.isNotEmpty ? double.parse(newDoseStreangth) : double.parse(doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1, itemId: drugId, - doseUnitId: - newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), + doseUnitId: newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), - frequency: frequency.isNotEmpty - ? int.parse(frequency) - : int.parse(frequencyId), + frequency: frequency.isNotEmpty ? int.parse(frequency) : int.parse(frequencyId), remarks: remarks.isEmpty ? enteredRemarks : remarks, approvalRequired: true, icdcode10Id: "test2", doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId), - duration: newDuration.isNotEmpty - ? int.parse(newDuration) - : int.parse(duration), - doseStartDate: - newStartDate != null ? newStartDate.toIso8601String() : startDate)); + duration: newDuration.isNotEmpty ? int.parse(newDuration) : int.parse(duration), + doseStartDate: newStartDate != null ? newStartDate.toIso8601String() : startDate)); updatePrescriptionReqModel.prescriptionRequestModel = sss; //postProcedureReqModel.procedures = controlsProcedure; - await model.updatePrescription( - updatePrescriptionReqModel, patient.patientMRN); + await model.updatePrescription(updatePrescriptionReqModel, patient.patientMRN!); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -1013,22 +805,22 @@ class _UpdatePrescriptionFormState extends State { void updatePrescriptionForm( {context, - String drugName, - String drugNameGeneric, - int drugId, - String remarks, - PrescriptionViewModel model, - PatiantInformtion patient, - String rouat, - String frequency, - String dose, - String duration, - String doseStreangth, - String doseUnit, - String enteredRemarks, - String uom, - int box, - String startDate}) { + required String drugName, + required String drugNameGeneric, + required int drugId, + required String remarks, + required PrescriptionViewModel model, + required PatiantInformtion patient, + required String rouat, + required String frequency, + required String dose, + required String duration, + required String doseStreangth, + required String doseUnit, + required String enteredRemarks, + required String uom, + required int box, + required String startDate}) { TextEditingController remarksController = TextEditingController(); TextEditingController doseController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); diff --git a/lib/screens/procedures/ExpansionProcedure.dart b/lib/screens/procedures/ExpansionProcedure.dart index 06e56f03..c1901411 100644 --- a/lib/screens/procedures/ExpansionProcedure.dart +++ b/lib/screens/procedures/ExpansionProcedure.dart @@ -23,16 +23,16 @@ class ExpansionProcedure extends StatefulWidget { final ProcedureTempleteDetailsModel groupProcedures; const ExpansionProcedure( - {Key key, - this.procedureTempleteModel, - this.model, - this.removeFavProcedure, - this.addFavProcedure, - this.selectProcedures, - this.isEntityListSelected, - this.isEntityFavListSelected, + {Key? key, + required this.procedureTempleteModel, + required this.model, + required this.removeFavProcedure, + required this.addFavProcedure, + required this.selectProcedures, + required this.isEntityListSelected, + required this.isEntityFavListSelected, this.isProcedure = true, - this.groupProcedures}) + required this.groupProcedures}) : super(key: key); @override @@ -77,8 +77,8 @@ class _ExpansionProcedureState extends State { padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), child: AppText( widget.isProcedure == true - ? "Procedures for " + widget.procedureTempleteModel.templateName - : "Prescription for " + widget.procedureTempleteModel.templateName, + ? "Procedures for " + widget.procedureTempleteModel.templateName! + : "Prescription for " + widget.procedureTempleteModel.templateName!, fontSize: 16.0, variant: "bodyText", bold: true, @@ -142,7 +142,7 @@ class _ExpansionProcedureState extends State { ? Checkbox( value: widget.isEntityFavListSelected(itemProcedure), activeColor: Color(0xffD02127), - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { if (widget.isEntityFavListSelected(itemProcedure)) { widget.removeFavProcedure(itemProcedure); @@ -155,8 +155,8 @@ class _ExpansionProcedureState extends State { value: itemProcedure, groupValue: widget.groupProcedures, activeColor: Color(0xffD02127), - onChanged: (newValue) { - widget.selectProcedures(newValue); + onChanged: (ProcedureTempleteDetailsModel? newValue) { + widget.selectProcedures(newValue!); })), Expanded( child: Padding( diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index d998ca58..ef9478d5 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -14,19 +14,19 @@ import 'package:provider/provider.dart'; class ProcedureCard extends StatelessWidget { final Function onTap; final EntityList entityList; - final String categoryName; + final String? categoryName; final int categoryID; final PatiantInformtion patient; final int doctorID; const ProcedureCard({ - Key key, - this.onTap, - this.entityList, - this.categoryID, + Key? key, + required this.onTap, + required this.entityList, + required this.categoryID, this.categoryName, - this.patient, - this.doctorID, + required this.patient, + required this.doctorID, }) : super(key: key); @override @@ -54,15 +54,13 @@ class ProcedureCard extends StatelessWidget { topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), - color: - entityList.orderType == 0 ? Colors.black : Colors.red[500], + color: entityList.orderType == 0 ? Colors.black : Colors.red[500], ), ), Expanded( child: Container( padding: EdgeInsets.only( - left: projectViewModel.isArabic ? 0 : 15, - right: projectViewModel.isArabic ? 15 : 0), + left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0), child: InkWell( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -75,12 +73,8 @@ class ProcedureCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - entityList.orderType == 0 - ? 'Routine' - : 'Urgent', - color: entityList.orderType == 0 - ? Colors.black - : Colors.red[800], + entityList.orderType == 0 ? 'Routine' : 'Urgent', + color: entityList.orderType == 0 ? Colors.black : Colors.red[800], fontWeight: FontWeight.w600, ), SizedBox( @@ -102,13 +96,13 @@ class ProcedureCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList.orderDate ?? ""), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.orderDate))}', + '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.orderDate ?? ""))}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, @@ -174,8 +168,7 @@ class ProcedureCard extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only( - left: 0, top: 25, right: 0, bottom: 0), + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: Container( width: 40, @@ -186,9 +179,7 @@ class ProcedureCard extends StatelessWidget { 'assets/images/male_avatar.png', height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, ))), @@ -196,8 +187,7 @@ class ProcedureCard extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, top: 25, right: 10, bottom: 0), + margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -254,12 +244,11 @@ class ProcedureCard extends StatelessWidget { fontSize: 12, ), ), - if ((entityList.categoryID == 2 || - entityList.categoryID == 4) && + if ((entityList.categoryID == 2 || entityList.categoryID == 4) && doctorID == entityList.doctorID) InkWell( child: Icon(DoctorApp.edit), - onTap: onTap, + onTap: onTap(), ) ], ), diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 9b5a97ad..8fa3220e 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -20,17 +20,17 @@ import 'package:flutter/material.dart'; class AddFavouriteProcedure extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - final String categoryID; + final String? categoryID; final String addButtonTitle; final String toolbarTitle; AddFavouriteProcedure( - {Key key, - this.model, - this.patient, + {Key? key, + required this.model, + required this.patient, this.categoryID, - @required this.addButtonTitle, - @required this.toolbarTitle}); + required this.addButtonTitle, + required this.toolbarTitle}); @override _AddFavouriteProcedureState createState() => _AddFavouriteProcedureState(); @@ -39,17 +39,15 @@ class AddFavouriteProcedure extends StatefulWidget { class _AddFavouriteProcedureState extends State { _AddFavouriteProcedureState({this.patient, this.model}); - ProcedureViewModel model; - PatiantInformtion patient; - List entityList = List(); + ProcedureViewModel? model; + PatiantInformtion? patient; + List entityList = []; @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => - model.getProcedureTemplate(categoryID: widget.categoryID), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.categoryID), + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: false, baseViewModel: model, body: Column( @@ -73,8 +71,7 @@ class _AddFavouriteProcedureState extends State { entityList.add(history); }); }, - isEntityFavListSelected: (master) => - isEntityListSelected(master), + isEntityFavListSelected: (master) => isEntityListSelected(master), ), ), ), @@ -84,15 +81,13 @@ class _AddFavouriteProcedureState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: widget.addButtonTitle ?? - TranslationBase.of(context).addSelectedProcedures, + title: widget.addButtonTitle ?? TranslationBase.of(context).addSelectedProcedures, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .fillTheMandatoryProcedureDetails, + TranslationBase.of(context).fillTheMandatoryProcedureDetails, ); return; } @@ -122,9 +117,7 @@ class _AddFavouriteProcedureState extends State { bool isEntityListSelected(ProcedureTempleteDetailsModel masterKey) { Iterable history = entityList.where( - (element) => - masterKey.templateID == element.templateID && - masterKey.procedureName == element.procedureName); + (element) => masterKey.templateID == element.templateID && masterKey.procedureName == element.procedureName); if (history.length > 0) { return true; } diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 354ada19..53024aca 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -19,10 +19,8 @@ import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; -valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, - List entityList) async { - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); +valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, List entityList) async { + ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient.appointmentNo; procedureValadteRequestModel.episodeID = patient.episodeNo; @@ -30,19 +28,18 @@ valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, } postProcedure( - {ProcedureViewModel model, - String remarks, - String orderType, - PatiantInformtion patient, - List entityList}) async { + {required ProcedureViewModel model, + required String remarks, + String? orderType, + required PatiantInformtion patient, + required List entityList}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - List controlsProcedure = List(); + List controlsProcedure = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -50,27 +47,22 @@ postProcedure( postProcedureReqModel.patientMRN = patient.patientMRN; entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); + procedureValadteRequestModel.procedure = [element.procedureId!]; + List controls = []; controls.add( - Controls( - code: "remarks", - controlValue: element.remarks != null ? element.remarks : ""), + Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""), ); controls.add( Controls(code: "ordertype", controlValue: element.type ?? "1"), ); - controlsProcedure.add(Procedures( - category: element.categoryID, - procedure: element.procedureId, - controls: controls)); + controlsProcedure.add(Procedures(category: element.categoryID, procedure: element.procedureId, controls: controls)); }); postProcedureReqModel.procedures = controlsProcedure; await model.valadteProcedure(procedureValadteRequestModel); if (model.state == ViewState.Idle) { - if (model.valadteProcedureList[0].entityList.length == 0) { - await model.postProcedure(postProcedureReqModel, patient.patientMRN); + if (model.valadteProcedureList[0].entityList!.length == 0) { + await model.postProcedure(postProcedureReqModel, patient.patientMRN!); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -83,8 +75,7 @@ postProcedure( Helpers.showErrorToast(model.error); model.getProcedure(mrn: patient.patientMRN); } else if (model.state == ViewState.Idle) { - Helpers.showErrorToast( - model.valadteProcedureList[0].entityList[0].warringMessages); + Helpers.showErrorToast(model.valadteProcedureList[0].entityList![0].warringMessages); } } } else { @@ -92,8 +83,7 @@ postProcedure( } } -void addSelectedProcedure( - context, ProcedureViewModel model, PatiantInformtion patient) { +void addSelectedProcedure(context, ProcedureViewModel model, PatiantInformtion patient) { showModalBottomSheet( context: context, isScrollControlled: true, @@ -109,25 +99,23 @@ class AddSelectedProcedure extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - const AddSelectedProcedure({Key key, this.model, this.patient}) - : super(key: key); + const AddSelectedProcedure({Key? key, required this.model, required this.patient}) : super(key: key); @override - _AddSelectedProcedureState createState() => - _AddSelectedProcedureState(patient: patient, model: model); + _AddSelectedProcedureState createState() => _AddSelectedProcedureState(patient: patient, model: model); } class _AddSelectedProcedureState extends State { - int selectedType; + late int selectedType; ProcedureViewModel model; PatiantInformtion patient; - _AddSelectedProcedureState({this.patient, this.model}); + _AddSelectedProcedureState({required this.patient, required this.model}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); + List entityList = []; + List entityListProcedure = []; TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; @@ -141,8 +129,7 @@ class _AddSelectedProcedureState extends State { @override Widget build(BuildContext context) { return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: false, body: Column( children: [ @@ -156,8 +143,7 @@ class _AddSelectedProcedureState extends State { minChildSize: 0.90, initialChildSize: 0.95, maxChildSize: 1.0, - builder: (BuildContext context, - ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.20, @@ -166,29 +152,22 @@ class _AddSelectedProcedureState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context) - .pleaseEnterProcedure, - fontWeight: FontWeight.w700, - fontSize: 20, - ), - ]), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + AppText( + TranslationBase.of(context).pleaseEnterProcedure, + fontWeight: FontWeight.w700, + fontSize: 20, + ), + ]), SizedBox( - height: - MediaQuery.of(context).size.height * 0.04, + height: MediaQuery.of(context).size.height * 0.04, ), Row( children: [ Container( - width: MediaQuery.of(context).size.width * - 0.79, + width: MediaQuery.of(context).size.width * 0.79, child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .searchProcedureHere, + hintText: TranslationBase.of(context).searchProcedureHere, isTextFieldHasSuffix: false, maxLines: 1, @@ -200,36 +179,28 @@ class _AddSelectedProcedureState extends State { // categoryName: procedureName.text); // }, onClick: () { - if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) + if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) model.getProcedureCategory( - patientId: patient.patientId, - categoryName: - procedureName.text); + patientId: patient.patientId, categoryName: procedureName.text); else DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .atLeastThreeCharacters, + TranslationBase.of(context).atLeastThreeCharacters, ); }, ), ), SizedBox( - width: MediaQuery.of(context).size.width * - 0.02, + width: MediaQuery.of(context).size.width * 0.02, ), Expanded( child: InkWell( onTap: () { - if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) + if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) model.getProcedureCategory( - patientId: patient.patientId, - categoryName: procedureName.text); + patientId: patient.patientId, categoryName: procedureName.text); else DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .atLeastThreeCharacters, + TranslationBase.of(context).atLeastThreeCharacters, ); }, child: Icon( @@ -240,14 +211,12 @@ class _AddSelectedProcedureState extends State { ), ], ), - if (procedureName.text.isNotEmpty && - model.procedureList.length != 0) + if (procedureName.text.isNotEmpty && model.procedureList.length != 0) NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchWidget( model: widget.model, - masterList: widget - .model.categoriesList[0].entityList, + masterList: widget.model.categoriesList[0].entityList!, removeHistory: (item) { setState(() { entityList.remove(item); @@ -262,8 +231,7 @@ class _AddSelectedProcedureState extends State { //TODO build your fun herr // widget.addSelectedHistories(); }, - isEntityListSelected: (master) => - isEntityListSelected(master), + isEntityListSelected: (master) => isEntityListSelected(master), )), SizedBox( height: 115.0, @@ -288,8 +256,7 @@ class _AddSelectedProcedureState extends State { onPressed: () { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .fillTheMandatoryProcedureDetails, + TranslationBase.of(context).fillTheMandatoryProcedureDetails, ); return; } @@ -313,17 +280,15 @@ class _AddSelectedProcedureState extends State { } bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); + Iterable history = entityList.where((element) => masterKey.procedureId == element.procedureId); if (history.length > 0) { return true; } return false; } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/procedures/add_lab_home_screen.dart b/lib/screens/procedures/add_lab_home_screen.dart index d86c4ecd..c6a83538 100644 --- a/lib/screens/procedures/add_lab_home_screen.dart +++ b/lib/screens/procedures/add_lab_home_screen.dart @@ -17,18 +17,16 @@ import 'add_lab_orders.dart'; class AddLabHomeScreen extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - const AddLabHomeScreen({Key key, this.model, this.patient}) : super(key: key); + const AddLabHomeScreen({Key? key, required this.model, required this.patient}) : super(key: key); @override - _AddLabHomeScreenState createState() => - _AddLabHomeScreenState(patient: patient, model: model); + _AddLabHomeScreenState createState() => _AddLabHomeScreenState(patient: patient, model: model); } -class _AddLabHomeScreenState extends State - with SingleTickerProviderStateMixin { - _AddLabHomeScreenState({this.patient, this.model}); +class _AddLabHomeScreenState extends State with SingleTickerProviderStateMixin { + _AddLabHomeScreenState({required this.patient, required this.model}); ProcedureViewModel model; PatiantInformtion patient; - TabController _tabController; + late TabController _tabController; int _activeTab = 0; @override @@ -54,125 +52,116 @@ class _AddLabHomeScreenState extends State Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( - isShowAppBar: false, - body: NetworkBaseView( - baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { - return Container( - height: MediaQuery.of(context).size.height * 1.20, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - 'Add Procedure', - fontWeight: FontWeight.w700, - fontSize: 20, - ), - InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ) - ]), - SizedBox( - height: MediaQuery.of(context).size.height * 0.04, + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( + isShowAppBar: false, + body: NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: (BuildContext context, ScrollController scrollController) { + return Container( + height: MediaQuery.of(context).size.height * 1.20, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + AppText( + 'Add Procedure', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + InkWell( + child: Icon( + Icons.close, + size: 24.0, ), - Expanded( - child: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight( - MediaQuery.of(context).size.height * 0.070), - child: Container( - height: - MediaQuery.of(context).size.height * 0.070, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.5), //width: 0.7 - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: false, - controller: _tabController, - indicatorColor: Colors.transparent, - indicatorWeight: 1.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only( - top: 0, left: 0, right: 0, bottom: 0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - tabWidget( - screenSize, - _activeTab == 0, - "Favorite Templates", - ), - tabWidget( - screenSize, - _activeTab == 1, - 'All Lab', - ), - ], - ), + onTap: () { + Navigator.pop(context); + }, + ) + ]), + SizedBox( + height: MediaQuery.of(context).size.height * 0.04, + ), + Expanded( + child: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: BoxDecoration( + border: Border( + bottom: + BorderSide(color: Theme.of(context).dividerColor, width: 0.5), //width: 0.7 ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + tabWidget( + screenSize, + _activeTab == 0, + "Favorite Templates", + ), + tabWidget( + screenSize, + _activeTab == 1, + 'All Lab', + ), + ], ), ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - AddFavouriteProcedure( - patient: patient, - model: model, - addButtonTitle: TranslationBase.of(context).addLabOrder, - toolbarTitle: TranslationBase.of(context).applyForNewLabOrder, - categoryID: "02", - ), - AddSelectedLabOrder( - model: model, - patient: patient, - ), - ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + AddFavouriteProcedure( + patient: patient, + model: model, + addButtonTitle: TranslationBase.of(context).addLabOrder!, + toolbarTitle: TranslationBase.of(context).applyForNewLabOrder!, + categoryID: "02", ), - ), - ], + AddSelectedLabOrder( + model: model, + patient: patient, + ), + ], + ), ), - ), + ], ), - ], + ), ), - ), - ); - }), - ), - ), + ], + ), + ), + ); + }), + ), + ), ); } - Widget tabWidget(Size screenSize, bool isActive, String title, - {int counter = -1}) { + Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}) { return Center( child: Container( height: screenSize.height * 0.070, diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index b8d4e7c7..025387a1 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -18,10 +18,8 @@ import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; -valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, - List entityList) async { - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); +valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, List entityList) async { + ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient.appointmentNo; procedureValadteRequestModel.episodeID = patient.episodeNo; @@ -29,19 +27,18 @@ valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, } postProcedure( - {ProcedureViewModel model, - String remarks, - String orderType, - PatiantInformtion patient, - List entityList}) async { + {required ProcedureViewModel model, + required String remarks, + required String orderType, + required PatiantInformtion patient, + required List entityList}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - List controlsProcedure = List(); + List controlsProcedure = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -49,27 +46,22 @@ postProcedure( postProcedureReqModel.patientMRN = patient.patientMRN; entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); + procedureValadteRequestModel.procedure = [element.procedureId!]; + List controls = []; controls.add( - Controls( - code: "remarks", - controlValue: element.remarks != null ? element.remarks : ""), + Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""), ); controls.add( Controls(code: "ordertype", controlValue: "0"), ); - controlsProcedure.add(Procedures( - category: element.categoryID, - procedure: element.procedureId, - controls: controls)); + controlsProcedure.add(Procedures(category: element.categoryID, procedure: element.procedureId, controls: controls)); }); postProcedureReqModel.procedures = controlsProcedure; await model.valadteProcedure(procedureValadteRequestModel); if (model.state == ViewState.Idle) { - if (model.valadteProcedureList[0].entityList.length == 0) { - await model.postProcedure(postProcedureReqModel, patient.patientMRN); + if (model.valadteProcedureList[0].entityList!.length == 0) { + await model.postProcedure(postProcedureReqModel, patient.patientMRN!); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -82,8 +74,7 @@ postProcedure( Helpers.showErrorToast(model.error); model.getLabs(patient); } else if (model.state == ViewState.Idle) { - Helpers.showErrorToast( - model.valadteProcedureList[0].entityList[0].warringMessages); + Helpers.showErrorToast(model.valadteProcedureList[0].entityList![0].warringMessages); } } } else { @@ -91,8 +82,7 @@ postProcedure( } } -void addSelectedLabOrder( - context, ProcedureViewModel model, PatiantInformtion patient) { +void addSelectedLabOrder(context, ProcedureViewModel model, PatiantInformtion patient) { showModalBottomSheet( context: context, isScrollControlled: true, @@ -108,22 +98,20 @@ class AddSelectedLabOrder extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - const AddSelectedLabOrder({Key key, this.model, this.patient}) - : super(key: key); + const AddSelectedLabOrder({Key? key, required this.model, required this.patient}) : super(key: key); @override - _AddSelectedLabOrderState createState() => - _AddSelectedLabOrderState(patient: patient, model: model); + _AddSelectedLabOrderState createState() => _AddSelectedLabOrderState(patient: patient, model: model); } class _AddSelectedLabOrderState extends State { - int selectedType; + late int selectedType; ProcedureViewModel model; PatiantInformtion patient; - _AddSelectedLabOrderState({this.patient, this.model}); + _AddSelectedLabOrderState({required this.patient, required this.model}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); + List entityList = []; + List entityListProcedure = []; dynamic selectedCategory; @@ -137,10 +125,9 @@ class _AddSelectedLabOrderState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getProcedureCategory( - categoryName: "Laboratory", categoryID: "02",patientId: patient.patientId), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + onModelReady: (model) => + model.getProcedureCategory(categoryName: "Laboratory", categoryID: "02", patientId: patient.patientId), + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: false, body: NetworkBaseView( baseViewModel: model, @@ -148,8 +135,7 @@ class _AddSelectedLabOrderState extends State { minChildSize: 0.90, initialChildSize: 0.95, maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * .90, @@ -166,8 +152,7 @@ class _AddSelectedLabOrderState extends State { baseViewModel: model, child: EntityListCheckboxSearchWidget( model: widget.model, - masterList: - widget.model.categoriesList[0].entityList, + masterList: widget.model.categoriesList[0].entityList!, removeHistory: (item) { setState(() { entityList.remove(item); @@ -182,8 +167,7 @@ class _AddSelectedLabOrderState extends State { //TODO build your fun herr // widget.addSelectedHistories(); }, - isEntityListSelected: (master) => - isEntityListSelected(master), + isEntityListSelected: (master) => isEntityListSelected(master), )), ], ), @@ -204,8 +188,7 @@ class _AddSelectedLabOrderState extends State { onPressed: () { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .fillTheMandatoryProcedureDetails, + TranslationBase.of(context).fillTheMandatoryProcedureDetails, ); return; } @@ -227,17 +210,15 @@ class _AddSelectedLabOrderState extends State { } bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); + Iterable history = entityList.where((element) => masterKey.procedureId == element.procedureId); if (history.length > 0) { return true; } return false; } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/procedures/add_procedure_homeScreen.dart b/lib/screens/procedures/add_procedure_homeScreen.dart index 39ed4b25..8b1a6d2c 100644 --- a/lib/screens/procedures/add_procedure_homeScreen.dart +++ b/lib/screens/procedures/add_procedure_homeScreen.dart @@ -15,18 +15,16 @@ import 'package:flutter/material.dart'; class AddProcedureHome extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - const AddProcedureHome({Key key, this.model, this.patient}) : super(key: key); + const AddProcedureHome({Key? key, required this.model, required this.patient}) : super(key: key); @override - _AddProcedureHomeState createState() => - _AddProcedureHomeState(patient: patient, model: model); + _AddProcedureHomeState createState() => _AddProcedureHomeState(patient: patient, model: model); } -class _AddProcedureHomeState extends State - with SingleTickerProviderStateMixin { - _AddProcedureHomeState({this.patient, this.model}); +class _AddProcedureHomeState extends State with SingleTickerProviderStateMixin { + _AddProcedureHomeState({required this.patient, required this.model}); ProcedureViewModel model; PatiantInformtion patient; - TabController _tabController; + late TabController _tabController; int _activeTab = 0; @override @@ -55,8 +53,7 @@ class _AddProcedureHomeState extends State final screenSize = MediaQuery.of(context).size; return BaseView( //onModelReady: (model) => model.getCategory(), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: false, body: NetworkBaseView( baseViewModel: model, @@ -64,8 +61,7 @@ class _AddProcedureHomeState extends State minChildSize: 0.90, initialChildSize: 0.95, maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return Container( height: MediaQuery.of(context).size.height * 1.20, child: Padding( @@ -73,24 +69,22 @@ class _AddProcedureHomeState extends State child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - 'Add Procedure', - fontWeight: FontWeight.w700, - fontSize: 20, - ), - InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ) - ]), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + AppText( + 'Add Procedure', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + InkWell( + child: Icon( + Icons.close, + size: 24.0, + ), + onTap: () { + Navigator.pop(context); + }, + ) + ]), SizedBox( height: MediaQuery.of(context).size.height * 0.04, ), @@ -98,16 +92,13 @@ class _AddProcedureHomeState extends State child: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( - preferredSize: Size.fromHeight( - MediaQuery.of(context).size.height * 0.070), + preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), child: Container( - height: - MediaQuery.of(context).size.height * 0.070, + height: MediaQuery.of(context).size.height * 0.070, decoration: BoxDecoration( border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.5), //width: 0.7 + bottom: + BorderSide(color: Theme.of(context).dividerColor, width: 0.5), //width: 0.7 ), color: Colors.white), child: Center( @@ -118,8 +109,7 @@ class _AddProcedureHomeState extends State indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only( - top: 0, left: 0, right: 0, bottom: 0), + labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget( @@ -147,7 +137,7 @@ class _AddProcedureHomeState extends State AddFavouriteProcedure( patient: patient, model: model, - addButtonTitle: TranslationBase.of(context).addSelectedProcedures, + addButtonTitle: TranslationBase.of(context).addSelectedProcedures!, toolbarTitle: 'Add Procedure', ), AddSelectedProcedure( @@ -171,8 +161,7 @@ class _AddProcedureHomeState extends State ); } - Widget tabWidget(Size screenSize, bool isActive, String title, - {int counter = -1}) { + Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}) { return Center( child: Container( height: screenSize.height * 0.070, diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index dc68aacc..dbd1d774 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -18,10 +18,8 @@ import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; -valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, - List entityList) async { - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); +valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, List entityList) async { + ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient.appointmentNo; procedureValadteRequestModel.episodeID = patient.episodeNo; @@ -29,19 +27,18 @@ valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, } postProcedure( - {ProcedureViewModel model, - String remarks, - String orderType, - PatiantInformtion patient, - List entityList}) async { + {required ProcedureViewModel model, + required String remarks, + String? orderType, + required PatiantInformtion patient, + required List entityList}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - List controlsProcedure = List(); + List controlsProcedure = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -49,27 +46,22 @@ postProcedure( postProcedureReqModel.patientMRN = patient.patientMRN; entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); + procedureValadteRequestModel.procedure = [element.procedureId!]; + List controls = []; controls.add( - Controls( - code: "remarks", - controlValue: element.remarks != null ? element.remarks : ""), + Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""), ); controls.add( Controls(code: "ordertype", controlValue: "0"), ); - controlsProcedure.add(Procedures( - category: element.categoryID, - procedure: element.procedureId, - controls: controls)); + controlsProcedure.add(Procedures(category: element.categoryID, procedure: element.procedureId, controls: controls)); }); postProcedureReqModel.procedures = controlsProcedure; await model.valadteProcedure(procedureValadteRequestModel); if (model.state == ViewState.Idle) { - if (model.valadteProcedureList[0].entityList.length == 0) { - await model.postProcedure(postProcedureReqModel, patient.patientMRN); + if (model.valadteProcedureList[0].entityList!.length == 0) { + await model.postProcedure(postProcedureReqModel, patient.patientMRN!); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -82,8 +74,7 @@ postProcedure( Helpers.showErrorToast(model.error); model.getPatientRadOrders(patient); } else if (model.state == ViewState.Idle) { - Helpers.showErrorToast( - model.valadteProcedureList[0].entityList[0].warringMessages); + Helpers.showErrorToast(model.valadteProcedureList[0].entityList![0].warringMessages); } } } else { @@ -91,8 +82,7 @@ postProcedure( } } -void addSelectedRadiologyOrder( - context, ProcedureViewModel model, PatiantInformtion patient) { +void addSelectedRadiologyOrder(context, ProcedureViewModel model, PatiantInformtion patient) { showModalBottomSheet( context: context, isScrollControlled: true, @@ -108,25 +98,23 @@ class AddSelectedRadiologyOrder extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - const AddSelectedRadiologyOrder({Key key, this.model, this.patient}) - : super(key: key); + const AddSelectedRadiologyOrder({Key? key, required this.model, required this.patient}) : super(key: key); @override - _AddSelectedRadiologyOrderState createState() => - _AddSelectedRadiologyOrderState(patient: patient, model: model); + _AddSelectedRadiologyOrderState createState() => _AddSelectedRadiologyOrderState(patient: patient, model: model); } class _AddSelectedRadiologyOrderState extends State { - int selectedType; + late int selectedType; ProcedureViewModel model; PatiantInformtion patient; - _AddSelectedRadiologyOrderState({this.patient, this.model}); + _AddSelectedRadiologyOrderState({required this.patient, required this.model}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); + List entityList = []; + List entityListProcedure = []; dynamic selectedCategory; @@ -140,10 +128,9 @@ class _AddSelectedRadiologyOrderState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getProcedureCategory( - categoryName: "Radiology", categoryID: "03",patientId: patient.patientId), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + onModelReady: (model) => + model.getProcedureCategory(categoryName: "Radiology", categoryID: "03", patientId: patient.patientId), + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: false, body: NetworkBaseView( baseViewModel: model, @@ -151,8 +138,7 @@ class _AddSelectedRadiologyOrderState extends State { minChildSize: 0.90, initialChildSize: 0.95, maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.0, @@ -169,8 +155,7 @@ class _AddSelectedRadiologyOrderState extends State { baseViewModel: model, child: EntityListCheckboxSearchWidget( model: widget.model, - masterList: - widget.model.categoriesList[0].entityList, + masterList: widget.model.categoriesList[0].entityList!, removeHistory: (item) { setState(() { entityList.remove(item); @@ -185,8 +170,7 @@ class _AddSelectedRadiologyOrderState extends State { //TODO build your fun herr // widget.addSelectedHistories(); }, - isEntityListSelected: (master) => - isEntityListSelected(master), + isEntityListSelected: (master) => isEntityListSelected(master), )), ], ), @@ -206,8 +190,7 @@ class _AddSelectedRadiologyOrderState extends State { fontWeight: FontWeight.w700, onPressed: () { if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast(TranslationBase.of(context) - .fillTheMandatoryProcedureDetails); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).fillTheMandatoryProcedureDetails); return; } @@ -228,17 +211,15 @@ class _AddSelectedRadiologyOrderState extends State { } bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); + Iterable history = entityList.where((element) => masterKey.procedureId == element.procedureId); if (history.length > 0) { return true; } return false; } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/procedures/add_radiology_screen.dart b/lib/screens/procedures/add_radiology_screen.dart index 26308553..63b5f7f5 100644 --- a/lib/screens/procedures/add_radiology_screen.dart +++ b/lib/screens/procedures/add_radiology_screen.dart @@ -18,18 +18,16 @@ import 'add_radiology_order.dart'; class AddRadiologyScreen extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - const AddRadiologyScreen({Key key, this.model, this.patient}) : super(key: key); + const AddRadiologyScreen({Key? key, required this.model, required this.patient}) : super(key: key); @override - _AddRadiologyScreenState createState() => - _AddRadiologyScreenState(patient: patient, model: model); + _AddRadiologyScreenState createState() => _AddRadiologyScreenState(patient: patient, model: model); } -class _AddRadiologyScreenState extends State - with SingleTickerProviderStateMixin { - _AddRadiologyScreenState({this.patient, this.model}); +class _AddRadiologyScreenState extends State with SingleTickerProviderStateMixin { + _AddRadiologyScreenState({required this.patient, required this.model}); ProcedureViewModel model; PatiantInformtion patient; - TabController _tabController; + late TabController _tabController; int _activeTab = 0; @override @@ -55,125 +53,116 @@ class _AddRadiologyScreenState extends State Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( - isShowAppBar: false, - body: NetworkBaseView( - baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { - return Container( - height: MediaQuery.of(context).size.height * 1.20, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context).addRadiologyOrder, - fontWeight: FontWeight.w700, - fontSize: 20, - ), - InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ) - ]), - SizedBox( - height: MediaQuery.of(context).size.height * 0.04, + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( + isShowAppBar: false, + body: NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: (BuildContext context, ScrollController scrollController) { + return Container( + height: MediaQuery.of(context).size.height * 1.20, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + AppText( + TranslationBase.of(context).addRadiologyOrder, + fontWeight: FontWeight.w700, + fontSize: 20, + ), + InkWell( + child: Icon( + Icons.close, + size: 24.0, ), - Expanded( - child: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight( - MediaQuery.of(context).size.height * 0.070), - child: Container( - height: - MediaQuery.of(context).size.height * 0.070, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.5), //width: 0.7 - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: false, - controller: _tabController, - indicatorColor: Colors.transparent, - indicatorWeight: 1.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only( - top: 0, left: 0, right: 0, bottom: 0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - tabWidget( - screenSize, - _activeTab == 0, - "Favorite Templates", - ), - tabWidget( - screenSize, - _activeTab == 1, - 'All Radiology', - ), - ], - ), + onTap: () { + Navigator.pop(context); + }, + ) + ]), + SizedBox( + height: MediaQuery.of(context).size.height * 0.04, + ), + Expanded( + child: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: BoxDecoration( + border: Border( + bottom: + BorderSide(color: Theme.of(context).dividerColor, width: 0.5), //width: 0.7 ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + tabWidget( + screenSize, + _activeTab == 0, + "Favorite Templates", + ), + tabWidget( + screenSize, + _activeTab == 1, + 'All Radiology', + ), + ], ), ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - AddFavouriteProcedure( - patient: patient, - model: model, - addButtonTitle: TranslationBase.of(context).addRadiologyOrder, - toolbarTitle: TranslationBase.of(context).addRadiologyOrder, - categoryID: "03", - ), - AddSelectedRadiologyOrder( - model: model, - patient: patient, - ), - ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + AddFavouriteProcedure( + patient: patient, + model: model, + addButtonTitle: TranslationBase.of(context).addRadiologyOrder!, + toolbarTitle: TranslationBase.of(context).addRadiologyOrder!, + categoryID: "03", ), - ), - ], + AddSelectedRadiologyOrder( + model: model, + patient: patient, + ), + ], + ), ), - ), + ], ), - ], + ), ), - ), - ); - }), - ), - ), + ], + ), + ), + ); + }), + ), + ), ); } - Widget tabWidget(Size screenSize, bool isActive, String title, - {int counter = -1}) { + Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}) { return Center( child: Container( height: screenSize.height * 0.070, diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 801c730c..ea743e6b 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import '../../widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; @@ -14,32 +14,30 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { final Function addSelectedHistories; final Function(EntityList) removeHistory; final Function(EntityList) addHistory; - final Function(EntityList) addRemarks; + final Function(EntityList)? addRemarks; final bool Function(EntityList) isEntityListSelected; final List masterList; EntityListCheckboxSearchWidget( - {Key key, - this.model, - this.addSelectedHistories, - this.removeHistory, - this.masterList, - this.addHistory, - this.isEntityListSelected, + {Key? key, + required this.model, + required this.addSelectedHistories, + required this.removeHistory, + required this.masterList, + required this.addHistory, + required this.isEntityListSelected, this.addRemarks}) : super(key: key); @override - _EntityListCheckboxSearchWidgetState createState() => - _EntityListCheckboxSearchWidgetState(); + _EntityListCheckboxSearchWidgetState createState() => _EntityListCheckboxSearchWidgetState(); } -class _EntityListCheckboxSearchWidgetState - extends State { +class _EntityListCheckboxSearchWidgetState extends State { int selectedType = 0; - int typeUrgent; - int typeRegular; + late int typeUrgent; + late int typeRegular; setSelectedType(int val) { setState(() { @@ -47,9 +45,9 @@ class _EntityListCheckboxSearchWidgetState }); } - List items = List(); - List remarksList = List(); - List typeList = List(); + List items = []; + List remarksList = []; + List typeList = []; @override void initState() { @@ -70,9 +68,7 @@ class _EntityListCheckboxSearchWidgetState child: Center( child: Container( margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white), child: ListView( children: [ TextFields( @@ -96,27 +92,21 @@ class _EntityListCheckboxSearchWidgetState title: Row( children: [ Checkbox( - value: widget.isEntityListSelected( - historyInfo), + value: widget.isEntityListSelected(historyInfo), activeColor: Color(0xffD02127), - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isEntityListSelected( - historyInfo)) { - widget.removeHistory( - historyInfo); + if (widget.isEntityListSelected(historyInfo)) { + widget.removeHistory(historyInfo); } else { - widget - .addHistory(historyInfo); + widget.addHistory(historyInfo); } }); }), Expanded( child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: AppText( - historyInfo.procedureName, + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), + child: AppText(historyInfo.procedureName, fontSize: 14.0, variant: "bodyText", bold: true, @@ -128,24 +118,17 @@ class _EntityListCheckboxSearchWidgetState children: [ Container( child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 12), + padding: EdgeInsets.symmetric(horizontal: 12), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 11), + padding: const EdgeInsets.symmetric(horizontal: 11), child: AppText( - TranslationBase.of( - context) - .orderType, - fontWeight: - FontWeight.w700, + TranslationBase.of(context).orderType, + fontWeight: FontWeight.w700, color: Color(0xff2B353E), ), ), @@ -154,17 +137,13 @@ class _EntityListCheckboxSearchWidgetState Row( children: [ Radio( - activeColor: - Color(0xFFD02127), + activeColor: Color(0xFFD02127), value: 0, groupValue: selectedType, - onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); + onChanged: (int? value) { + historyInfo.type = setSelectedType(value!).toString(); - historyInfo.type = - value.toString(); + historyInfo.type = value.toString(); }, ), AppText( @@ -173,22 +152,17 @@ class _EntityListCheckboxSearchWidgetState fontWeight: FontWeight.w600, ), Radio( - activeColor: - Color(0xFFD02127), + activeColor: Color(0xFFD02127), groupValue: selectedType, value: 1, - onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); + onChanged: (int? value) { + historyInfo.type = setSelectedType(value!).toString(); - historyInfo.type = - value.toString(); + historyInfo.type = value.toString(); }, ), AppText( - TranslationBase.of(context) - .urgent, + TranslationBase.of(context).urgent, color: Color(0xff575757), fontWeight: FontWeight.w600, ), @@ -202,11 +176,9 @@ class _EntityListCheckboxSearchWidgetState height: 2.0, ), Padding( - padding: EdgeInsets.symmetric( - horizontal: 12, vertical: 12.0), + padding: EdgeInsets.symmetric(horizontal: 12, vertical: 12.0), child: TextFields( - hintText: TranslationBase.of(context) - .remarks, + hintText: TranslationBase.of(context).remarks, //controller: remarksController, onChanged: (value) { historyInfo.remarks = value; @@ -226,8 +198,7 @@ class _EntityListCheckboxSearchWidgetState ) : Center( child: Container( - child: AppText("Sorry , No Match", - color: Color(0xFFB9382C)), + child: AppText("Sorry , No Match", color: Color(0xFFB9382C)), ), ) ], @@ -244,12 +215,12 @@ class _EntityListCheckboxSearchWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.procedureName.toLowerCase().contains(query.toLowerCase())) { + if (item.procedureName!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/screens/procedures/entity_list_fav_procedure.dart b/lib/screens/procedures/entity_list_fav_procedure.dart index c386afc8..9d0835ae 100644 --- a/lib/screens/procedures/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/entity_list_fav_procedure.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel. import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import '../../widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; @@ -15,32 +15,32 @@ import 'ExpansionProcedure.dart'; class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { final ProcedureViewModel model; - final Function addSelectedHistories; - final Function(ProcedureTempleteModel) removeHistory; - final Function(ProcedureTempleteModel) addHistory; - final Function(ProcedureTempleteModel) addRemarks; + final Function? addSelectedHistories; + final Function(ProcedureTempleteModel)? removeHistory; + final Function(ProcedureTempleteModel)? addHistory; + final Function(ProcedureTempleteModel)? addRemarks; final Function(ProcedureTempleteDetailsModel) removeFavProcedure; final Function(ProcedureTempleteDetailsModel) addFavProcedure; - final Function(ProcedureTempleteDetailsModel) selectProcedures; - final ProcedureTempleteDetailsModel groupProcedures; + final Function(ProcedureTempleteDetailsModel)? selectProcedures; + final ProcedureTempleteDetailsModel? groupProcedures; - final bool Function(ProcedureTempleteModel) isEntityListSelected; - final bool Function(ProcedureTempleteDetailsModel) isEntityFavListSelected; - final List masterList; + final bool Function(ProcedureTempleteModel)? isEntityListSelected; + final bool Function(ProcedureTempleteDetailsModel)? isEntityFavListSelected; + final List? masterList; final bool isProcedure; EntityListCheckboxSearchFavProceduresWidget( - {Key key, - this.model, + {Key? key, + required this.model, this.addSelectedHistories, this.removeHistory, this.masterList, this.addHistory, - this.addFavProcedure, + required this.addFavProcedure, this.selectProcedures, - this.removeFavProcedure, + required this.removeFavProcedure, this.isEntityListSelected, this.isEntityFavListSelected, this.addRemarks, @@ -55,8 +55,8 @@ class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { class _EntityListCheckboxSearchFavProceduresWidgetState extends State { int selectedType = 0; - int typeUrgent; - int typeRegular; + late int typeUrgent; + late int typeRegular; setSelectedType(int val) { setState(() { @@ -64,10 +64,10 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State items = List(); - List itemsProcedure = List(); - List remarksList = List(); - List typeList = List(); + List items = []; + List itemsProcedure = []; + List remarksList = []; + List typeList = []; @override void initState() { @@ -112,11 +112,11 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State dummySearchList = List(); - dummySearchList.addAll(widget.masterList); + List dummySearchList = []; + dummySearchList.addAll(widget.masterList!); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.templateName.toLowerCase().contains(query.toLowerCase())) { + if (item.templateName!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); @@ -152,7 +152,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State masterList; ProcedureListWidget( - {Key key, - this.model, - this.addSelectedHistories, - this.removeHistory, - this.masterList, - this.addHistory, - this.isEntityListSelected, - this.addRemarks}) + {Key? key, + required this.model, + required this.addSelectedHistories, + required this.removeHistory, + required this.masterList, + required this.addHistory, + required this.isEntityListSelected, + required this.addRemarks}) : super(key: key); @override @@ -36,8 +36,8 @@ class ProcedureListWidget extends StatefulWidget { class _ProcedureListWidgetState extends State { int selectedType = 0; - int typeUrgent; - int typeRegular; + late int typeUrgent; + late int typeRegular; setSelectedType(int val) { setState(() { @@ -45,9 +45,9 @@ class _ProcedureListWidgetState extends State { }); } - List items = List(); - List remarksList = List(); - List typeList = List(); + List items = []; + List remarksList = []; + List typeList = []; @override void initState() { @@ -68,9 +68,7 @@ class _ProcedureListWidgetState extends State { child: Center( child: Container( margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: ListView( children: [ TextFields( @@ -91,15 +89,12 @@ class _ProcedureListWidgetState extends State { Row( children: [ Checkbox( - value: widget.isEntityListSelected( - historyInfo), + value: widget.isEntityListSelected(historyInfo), activeColor: Colors.red[800], - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isEntityListSelected( - historyInfo)) { - widget - .removeHistory(historyInfo); + if (widget.isEntityListSelected(historyInfo)) { + widget.removeHistory(historyInfo); } else { widget.addHistory(historyInfo); } @@ -107,13 +102,9 @@ class _ProcedureListWidgetState extends State { }), Expanded( child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: AppText( - historyInfo.procedureName, - variant: "bodyText", - bold: true, - color: Colors.black), + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), + child: AppText(historyInfo.procedureName, + variant: "bodyText", bold: true, color: Colors.black), ), ), ], @@ -125,9 +116,7 @@ class _ProcedureListWidgetState extends State { ) : Center( child: Container( - child: AppText( - "There's no procedures for this category", - color: Color(0xFFB9382C)), + child: AppText("There's no procedures for this category", color: Color(0xFFB9382C)), ), ) ], @@ -144,12 +133,12 @@ class _ProcedureListWidgetState extends State { } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.procedureName.toLowerCase().contains(query.toLowerCase())) { + if (item.procedureName!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/screens/procedures/procedure_checkout_screen.dart b/lib/screens/procedures/procedure_checkout_screen.dart index 76d6cf6f..aa898411 100644 --- a/lib/screens/procedures/procedure_checkout_screen.dart +++ b/lib/screens/procedures/procedure_checkout_screen.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import '../../widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -21,23 +21,25 @@ class ProcedureCheckOutScreen extends StatefulWidget { final String toolbarTitle; ProcedureCheckOutScreen( - {this.items, this.model, this.patient,@required this.addButtonTitle,@required this.toolbarTitle}); + {required this.items, + required this.model, + required this.patient, + required this.addButtonTitle, + required this.toolbarTitle}); @override - _ProcedureCheckOutScreenState createState() => - _ProcedureCheckOutScreenState(); + _ProcedureCheckOutScreenState createState() => _ProcedureCheckOutScreenState(); } class _ProcedureCheckOutScreenState extends State { - List remarksList = List(); + List remarksList = []; final TextEditingController remarksController = TextEditingController(); - List typeList = List(); + List typeList = []; @override Widget build(BuildContext context) { return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), isShowAppBar: false, body: SingleChildScrollView( @@ -82,10 +84,8 @@ class _ProcedureCheckOutScreenState extends State { widget.items.length, (index) => Container( margin: EdgeInsets.only(bottom: 15.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: - BorderRadius.all(Radius.circular(10.0))), + decoration: + BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(10.0))), child: ExpansionTile( initiallyExpanded: true, title: Row( @@ -98,9 +98,7 @@ class _ProcedureCheckOutScreenState extends State { SizedBox( width: 6.0, ), - Expanded( - child: AppText( - widget.items[index].procedureName)), + Expanded(child: AppText(widget.items[index].procedureName)), ], ), children: [ @@ -113,11 +111,9 @@ class _ProcedureCheckOutScreenState extends State { Row( children: [ Padding( - padding: const EdgeInsets.symmetric( - horizontal: 11), + padding: const EdgeInsets.symmetric(horizontal: 11), child: AppText( - TranslationBase.of(context) - .orderType, + TranslationBase.of(context).orderType, fontWeight: FontWeight.w700, color: Color(0xff2B353E), ), @@ -129,14 +125,11 @@ class _ProcedureCheckOutScreenState extends State { Radio( activeColor: Color(0xFFD02127), value: 0, - groupValue: - widget.items[index].selectedType, + groupValue: widget.items[index].selectedType, onChanged: (value) { - widget.items[index].selectedType = - 0; + widget.items[index].selectedType = 0; setState(() { - widget.items[index].type = - value.toString(); + widget.items[index].type = value.toString(); }); }, ), @@ -147,15 +140,12 @@ class _ProcedureCheckOutScreenState extends State { ), Radio( activeColor: Color(0xFFD02127), - groupValue: - widget.items[index].selectedType, + groupValue: widget.items[index].selectedType, value: 1, onChanged: (value) { - widget.items[index].selectedType = - 1; + widget.items[index].selectedType = 1; setState(() { - widget.items[index].type = - value.toString(); + widget.items[index].type = value.toString(); }); }, ), @@ -174,8 +164,7 @@ class _ProcedureCheckOutScreenState extends State { height: 2.0, ), Padding( - padding: EdgeInsets.symmetric( - horizontal: 12, vertical: 15.0), + padding: EdgeInsets.symmetric(horizontal: 12, vertical: 15.0), child: TextFields( hintText: TranslationBase.of(context).remarks, controller: remarksController, @@ -211,7 +200,7 @@ class _ProcedureCheckOutScreenState extends State { color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { - List entityList = List(); + List entityList = []; widget.items.forEach((element) { entityList.add( EntityList( diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index f6752c4a..a35f826d 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -17,7 +17,7 @@ import 'package:flutter/material.dart'; import 'ProcedureCard.dart'; class ProcedureScreen extends StatelessWidget { - int doctorNameP; + int? doctorNameP; void initState() async { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -27,7 +27,7 @@ class ProcedureScreen extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -38,8 +38,7 @@ class ProcedureScreen extends StatelessWidget { mrn: patient.patientId, patientType: patientType, ), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, @@ -57,8 +56,7 @@ class ProcedureScreen extends StatelessWidget { SizedBox( height: 12, ), - if (model.procedureList.length == 0 && - patient.patientStatusType != 43) + if (model.procedureList.length == 0 && patient.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -78,8 +76,7 @@ class ProcedureScreen extends StatelessWidget { ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient.patientStatusType != null && patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -99,8 +96,7 @@ class ProcedureScreen extends StatelessWidget { ], ), ), - if ((patient.patientStatusType != null && - patient.patientStatusType == 43) || + if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) InkWell( onTap: () { @@ -156,45 +152,33 @@ class ProcedureScreen extends StatelessWidget { ), if (model.procedureList.isNotEmpty) ...List.generate( - model.procedureList[0].rowcount, + model.procedureList[0].rowcount!, (index) => ProcedureCard( - categoryID: - model.procedureList[0].entityList[index].categoryID, - entityList: model.procedureList[0].entityList[index], + categoryID: model.procedureList[0].entityList![index].categoryID!, + entityList: model.procedureList[0].entityList![index], onTap: () { - if (model.procedureList[0].entityList[index].categoryID == - 2 || - model.procedureList[0].entityList[index].categoryID == 4) + if (model.procedureList[0].entityList![index].categoryID == 2 || + model.procedureList[0].entityList![index].categoryID == 4) updateProcedureForm(context, model: model, patient: patient, - remarks: model - .procedureList[0].entityList[index].remarks, - orderType: model - .procedureList[0].entityList[index].orderType - .toString(), - orderNo: model - .procedureList[0].entityList[index].orderNo, - procedureName: model.procedureList[0] - .entityList[index].procedureName, - categoreId: model - .procedureList[0].entityList[index].categoryID - .toString(), - procedureId: model.procedureList[0] - .entityList[index].procedureId, - limetNo: model.procedureList[0].entityList[index] - .lineItemNo); + remarks: model.procedureList[0].entityList![index].remarks!, + orderType: model.procedureList[0].entityList![index].orderType.toString(), + orderNo: model.procedureList[0].entityList![index].orderNo!, + procedureName: model.procedureList[0].entityList![index].procedureName!, + categoreId: model.procedureList[0].entityList![index].categoryID.toString(), + procedureId: model.procedureList[0].entityList![index].procedureId!, + limetNo: model.procedureList[0].entityList![index].lineItemNo!); // } else // Helpers.showErrorToast( // 'You Cant Update This Procedure'); }, patient: patient, - doctorID: model?.doctorProfile?.doctorID, + doctorID: model!.doctorProfile!.doctorID!, ), ), if (model.state == ViewState.ErrorLocal || - (model.procedureList.isNotEmpty && - model.procedureList[0].entityList.isEmpty)) + (model.procedureList.isNotEmpty && model.procedureList[0].entityList!.isEmpty)) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -205,9 +189,7 @@ class ProcedureScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(22.0), - child: AppText(model.procedureList.isEmpty - ? model.error - : 'No Procedure Found '), + child: AppText(model.procedureList.isEmpty ? model.error : 'No Procedure Found '), ) ], ), diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 24c4ea41..1909fec7 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.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/shared/TextFields.dart'; +import '../../widgets/shared/text_fields/TextFields.dart'; 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/network_base_view.dart'; @@ -17,15 +17,15 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; void updateProcedureForm(context, - {String procedureName, - int orderNo, - int limetNo, - PatiantInformtion patient, - String orderType, - String procedureId, - String remarks, - ProcedureViewModel model, - String categoreId}) { + {required String procedureName, + required int orderNo, + required int limetNo, + required PatiantInformtion patient, + required String orderType, + required String procedureId, + required String remarks, + required ProcedureViewModel model, + required String categoreId}) { //ProcedureViewModel model2 = ProcedureViewModel(); TextEditingController remarksController = TextEditingController(); TextEditingController orderController = TextEditingController(); @@ -59,15 +59,15 @@ class UpdateProcedureWidget extends StatefulWidget { final int limetNo; UpdateProcedureWidget( - {this.model, - this.procedureName, - this.remarks, - this.remarksController, - this.patient, - this.procedureId, - this.categoryId, - this.orderNo, - this.limetNo}); + {required this.model, + required this.procedureName, + required this.remarks, + required this.remarksController, + required this.patient, + required this.procedureId, + required this.categoryId, + required this.orderNo, + required this.limetNo}); @override _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); } @@ -85,26 +85,22 @@ class _UpdateProcedureWidgetState extends State { widget.remarksController.text = widget.remarks; } - List entityList = List(); + List entityList = []; dynamic selectedCategory; @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return StatefulBuilder(builder: - (BuildContext context, StateSetter setState /*You can rename this!*/) { + return StatefulBuilder(builder: (BuildContext context, StateSetter setState /*You can rename this!*/) { return BaseView( onModelReady: (model) => model.getCategory(), - builder: - (BuildContext context, ProcedureViewModel model, Widget child) => - NetworkBaseView( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 0.9, child: Form( child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -246,8 +242,8 @@ class _UpdateProcedureWidgetState extends State { activeColor: Color(0xFFB9382C), value: 0, groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); + onChanged: (int? value) { + setSelectedType(value!); }, ), Text('routine'), @@ -255,11 +251,11 @@ class _UpdateProcedureWidgetState extends State { activeColor: Color(0xFFB9382C), groupValue: selectedType, value: 1, - onChanged: (value) { - setSelectedType(value); + onChanged: (int? value) { + setSelectedType(value!); }, ), - Text(TranslationBase.of(context).urgent), + Text(TranslationBase.of(context).urgent ?? ""), ], ), ), @@ -268,16 +264,12 @@ class _UpdateProcedureWidgetState extends State { ), Container( decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), child: TextFields( fontSize: 15.0, controller: widget.remarksController, - hintText: widget.remarksController.text.isEmpty - ? 'No Remarks Added' - : '', + hintText: widget.remarksController.text.isEmpty ? 'No Remarks Added' : '', maxLines: 3, minLines: 2, onChanged: (value) {}, @@ -287,16 +279,13 @@ class _UpdateProcedureWidgetState extends State { height: 70.0, ), Container( - margin: - EdgeInsets.all(SizeConfig.widthMultiplier * 2), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), child: Column( //alignment: WrapAlignment.center, children: [ AppButton( color: Color(0xff359846), - title: TranslationBase.of(context) - .updateProcedure - .toUpperCase(), + title: TranslationBase.of(context).updateProcedure!.toUpperCase(), onPressed: () { // if (entityList.isEmpty == true && // widget.remarksController.text == @@ -343,20 +332,19 @@ class _UpdateProcedureWidgetState extends State { } updateProcedure( - {ProcedureViewModel model, - String remarks, - int limetNO, - int orderNo, - String newProcedureId, - String newCategorieId, - List entityList, - String orderType, - String procedureId, - PatiantInformtion patient, - String categorieId}) async { - UpdateProcedureRequestModel updateProcedureReqModel = - new UpdateProcedureRequestModel(); - List controls = List(); + {required ProcedureViewModel model, + required String remarks, + required int limetNO, + required int orderNo, + String? newProcedureId, + String? newCategorieId, + required List entityList, + required String orderType, + required String procedureId, + required PatiantInformtion patient, + required String categorieId}) async { + UpdateProcedureRequestModel updateProcedureReqModel = new UpdateProcedureRequestModel(); + List controls = []; ProcedureDetail controlsProcedure = new ProcedureDetail(); updateProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -385,8 +373,7 @@ class _UpdateProcedureWidgetState extends State { // else { { controls.add( - Controls( - code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""), + Controls(code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""), ); controls.add( Controls(code: "ordertype", controlValue: orderType), @@ -401,9 +388,7 @@ class _UpdateProcedureWidgetState extends State { // category: categorieId, procedure: procedureId, controls: controls)); updateProcedureReqModel.procedureDetail = controlsProcedure; - await model.updateProcedure( - updateProcedureRequestModel: updateProcedureReqModel, - mrn: patient.patientMRN); + await model.updateProcedure(updateProcedureRequestModel: updateProcedureReqModel, mrn: patient.patientMRN); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -415,17 +400,15 @@ class _UpdateProcedureWidgetState extends State { } bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); + Iterable history = entityList.where((element) => masterKey.procedureId == element.procedureId); if (history.length > 0) { return true; } return false; } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index 30c05fef..e2993767 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -61,8 +61,7 @@ class _QrReaderScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: - TranslationBase.of(context).qr + TranslationBase.of(context).reader, + appBarTitle: TranslationBase.of(context).qr! + TranslationBase.of(context).reader!, body: Center( child: Container( margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), @@ -80,9 +79,7 @@ class _QrReaderScreenState extends State { height: 7, ), AppText(TranslationBase.of(context).scanQrCode, - fontSize: 14, - fontWeight: FontWeight.w400, - textAlign: TextAlign.center), + fontSize: 14, fontWeight: FontWeight.w400, textAlign: TextAlign.center), SizedBox( height: 15, ), @@ -106,18 +103,13 @@ class _QrReaderScreenState extends State { margin: EdgeInsets.only(top: 8), decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), - color: - Theme.of(context).errorColor.withOpacity(0.06), + color: Theme.of(context).errorColor.withOpacity(0.06), ), - padding: EdgeInsets.symmetric( - vertical: 8.0, horizontal: 12.0), + padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0), child: Row( children: [ Expanded( - child: AppText( - error ?? - TranslationBase.of(context) - .errorMessage, + child: AppText(error ?? TranslationBase.of(context).errorMessage, color: Theme.of(context).errorColor)), ], ), @@ -162,9 +154,7 @@ class _QrReaderScreenState extends State { case "0": if (response['List_MyOutPatient'] != null) { setState(() { - patientList = - ModelResponse.fromJson(response['List_MyOutPatient']) - .list; + patientList = ModelResponse.fromJson(response['List_MyOutPatient']).list!; isLoading = false; }); Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { @@ -181,8 +171,7 @@ class _QrReaderScreenState extends State { case "1": if (response['List_MyInPatient'] != null) { setState(() { - patientList = - ModelResponse.fromJson(response['List_MyInPatient']).list; + patientList = ModelResponse.fromJson(response['List_MyInPatient']).list!; isLoading = false; error = ""; }); @@ -203,8 +192,7 @@ class _QrReaderScreenState extends State { isLoading = false; isError = true; }); - DrAppToastMsg.showErrorToast( - response['ErrorEndUserMessage'] ?? response['ErrorMessage']); + DrAppToastMsg.showErrorToast(response['ErrorEndUserMessage'] ?? response['ErrorMessage']); } }).catchError((error) { setState(() { diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 2e0a284f..411dbe59 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -15,28 +15,29 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class AddRescheduleLeavScreen extends StatelessWidget { - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); return BaseView( - onModelReady: (model) => - {model.getRescheduleLeave(), model.getCoveringDoctors()}, + onModelReady: (model) => {model.getRescheduleLeave(), model.getCoveringDoctors()}, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves, + appBarTitle: TranslationBase.of(context).rescheduleLeaves ?? "", body: SingleChildScrollView( child: Column(children: [ - AddNewOrder( onTap: () { - openLeave( - context, - false, - ); - },label: TranslationBase.of(context).applyForReschedule,), + AddNewOrder( + onTap: () { + openLeave( + context, + false, + ); + }, + label: TranslationBase.of(context).applyForReschedule ?? "", + ), Column( - children: model.getReschduleLeave - .map((GetRescheduleLeavesResponse item) { + children: model.getReschduleLeave.map((GetRescheduleLeavesResponse item) { return RoundedContainer( child: Column( children: [ @@ -45,7 +46,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { border: Border( left: BorderSide( color: item.status == 10 - ? Colors.red[800] + ? Colors.red[800]! : item.status == 2 ? HexColor('#CC9B14') : item.status == 9 @@ -62,71 +63,55 @@ class AddRescheduleLeavScreen extends StatelessWidget { child: Wrap( children: [ Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - padding: EdgeInsets.all(3), - margin: - EdgeInsets.only(top: 10), - child: AppText( - item.statusDescription, - fontWeight: FontWeight.bold, - color: item.status == 10 - ? Colors.red[800] - : item.status == 2 - ? HexColor('#CC9B14') - : item.status == 9 - ? Colors.green - : Colors.red, - fontSize: 14, - ), - ), - Padding( - padding: - EdgeInsets.only(top: 10), - child: AppText( - AppDateUtils - .convertStringToDateFormat( - item.createdOn, - 'yyyy-MM-dd HH:mm'), - fontWeight: FontWeight.bold, - )) - ]), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Container( + padding: EdgeInsets.all(3), + margin: EdgeInsets.only(top: 10), + child: AppText( + item.statusDescription, + fontWeight: FontWeight.bold, + color: item.status == 10 + ? Colors.red[800] + : item.status == 2 + ? HexColor('#CC9B14') + : item.status == 9 + ? Colors.green + : Colors.red, + fontSize: 14, + ), + ), + Padding( + padding: EdgeInsets.only(top: 10), + child: AppText( + AppDateUtils.convertStringToDateFormat( + item.createdOn ?? "", 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + )) + ]), SizedBox( height: 5, ), Container( child: AppText( item.requisitionType == 1 - ? TranslationBase.of(context) - .offTime + ? TranslationBase.of(context).offTime : item.requisitionType == 2 - ? TranslationBase.of(context) - .holiday + ? TranslationBase.of(context).holiday : item.requisitionType == 3 - ? TranslationBase.of( - context) - .changeOfSchedule - : TranslationBase.of( - context) - .newSchedule, + ? TranslationBase.of(context).changeOfSchedule + : TranslationBase.of(context).newSchedule, fontWeight: FontWeight.bold, )), SizedBox( height: 5, ), Row(children: [ - AppText(TranslationBase.of(context) - .startDate), + AppText(TranslationBase.of(context).startDate), AppText( AppDateUtils.convertStringToDateFormat( - item.dateTimeFrom, - 'yyyy-MM-dd HH:mm'), + item.dateTimeFrom ?? "", 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, ) @@ -142,13 +127,10 @@ class AddRescheduleLeavScreen extends StatelessWidget { ), Row( children: [ - AppText(TranslationBase.of(context) - .endDate), + AppText(TranslationBase.of(context).endDate), AppText( - AppDateUtils - .convertStringToDateFormat( - item.dateTimeTo, - 'yyyy-MM-dd HH:mm'), + AppDateUtils.convertStringToDateFormat( + item.dateTimeTo ?? "", 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, ) ], @@ -160,13 +142,10 @@ class AddRescheduleLeavScreen extends StatelessWidget { model.coveringDoctors.length > 0 ? Row(children: [ AppText( - TranslationBase.of(context) - .coveringDoctor, + TranslationBase.of(context).coveringDoctor, ), AppText( - getDoctor( - model.coveringDoctors, - item.coveringDoctorId), + getDoctor(model.coveringDoctors, item.coveringDoctorId), fontWeight: FontWeight.bold, ) ]) @@ -176,28 +155,18 @@ class AddRescheduleLeavScreen extends StatelessWidget { // .reasons, // fontWeight: FontWeight.bold, // ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: EdgeInsets.only( - bottom: 5), - child: AppText(getReasons( - model.allReasons, - item.reasonId))), - (item.status == 2) - ? IconButton( - icon: Image.asset( - 'assets/images/edit.png'), - // color: Colors.green, //Colors.black, - onPressed: () => { - openLeave(context, true, - extendedData: item) - }, - ) - : SizedBox(), - ]), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Padding( + padding: EdgeInsets.only(bottom: 5), + child: AppText(getReasons(model.allReasons, item.reasonId))), + (item.status == 2) + ? IconButton( + icon: Image.asset('assets/images/edit.png'), + // color: Colors.green, //Colors.black, + onPressed: () => {openLeave(context, true, extendedData: item)}, + ) + : SizedBox(), + ]), ], ), SizedBox( diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index dc3d0adf..c754e468 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -37,19 +37,19 @@ class _RescheduleLeaveScreen extends State { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); TextEditingController _toDateController = new TextEditingController(); TextEditingController _toDateController2 = new TextEditingController(); - ProjectViewModel projectsProvider; - SickLeaveViewModel sickLeaveViewModel; - String _selectedClinic; + late ProjectViewModel projectsProvider; + late SickLeaveViewModel sickLeaveViewModel; + Map profile = {}; - var offTime = '1'; + String offTime = '1'; var date; var doctorID; var reason; var fromDate; var toDate; var clinicID; - String fromTime; - String toTime; + late String fromTime; + late String toTime; TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController(); void _presentDatePicker(id) { @@ -99,9 +99,7 @@ class _RescheduleLeaveScreen extends State { @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); - offTime = widget.updateData != null - ? widget.updateData.requisitionType.toString() - : offTime; + offTime = widget.updateData != null ? widget.updateData.requisitionType.toString() : offTime; return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( @@ -121,7 +119,7 @@ class _RescheduleLeaveScreen extends State { child: AppScaffold( baseViewModel: model2, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves, + appBarTitle: TranslationBase.of(context).rescheduleLeaves ?? "", body: Center( child: Container( margin: EdgeInsets.only(top: 10), @@ -248,22 +246,17 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: - SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -271,34 +264,23 @@ class _RescheduleLeaveScreen extends State { model2.allOffTime.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: - DropdownButton( + child: DropdownButtonHideUnderline( + child: DropdownButton( // focusColor: Colors.grey, isExpanded: true, value: offTime == null - ? model2.allOffTime[0] - ['code'] + ? model2.allOffTime[0]['code'].toString() : offTime, iconSize: 40, elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model2.allOffTime - .map((item) { + selectedItemBuilder: (BuildContext context) { + return model2.allOffTime.map((item) { return Row( - mainAxisSize: - MainAxisSize - .max, + mainAxisSize: MainAxisSize.max, children: [ AppText( - item[ - 'description'], - fontSize: SizeConfig - .textMultiplier * - 2.1, + item['description'], + fontSize: SizeConfig.textMultiplier * 2.1, // color: // Colors.grey, ), @@ -306,38 +288,23 @@ class _RescheduleLeaveScreen extends State { ); }).toList(); }, - onChanged: (newValue) => { + onChanged: (String? newValue) => { setState(() { - offTime = newValue; + offTime = newValue!; }), if (offTime == '1') - { - model2 - .getReasons(18) - } + {model2.getReasons(18)} else if (offTime == '2') - { - model2 - .getReasons(19) - } - else if (offTime == - '3' || - offTime == '5') - { - model2 - .getReasons(102) - } + {model2.getReasons(19)} + else if (offTime == '3' || offTime == '5') + {model2.getReasons(102)} }, - items: model2.allOffTime - .map((item) { - return DropdownMenuItem< - String>( - value: item['code'] - .toString(), + items: model2.allOffTime.map((item) { + return DropdownMenuItem( + value: item['code'].toString(), child: Text( item['description'], - textAlign: - TextAlign.end, + textAlign: TextAlign.end, ), ); }).toList(), @@ -355,37 +322,25 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase.of( - context) - .fromDate, + hintText: TranslationBase.of(context).fromDate, borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons - .calendar_today)), - textInputType: - TextInputType.number, + prefix: + IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, controller: _toDateController, onTap: () { - _presentDatePicker( - 'fromDate'); + _presentDatePicker('fromDate'); }, inputFormatter: ONLY_DATE, - onChanged: (val) => - fromDate = val, - onSaved: (val) => - fromDate = val, + onChanged: (val) => fromDate = val, + onSaved: (val) => fromDate = val, ) ], )), @@ -395,37 +350,24 @@ class _RescheduleLeaveScreen extends State { child: Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 6.0)), - border: Border.all( - width: 1.0, - color: HexColor( - "#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ DateTimePicker( - timeHintText: - TranslationBase.of( - context) - .fromTime, - type: DateTimePickerType - .time, + timeHintText: TranslationBase.of(context).fromTime, + type: DateTimePickerType.time, controller: _controller4, - onChanged: (val) => - fromTime = val, + onChanged: (val) => fromTime = val, validator: (val) { print(val); // setState( // () => _valueToValidate4 = val); return null; }, - onSaved: (val) => - fromTime = val, + onSaved: (val) => fromTime = val!, ) ], ), @@ -435,37 +377,24 @@ class _RescheduleLeaveScreen extends State { child: Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 6.0)), - border: Border.all( - width: 1.0, - color: HexColor( - "#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ DateTimePicker( - timeHintText: - TranslationBase.of( - context) - .toTime, - type: DateTimePickerType - .time, + timeHintText: TranslationBase.of(context).toTime, + type: DateTimePickerType.time, controller: _controller5, - onChanged: (val) => - toTime = val, + onChanged: (val) => toTime = val, validator: (val) { print(val); // setState( // () => _valueToValidate4 = val); return null; }, - onSaved: (val) => - toTime = val, + onSaved: (val) => toTime = val!, ) ], ), @@ -480,33 +409,21 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: - TranslationBase.of( - context) - .fromDate, + hintText: TranslationBase.of(context).fromDate, borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons - .calendar_today)), - textInputType: - TextInputType.number, - controller: - _toDateController, + prefix: + IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController, onTap: () { - _presentDatePicker( - 'fromDate'); + _presentDatePicker('fromDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { @@ -519,33 +436,21 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: - TranslationBase - .of(context) - .toDate, + hintText: TranslationBase.of(context).toDate, borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons - .calendar_today)), - textInputType: - TextInputType.number, - controller: - _toDateController2, + prefix: + IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController2, onTap: () { - _presentDatePicker( - 'toDate'); + _presentDatePicker('toDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { @@ -560,22 +465,17 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: - SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -583,39 +483,25 @@ class _RescheduleLeaveScreen extends State { model2.allReasons.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: - DropdownButton( + child: DropdownButtonHideUnderline( + child: DropdownButton( focusColor: Colors.grey, isExpanded: true, value: reason == null - ? model2.allReasons[0] - ['id'] - .toString() + ? model2.allReasons[0]['id'].toString() : reason, iconSize: 40, elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model2.allReasons - .map((item) { + selectedItemBuilder: (BuildContext context) { + return model2.allReasons.map((item) { return Row( - mainAxisSize: - MainAxisSize - .max, + mainAxisSize: MainAxisSize.max, children: [ AppText( - projectsProvider - .isArabic - ? item[ - 'nameAr'] - : item[ - 'nameEn'], - fontSize: SizeConfig - .textMultiplier * - 2.1, + projectsProvider.isArabic + ? item['nameAr'] + : item['nameEn'], + fontSize: SizeConfig.textMultiplier * 2.1, // color: // Colors.grey, ), @@ -628,20 +514,12 @@ class _RescheduleLeaveScreen extends State { reason = newValue; }) }, - items: model2.allReasons - .map((item) { - return DropdownMenuItem< - String>( - value: item['id'] - .toString(), + items: model2.allReasons.map((item) { + return DropdownMenuItem( + value: item['id'].toString(), child: Text( - projectsProvider - .isArabic - ? item['nameAr'] - : item[ - 'nameEn'], - textAlign: - TextAlign.end, + projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], + textAlign: TextAlign.end, ), ); }).toList(), @@ -657,22 +535,17 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: - SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -683,69 +556,36 @@ class _RescheduleLeaveScreen extends State { child: DropdownSearch( mode: Mode.BOTTOM_SHEET, - dropdownSearchDecoration: - InputDecoration( - contentPadding: - EdgeInsets - .all(0), - border: - InputBorder - .none), + dropdownSearchDecoration: InputDecoration( + contentPadding: EdgeInsets.all(0), border: InputBorder.none), //maxHeight: 300, - items: model2 - .coveringDoctors - .map((item) { - return projectsProvider - .isArabic - ? item[ - 'doctorNameN'] - : item[ - 'doctorName']; + items: model2.coveringDoctors.map((item) { + return projectsProvider.isArabic + ? item['doctorNameN'].toString() + : item['doctorName'].toString(); }).toList(), // label: "Doctor List", onChanged: (item) { - model2.coveringDoctors - .forEach( - (newVal) => { - if (newVal['doctorName'] == - item || - newVal['doctorName'] == - item) - { - doctorID = - newVal['DoctorID'] - } - }); + model2.coveringDoctors.forEach((newVal) => { + if (newVal['doctorName'] == item || + newVal['doctorName'] == item) + {doctorID = newVal['DoctorID']} + }); }, - selectedItem: - getSelectedDoctor( - model2), + selectedItem: getSelectedDoctor(model2), showSearchBox: true, - searchBoxDecoration: - InputDecoration( - border: - OutlineInputBorder(), - contentPadding: - EdgeInsets.fromLTRB( - 12, 12, 8, 0), - labelText: - "Search Doctor", + searchBoxDecoration: InputDecoration( + border: OutlineInputBorder(), + contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0), + labelText: "Search Doctor", ), popupTitle: Container( height: 50, - decoration: - BoxDecoration( - color: Theme.of( - context) - .primaryColorDark, - borderRadius: - BorderRadius.only( - topLeft: - Radius.circular( - 20), - topRight: - Radius.circular( - 20), + decoration: BoxDecoration( + color: Theme.of(context).primaryColorDark, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), ), ), child: Center( @@ -753,25 +593,16 @@ class _RescheduleLeaveScreen extends State { '', style: TextStyle( fontSize: 24, - fontWeight: - FontWeight - .bold, - color: - Colors.white, + fontWeight: FontWeight.bold, + color: Colors.white, ), ), ), ), - popupShape: - RoundedRectangleBorder( - borderRadius: - BorderRadius.only( - topLeft: - Radius.circular( - 24), - topRight: - Radius.circular( - 24), + popupShape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(24), + topRight: Radius.circular(24), ), ), ), @@ -845,17 +676,14 @@ class _RescheduleLeaveScreen extends State { )), SizedBox(height: SizeConfig.screenHeight * .3), Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( title: widget.isUpdate == true - ? TranslationBase.of(context) - .updateReschedule - : TranslationBase.of(context) - .addReschedule, + ? TranslationBase.of(context).updateReschedule + : TranslationBase.of(context).addReschedule, color: HexColor('#359846'), onPressed: () { if (offTime == '1' || offTime == '2') { @@ -865,9 +693,7 @@ class _RescheduleLeaveScreen extends State { addRecheduleLeave(model2); } } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .onlyOfftimeHoliday); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); } }, ), @@ -900,16 +726,13 @@ class _RescheduleLeaveScreen extends State { final df = new DateFormat('HH:mm:ss'); final dateFormat = new DateFormat('yyyy-MM-dd'); this.offTime = widget.updateData.requisitionType.toString(); - _toDateController.text = - dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); + _toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); //df.format(DateTime.parse(widget.updateData.dateTimeFrom)); - this.fromTime = - df.format(DateTime.parse(widget.updateData.dateTimeFrom)); + this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom)); this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); this.toTime = this.toTime.substring(0, this.toTime.length - 3); - _toDateController2.text = - dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); + _toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); _controller5.text = toTime; _controller4.text = fromTime; toDate = _toDateController2.text; @@ -922,8 +745,7 @@ class _RescheduleLeaveScreen extends State { getClinicName(model) { var clinicID = this.profile['ClinicID'] ?? 1; - var clinicInfo = - model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); + var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; } @@ -933,16 +755,10 @@ class _RescheduleLeaveScreen extends State { var fromDates = fromDate; var toDates = toDate; if (offTime == '1') { - fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + - 'T' + - fromTime + - ':' + - DateTime.now().second.toString())); - toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + - 'T' + - toTime + - ':' + - DateTime.now().second.toString())); + fromDate = df.format( + DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime + ':' + DateTime.now().second.toString())); + toDate = df + .format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime + ':' + DateTime.now().second.toString())); } else { fromDate = df.format(fromDates); toDate = df.format(toDates); @@ -957,8 +773,7 @@ class _RescheduleLeaveScreen extends State { "dateTimeTo": toDate, "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, - "coveringDoctorId": - doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "status": 2, "schedule": [ { @@ -995,16 +810,10 @@ class _RescheduleLeaveScreen extends State { var fromDates = fromDate; var toDates = toDate; if (offTime == '1') { - fromDate = df.format(DateTime.parse(_toDateController.text)) + - 'T' + - fromTime + - ':' + - DateTime.now().second.toString(); - toDate = df.format(DateTime.parse(_toDateController.text)) + - 'T' + - toTime + - ':' + - DateTime.now().second.toString(); + fromDate = + df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString(); + toDate = + df.format(DateTime.parse(_toDateController.text)) + 'T' + toTime + ':' + DateTime.now().second.toString(); } else { fromDate = df.format(fromDates); toDate = df.format(toDates); @@ -1020,8 +829,7 @@ class _RescheduleLeaveScreen extends State { "dateTimeTo": toDate, "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, - "coveringDoctorId": - doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "status": 2, "schedule": [ { @@ -1060,8 +868,7 @@ class _RescheduleLeaveScreen extends State { : model2.coveringDoctors[0]['doctorName']; else { model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorID'].toString() == doctorID) - {doctorName = newVal['doctorName']} + if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} }); return doctorName; } diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 734e849a..421eacd2 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -19,17 +19,16 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class AddSickLeavScreen extends StatelessWidget { - PatiantInformtion patient; + late PatiantInformtion patient; @override Widget build(BuildContext context) { ProjectViewModel projectsProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; bool isInpatient = routeArgs['isInpatient']; return BaseView( - onModelReady: (model) => - model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), + onModelReady: (model) => model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -65,20 +64,17 @@ class AddSickLeavScreen extends StatelessWidget { )), Container( width: SizeConfig.screenWidth, - margin: EdgeInsets.only( - left: 20, right: 20, top: 10, bottom: 10), + margin: EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 10), padding: EdgeInsets.all(20), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: HexColor('#EAEAEA')), + decoration: + BoxDecoration(borderRadius: BorderRadius.circular(10), color: HexColor('#EAEAEA')), child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ Container( child: Container( - decoration: BoxDecoration( - color: Colors.grey, - borderRadius: BorderRadius.circular(10)), + decoration: + BoxDecoration(color: Colors.grey, borderRadius: BorderRadius.circular(10)), padding: EdgeInsets.all(3), child: IconButton( icon: Icon( @@ -94,9 +90,7 @@ class AddSickLeavScreen extends StatelessWidget { }), )), Padding( - child: AppText( - TranslationBase.of(context) - .noSickLeaveApplied, + child: AppText(TranslationBase.of(context).noSickLeaveApplied, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 16, @@ -111,8 +105,7 @@ class AddSickLeavScreen extends StatelessWidget { : SizedBox(), model.getAllSIckLeavePatient.length > 0 ? Column( - children: model.getAllSIckLeavePatient - .map((SickLeavePatientModel item) { + children: model.getAllSIckLeavePatient.map((SickLeavePatientModel item) { return RoundedContainer( margin: EdgeInsets.all(10), child: Column( @@ -131,8 +124,7 @@ class AddSickLeavScreen extends StatelessWidget { // ))), padding: EdgeInsets.all(10), child: Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( flex: 4, @@ -141,8 +133,7 @@ class AddSickLeavScreen extends StatelessWidget { // MainAxisAlignment.start, children: [ Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(3), @@ -160,8 +151,7 @@ class AddSickLeavScreen extends StatelessWidget { // : TranslationBase // .of(context) // .all, - fontWeight: - FontWeight.bold, + fontWeight: FontWeight.bold, // color: item.status == 1 // ? Colors.yellow[800] // : item.status == 2 @@ -172,34 +162,23 @@ class AddSickLeavScreen extends StatelessWidget { ), Row( children: [ - AppText(TranslationBase - .of(context) - .daysSickleave + - ": "), + AppText(TranslationBase.of(context).daysSickleave ?? "" + ": "), AppText( - item.sickLeaveDays - .toString(), - fontWeight: - FontWeight.bold, + item.sickLeaveDays.toString(), + fontWeight: FontWeight.bold, ), ], ), Row( children: [ AppText( - TranslationBase.of( - context) - .startDate + - ' ', + TranslationBase.of(context).startDate! + ' ', ), Flexible( child: AppText( AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .convertStringToDate( - item.startDate)), - fontWeight: - FontWeight.bold, + AppDateUtils.convertStringToDate(item.startDate!)), + fontWeight: FontWeight.bold, ), ) ], @@ -207,38 +186,27 @@ class AddSickLeavScreen extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context) - .endDate + - ' ', + TranslationBase.of(context).endDate! + ' ', ), Flexible( child: AppText( - AppDateUtils - .getDayMonthYearDateFormatted( - AppDateUtils - .convertStringToDate( - item.endDate, + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + item.endDate ?? "", )), - fontWeight: - FontWeight.bold, + fontWeight: FontWeight.bold, ), ) ], ), Row(children: [ - AppText(TranslationBase.of( - context) - .branch + - ": "), + AppText(TranslationBase.of(context).branch! + ": "), AppText( item.projectName ?? "", ), ]), Row(children: [ - AppText(TranslationBase.of( - context) - .clinic + - ": "), + AppText(TranslationBase.of(context).clinic! + ": "), AppText( item.clinicName ?? "", ), @@ -268,8 +236,7 @@ class AddSickLeavScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).noSickLeave), + child: AppText(TranslationBase.of(context).noSickLeave), ) ], ), @@ -278,8 +245,7 @@ class AddSickLeavScreen extends StatelessWidget { ])))); } - openSickLeave(BuildContext context, isExtend, - {GetAllSickLeaveResponse extendedData}) { + openSickLeave(BuildContext context, isExtend, {GetAllSickLeaveResponse? extendedData}) { // showModalBottomSheet( // context: context, // builder: (context) { @@ -290,13 +256,11 @@ class AddSickLeavScreen extends StatelessWidget { FadePage( page: SickLeaveScreen( appointmentNo: isExtend == true - ? extendedData.appointmentNo + ? extendedData!.appointmentNo : patient.appointmentNo, //extendedData.appointmentNo, - patientMRN: isExtend == true - ? extendedData.patientMRN - : patient.patientMRN, + patientMRN: isExtend == true ? extendedData!.patientMRN : patient.patientMRN, isExtended: isExtend, - extendedData: extendedData, + extendedData: extendedData!, patient: patient))); } } diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 3fbb3287..b97fe553 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -12,15 +12,14 @@ import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart' import 'package:flutter/material.dart'; class ShowSickLeaveScreen extends StatelessWidget { - PatiantInformtion patient; + late PatiantInformtion patient; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => - model.getSickLeave(patient.patientMRN ?? patient.patientId), + onModelReady: (model) => model.getSickLeave(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -37,8 +36,7 @@ class ShowSickLeaveScreen extends StatelessWidget { // patient, routeArgs['patientType'], routeArgs['arrivalType']), model.getAllSIckLeave.length > 0 ? Column( - children: model.getAllSIckLeave - .map((GetAllSickLeaveResponse item) { + children: model.getAllSIckLeave.map((GetAllSickLeaveResponse item) { return RoundedContainer( margin: EdgeInsets.all(10), child: Column( @@ -48,7 +46,7 @@ class ShowSickLeaveScreen extends StatelessWidget { border: Border( left: BorderSide( color: item.status == 1 - ? Colors.yellow[800] + ? Colors.yellow[800]! : item.status == 2 ? Colors.green : Colors.black, @@ -56,8 +54,7 @@ class ShowSickLeaveScreen extends StatelessWidget { ))), padding: EdgeInsets.all(10), child: Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( flex: 4, @@ -66,26 +63,17 @@ class ShowSickLeaveScreen extends StatelessWidget { // MainAxisAlignment.start, children: [ Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(3), child: AppText( item.status == 1 - ? TranslationBase.of( - context) - .hold + ? TranslationBase.of(context).hold : item.status == 2 - ? TranslationBase - .of( - context) - .active - : TranslationBase - .of(context) - .all, - fontWeight: - FontWeight.bold, + ? TranslationBase.of(context).active + : TranslationBase.of(context).all, + fontWeight: FontWeight.bold, color: item.status == 1 ? Colors.yellow[800] : item.status == 2 @@ -95,72 +83,53 @@ class ShowSickLeaveScreen extends StatelessWidget { ), Row( children: [ + AppText(TranslationBase.of(context).daysSickleave), AppText( - TranslationBase.of( - context) - .daysSickleave), - AppText( - item.noOfDays - .toString(), - fontWeight: - FontWeight.bold, + item.noOfDays.toString(), + fontWeight: FontWeight.bold, ), ], ), Row( children: [ AppText( - TranslationBase.of( - context) - .startDate + - ' ', + TranslationBase.of(context).startDate! + ' ', ), Flexible( child: AppText( - AppDateUtils - .convertStringToDateFormat( - item.startDate, - 'dd-MMM-yyyy'), - fontWeight: - FontWeight.bold, + AppDateUtils.convertStringToDateFormat( + item.startDate ?? "", 'dd-MMM-yyyy'), + fontWeight: FontWeight.bold, )) ], ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - AppText( - item.remarks ?? "", - ), - (item.status == 1) - ? IconButton( - icon: Image.asset( - 'assets/images/edit.png'), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + AppText( + item.remarks ?? "", + ), + (item.status == 1) + ? IconButton( + icon: Image.asset('assets/images/edit.png'), - // color: Colors.green, //Colors.black, - onPressed: () => - { - if (item.status == - 1) - { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .sickleaveonhold) - } - // else - // { - // openSickLeave( - // context, - // true, - // extendedData: - // item) - // } - }, - ) - : SizedBox() - ]), + // color: Colors.green, //Colors.black, + onPressed: () => { + if (item.status == 1) + { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).sickleaveonhold) + } + // else + // { + // openSickLeave( + // context, + // true, + // extendedData: + // item) + // } + }, + ) + : SizedBox() + ]), ], ), SizedBox( @@ -185,8 +154,7 @@ class ShowSickLeaveScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).noSickLeave), + child: AppText(TranslationBase.of(context).noSickLeave), ) ], ), diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 199a7c82..f305caf8 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -29,11 +29,7 @@ class SickLeaveScreen extends StatefulWidget { final patientMRN; final patient; SickLeaveScreen( - {this.appointmentNo, - this.patientMRN, - this.isExtended = false, - this.extendedData, - this.patient}); + {this.appointmentNo, this.patientMRN, this.isExtended = false, required this.extendedData, this.patient}); @override _SickLeaveScreenState createState() => _SickLeaveScreenState(); } @@ -41,7 +37,7 @@ class SickLeaveScreen extends StatefulWidget { class _SickLeaveScreenState extends State { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); TextEditingController _toDateController = new TextEditingController(); - String _selectedClinic; + Map profile = {}; AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); void _presentDatePicker(id) { @@ -59,7 +55,7 @@ class _SickLeaveScreenState extends State { final df = new DateFormat('yyyy-MM-dd'); addSickLeave.startDate = df.format(pickedDate); - _toDateController.text = addSickLeave.startDate; + _toDateController.text = addSickLeave.startDate!; //addSickLeave.startDate = selectedDate; }); }); @@ -76,8 +72,7 @@ class _SickLeaveScreenState extends State { return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( - onModelReady: (model2) => model2.preSickLeaveStatistics( - widget.appointmentNo, widget.patientMRN), + onModelReady: (model2) => model2.preSickLeaveStatistics(widget.appointmentNo, widget.patientMRN), builder: (_, model2, w) => GestureDetector( onTap: () { FocusScope.of(context).requestFocus(new FocusNode()); @@ -85,8 +80,8 @@ class _SickLeaveScreenState extends State { child: AppScaffold( baseViewModel: model2, appBarTitle: widget.isExtended == true - ? TranslationBase.of(context).extendSickLeave - : TranslationBase.of(context).addSickLeave, + ? TranslationBase.of(context).extendSickLeave ?? "" + : TranslationBase.of(context).addSickLeave ?? "", isShowAppBar: true, body: Center( child: Container( @@ -108,46 +103,35 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"), ), color: Colors.white), padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 5, left: 10, right: 10), - child: AppText( - TranslationBase.of(context) - .sickLeave + - ' ' + - TranslationBase.of(context) - .days)), - AppTextFormField( - borderColor: Colors.white, - onChanged: (value) { - addSickLeave.noOfDays = value; - if (widget.extendedData != null) { - widget.extendedData.noOfDays = - int.parse(value); - } - }, - hintText: widget.extendedData != null - ? widget.extendedData.noOfDays - .toString() - : '', - // validator: (value) { - // return TextValidator().validateName(value); - // }, - textInputType:TextInputType.number, - inputFormatter: ONLY_NUMBERS) - ]), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.only(top: 5, left: 10, right: 10), + child: AppText(TranslationBase.of(context).sickLeave! + + ' ' + + TranslationBase.of(context).days!)), + AppTextFormField( + borderColor: Colors.white, + onChanged: (value) { + addSickLeave.noOfDays = value; + if (widget.extendedData != null) { + widget.extendedData.noOfDays = int.parse(value); + } + }, + hintText: + widget.extendedData != null ? widget.extendedData.noOfDays.toString() : '', + // validator: (value) { + // return TextValidator().validateName(value); + // }, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS) + ]), ), SizedBox( height: 10, @@ -155,146 +139,107 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC")), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), color: Colors.white, ), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only( - top: 5, left: 10, right: 10), + padding: EdgeInsets.only(top: 5, left: 10, right: 10), child: AppText( - TranslationBase.of(context) - .sickLeaveDate, + TranslationBase.of(context).sickLeaveDate, )), AppTextFormField( - hintText: widget.extendedData != null - ? widget.extendedData.startDate - : '', + hintText: widget.extendedData != null ? widget.extendedData.startDate : '', borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons.calendar_today)), + prefix: IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), textInputType: TextInputType.number, controller: _toDateController, onTap: () { - _presentDatePicker( - '_selectedToDate'); + _presentDatePicker('_selectedToDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { addSickLeave.startDate = value; if (widget.extendedData != null) { - widget.extendedData.startDate = - value; + widget.extendedData.startDate = value; } }), ], )), Container( - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC")), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), color: Colors.white, ), width: double.infinity, child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: - SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.only(top: 5), child: AppText( - TranslationBase.of(context) - .clinicName, + TranslationBase.of(context).clinicName, )), Row( mainAxisSize: MainAxisSize.max, children: [ Expanded( // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - isExpanded: true, - value: getClinicName( - model) ?? - "", - iconSize: 0, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: < - Widget>[ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - color: Colors - .grey, - ), - ], - ); - }).toList(); - }, - onChanged: - (newValue) => - {}, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: item - .toString(), - child: Text( + child: DropdownButtonHideUnderline( + child: new IgnorePointer( + ignoring: true, + child: DropdownButton( + isExpanded: true, + value: getClinicName(model) ?? "", + iconSize: 0, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model.getClinicNameList().map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( item, - textAlign: - TextAlign - .end, + fontSize: SizeConfig.textMultiplier * 2.1, + color: Colors.grey, ), - ); - }).toList(), - ))), + ], + ); + }).toList(); + }, + onChanged: (newValue) => {}, + items: model.getClinicNameList().map((item) { + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, + ), + ); + }).toList(), + ))), ), ], ) ], ), )), - model2.sickLeaveStatistics[ - 'recommendedSickLeaveDays'] != - null + model2.sickLeaveStatistics['recommendedSickLeaveDays'] != null ? Padding( child: AppText( - model2.sickLeaveStatistics[ - 'recommendedSickLeaveDays'], + model2.sickLeaveStatistics['recommendedSickLeaveDays'], fontWeight: FontWeight.bold, textAlign: TextAlign.start, ), @@ -306,10 +251,8 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC")), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), color: Colors.white, ), padding: EdgeInsets.all(5), @@ -317,11 +260,9 @@ class _SickLeaveScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only( - top: 5, left: 10, right: 10), + padding: EdgeInsets.only(top: 5, left: 10, right: 10), child: AppText( - TranslationBase.of(context) - .doctorName, + TranslationBase.of(context).doctorName, )), new IgnorePointer( ignoring: true, @@ -343,10 +284,8 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC")), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), color: Colors.white, ), padding: EdgeInsets.all(5), @@ -354,8 +293,7 @@ class _SickLeaveScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only( - top: 5, left: 10, right: 10), + padding: EdgeInsets.only(top: 5, left: 10, right: 10), child: AppText( TranslationBase.of(context).remarks, )), @@ -364,9 +302,7 @@ class _SickLeaveScreenState extends State { decoration: InputDecoration( contentPadding: EdgeInsets.all(20.0), border: InputBorder.none, - hintText: widget.extendedData != null - ? widget.extendedData.remarks - : ''), + hintText: widget.extendedData != null ? widget.extendedData.remarks : ''), onChanged: (value) { addSickLeave.remarks = value; if (widget.extendedData != null) { @@ -378,36 +314,26 @@ class _SickLeaveScreenState extends State { ), ), Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( title: widget.isExtended == true ? TranslationBase.of(context).extend - : TranslationBase.of(context) - .addSickLeaverequest, + : TranslationBase.of(context).addSickLeaverequest, color: Colors.green, onPressed: () async { if (widget.isExtended) { - await model2.extendSickLeave( - widget.extendedData); + await model2.extendSickLeave(widget.extendedData); DrAppToastMsg.showSuccesToast( - model2.sickleaveResponse[ - 'ListSickLeavesToExtent'] - ['success']); - Navigator.of(context) - .popUntil((route) { - return route.settings.name == - PATIENTS_PROFILE; + model2.sickleaveResponse['ListSickLeavesToExtent']['success']); + Navigator.of(context).popUntil((route) { + return route.settings.name == PATIENTS_PROFILE; }); - Navigator.of(context).pushNamed( - ADD_SICKLEAVE, - arguments: { - 'patient': widget.patient - }); + Navigator.of(context) + .pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient}); //print(value); //}); } else { @@ -437,26 +363,21 @@ class _SickLeaveScreenState extends State { void _validateInputs(model2) async { try { if (addSickLeave.noOfDays == null) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseEnterNoOfDays); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterNoOfDays); } else if (addSickLeave.remarks == null) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseEnterRemarks); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterRemarks); } else if (addSickLeave.startDate == null) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseEnterDate); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterDate); } else { addSickLeave.patientMRN = widget.patient.patientMRN.toString(); addSickLeave.appointmentNo = widget.patient.appointmentNo.toString(); await model2.addSickLeave(addSickLeave).then((value) => print(value)); - DrAppToastMsg.showSuccesToast( - model2.sickleaveResponse['ListSickLeavesToExtent']['success']); + DrAppToastMsg.showSuccesToast(model2.sickleaveResponse['ListSickLeavesToExtent']['success']); Navigator.of(context).popUntil((route) { return route.settings.name == PATIENTS_PROFILE; }); - Navigator.of(context) - .pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient}); + Navigator.of(context).pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient}); } } catch (err) { print(err); @@ -471,9 +392,7 @@ class _SickLeaveScreenState extends State { } getClinicName(model) { - var clinicInfo = model.clinicsList - .where((i) => i['ClinicID'] == this.profile['ClinicID']) - .toList(); + var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == this.profile['ClinicID']).toList(); return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; } } diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index a0962010..c0bd4e87 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -1,4 +1,3 @@ - import 'dart:convert'; import 'dart:io' show Platform; @@ -6,11 +5,22 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; import 'package:flutter/services.dart'; -class VideoChannel{ +class VideoChannel { /// channel name static const _channel = const MethodChannel("Dr.cloudSolution/videoCall"); - static openVideoCallScreen( - {kApiKey, kSessionId, kToken, callDuration, warningDuration,int vcId,String tokenID,String generalId,int doctorId, Function() onCallEnd , Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure}) async { + static openVideoCallScreen( + {kApiKey, + kSessionId, + kToken, + callDuration, + warningDuration, + int? vcId, + String? tokenID, + String? generalId, + int? doctorId, + Function()? onCallEnd, + Function(SessionStatusModel sessionStatusModel)? onCallNotRespond, + Function(String error)? onFailure}) async { var result; try { result = await _channel.invokeMethod( @@ -20,26 +30,22 @@ class VideoChannel{ "kSessionId": kSessionId, "kToken": kToken, "appLang": "en", - "baseUrl": BASE_URL_LIVE_CARE,//TODO change it to live + "baseUrl": BASE_URL_LIVE_CARE, //TODO change it to live "VC_ID": vcId, "TokenID": tokenID, "generalId": generalId, - "DoctorId": doctorId , + "DoctorId": doctorId, }, ); - if(result['callResponse'] == 'CallEnd') { - onCallEnd(); - } - else { - SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson(Platform.isIOS ?result['sessionStatus'] :json.decode(result['sessionStatus'])); - onCallNotRespond(sessionStatusModel); + if (result['callResponse'] == 'CallEnd') { + onCallEnd!(); + } else { + SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson( + Platform.isIOS ? result['sessionStatus'] : json.decode(result['sessionStatus'])); + onCallNotRespond!(sessionStatusModel); } - } catch (e) { - onFailure(e.toString()); + onFailure!(e.toString()); } - } - - -} \ No newline at end of file +} diff --git a/lib/util/dr_app_shared_pref.dart b/lib/util/dr_app_shared_pref.dart index bac296bf..f08a6e3c 100644 --- a/lib/util/dr_app_shared_pref.dart +++ b/lib/util/dr_app_shared_pref.dart @@ -40,7 +40,7 @@ class DrAppSharedPreferances { /// Get String [key] the key was saved getStringWithDefaultValue(String key, String defaultVal) async { final SharedPreferences prefs = await _prefs; - String value = prefs.getString(key); + String? value = prefs.getString(key); return value == null ? defaultVal : value; } @@ -81,10 +81,10 @@ class DrAppSharedPreferances { return prefs.getInt(key); } - getObj(String key) async{ + getObj(String key) async { final SharedPreferences prefs = await _prefs; var string = prefs.getString(key); - if (string == null ){ + if (string == null) { return null; } return json.decode(string); @@ -92,8 +92,8 @@ class DrAppSharedPreferances { clear() async { final SharedPreferences prefs = await _prefs; - var vvas= await prefs.clear(); - var asd; + var vvas = await prefs.clear(); + var asd; } remove(String key) async { diff --git a/lib/util/extenstions.dart b/lib/util/extenstions.dart index 26e49670..ae638fe4 100644 --- a/lib/util/extenstions.dart +++ b/lib/util/extenstions.dart @@ -1,8 +1,3 @@ extension Extension on Object { - bool isNullOrEmpty() => this == null || this == ''; - - bool isNullEmptyOrFalse() => this == null || this == '' || !this; - - bool isNullEmptyZeroOrFalse() => - this == null || this == '' || !this || this == 0; + bool isNullOrEmpty() => this == ''; } diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 634abd02..a9da05d1 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -27,8 +27,7 @@ class Helpers { get currentLanguage => null; - static showConfirmationDialog( - BuildContext context, String message, Function okFunction) { + static showConfirmationDialog(BuildContext context, String message, Function okFunction) { return showDialog( context: context, barrierDismissible: false, // user must tap button! @@ -44,7 +43,7 @@ class Helpers { ), actions: [ AppButton( - onPressed: okFunction, + onPressed: okFunction(), title: TranslationBase.of(context).noteConfirm, fontColor: Colors.white, color: Colors.green[600], @@ -65,8 +64,8 @@ class Helpers { }); } - static showCupertinoPicker(context, List items, - decKey, onSelectFun, AuthenticationViewModel model) { + static showCupertinoPicker( + context, List items, decKey, onSelectFun, AuthenticationViewModel model) { showModalBottomSheet( isDismissible: false, context: context, @@ -84,15 +83,14 @@ class Helpers { mainAxisAlignment: MainAxisAlignment.end, children: [ CupertinoButton( - child: Text(TranslationBase.of(context).cancel, - style: textStyle(context)), + child: Text(TranslationBase.of(context).cancel ?? "", style: textStyle(context)), onPressed: () { Navigator.pop(context); }, ), CupertinoButton( child: Text( - TranslationBase.of(context).done, + TranslationBase.of(context).done ?? "", style: textStyle(context), ), onPressed: () { @@ -106,23 +104,19 @@ class Helpers { Container( height: SizeConfig.realScreenHeight * 0.3, color: Color(0xfff7f7f7), - child: buildPickerItems( - context, items, decKey, onSelectFun, model)) + child: buildPickerItems(context, items, decKey, onSelectFun, model)) ], ), ); }); } - static TextStyle textStyle(context) => - TextStyle(color: Theme.of(context).primaryColor); + static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor); - static buildPickerItems(context, List items, - decKey, onSelectFun, model) { + static buildPickerItems(context, List items, decKey, onSelectFun, model) { return CupertinoPicker( magnification: 1.5, - scrollController: - FixedExtentScrollController(initialItem: cupertinoPickerIndex), + scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex), children: items.map((item) { return Text( '${item.facilityName}', @@ -148,10 +142,8 @@ class Helpers { } static Future checkConnection() async { - ConnectivityResult connectivityResult = - await (Connectivity().checkConnectivity()); - if ((connectivityResult == ConnectivityResult.mobile) || - (connectivityResult == ConnectivityResult.wifi)) { + ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); + if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) { return true; } else { return false; @@ -163,9 +155,8 @@ class Helpers { List listOfHours = workingHours.split('a'); listOfHours.forEach((element) { - WorkingHours workingHours = WorkingHours(); - var from = element.substring( - element.indexOf('m ') + 2, element.indexOf('To') - 1); + WorkingHours? workingHours = WorkingHours(); + var from = element.substring(element.indexOf('m ') + 2, element.indexOf('To') - 1); workingHours.from = from.trim(); var to = element.substring(element.indexOf('To') + 2); workingHours.to = to.trim(); @@ -202,14 +193,13 @@ class Helpers { static String parseHtmlString(String htmlString) { final document = parse(htmlString); - final String parsedString = parse(document.body.text).documentElement.text; + final String parsedString = parse(document.body!.text).documentElement!.text; return parsedString; } - static InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon, Color dropDownColor}) { + static InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon, Color? dropDownColor}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -239,9 +229,7 @@ class Helpers { ); } - static BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor, - {double borderWidth = -1}) { + static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, {double borderWidth = -1}) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 9ed00146..28feb82e 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -7,1354 +7,1078 @@ import 'package:flutter/material.dart'; class TranslationBase { TranslationBase(this.locale); - final Locale locale; + late Locale locale; static TranslationBase of(BuildContext context) { - return Localizations.of(context, TranslationBase); + return Localizations.of(context, TranslationBase)!; } - String get dashboardScreenToolbarTitle => - localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String? get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle']![locale.languageCode]; - String get settings => localizedValues['settings'][locale.languageCode]; + String? get settings => localizedValues['settings']![locale.languageCode]; - String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode]; + String? get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo']![locale.languageCode]; - String get language => localizedValues['language'][locale.languageCode]; + String? get language => localizedValues['language']![locale.languageCode]; - String get lanEnglish => localizedValues['lanEnglish'][locale.languageCode]; + String? get lanEnglish => localizedValues['lanEnglish']![locale.languageCode]; - String get lanArabic => localizedValues['lanArabic'][locale.languageCode]; + String? get lanArabic => localizedValues['lanArabic']![locale.languageCode]; - String get theDoctor => localizedValues['theDoctor'][locale.languageCode]; + String? get theDoctor => localizedValues['theDoctor']![locale.languageCode]; - String get reply => localizedValues['reply'][locale.languageCode]; + String? get reply => localizedValues['reply']![locale.languageCode]; - String get time => localizedValues['time'][locale.languageCode]; + String? get time => localizedValues['time']![locale.languageCode]; - String get fileNo => localizedValues['fileNo'][locale.languageCode]; + String? get fileNo => localizedValues['fileNo']![locale.languageCode]; - String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; + String? get mobileNo => localizedValues['mobileNo']![locale.languageCode]; - String get replySuccessfully => - localizedValues['replySuccessfully'][locale.languageCode]; + String? get replySuccessfully => localizedValues['replySuccessfully']![locale.languageCode]; - String get messagesScreenToolbarTitle => - localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; + String? get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle']![locale.languageCode]; - String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; + String? get mySchedule => localizedValues['mySchedule']![locale.languageCode]; - String get errorNoSchedule => - localizedValues['errorNoSchedule'][locale.languageCode]; + String? get errorNoSchedule => localizedValues['errorNoSchedule']![locale.languageCode]; - String get verify => localizedValues['verify'][locale.languageCode]; + String? get verify => localizedValues['verify']![locale.languageCode]; - String get referralDoctor => - localizedValues['referralDoctor'][locale.languageCode]; + String? get referralDoctor => localizedValues['referralDoctor']![locale.languageCode]; - String get referringClinic => - localizedValues['referringClinic'][locale.languageCode]; + String? get referringClinic => localizedValues['referringClinic']![locale.languageCode]; - String get frequency => localizedValues['frequency'][locale.languageCode]; + String? get frequency => localizedValues['frequency']![locale.languageCode]; - String get priority => localizedValues['priority'][locale.languageCode]; + String? get priority => localizedValues['priority']![locale.languageCode]; - String get maxResponseTime => - localizedValues['maxResponseTime'][locale.languageCode]; + String? get maxResponseTime => localizedValues['maxResponseTime']![locale.languageCode]; - String get clinicDetailsandRemarks => - localizedValues['clinicDetailsandRemarks'][locale.languageCode]; + String? get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks']![locale.languageCode]; - String get answerSuggestions => - localizedValues['answerSuggestions'][locale.languageCode]; + String? get answerSuggestions => localizedValues['answerSuggestions']![locale.languageCode]; - String get outPatients => localizedValues['outPatients'][locale.languageCode]; + String? get outPatients => localizedValues['outPatients']![locale.languageCode]; - String get searchPatient => localizedValues['searchPatient'][locale.languageCode]; - String get searchPatientDashBoard => localizedValues['searchPatientDashBoard'][locale.languageCode]; - String get searchPatientName => - localizedValues['searchPatient-name'][locale.languageCode]; + String? get searchPatient => localizedValues['searchPatient']![locale.languageCode]; + String? get searchPatientDashBoard => localizedValues['searchPatientDashBoard']![locale.languageCode]; + String? get searchPatientName => localizedValues['searchPatient-name']![locale.languageCode]; - String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; + String? get searchAbout => localizedValues['searchAbout']![locale.languageCode]; - String get patient => localizedValues['patient'][locale.languageCode]; - String get patients => localizedValues['patients'][locale.languageCode]; - String get labResult => localizedValues['labResult'][locale.languageCode]; + String? get patient => localizedValues['patient']![locale.languageCode]; + String? get patients => localizedValues['patients']![locale.languageCode]; + String? get labResult => localizedValues['labResult']![locale.languageCode]; - String get todayStatistics => - localizedValues['todayStatistics'][locale.languageCode]; + String? get todayStatistics => localizedValues['todayStatistics']![locale.languageCode]; - String get familyMedicine => - localizedValues['familyMedicine'][locale.languageCode]; + String? get familyMedicine => localizedValues['familyMedicine']![locale.languageCode]; - String get arrived => localizedValues['arrived'][locale.languageCode]; + String? get arrived => localizedValues['arrived']![locale.languageCode]; - String get er => localizedValues['er'][locale.languageCode]; + String? get er => localizedValues['er']![locale.languageCode]; - String get walkIn => localizedValues['walkIn'][locale.languageCode]; + String? get walkIn => localizedValues['walkIn']![locale.languageCode]; - String get notArrived => localizedValues['notArrived'][locale.languageCode]; + String? get notArrived => localizedValues['notArrived']![locale.languageCode]; - String get radiology => localizedValues['radiology'][locale.languageCode]; + String? get radiology => localizedValues['radiology']![locale.languageCode]; - String get service => localizedValues['service'][locale.languageCode]; + String? get service => localizedValues['service']![locale.languageCode]; - String get referral => localizedValues['referral'][locale.languageCode]; + String? get referral => localizedValues['referral']![locale.languageCode]; - String get inPatient => localizedValues['inPatient'][locale.languageCode]; - String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; - String get inPatientLabel => - localizedValues['inPatientLabel'][locale.languageCode]; + String? get inPatient => localizedValues['inPatient']![locale.languageCode]; + String? get myInPatient => localizedValues['myInPatient']![locale.languageCode]; + String? get inPatientLabel => localizedValues['inPatientLabel']![locale.languageCode]; - String get inPatientAll => - localizedValues['inPatientAll'][locale.languageCode]; + String? get inPatientAll => localizedValues['inPatientAll']![locale.languageCode]; - String get operations => localizedValues['operations'][locale.languageCode]; + String? get operations => localizedValues['operations']![locale.languageCode]; - String get patientServices => - localizedValues['patientServices'][locale.languageCode]; + String? get patientServices => localizedValues['patientServices']![locale.languageCode]; - String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; - String get searchMedicineDashboard => localizedValues['searchMedicineDashboard'][locale.languageCode]; + String? get searchMedicine => localizedValues['searchMedicine']![locale.languageCode]; + String? get searchMedicineDashboard => localizedValues['searchMedicineDashboard']![locale.languageCode]; - String get myReferralPatient => - localizedValues['myReferralPatient'][locale.languageCode]; + String? get myReferralPatient => localizedValues['myReferralPatient']![locale.languageCode]; - String get referPatient => - localizedValues['referPatient'][locale.languageCode]; + String? get referPatient => localizedValues['referPatient']![locale.languageCode]; - String get myReferral => localizedValues['myReferral'][locale.languageCode]; + String? get myReferral => localizedValues['myReferral']![locale.languageCode]; - String get myReferredPatient => - localizedValues['myReferredPatient'][locale.languageCode]; - String get referredPatient => - localizedValues['referredPatient'][locale.languageCode]; - String get referredOn => localizedValues['referredOn'][locale.languageCode]; + String? get myReferredPatient => localizedValues['myReferredPatient']![locale.languageCode]; + String? get referredPatient => localizedValues['referredPatient']![locale.languageCode]; + String? get referredOn => localizedValues['referredOn']![locale.languageCode]; - String get firstName => localizedValues['firstName'][locale.languageCode]; + String? get firstName => localizedValues['firstName']![locale.languageCode]; - String get middleName => localizedValues['middleName'][locale.languageCode]; + String? get middleName => localizedValues['middleName']![locale.languageCode]; - String get lastName => localizedValues['lastName'][locale.languageCode]; + String? get lastName => localizedValues['lastName']![locale.languageCode]; - String get phoneNumber => localizedValues['phoneNumber'][locale.languageCode]; + String? get phoneNumber => localizedValues['phoneNumber']![locale.languageCode]; - String get patientID => localizedValues['patientID'][locale.languageCode]; + String? get patientID => localizedValues['patientID']![locale.languageCode]; - String get patientFile => localizedValues['patientFile'][locale.languageCode]; + String? get patientFile => localizedValues['patientFile']![locale.languageCode]; - String get search => localizedValues['search'][locale.languageCode]; + String? get search => localizedValues['search']![locale.languageCode]; - String get onlyArrivedPatient => - localizedValues['onlyArrivedPatient'][locale.languageCode]; + String? get onlyArrivedPatient => localizedValues['onlyArrivedPatient']![locale.languageCode]; - String get searchMedicineNameHere => - localizedValues['searchMedicineNameHere'][locale.languageCode]; + String? get searchMedicineNameHere => localizedValues['searchMedicineNameHere']![locale.languageCode]; - String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; + String? get youCanFind => localizedValues['youCanFind']![locale.languageCode]; - String get itemsInSearch => - localizedValues['itemsInSearch'][locale.languageCode]; + String? get itemsInSearch => localizedValues['itemsInSearch']![locale.languageCode]; - String get qr => localizedValues['qr'][locale.languageCode]; + String? get qr => localizedValues['qr']![locale.languageCode]; - String get reader => localizedValues['reader'][locale.languageCode]; + String? get reader => localizedValues['reader']![locale.languageCode]; - String get startScanning => - localizedValues['startScanning'][locale.languageCode]; + String? get startScanning => localizedValues['startScanning']![locale.languageCode]; - String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; + String? get scanQrCode => localizedValues['scanQrCode']![locale.languageCode]; - String get scanQr => localizedValues['scanQr'][locale.languageCode]; + String? get scanQr => localizedValues['scanQr']![locale.languageCode]; - String get profile => localizedValues['profile'][locale.languageCode]; + String? get profile => localizedValues['profile']![locale.languageCode]; - String get gender => localizedValues['gender'][locale.languageCode]; + String? get gender => localizedValues['gender']![locale.languageCode]; - String get clinic => localizedValues['clinic'][locale.languageCode]; + String? get clinic => localizedValues['clinic']![locale.languageCode]; - String get clinicSelect => - localizedValues['clinicSelect'][locale.languageCode]; + String? get clinicSelect => localizedValues['clinicSelect']![locale.languageCode]; - String get doctorSelect => - localizedValues['doctorSelect'][locale.languageCode]; + String? get doctorSelect => localizedValues['doctorSelect']![locale.languageCode]; - String get hospital => localizedValues['hospital'][locale.languageCode]; + String? get hospital => localizedValues['hospital']![locale.languageCode]; - String get speciality => localizedValues['speciality'][locale.languageCode]; + String? get speciality => localizedValues['speciality']![locale.languageCode]; - String get errorMessage => - localizedValues['errorMessage'][locale.languageCode]; + String? get errorMessage => localizedValues['errorMessage']![locale.languageCode]; - String get patientProfile => - localizedValues['patientProfile'][locale.languageCode]; + String? get patientProfile => localizedValues['patientProfile']![locale.languageCode]; - String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; + String? get vitalSign => localizedValues['vitalSign']![locale.languageCode]; - String get vital => localizedValues['vital'][locale.languageCode]; + String? get vital => localizedValues['vital']![locale.languageCode]; - String get signs => localizedValues['signs'][locale.languageCode]; + String? get signs => localizedValues['signs']![locale.languageCode]; - String get labOrder => localizedValues['labOrder'][locale.languageCode]; + String? get labOrder => localizedValues['labOrder']![locale.languageCode]; - String get lab => localizedValues['lab'][locale.languageCode]; + String? get lab => localizedValues['lab']![locale.languageCode]; - String get result => localizedValues['result'][locale.languageCode]; + String? get result => localizedValues['result']![locale.languageCode]; - String get medicines => localizedValues['medicines'][locale.languageCode]; + String? get medicines => localizedValues['medicines']![locale.languageCode]; - String get prescription => - localizedValues['prescription'][locale.languageCode]; + String? get prescription => localizedValues['prescription']![locale.languageCode]; - String get insuranceApprovals => - localizedValues['insuranceApprovals'][locale.languageCode]; + String? get insuranceApprovals => localizedValues['insuranceApprovals']![locale.languageCode]; - String get insurance => localizedValues['insurance'][locale.languageCode]; + String? get insurance => localizedValues['insurance']![locale.languageCode]; - String get approvals => localizedValues['approvals'][locale.languageCode]; + String? get approvals => localizedValues['approvals']![locale.languageCode]; - String get bodyMeasurements => - localizedValues['bodyMeasurements'][locale.languageCode]; + String? get bodyMeasurements => localizedValues['bodyMeasurements']![locale.languageCode]; - String get temperature => localizedValues['temperature'][locale.languageCode]; + String? get temperature => localizedValues['temperature']![locale.languageCode]; - String get pulse => localizedValues['pulse'][locale.languageCode]; + String? get pulse => localizedValues['pulse']![locale.languageCode]; - String get respiration => localizedValues['respiration'][locale.languageCode]; + String? get respiration => localizedValues['respiration']![locale.languageCode]; - String get bloodPressure => - localizedValues['bloodPressure'][locale.languageCode]; + String? get bloodPressure => localizedValues['bloodPressure']![locale.languageCode]; - String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; + String? get oxygenation => localizedValues['oxygenation']![locale.languageCode]; - String get painScale => localizedValues['painScale'][locale.languageCode]; + String? get painScale => localizedValues['painScale']![locale.languageCode]; - String get errorNoVitalSign => - localizedValues['errorNoVitalSign'][locale.languageCode]; + String? get errorNoVitalSign => localizedValues['errorNoVitalSign']![locale.languageCode]; - String get labOrders => localizedValues['labOrders'][locale.languageCode]; + String? get labOrders => localizedValues['labOrders']![locale.languageCode]; - String get errorNoLabOrders => - localizedValues['errorNoLabOrders'][locale.languageCode]; + String? get errorNoLabOrders => localizedValues['errorNoLabOrders']![locale.languageCode]; - String get answerThePatient => - localizedValues['answerThePatient'][locale.languageCode]; + String? get answerThePatient => localizedValues['answerThePatient']![locale.languageCode]; - String get pleaseEnterAnswer => - localizedValues['pleaseEnterAnswer'][locale.languageCode]; + String? get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer']![locale.languageCode]; - String get replay => localizedValues['replay'][locale.languageCode]; + String? get replay => localizedValues['replay']![locale.languageCode]; - String get progressNote => - localizedValues['progressNote'][locale.languageCode]; + String? get progressNote => localizedValues['progressNote']![locale.languageCode]; - String get progress => localizedValues['progress'][locale.languageCode]; + String? get progress => localizedValues['progress']![locale.languageCode]; - String get note => localizedValues['note'][locale.languageCode]; + String? get note => localizedValues['note']![locale.languageCode]; - String get searchNote => localizedValues['searchNote'][locale.languageCode]; + String? get searchNote => localizedValues['searchNote']![locale.languageCode]; - String get errorNoProgressNote => - localizedValues['errorNoProgressNote'][locale.languageCode]; + String? get errorNoProgressNote => localizedValues['errorNoProgressNote']![locale.languageCode]; - String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; - String get orderNo => localizedValues['orderNo'][locale.languageCode]; + String? get invoiceNo => localizedValues['invoiceNo:']![locale.languageCode]; + String? get orderNo => localizedValues['orderNo']![locale.languageCode]; - String get generalResult => - localizedValues['generalResult'][locale.languageCode]; + String? get generalResult => localizedValues['generalResult']![locale.languageCode]; - String get description => localizedValues['description'][locale.languageCode]; + String? get description => localizedValues['description']![locale.languageCode]; - String get value => localizedValues['value'][locale.languageCode]; + String? get value => localizedValues['value']![locale.languageCode]; - String get range => localizedValues['range'][locale.languageCode]; + String? get range => localizedValues['range']![locale.languageCode]; - String get enterId => localizedValues['enterId'][locale.languageCode]; + String? get enterId => localizedValues['enterId']![locale.languageCode]; - String get pleaseEnterYourID => - localizedValues['pleaseEnterYourID'][locale.languageCode]; + String? get pleaseEnterYourID => localizedValues['pleaseEnterYourID']![locale.languageCode]; - String get enterPassword => - localizedValues['enterPassword'][locale.languageCode]; + String? get enterPassword => localizedValues['enterPassword']![locale.languageCode]; - String get pleaseEnterPassword => - localizedValues['pleaseEnterPassword'][locale.languageCode]; + String? get pleaseEnterPassword => localizedValues['pleaseEnterPassword']![locale.languageCode]; - String get selectYourProject => - localizedValues['selectYourProject'][locale.languageCode]; + String? get selectYourProject => localizedValues['selectYourProject']![locale.languageCode]; - String get pleaseEnterYourProject => - localizedValues['pleaseEnterYourProject'][locale.languageCode]; + String? get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject']![locale.languageCode]; - String get login => localizedValues['login'][locale.languageCode]; + String? get login => localizedValues['login']![locale.languageCode]; - String get drSulaimanAlHabib => - localizedValues['drSulaimanAlHabib'][locale.languageCode]; + String? get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib']![locale.languageCode]; - String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; + String? get welcomeTo => localizedValues['welcomeTo']![locale.languageCode]; - String get welcomeBackTo => - localizedValues['welcomeBackTo'][locale.languageCode]; + String? get welcomeBackTo => localizedValues['welcomeBackTo']![locale.languageCode]; - String get home => localizedValues['home'][locale.languageCode]; + String? get home => localizedValues['home']![locale.languageCode]; - String get services => localizedValues['services'][locale.languageCode]; + String? get services => localizedValues['services']![locale.languageCode]; - String get sms => localizedValues['sms'][locale.languageCode]; + String? get sms => localizedValues['sms']![locale.languageCode]; - String get fingerprint => localizedValues['fingerprint'][locale.languageCode]; + String? get fingerprint => localizedValues['fingerprint']![locale.languageCode]; - String get faceId => localizedValues['faceId'][locale.languageCode]; + String? get faceId => localizedValues['faceId']![locale.languageCode]; - String get whatsApp => localizedValues['whatsApp'][locale.languageCode]; + String? get whatsApp => localizedValues['whatsApp']![locale.languageCode]; - String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; + String? get whatsAppBy => localizedValues['whatsAppBy']![locale.languageCode]; - String get pleaseChoose => - localizedValues['pleaseChoose'][locale.languageCode]; + String? get pleaseChoose => localizedValues['pleaseChoose']![locale.languageCode]; - String get choose => localizedValues['choose'][locale.languageCode]; + String? get choose => localizedValues['choose']![locale.languageCode]; - String get verification => - localizedValues['verification'][locale.languageCode]; + String? get verification => localizedValues['verification']![locale.languageCode]; - String get firstStep => localizedValues['firstStep'][locale.languageCode]; + String? get firstStep => localizedValues['firstStep']![locale.languageCode]; - String get yourAccount => - localizedValues['yourAccount!'][locale.languageCode]; + String? get yourAccount => localizedValues['yourAccount!']![locale.languageCode]; - String get verify1 => localizedValues['verify1'][locale.languageCode]; + String? get verify1 => localizedValues['verify1']![locale.languageCode]; - String get youWillReceiveA => - localizedValues['youWillReceiveA'][locale.languageCode]; + String? get youWillReceiveA => localizedValues['youWillReceiveA']![locale.languageCode]; - String get loginCode => localizedValues['loginCode'][locale.languageCode]; + String? get loginCode => localizedValues['loginCode']![locale.languageCode]; - String get smsBy => localizedValues['smsBy'][locale.languageCode]; + String? get smsBy => localizedValues['smsBy']![locale.languageCode]; - String get pleaseEnterTheCode => - localizedValues['pleaseEnterTheCode'][locale.languageCode]; + String? get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode']![locale.languageCode]; - String get youDontHaveAnyPatient => - localizedValues['youDon\'tHaveAnyPatient'][locale.languageCode]; + String? get youDontHaveAnyPatient => localizedValues['youDon\'tHaveAnyPatient']![locale.languageCode]; - String get youDoNotHaveAnyItem => - localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; + String? get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem']![locale.languageCode]; - String get age => localizedValues['age'][locale.languageCode]; + String? get age => localizedValues['age']![locale.languageCode]; - String get nationality => localizedValues['nationality'][locale.languageCode]; + String? get nationality => localizedValues['nationality']![locale.languageCode]; - String get today => localizedValues['today'][locale.languageCode]; + String? get today => localizedValues['today']![locale.languageCode]; - String get tomorrow => localizedValues['tomorrow'][locale.languageCode]; + String? get tomorrow => localizedValues['tomorrow']![locale.languageCode]; - String get all => localizedValues['all'][locale.languageCode]; + String? get all => localizedValues['all']![locale.languageCode]; - String get nextWeek => localizedValues['nextWeek'][locale.languageCode]; + String? get nextWeek => localizedValues['nextWeek']![locale.languageCode]; - String get yesterday => localizedValues['yesterday'][locale.languageCode]; + String? get yesterday => localizedValues['yesterday']![locale.languageCode]; - String get errorNoInsuranceApprovals => - localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; + String? get errorNoInsuranceApprovals => localizedValues['errorNoInsuranceApprovals']![locale.languageCode]; - String get searchInsuranceApprovals => - localizedValues['searchInsuranceApprovals'][locale.languageCode]; + String? get searchInsuranceApprovals => localizedValues['searchInsuranceApprovals']![locale.languageCode]; - String get status => localizedValues['status'][locale.languageCode]; + String? get status => localizedValues['status']![locale.languageCode]; - String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; + String? get expiryDate => localizedValues['expiryDate']![locale.languageCode]; - String get producerName => - localizedValues['producerName'][locale.languageCode]; + String? get producerName => localizedValues['producerName']![locale.languageCode]; - String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; + String? get receiptOn => localizedValues['receiptOn']![locale.languageCode]; - String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; + String? get approvalNo => localizedValues['approvalNo']![locale.languageCode]; - String get doctor => localizedValues['doctor'][locale.languageCode]; + String? get doctor => localizedValues['doctor']![locale.languageCode]; - String get ext => localizedValues['ext'][locale.languageCode]; + String? get ext => localizedValues['ext']![locale.languageCode]; - String get veryUrgent => localizedValues['veryUrgent'][locale.languageCode]; + String? get veryUrgent => localizedValues['veryUrgent']![locale.languageCode]; - String get urgent => localizedValues['urgent'][locale.languageCode]; + String? get urgent => localizedValues['urgent']![locale.languageCode]; - String get routine => localizedValues['routine'][locale.languageCode]; + String? get routine => localizedValues['routine']![locale.languageCode]; - String get send => localizedValues['send'][locale.languageCode]; + String? get send => localizedValues['send']![locale.languageCode]; - String get referralFrequency => - localizedValues['referralFrequency'][locale.languageCode]; + String? get referralFrequency => localizedValues['referralFrequency']![locale.languageCode]; - String get selectReferralFrequency => - localizedValues['selectReferralFrequency'][locale.languageCode]; + String? get selectReferralFrequency => localizedValues['selectReferralFrequency']![locale.languageCode]; - String get clinicalDetailsAndRemarks => - localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; + String? get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks']![locale.languageCode]; - String get remarks => localizedValues['remarks'][locale.languageCode]; + String? get remarks => localizedValues['remarks']![locale.languageCode]; - String get pleaseFill => localizedValues['pleaseFill'][locale.languageCode]; + String? get pleaseFill => localizedValues['pleaseFill']![locale.languageCode]; - String get replay2 => localizedValues['replay2'][locale.languageCode]; + String? get replay2 => localizedValues['replay2']![locale.languageCode]; - String get outPatient => localizedValues['outPatients'][locale.languageCode]; + String? get outPatient => localizedValues['outPatients']![locale.languageCode]; - String get myOutPatient => localizedValues['myOutPatient'][locale.languageCode]; - String get myOutPatient_2lines => localizedValues['myOutPatient_2lines'][locale.languageCode]; + String? get myOutPatient => localizedValues['myOutPatient']![locale.languageCode]; + String? get myOutPatient_2lines => localizedValues['myOutPatient_2lines']![locale.languageCode]; - String get logout => localizedValues['logout'][locale.languageCode]; + String? get logout => localizedValues['logout']![locale.languageCode]; - String get pharmaciesList => - localizedValues['pharmaciesList'][locale.languageCode]; + String? get pharmaciesList => localizedValues['pharmaciesList']![locale.languageCode]; - String get price => localizedValues['price'][locale.languageCode]; + String? get price => localizedValues['price']![locale.languageCode]; - String get youCanFindItIn => - localizedValues['youCanFindItIn'][locale.languageCode]; + String? get youCanFindItIn => localizedValues['youCanFindItIn']![locale.languageCode]; - String get radiologyReport => - localizedValues['radiologyReport'][locale.languageCode]; + String? get radiologyReport => localizedValues['radiologyReport']![locale.languageCode]; - String get orders => localizedValues['orders'][locale.languageCode]; + String? get orders => localizedValues['orders']![locale.languageCode]; - String get list => localizedValues['list'][locale.languageCode]; + String? get list => localizedValues['list']![locale.languageCode]; - String get searchOrders => - localizedValues['searchOrders'][locale.languageCode]; + String? get searchOrders => localizedValues['searchOrders']![locale.languageCode]; - String get prescriptionDetails => - localizedValues['prescriptionDetails'][locale.languageCode]; + String? get prescriptionDetails => localizedValues['prescriptionDetails']![locale.languageCode]; - String get prescriptionInfo => - localizedValues['prescriptionInfo'][locale.languageCode]; + String? get prescriptionInfo => localizedValues['prescriptionInfo']![locale.languageCode]; - String get errorNoOrders => - localizedValues['errorNoOrders'][locale.languageCode]; + String? get errorNoOrders => localizedValues['errorNoOrders']![locale.languageCode]; - String get livecare => localizedValues['livecare'][locale.languageCode]; + String? get livecare => localizedValues['livecare']![locale.languageCode]; - String get beingBad => localizedValues['beingBad'][locale.languageCode]; + String? get beingBad => localizedValues['beingBad']![locale.languageCode]; - String get beingGreat => localizedValues['beingGreat'][locale.languageCode]; + String? get beingGreat => localizedValues['beingGreat']![locale.languageCode]; - String get cancel => localizedValues['cancel'][locale.languageCode]; + String? get cancel => localizedValues['cancel']![locale.languageCode]; - String get ok => localizedValues['ok'][locale.languageCode]; + String? get ok => localizedValues['ok']![locale.languageCode]; - String get done => localizedValues['done'][locale.languageCode]; + String? get done => localizedValues['done']![locale.languageCode]; - String get searchMedicineImageCaption => - localizedValues['searchMedicineImageCaption'][locale.languageCode]; + String? get searchMedicineImageCaption => localizedValues['searchMedicineImageCaption']![locale.languageCode]; - String get type => localizedValues['type'][locale.languageCode]; + String? get type => localizedValues['type']![locale.languageCode]; - String get resumecall => localizedValues['resumecall'][locale.languageCode]; + String? get resumecall => localizedValues['resumecall']![locale.languageCode]; - String get endcallwithcharge => - localizedValues['endcallwithcharge'][locale.languageCode]; + String? get endcallwithcharge => localizedValues['endcallwithcharge']![locale.languageCode]; - String get endcall => localizedValues['endcall'][locale.languageCode]; + String? get endcall => localizedValues['endcall']![locale.languageCode]; - String get transfertoadmin => - localizedValues['transfertoadmin'][locale.languageCode]; + String? get transfertoadmin => localizedValues['transfertoadmin']![locale.languageCode]; - String get fromDate => localizedValues['fromDate'][locale.languageCode]; + String? get fromDate => localizedValues['fromDate']![locale.languageCode]; - String get toDate => localizedValues['toDate'][locale.languageCode]; + String? get toDate => localizedValues['toDate']![locale.languageCode]; - String get fromTime => localizedValues['fromTime'][locale.languageCode]; + String? get fromTime => localizedValues['fromTime']![locale.languageCode]; - String get toTime => localizedValues['toTime'][locale.languageCode]; + String? get toTime => localizedValues['toTime']![locale.languageCode]; - String get searchPatientImageCaptionTitle => - localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; + String? get searchPatientImageCaptionTitle => localizedValues['searchPatientImageCaptionTitle']![locale.languageCode]; - String get searchPatientImageCaptionBody => - localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; + String? get searchPatientImageCaptionBody => localizedValues['searchPatientImageCaptionBody']![locale.languageCode]; - String get welcome => localizedValues['welcome'][locale.languageCode]; + String? get welcome => localizedValues['welcome']![locale.languageCode]; - String get typeMedicineName => - localizedValues['typeMedicineName'][locale.languageCode]; + String? get typeMedicineName => localizedValues['typeMedicineName']![locale.languageCode]; - String get moreThan3Letter => - localizedValues['moreThan3Letter'][locale.languageCode]; + String? get moreThan3Letter => localizedValues['moreThan3Letter']![locale.languageCode]; - String get gender2 => localizedValues['gender2'][locale.languageCode]; + String? get gender2 => localizedValues['gender2']![locale.languageCode]; - String get age2 => localizedValues['age2'][locale.languageCode]; + String? get age2 => localizedValues['age2']![locale.languageCode]; - String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; + String? get sickleave => localizedValues['sick-leaves']![locale.languageCode]; - String get patientSick => - localizedValues['patient-sick'][locale.languageCode]; + String? get patientSick => localizedValues['patient-sick']![locale.languageCode]; - String get leave => localizedValues['leave'][locale.languageCode]; + String? get leave => localizedValues['leave']![locale.languageCode]; - String get submit => localizedValues['submit'][locale.languageCode]; + String? get submit => localizedValues['submit']![locale.languageCode]; - String get doctorName => localizedValues['doc-name'][locale.languageCode]; + String? get doctorName => localizedValues['doc-name']![locale.languageCode]; - String get clinicName => localizedValues['clinicname'][locale.languageCode]; + String? get clinicName => localizedValues['clinicname']![locale.languageCode]; - String get sickLeaveDate => - localizedValues['sick-leave-date'][locale.languageCode]; + String? get sickLeaveDate => localizedValues['sick-leave-date']![locale.languageCode]; - String get sickLeaveDays => - localizedValues['sick-leave-days'][locale.languageCode]; + String? get sickLeaveDays => localizedValues['sick-leave-days']![locale.languageCode]; - String get admissionDetail => - localizedValues['admissionDetail'][locale.languageCode]; + String? get admissionDetail => localizedValues['admissionDetail']![locale.languageCode]; - String get dateTime => localizedValues['dateTime'][locale.languageCode]; + String? get dateTime => localizedValues['dateTime']![locale.languageCode]; - String get date => localizedValues['date'][locale.languageCode]; + String? get date => localizedValues['date']![locale.languageCode]; - String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; + String? get admissionNo => localizedValues['admissionNo']![locale.languageCode]; - String get losNo => localizedValues['losNo'][locale.languageCode]; + String? get losNo => localizedValues['losNo']![locale.languageCode]; - String get area => localizedValues['area'][locale.languageCode]; + String? get area => localizedValues['area']![locale.languageCode]; - String get room => localizedValues['room'][locale.languageCode]; + String? get room => localizedValues['room']![locale.languageCode]; - String get bed => localizedValues['bed'][locale.languageCode]; + String? get bed => localizedValues['bed']![locale.languageCode]; - String get previousSickLeaveIssue => - localizedValues['prevoius-sickleave-issed'][locale.languageCode]; + String? get previousSickLeaveIssue => localizedValues['prevoius-sickleave-issed']![locale.languageCode]; - String get noSickLeaveApplied => - localizedValues['no-sickleve-applied'][locale.languageCode]; + String? get noSickLeaveApplied => localizedValues['no-sickleve-applied']![locale.languageCode]; - String get applyNow => localizedValues['applynow'][locale.languageCode]; + String? get applyNow => localizedValues['applynow']![locale.languageCode]; - String get addSickLeave => - localizedValues['add-sickleave'][locale.languageCode]; + String? get addSickLeave => localizedValues['add-sickleave']![locale.languageCode]; - String get add => localizedValues['add'][locale.languageCode]; - String get addSickLeaverequest => - localizedValues['addSickLeaveRequest'][locale.languageCode]; - String get extendSickLeaverequest => - localizedValues['extendSickLeaveRequest'][locale.languageCode]; - String get approved => localizedValues['approved'][locale.languageCode]; + String? get add => localizedValues['add']![locale.languageCode]; + String? get addSickLeaverequest => localizedValues['addSickLeaveRequest']![locale.languageCode]; + String? get extendSickLeaverequest => localizedValues['extendSickLeaveRequest']![locale.languageCode]; + String? get approved => localizedValues['approved']![locale.languageCode]; - String get extended => localizedValues['extended'][locale.languageCode]; + String? get extended => localizedValues['extended']![locale.languageCode]; - String get pending => localizedValues['pending'][locale.languageCode]; + String? get pending => localizedValues['pending']![locale.languageCode]; - String get leaveStartDate => - localizedValues['leave-start-date'][locale.languageCode]; + String? get leaveStartDate => localizedValues['leave-start-date']![locale.languageCode]; - String get daysSickleave => - localizedValues['days-sick-leave'][locale.languageCode]; + String? get daysSickleave => localizedValues['days-sick-leave']![locale.languageCode]; - String get extend => localizedValues['extend'][locale.languageCode]; + String? get extend => localizedValues['extend']![locale.languageCode]; - String get extendSickLeave => - localizedValues['extend-sickleave'][locale.languageCode]; + String? get extendSickLeave => localizedValues['extend-sickleave']![locale.languageCode]; - String get targetPatient => - localizedValues['patient-target'][locale.languageCode]; + String? get targetPatient => localizedValues['patient-target']![locale.languageCode]; - String get noPrescription => - localizedValues['no-priscription-listed'][locale.languageCode]; + String? get noPrescription => localizedValues['no-priscription-listed']![locale.languageCode]; - String get next => localizedValues['next'][locale.languageCode]; + String? get next => localizedValues['next']![locale.languageCode]; - String get previous => localizedValues['previous'][locale.languageCode]; + String? get previous => localizedValues['previous']![locale.languageCode]; - String get emptyMessage => - localizedValues['empty-message'][locale.languageCode]; + String? get emptyMessage => localizedValues['empty-message']![locale.languageCode]; - String get healthRecordInformation => - localizedValues['healthRecordInformation'][locale.languageCode]; + String? get healthRecordInformation => localizedValues['healthRecordInformation']![locale.languageCode]; - String get chiefComplaintLength => - localizedValues['chiefComplaintLength'][locale.languageCode]; + String? get chiefComplaintLength => localizedValues['chiefComplaintLength']![locale.languageCode]; - String get referTo => localizedValues['referTo'][locale.languageCode]; + String? get referTo => localizedValues['referTo']![locale.languageCode]; - String get referredFrom => - localizedValues['referredFrom'][locale.languageCode]; - String get refClinic => localizedValues['refClinic'][locale.languageCode]; + String? get referredFrom => localizedValues['referredFrom']![locale.languageCode]; + String? get refClinic => localizedValues['refClinic']![locale.languageCode]; - String get branch => localizedValues['branch'][locale.languageCode]; + String? get branch => localizedValues['branch']![locale.languageCode]; - String get chooseAppointment => - localizedValues['chooseAppointment'][locale.languageCode]; + String? get chooseAppointment => localizedValues['chooseAppointment']![locale.languageCode]; - String get appointmentNo => - localizedValues['appointmentNo'][locale.languageCode]; + String? get appointmentNo => localizedValues['appointmentNo']![locale.languageCode]; - String get refer => localizedValues['refer'][locale.languageCode]; + String? get refer => localizedValues['refer']![locale.languageCode]; - String get rejected => localizedValues['rejected'][locale.languageCode]; + String? get rejected => localizedValues['rejected']![locale.languageCode]; - String get sameBranch => localizedValues['sameBranch'][locale.languageCode]; + String? get sameBranch => localizedValues['sameBranch']![locale.languageCode]; - String get otherBranch => localizedValues['otherBranch'][locale.languageCode]; + String? get otherBranch => localizedValues['otherBranch']![locale.languageCode]; - String get dr => localizedValues['dr'][locale.languageCode]; + String? get dr => localizedValues['dr']![locale.languageCode]; - String get previewHealth => - localizedValues['previewHealth'][locale.languageCode]; + String? get previewHealth => localizedValues['previewHealth']![locale.languageCode]; - String get summaryReport => - localizedValues['summaryReport'][locale.languageCode]; + String? get summaryReport => localizedValues['summaryReport']![locale.languageCode]; - String get accept => localizedValues['accept'][locale.languageCode]; + String? get accept => localizedValues['accept']![locale.languageCode]; - String get reject => localizedValues['reject'][locale.languageCode]; + String? get reject => localizedValues['reject']![locale.languageCode]; - String get noAppointmentsErrorMsg => - localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; + String? get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg']![locale.languageCode]; - String get referralPatient => - localizedValues['referralPatient'][locale.languageCode]; + String? get referralPatient => localizedValues['referralPatient']![locale.languageCode]; - String get noPrescriptionListed => - localizedValues['noPrescriptionListed'][locale.languageCode]; + String? get noPrescriptionListed => localizedValues['noPrescriptionListed']![locale.languageCode]; - String get addNow => localizedValues['addNow'][locale.languageCode]; + String? get addNow => localizedValues['addNow']![locale.languageCode]; - String get orderType => localizedValues['orderType'][locale.languageCode]; + String? get orderType => localizedValues['orderType']![locale.languageCode]; - String get strength => localizedValues['strength'][locale.languageCode]; + String? get strength => localizedValues['strength']![locale.languageCode]; - String get doseTime => localizedValues['doseTime'][locale.languageCode]; + String? get doseTime => localizedValues['doseTime']![locale.languageCode]; - String get indication => localizedValues['indication'][locale.languageCode]; + String? get indication => localizedValues['indication']![locale.languageCode]; - String get duration => localizedValues['duration'][locale.languageCode]; + String? get duration => localizedValues['duration']![locale.languageCode]; - String get instruction => localizedValues['instruction'][locale.languageCode]; + String? get instruction => localizedValues['instruction']![locale.languageCode]; - String get rescheduleLeaves => - localizedValues['reschedule-leave'][locale.languageCode]; + String? get rescheduleLeaves => localizedValues['reschedule-leave']![locale.languageCode]; - String get applyOrRescheduleLeave => - localizedValues['applyOrRescheduleLeave'][locale.languageCode]; - String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; + String? get applyOrRescheduleLeave => localizedValues['applyOrRescheduleLeave']![locale.languageCode]; + String? get myQRCode => localizedValues['myQRCode']![locale.languageCode]; - String get addMedication => - localizedValues['addMedication'][locale.languageCode]; + String? get addMedication => localizedValues['addMedication']![locale.languageCode]; - String get route => localizedValues['route'][locale.languageCode]; + String? get route => localizedValues['route']![locale.languageCode]; - String get noReScheduleLeave => - localizedValues['no-reschedule-leave'][locale.languageCode]; + String? get noReScheduleLeave => localizedValues['no-reschedule-leave']![locale.languageCode]; - String get weight => localizedValues['weight'][locale.languageCode]; + String? get weight => localizedValues['weight']![locale.languageCode]; - String get kg => localizedValues['kg'][locale.languageCode]; + String? get kg => localizedValues['kg']![locale.languageCode]; - String get height => localizedValues['height'][locale.languageCode]; + String? get height => localizedValues['height']![locale.languageCode]; - String get cm => localizedValues['cm'][locale.languageCode]; + String? get cm => localizedValues['cm']![locale.languageCode]; - String get idealBodyWeight => - localizedValues['idealBodyWeight'][locale.languageCode]; + String? get idealBodyWeight => localizedValues['idealBodyWeight']![locale.languageCode]; - String get waistSize => localizedValues['waistSize'][locale.languageCode]; + String? get waistSize => localizedValues['waistSize']![locale.languageCode]; - String get inch => localizedValues['inch'][locale.languageCode]; + String? get inch => localizedValues['inch']![locale.languageCode]; - String get headCircum => localizedValues['headCircum'][locale.languageCode]; + String? get headCircum => localizedValues['headCircum']![locale.languageCode]; - String get leanBodyWeight => - localizedValues['leanBodyWeight'][locale.languageCode]; + String? get leanBodyWeight => localizedValues['leanBodyWeight']![locale.languageCode]; - String get bodyMassIndex => - localizedValues['bodyMassIndex'][locale.languageCode]; + String? get bodyMassIndex => localizedValues['bodyMassIndex']![locale.languageCode]; - String get yourBodyMassIndex => - localizedValues['yourBodyMassIndex'][locale.languageCode]; - String get bmiUnderWeight => - localizedValues['bmiUnderWeight'][locale.languageCode]; - String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; - String get bmiOverWeight => - localizedValues['bmiOverWeight'][locale.languageCode]; - String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; - String get bmiObeseExtreme => - localizedValues['bmiObeseExtreme'][locale.languageCode]; + String? get yourBodyMassIndex => localizedValues['yourBodyMassIndex']![locale.languageCode]; + String? get bmiUnderWeight => localizedValues['bmiUnderWeight']![locale.languageCode]; + String? get bmiHealthy => localizedValues['bmiHealthy']![locale.languageCode]; + String? get bmiOverWeight => localizedValues['bmiOverWeight']![locale.languageCode]; + String? get bmiObese => localizedValues['bmiObese']![locale.languageCode]; + String? get bmiObeseExtreme => localizedValues['bmiObeseExtreme']![locale.languageCode]; - String get method => localizedValues['method'][locale.languageCode]; + String? get method => localizedValues['method']![locale.languageCode]; - String get pulseBeats => localizedValues['pulseBeats'][locale.languageCode]; + String? get pulseBeats => localizedValues['pulseBeats']![locale.languageCode]; - String get rhythm => localizedValues['rhythm'][locale.languageCode]; + String? get rhythm => localizedValues['rhythm']![locale.languageCode]; - String get respBeats => localizedValues['respBeats'][locale.languageCode]; + String? get respBeats => localizedValues['respBeats']![locale.languageCode]; - String get patternOfRespiration => - localizedValues['patternOfRespiration'][locale.languageCode]; + String? get patternOfRespiration => localizedValues['patternOfRespiration']![locale.languageCode]; - String get bloodPressureDiastoleAndSystole => - localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; + String? get bloodPressureDiastoleAndSystole => + localizedValues['bloodPressureDiastoleAndSystole']![locale.languageCode]; - String get cuffLocation => - localizedValues['cuffLocation'][locale.languageCode]; + String? get cuffLocation => localizedValues['cuffLocation']![locale.languageCode]; - String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; + String? get cuffSize => localizedValues['cuffSize']![locale.languageCode]; - String get patientPosition => - localizedValues['patientPosition'][locale.languageCode]; + String? get patientPosition => localizedValues['patientPosition']![locale.languageCode]; - String get fio2 => localizedValues['fio2'][locale.languageCode]; + String? get fio2 => localizedValues['fio2']![locale.languageCode]; - String get sao2 => localizedValues['sao2'][locale.languageCode]; + String? get sao2 => localizedValues['sao2']![locale.languageCode]; - String get painManagement => - localizedValues['painManagement'][locale.languageCode]; + String? get painManagement => localizedValues['painManagement']![locale.languageCode]; - String get holiday => localizedValues['holiday'][locale.languageCode]; + String? get holiday => localizedValues['holiday']![locale.languageCode]; - String get to => localizedValues['to'][locale.languageCode]; + String? get to => localizedValues['to']![locale.languageCode]; - String get coveringDoctor => - localizedValues['coveringDoctor'][locale.languageCode]; + String? get coveringDoctor => localizedValues['coveringDoctor']![locale.languageCode]; - String get requestLeave => - localizedValues['requestLeave'][locale.languageCode]; + String? get requestLeave => localizedValues['requestLeave']![locale.languageCode]; - String get pleaseEnterDate => - localizedValues['pleaseEnterDate'][locale.languageCode]; + String? get pleaseEnterDate => localizedValues['pleaseEnterDate']![locale.languageCode]; - String get pleaseEnterNoOfDays => - localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; + String? get pleaseEnterNoOfDays => localizedValues['pleaseEnterNoOfDays']![locale.languageCode]; - String get pleaseEnterRemarks => - localizedValues['pleaseEnterRemarks'][locale.languageCode]; + String? get pleaseEnterRemarks => localizedValues['pleaseEnterRemarks']![locale.languageCode]; - String get update => localizedValues['update'][locale.languageCode]; + String? get update => localizedValues['update']![locale.languageCode]; - String get admission => localizedValues['admission'][locale.languageCode]; + String? get admission => localizedValues['admission']![locale.languageCode]; - String get request => localizedValues['request'][locale.languageCode]; + String? get request => localizedValues['request']![locale.languageCode]; - String get admissionRequest => - localizedValues['admissionRequest'][locale.languageCode]; + String? get admissionRequest => localizedValues['admissionRequest']![locale.languageCode]; - String get patientDetails => - localizedValues['patientDetails'][locale.languageCode]; + String? get patientDetails => localizedValues['patientDetails']![locale.languageCode]; - String get specialityAndDoctorDetail => - localizedValues['specialityAndDoctorDetail'][locale.languageCode]; + String? get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail']![locale.languageCode]; - String get referringDate => - localizedValues['referringDate'][locale.languageCode]; + String? get referringDate => localizedValues['referringDate']![locale.languageCode]; - String get referringDoctor => - localizedValues['referringDoctor'][locale.languageCode]; + String? get referringDoctor => localizedValues['referringDoctor']![locale.languageCode]; - String get otherInformation => - localizedValues['otherInformation'][locale.languageCode]; + String? get otherInformation => localizedValues['otherInformation']![locale.languageCode]; - String get expectedDays => - localizedValues['expectedDays'][locale.languageCode]; + String? get expectedDays => localizedValues['expectedDays']![locale.languageCode]; - String get expectedAdmissionDate => - localizedValues['expectedAdmissionDate'][locale.languageCode]; + String? get expectedAdmissionDate => localizedValues['expectedAdmissionDate']![locale.languageCode]; - String get emergencyAdmission => - localizedValues['emergencyAdmission'][locale.languageCode]; - String get isSickLeaveRequired => - localizedValues['isSickLeaveRequired'][locale.languageCode]; + String? get emergencyAdmission => localizedValues['emergencyAdmission']![locale.languageCode]; + String? get isSickLeaveRequired => localizedValues['isSickLeaveRequired']![locale.languageCode]; - String get patientPregnant => - localizedValues['patientPregnant'][locale.languageCode]; + String? get patientPregnant => localizedValues['patientPregnant']![locale.languageCode]; - String get treatmentLine => - localizedValues['treatmentLine'][locale.languageCode]; + String? get treatmentLine => localizedValues['treatmentLine']![locale.languageCode]; - String get ward => localizedValues['ward'][locale.languageCode]; + String? get ward => localizedValues['ward']![locale.languageCode]; - String get preAnesthesiaReferred => - localizedValues['preAnesthesiaReferred'][locale.languageCode]; + String? get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred']![locale.languageCode]; - String get admissionType => - localizedValues['admissionType'][locale.languageCode]; + String? get admissionType => localizedValues['admissionType']![locale.languageCode]; - String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; + String? get diagnosis => localizedValues['diagnosis']![locale.languageCode]; - String get allergies => localizedValues['allergies'][locale.languageCode]; + String? get allergies => localizedValues['allergies']![locale.languageCode]; - String get preOperativeOrders => - localizedValues['preOperativeOrders'][locale.languageCode]; + String? get preOperativeOrders => localizedValues['preOperativeOrders']![locale.languageCode]; - String get elementForImprovement => - localizedValues['elementForImprovement'][locale.languageCode]; + String? get elementForImprovement => localizedValues['elementForImprovement']![locale.languageCode]; - String get dischargeDate => - localizedValues['dischargeDate'][locale.languageCode]; + String? get dischargeDate => localizedValues['dischargeDate']![locale.languageCode]; - String get dietType => localizedValues['dietType'][locale.languageCode]; + String? get dietType => localizedValues['dietType']![locale.languageCode]; - String get dietTypeRemarks => - localizedValues['dietTypeRemarks'][locale.languageCode]; + String? get dietTypeRemarks => localizedValues['dietTypeRemarks']![locale.languageCode]; - String get save => localizedValues['save'][locale.languageCode]; + String? get save => localizedValues['save']![locale.languageCode]; - String get postPlansEstimatedCost => - localizedValues['postPlansEstimatedCost'][locale.languageCode]; - String get postPlans => localizedValues['postPlans'][locale.languageCode]; + String? get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost']![locale.languageCode]; + String? get postPlans => localizedValues['postPlans']![locale.languageCode]; - String get ucaf => localizedValues['ucaf'][locale.languageCode]; + String? get ucaf => localizedValues['ucaf']![locale.languageCode]; - String get emergencyCase => - localizedValues['emergencyCase'][locale.languageCode]; + String? get emergencyCase => localizedValues['emergencyCase']![locale.languageCode]; - String get durationOfIllness => - localizedValues['durationOfIllness'][locale.languageCode]; + String? get durationOfIllness => localizedValues['durationOfIllness']![locale.languageCode]; - String get chiefComplaintsAndSymptoms => - localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; + String? get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms']![locale.languageCode]; - String get patientFeelsPainInHisBackAndCough => - localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; + String? get patientFeelsPainInHisBackAndCough => + localizedValues['patientFeelsPainInHisBackAndCough']![locale.languageCode]; - String get additionalTextComplaints => - localizedValues['additionalTextComplaints'][locale.languageCode]; + String? get additionalTextComplaints => localizedValues['additionalTextComplaints']![locale.languageCode]; - String get otherConditions => - localizedValues['otherConditions'][locale.languageCode]; + String? get otherConditions => localizedValues['otherConditions']![locale.languageCode]; - String get other => localizedValues['other'][locale.languageCode]; + String? get other => localizedValues['other']![locale.languageCode]; - String get how => localizedValues['how'][locale.languageCode]; + String? get how => localizedValues['how']![locale.languageCode]; - String get when => localizedValues['when'][locale.languageCode]; + String? get when => localizedValues['when']![locale.languageCode]; - String get where => localizedValues['where'][locale.languageCode]; + String? get where => localizedValues['where']![locale.languageCode]; - String get specifyPossibleLineManagement => - localizedValues['specifyPossibleLineManagement'][locale.languageCode]; + String? get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement']![locale.languageCode]; - String get significantSigns => - localizedValues['significantSigns'][locale.languageCode]; + String? get significantSigns => localizedValues['significantSigns']![locale.languageCode]; - String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; + String? get backAbdomen => localizedValues['backAbdomen']![locale.languageCode]; - String get reasons => localizedValues['reasons'][locale.languageCode]; + String? get reasons => localizedValues['reasons']![locale.languageCode]; - String get createNew => localizedValues['createNew'][locale.languageCode]; + String? get createNew => localizedValues['createNew']![locale.languageCode]; - String get episode => localizedValues['episode'][locale.languageCode]; + String? get episode => localizedValues['episode']![locale.languageCode]; - String get medications => localizedValues['medications'][locale.languageCode]; + String? get medications => localizedValues['medications']![locale.languageCode]; - String get procedures => localizedValues['procedures'][locale.languageCode]; + String? get procedures => localizedValues['procedures']![locale.languageCode]; - String get chiefComplaints => - localizedValues['chiefComplaints'][locale.languageCode]; + String? get chiefComplaints => localizedValues['chiefComplaints']![locale.languageCode]; - String get histories => localizedValues['histories'][locale.languageCode]; + String? get histories => localizedValues['histories']![locale.languageCode]; - String get allergiesSoap => - localizedValues['allergiesSoap'][locale.languageCode]; + String? get allergiesSoap => localizedValues['allergiesSoap']![locale.languageCode]; - String get addChiefComplaints => - localizedValues['addChiefComplaints'][locale.languageCode]; + String? get addChiefComplaints => localizedValues['addChiefComplaints']![locale.languageCode]; - String get historyOfPresentIllness => - localizedValues['historyOfPresentIllness'][locale.languageCode]; + String? get historyOfPresentIllness => localizedValues['historyOfPresentIllness']![locale.languageCode]; - String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; + String? get requiredMsg => localizedValues['requiredMsg']![locale.languageCode]; - String get addHistory => localizedValues['addHistory'][locale.languageCode]; + String? get addHistory => localizedValues['addHistory']![locale.languageCode]; - String get searchHistory => - localizedValues['searchHistory'][locale.languageCode]; + String? get searchHistory => localizedValues['searchHistory']![locale.languageCode]; - String get addSelectedHistories => - localizedValues['addSelectedHistories'][locale.languageCode]; + String? get addSelectedHistories => localizedValues['addSelectedHistories']![locale.languageCode]; - String get addAllergies => - localizedValues['addAllergies'][locale.languageCode]; + String? get addAllergies => localizedValues['addAllergies']![locale.languageCode]; - String get itemExist => localizedValues['itemExist'][locale.languageCode]; + String? get itemExist => localizedValues['itemExist']![locale.languageCode]; - String get selectAllergy => - localizedValues['selectAllergy'][locale.languageCode]; + String? get selectAllergy => localizedValues['selectAllergy']![locale.languageCode]; - String get selectSeverity => - localizedValues['selectSeverity'][locale.languageCode]; + String? get selectSeverity => localizedValues['selectSeverity']![locale.languageCode]; - String get leaveCreated => - localizedValues['leaveCreated'][locale.languageCode]; + String? get leaveCreated => localizedValues['leaveCreated']![locale.languageCode]; - String get vitalSignEmptyMsg => - localizedValues['vitalSignEmptyMsg'][locale.languageCode]; + String? get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg']![locale.languageCode]; - String get referralEmptyMsg => - localizedValues['referralEmptyMsg'][locale.languageCode]; + String? get referralEmptyMsg => localizedValues['referralEmptyMsg']![locale.languageCode]; - String get referralSuccessMsg => - localizedValues['referralSuccessMsg'][locale.languageCode]; + String? get referralSuccessMsg => localizedValues['referralSuccessMsg']![locale.languageCode]; - String get diagnoseType => - localizedValues['diagnoseType'][locale.languageCode]; + String? get diagnoseType => localizedValues['diagnoseType']![locale.languageCode]; - String get condition => localizedValues['condition'][locale.languageCode]; + String? get condition => localizedValues['condition']![locale.languageCode]; - String get id => localizedValues['id'][locale.languageCode]; + String? get id => localizedValues['id']![locale.languageCode]; - String get quantity => localizedValues['quantity'][locale.languageCode]; + String? get quantity => localizedValues['quantity']![locale.languageCode]; - String get durDays => localizedValues['durDays'][locale.languageCode]; + String? get durDays => localizedValues['durDays']![locale.languageCode]; - String get codeNo => localizedValues['codeNo'][locale.languageCode]; + String? get codeNo => localizedValues['codeNo']![locale.languageCode]; - String get covered => localizedValues['covered'][locale.languageCode]; + String? get covered => localizedValues['covered']![locale.languageCode]; - String get approvalRequired => - localizedValues['approvalRequired'][locale.languageCode]; + String? get approvalRequired => localizedValues['approvalRequired']![locale.languageCode]; - String get uncoveredByDoctor => - localizedValues['uncoveredByDoctor'][locale.languageCode]; + String? get uncoveredByDoctor => localizedValues['uncoveredByDoctor']![locale.languageCode]; - String get chiefComplaintEmptyMsg => - localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String? get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg']![locale.languageCode]; - String get moreVerification => - localizedValues['more-verify'][locale.languageCode]; + String? get moreVerification => localizedValues['more-verify']![locale.languageCode]; - String get welcomeBack => - localizedValues['welcome-back'][locale.languageCode]; + String? get welcomeBack => localizedValues['welcome-back']![locale.languageCode]; - String get accountInfo => - localizedValues['account-info'][locale.languageCode]; + String? get accountInfo => localizedValues['account-info']![locale.languageCode]; - String get useAnotherAccount => - localizedValues['another-acc'][locale.languageCode]; + String? get useAnotherAccount => localizedValues['another-acc']![locale.languageCode]; - String get verifyLoginWith => - localizedValues['verify-login-with'][locale.languageCode]; + String? get verifyLoginWith => localizedValues['verify-login-with']![locale.languageCode]; - String get register => localizedValues['register-user'][locale.languageCode]; + String? get register => localizedValues['register-user']![locale.languageCode]; - String get verifyFingerprint => - localizedValues['verify-with-fingerprint'][locale.languageCode]; + String? get verifyFingerprint => localizedValues['verify-with-fingerprint']![locale.languageCode]; - String get verifyFaceID => - localizedValues['verify-with-faceid'][locale.languageCode]; + String? get verifyFaceID => localizedValues['verify-with-faceid']![locale.languageCode]; - String get verifySMS => - localizedValues['verify-with-sms'][locale.languageCode]; - String get verifyWith => - localizedValues['verify-with'][locale.languageCode]; + String? get verifySMS => localizedValues['verify-with-sms']![locale.languageCode]; + String? get verifyWith => localizedValues['verify-with']![locale.languageCode]; - String get verifyWhatsApp => - localizedValues['verify-with-whatsapp'][locale.languageCode]; + String? get verifyWhatsApp => localizedValues['verify-with-whatsapp']![locale.languageCode]; - String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; + String? get lastLoginAt => localizedValues['last-login']![locale.languageCode]; - String get lastLoginWith => - localizedValues['last-login-with'][locale.languageCode]; + String? get lastLoginWith => localizedValues['last-login-with']![locale.languageCode]; - String get verifyFingerprint2 => - localizedValues['verify-fingerprint'][locale.languageCode]; + String? get verifyFingerprint2 => localizedValues['verify-fingerprint']![locale.languageCode]; - String get verificationMessage => - localizedValues['verification_message'][locale.languageCode]; + String? get verificationMessage => localizedValues['verification_message']![locale.languageCode]; - String get validationMessage => - localizedValues['validation_message'][locale.languageCode]; + String? get validationMessage => localizedValues['validation_message']![locale.languageCode]; - String get addAssessment => - localizedValues['addAssessment'][locale.languageCode]; + String? get addAssessment => localizedValues['addAssessment']![locale.languageCode]; - String get assessment => localizedValues['assessment'][locale.languageCode]; + String? get assessment => localizedValues['assessment']![locale.languageCode]; - String get physicalSystemExamination => - localizedValues['physicalSystemExamination'][locale.languageCode]; + String? get physicalSystemExamination => localizedValues['physicalSystemExamination']![locale.languageCode]; - String get searchExamination => - localizedValues['searchExamination'][locale.languageCode]; + String? get searchExamination => localizedValues['searchExamination']![locale.languageCode]; - String get addExamination => - localizedValues['addExamination'][locale.languageCode]; + String? get addExamination => localizedValues['addExamination']![locale.languageCode]; - String get doc => localizedValues['doc'][locale.languageCode]; + String? get doc => localizedValues['doc']![locale.languageCode]; - String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; + String? get allergicTO => localizedValues['allergicTO']![locale.languageCode]; - String get normal => localizedValues['normal'][locale.languageCode]; - String get notExamined => localizedValues['notExamined'][locale.languageCode]; + String? get normal => localizedValues['normal']![locale.languageCode]; + String? get notExamined => localizedValues['notExamined']![locale.languageCode]; - String get abnormal => localizedValues['abnormal'][locale.languageCode]; + String? get abnormal => localizedValues['abnormal']![locale.languageCode]; - String get patientNoDetailErrMsg => - localizedValues['patientNoDetailErrMsg'][locale.languageCode]; + String? get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg']![locale.languageCode]; - String get systolicLng => - localizedValues['systolic-lng'][locale.languageCode]; + String? get systolicLng => localizedValues['systolic-lng']![locale.languageCode]; - String get diastolicLng => - localizedValues['diastolic-lng'][locale.languageCode]; + String? get diastolicLng => localizedValues['diastolic-lng']![locale.languageCode]; - String get mass => localizedValues['mass'][locale.languageCode]; + String? get mass => localizedValues['mass']![locale.languageCode]; - String get tempC => localizedValues['temp-c'][locale.languageCode]; + String? get tempC => localizedValues['temp-c']![locale.languageCode]; - String get bpm => localizedValues['bpm'][locale.languageCode]; + String? get bpm => localizedValues['bpm']![locale.languageCode]; - String get respirationSigns => - localizedValues['respiration-signs'][locale.languageCode]; + String? get respirationSigns => localizedValues['respiration-signs']![locale.languageCode]; - String get sysDias => localizedValues['sys-dias'][locale.languageCode]; + String? get sysDias => localizedValues['sys-dias']![locale.languageCode]; - String get body => localizedValues['body'][locale.languageCode]; + String? get body => localizedValues['body']![locale.languageCode]; - String get respirationRate => - localizedValues['respirationRate'][locale.languageCode]; + String? get respirationRate => localizedValues['respirationRate']![locale.languageCode]; - String get heart => localizedValues['heart'][locale.languageCode]; + String? get heart => localizedValues['heart']![locale.languageCode]; - String get medicalReport => localizedValues['medicalReport'][locale.languageCode]; + String? get medicalReport => localizedValues['medicalReport']![locale.languageCode]; - String get visitDate => localizedValues['visitDate'][locale.languageCode]; + String? get visitDate => localizedValues['visitDate']![locale.languageCode]; - String get test => localizedValues['test'][locale.languageCode]; + String? get test => localizedValues['test']![locale.languageCode]; - String get addMoreProcedure => - localizedValues['addMoreProcedure'][locale.languageCode]; + String? get addMoreProcedure => localizedValues['addMoreProcedure']![locale.languageCode]; - String get regular => localizedValues['regular'][locale.languageCode]; + String? get regular => localizedValues['regular']![locale.languageCode]; - String get searchProcedures => - localizedValues['searchProcedures'][locale.languageCode]; + String? get searchProcedures => localizedValues['searchProcedures']![locale.languageCode]; - String get procedureCategorise => - localizedValues['procedureCategorise'][locale.languageCode]; + String? get procedureCategorise => localizedValues['procedureCategorise']![locale.languageCode]; - String get selectProcedures => - localizedValues['selectProcedures'][locale.languageCode]; + String? get selectProcedures => localizedValues['selectProcedures']![locale.languageCode]; - String get addSelectedProcedures => - localizedValues['addSelectedProcedures'][locale.languageCode]; + String? get addSelectedProcedures => localizedValues['addSelectedProcedures']![locale.languageCode]; - String get updateProcedure => - localizedValues['updateProcedure'][locale.languageCode]; + String? get updateProcedure => localizedValues['updateProcedure']![locale.languageCode]; - String get orderProcedure => - localizedValues['orderProcedure'][locale.languageCode]; + String? get orderProcedure => localizedValues['orderProcedure']![locale.languageCode]; - String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; + String? get nameOrICD => localizedValues['nameOrICD']![locale.languageCode]; - String get dType => localizedValues['dType'][locale.languageCode]; + String? get dType => localizedValues['dType']![locale.languageCode]; - String get addAssessmentDetails => - localizedValues['addAssessmentDetails'][locale.languageCode]; + String? get addAssessmentDetails => localizedValues['addAssessmentDetails']![locale.languageCode]; - String get progressNoteSOAP => - localizedValues['progressNoteSOAP'][locale.languageCode]; + String? get progressNoteSOAP => localizedValues['progressNoteSOAP']![locale.languageCode]; - String get addProgressNote => - localizedValues['addProgressNote'][locale.languageCode]; + String? get addProgressNote => localizedValues['addProgressNote']![locale.languageCode]; - String get createdBy => localizedValues['createdBy'][locale.languageCode]; + String? get createdBy => localizedValues['createdBy']![locale.languageCode]; - String get editedBy => localizedValues['editedBy'][locale.languageCode]; + String? get editedBy => localizedValues['editedBy']![locale.languageCode]; - String get currentMedications => - localizedValues['currentMedications'][locale.languageCode]; + String? get currentMedications => localizedValues['currentMedications']![locale.languageCode]; - String get noItem => localizedValues['noItem'][locale.languageCode]; + String? get noItem => localizedValues['noItem']![locale.languageCode]; - String get postUcafSuccessMsg => - localizedValues['postUcafSuccessMsg'][locale.languageCode]; + String? get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg']![locale.languageCode]; - String get vitalSignDetailEmpty => - localizedValues['vitalSignDetailEmpty'][locale.languageCode]; + String? get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty']![locale.languageCode]; - String get onlyOfftimeHoliday => - localizedValues['onlyOfftimeHoliday'][locale.languageCode]; + String? get onlyOfftimeHoliday => localizedValues['onlyOfftimeHoliday']![locale.languageCode]; - String get active => localizedValues['active'][locale.languageCode]; + String? get active => localizedValues['active']![locale.languageCode]; - String get hold => localizedValues['hold'][locale.languageCode]; + String? get hold => localizedValues['hold']![locale.languageCode]; - String get loading => localizedValues['loading'][locale.languageCode]; + String? get loading => localizedValues['loading']![locale.languageCode]; - String get assessmentErrorMsg => - localizedValues['assessmentErrorMsg'][locale.languageCode]; + String? get assessmentErrorMsg => localizedValues['assessmentErrorMsg']![locale.languageCode]; - String get examinationErrorMsg => - localizedValues['examinationErrorMsg'][locale.languageCode]; - - String get progressNoteErrorMsg => - localizedValues['progressNoteErrorMsg'][locale.languageCode]; - - String get chiefComplaintErrorMsg => - localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; - String get ICDName => localizedValues['ICDName'][locale.languageCode]; - - String get referralStatus => - localizedValues['referralStatus'][locale.languageCode]; - - String get referralRemark => - localizedValues['referralRemark'][locale.languageCode]; - String get offTime => localizedValues['offTime'][locale.languageCode]; - - String get icd => localizedValues['icd'][locale.languageCode]; - String get days => localizedValues['days'][locale.languageCode]; - String get hr => localizedValues['hr'][locale.languageCode]; - String get min => localizedValues['min'][locale.languageCode]; - String get months => localizedValues['months'][locale.languageCode]; - String get years => localizedValues['years'][locale.languageCode]; - String get referralStatusHold => - localizedValues['referralStatusHold'][locale.languageCode]; - String get referralStatusActive => - localizedValues['referralStatusActive'][locale.languageCode]; - String get referralStatusCancelled => - localizedValues['referralStatusCancelled'][locale.languageCode]; - String get referralStatusCompleted => - localizedValues['referralStatusCompleted'][locale.languageCode]; - String get referralStatusNotSeen => - localizedValues['referralStatusNotSeen'][locale.languageCode]; - String get clinicSearch => - localizedValues['clinicSearch'][locale.languageCode]; - String get doctorSearch => - localizedValues['doctorSearch'][locale.languageCode]; - String get referralResponse => - localizedValues['referralResponse'][locale.languageCode]; - String get estimatedCost => - localizedValues['estimatedCost'][locale.languageCode]; - String get diagnosisDetail => - localizedValues['diagnosisDetail'][locale.languageCode]; - String get referralSuccessMsgAccept => - localizedValues['referralSuccessMsgAccept'][locale.languageCode]; - String get referralSuccessMsgReject => - localizedValues['referralSuccessMsgReject'][locale.languageCode]; - - String get patientName => - localizedValues['patient-name'][locale.languageCode]; - - String get appointmentNumber => - localizedValues['appointmentNumber'][locale.languageCode]; - String get sickLeaveComments => - localizedValues['sickLeaveComments'][locale.languageCode]; - String get pastMedicalHistory => - localizedValues['pastMedicalHistory'][locale.languageCode]; - String get pastSurgicalHistory => - localizedValues['pastSurgicalHistory'][locale.languageCode]; - String get complications => - localizedValues['complications'][locale.languageCode]; - String get floor => localizedValues['floor'][locale.languageCode]; - String get roomCategory => - localizedValues['roomCategory'][locale.languageCode]; - String get otherDepartmentsInterventions => - localizedValues['otherDepartmentsInterventions'][locale.languageCode]; - String get otherProcedure => - localizedValues['otherProcedure'][locale.languageCode]; - String get admissionRequestSuccessMsg => - localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; - String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; - String get doctorResponse => - localizedValues['doctorResponse'][locale.languageCode]; - String get sickleaveonhold => - localizedValues['sickleaveonhold'][locale.languageCode]; - String get noClinic => localizedValues['no-clinic'][locale.languageCode]; - - String get otherStatistic => - localizedValues['otherStatistic'][locale.languageCode]; - - String get patientsreferral => - localizedValues['ptientsreferral'][locale.languageCode]; - String get myPatientsReferral => - localizedValues['myPatientsReferral'][locale.languageCode]; - String get arrivalpatient => - localizedValues['arrivalpatient'][locale.languageCode]; - String get searchmedicinepatient => - localizedValues['searchmedicinepatient'][locale.languageCode]; - String get appointmentDate => - localizedValues['appointmentDate'][locale.languageCode]; - String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; - - String get details => localizedValues['details'][locale.languageCode]; - String get liveCare => localizedValues['liveCare'][locale.languageCode]; - String get outpatient => localizedValues['out-patient'][locale.languageCode]; - String get billNo => localizedValues['BillNo'][locale.languageCode]; - String get labResults => localizedValues['labResults'][locale.languageCode]; - String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; - String get specialResult => - localizedValues['SpecialResult'][locale.languageCode]; - String get noDataAvailable => - localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => - localizedValues['show-more-btn'][locale.languageCode]; - String get showDetail => localizedValues['showDetail'][locale.languageCode]; - String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; - - String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; - String get reschedule => localizedValues['reschedule'][locale.languageCode]; - String get leaves => localizedValues['leaves'][locale.languageCode]; - String get openRad => localizedValues['open-rad'][locale.languageCode]; - - String get totalApproval => - localizedValues['totalApproval'][locale.languageCode]; - String get procedureStatus => - localizedValues['procedureStatus'][locale.languageCode]; - String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; - String get companyName => localizedValues['companyName'][locale.languageCode]; - String get procedureName => - localizedValues['procedureName'][locale.languageCode]; - String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; - String get prescriptions => - localizedValues['prescriptions'][locale.languageCode]; - String get notes => localizedValues['notes'][locale.languageCode]; - String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; - String get searchWithOther => - localizedValues['searchWithOther'][locale.languageCode]; - String get hideOtherCriteria => - localizedValues['hideOtherCriteria'][locale.languageCode]; - String get applyForReschedule => - localizedValues['applyForReschedule'][locale.languageCode]; - - String get startDate => localizedValues['startDate'][locale.languageCode]; - String get endDate => localizedValues['endDate'][locale.languageCode]; - - String get addReschedule => - localizedValues['add-reschedule'][locale.languageCode]; - String get updateReschedule => - localizedValues['update-reschedule'][locale.languageCode]; - String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; - String get accepted => localizedValues['accepted'][locale.languageCode]; - String get cancelled => localizedValues['cancelled'][locale.languageCode]; - String get unReplied => localizedValues['unReplied'][locale.languageCode]; - String get replied => localizedValues['replied'][locale.languageCode]; - String get typeHereToReply => - localizedValues['typeHereToReply'][locale.languageCode]; - String get searchHere => localizedValues['searchHere'][locale.languageCode]; - String get remove => localizedValues['remove'][locale.languageCode]; - - String get step => localizedValues['step'][locale.languageCode]; - String get fieldRequired => - localizedValues['fieldRequired'][locale.languageCode]; - String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; - String get changeOfSchedule => - localizedValues['changeOfSchedule'][locale.languageCode]; - String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; - String get enterCredentials => - localizedValues['enter_credentials'][locale.languageCode]; - String get patpatientIDMobilenationalientID => - localizedValues['patientIDMobilenational'][locale.languageCode]; - - String get updateNow => localizedValues['updateNow'][locale.languageCode]; - String get updateTheApp => - localizedValues['updateTheApp'][locale.languageCode]; - String get admissionDate => - localizedValues['admission-date'][locale.languageCode]; - String get noOfDays => localizedValues['noOfDays'][locale.languageCode]; - String get numOfDays => localizedValues['numOfDays'][locale.languageCode]; - String get replayBefore => - localizedValues['replayBefore'][locale.languageCode]; - String get trySaying => localizedValues["try-saying"][locale.languageCode]; - String get acknowledged => - localizedValues['acknowledged'][locale.languageCode]; - String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; - String get pleaseEnterProcedure => - localizedValues["pleaseEnterProcedure"][locale.languageCode]; - String get fillTheMandatoryProcedureDetails => - localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; - String get atLeastThreeCharacters => - localizedValues["atLeastThreeCharacters"][locale.languageCode]; - String get searchProcedureHere => - localizedValues["searchProcedureHere"][locale.languageCode]; - String get noInsuranceApprovalFound => - localizedValues["noInsuranceApprovalFound"][locale.languageCode]; - String get procedure => localizedValues["procedure"][locale.languageCode]; - String get stopDate => localizedValues["stopDate"][locale.languageCode]; - String get processed => localizedValues["processed"][locale.languageCode]; - String get direction => localizedValues["direction"][locale.languageCode]; - String get refill => localizedValues["refill"][locale.languageCode]; - String get medicationHasBeenAdded => - localizedValues["medicationHasBeenAdded"][locale.languageCode]; - String get newPrescriptionOrder => - localizedValues["newPrescriptionOrder"][locale.languageCode]; - String get pleaseFillAllFields => - localizedValues["pleaseFillAllFields"][locale.languageCode]; - String get narcoticMedicineCanOnlyBePrescribedFromVida => - localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] - [locale.languageCode]; - String get only5DigitsAllowedForStrength => - localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; - String get unit => localizedValues["unit"][locale.languageCode]; - String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; - String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; - String get applyForRadiologyOrder => - localizedValues["applyForRadiologyOrder"][locale.languageCode]; - String get applyForNewLabOrder => - localizedValues["applyForNewLabOrder"][locale.languageCode]; - String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; - String get addRadiologyOrder => - localizedValues["addRadiologyOrder"][locale.languageCode]; - String get newRadiologyOrder => - localizedValues["newRadiologyOrder"][locale.languageCode]; - String get orderDate => localizedValues["orderDate"][locale.languageCode]; - String get examType => localizedValues["examType"][locale.languageCode]; - String get health => localizedValues["health"][locale.languageCode]; - String get summary => localizedValues["summary"][locale.languageCode]; - String get applyForNewPrescriptionsOrder => - localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; - String get noPrescriptionsFound => - localizedValues["noPrescriptionsFound"][locale.languageCode]; - String get noMedicalFileFound => - localizedValues["noMedicalFileFound"][locale.languageCode]; - String get insurance22 => localizedValues["insurance22"][locale.languageCode]; - String get approvals22 => localizedValues["approvals22"][locale.languageCode]; - String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => - localizedValues["graphDetails"][locale.languageCode]; - String get discharged => localizedValues["discharged"][locale.languageCode]; - String get addNewOrderSheet => - localizedValues["addNewOrderSheet"][locale.languageCode]; - String get addNewProgressNote => - localizedValues["addNewProgressNote"][locale.languageCode]; - String get notePending => localizedValues["notePending"][locale.languageCode]; - String get noteCanceled => - localizedValues["noteCanceled"][locale.languageCode]; - String get noteVerified => - localizedValues["noteVerified"][locale.languageCode]; - String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; - String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; - String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; - - String get noteUpdate => localizedValues["noteUpdate"][locale.languageCode]; - - String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; - String get order => localizedValues["order"][locale.languageCode]; - String get sheet => localizedValues["sheet"][locale.languageCode]; - String get medical => localizedValues["medical"][locale.languageCode]; - String get report => localizedValues["report"][locale.languageCode]; - String get discharge => localizedValues["discharge"][locale.languageCode]; - String get none => localizedValues["none"][locale.languageCode]; - String get notRepliedYet => - localizedValues["notRepliedYet"][locale.languageCode]; - String get clearText => localizedValues["clearText"][locale.languageCode]; - String get medicalReportAdd => localizedValues['medicalReportAdd'][locale.languageCode]; - String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode]; - String get comments => localizedValues['comments'][locale.languageCode]; - String get initiateCall => localizedValues['initiateCall'][locale.languageCode]; - String get endCall => localizedValues['endCall'][locale.languageCode]; - - String get transferTo => localizedValues['transferTo'][locale.languageCode]; - String get admin => localizedValues['admin'][locale.languageCode]; - String get instructions => localizedValues['instructions'][locale.languageCode]; - String get sendLC => localizedValues['sendLC'][locale.languageCode]; - String get endLC => localizedValues['endLC'][locale.languageCode]; - String get consultation => localizedValues['consultation'][locale.languageCode]; - String get resume => localizedValues['resume'][locale.languageCode]; - String get theCall => localizedValues['theCall'][locale.languageCode]; - String get createNewMedicalReport => localizedValues['createNewMedicalReport'][locale.languageCode]; - String get historyPhysicalFinding => localizedValues['historyPhysicalFinding'][locale.languageCode]; - String get laboratoryPhysicalData => localizedValues['laboratoryPhysicalData'][locale.languageCode]; - String get impressionRecommendation => localizedValues['impressionRecommendation'][locale.languageCode]; - String get onHold => localizedValues['onHold'][locale.languageCode]; - String get verified => localizedValues['verified'][locale.languageCode]; + String? get examinationErrorMsg => localizedValues['examinationErrorMsg']![locale.languageCode]; + + String? get progressNoteErrorMsg => localizedValues['progressNoteErrorMsg']![locale.languageCode]; + + String? get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg']![locale.languageCode]; + String? get ICDName => localizedValues['ICDName']![locale.languageCode]; + + String? get referralStatus => localizedValues['referralStatus']![locale.languageCode]; + + String? get referralRemark => localizedValues['referralRemark']![locale.languageCode]; + String? get offTime => localizedValues['offTime']![locale.languageCode]; + + String? get icd => localizedValues['icd']![locale.languageCode]; + String? get days => localizedValues['days']![locale.languageCode]; + String? get hr => localizedValues['hr']![locale.languageCode]; + String? get min => localizedValues['min']![locale.languageCode]; + String? get months => localizedValues['months']![locale.languageCode]; + String? get years => localizedValues['years']![locale.languageCode]; + String? get referralStatusHold => localizedValues['referralStatusHold']![locale.languageCode]; + String? get referralStatusActive => localizedValues['referralStatusActive']![locale.languageCode]; + String? get referralStatusCancelled => localizedValues['referralStatusCancelled']![locale.languageCode]; + String? get referralStatusCompleted => localizedValues['referralStatusCompleted']![locale.languageCode]; + String? get referralStatusNotSeen => localizedValues['referralStatusNotSeen']![locale.languageCode]; + String? get clinicSearch => localizedValues['clinicSearch']![locale.languageCode]; + String? get doctorSearch => localizedValues['doctorSearch']![locale.languageCode]; + String? get referralResponse => localizedValues['referralResponse']![locale.languageCode]; + String? get estimatedCost => localizedValues['estimatedCost']![locale.languageCode]; + String? get diagnosisDetail => localizedValues['diagnosisDetail']![locale.languageCode]; + String? get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept']![locale.languageCode]; + String? get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject']![locale.languageCode]; + + String? get patientName => localizedValues['patient-name']![locale.languageCode]; + + String? get appointmentNumber => localizedValues['appointmentNumber']![locale.languageCode]; + String? get sickLeaveComments => localizedValues['sickLeaveComments']![locale.languageCode]; + String? get pastMedicalHistory => localizedValues['pastMedicalHistory']![locale.languageCode]; + String? get pastSurgicalHistory => localizedValues['pastSurgicalHistory']![locale.languageCode]; + String? get complications => localizedValues['complications']![locale.languageCode]; + String? get floor => localizedValues['floor']![locale.languageCode]; + String? get roomCategory => localizedValues['roomCategory']![locale.languageCode]; + String? get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions']![locale.languageCode]; + String? get otherProcedure => localizedValues['otherProcedure']![locale.languageCode]; + String? get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg']![locale.languageCode]; + String? get infoStatus => localizedValues['infoStatus']![locale.languageCode]; + String? get doctorResponse => localizedValues['doctorResponse']![locale.languageCode]; + String? get sickleaveonhold => localizedValues['sickleaveonhold']![locale.languageCode]; + String? get noClinic => localizedValues['no-clinic']![locale.languageCode]; + + String? get otherStatistic => localizedValues['otherStatistic']![locale.languageCode]; + + String? get patientsreferral => localizedValues['ptientsreferral']![locale.languageCode]; + String? get myPatientsReferral => localizedValues['myPatientsReferral']![locale.languageCode]; + String? get arrivalpatient => localizedValues['arrivalpatient']![locale.languageCode]; + String? get searchmedicinepatient => localizedValues['searchmedicinepatient']![locale.languageCode]; + String? get appointmentDate => localizedValues['appointmentDate']![locale.languageCode]; + String? get arrivedP => localizedValues['arrived_p']![locale.languageCode]; + + String? get details => localizedValues['details']![locale.languageCode]; + String? get liveCare => localizedValues['liveCare']![locale.languageCode]; + String? get outpatient => localizedValues['out-patient']![locale.languageCode]; + String? get billNo => localizedValues['BillNo']![locale.languageCode]; + String? get labResults => localizedValues['labResults']![locale.languageCode]; + String? get sendSuc => localizedValues['sendSuc']![locale.languageCode]; + String? get specialResult => localizedValues['SpecialResult']![locale.languageCode]; + String? get noDataAvailable => localizedValues['noDataAvailable']![locale.languageCode]; + String? get showMoreBtn => localizedValues['show-more-btn']![locale.languageCode]; + String? get showDetail => localizedValues['showDetail']![locale.languageCode]; + String? get viewProfile => localizedValues['viewProfile']![locale.languageCode]; + + String? get fileNumber => localizedValues['fileNumber']![locale.languageCode]; + String? get reschedule => localizedValues['reschedule']![locale.languageCode]; + String? get leaves => localizedValues['leaves']![locale.languageCode]; + String? get openRad => localizedValues['open-rad']![locale.languageCode]; + + String? get totalApproval => localizedValues['totalApproval']![locale.languageCode]; + String? get procedureStatus => localizedValues['procedureStatus']![locale.languageCode]; + String? get unusedCount => localizedValues['unusedCount']![locale.languageCode]; + String? get companyName => localizedValues['companyName']![locale.languageCode]; + String? get procedureName => localizedValues['procedureName']![locale.languageCode]; + String? get usageStatus => localizedValues['usageStatus']![locale.languageCode]; + String? get prescriptions => localizedValues['prescriptions']![locale.languageCode]; + String? get notes => localizedValues['notes']![locale.languageCode]; + String? get dailyDoses => localizedValues['dailyDoses']![locale.languageCode]; + String? get searchWithOther => localizedValues['searchWithOther']![locale.languageCode]; + String? get hideOtherCriteria => localizedValues['hideOtherCriteria']![locale.languageCode]; + String? get applyForReschedule => localizedValues['applyForReschedule']![locale.languageCode]; + + String? get startDate => localizedValues['startDate']![locale.languageCode]; + String? get endDate => localizedValues['endDate']![locale.languageCode]; + + String? get addReschedule => localizedValues['add-reschedule']![locale.languageCode]; + String? get updateReschedule => localizedValues['update-reschedule']![locale.languageCode]; + String? get sickLeave => localizedValues['sick_leave']![locale.languageCode]; + String? get accepted => localizedValues['accepted']![locale.languageCode]; + String? get cancelled => localizedValues['cancelled']![locale.languageCode]; + String? get unReplied => localizedValues['unReplied']![locale.languageCode]; + String? get replied => localizedValues['replied']![locale.languageCode]; + String? get typeHereToReply => localizedValues['typeHereToReply']![locale.languageCode]; + String? get searchHere => localizedValues['searchHere']![locale.languageCode]; + String? get remove => localizedValues['remove']![locale.languageCode]; + + String? get step => localizedValues['step']![locale.languageCode]; + String? get fieldRequired => localizedValues['fieldRequired']![locale.languageCode]; + String? get noSickLeave => localizedValues['no-sickleve']![locale.languageCode]; + String? get changeOfSchedule => localizedValues['changeOfSchedule']![locale.languageCode]; + String? get newSchedule => localizedValues['newSchedule']![locale.languageCode]; + String? get enterCredentials => localizedValues['enter_credentials']![locale.languageCode]; + String? get patpatientIDMobilenationalientID => localizedValues['patientIDMobilenational']![locale.languageCode]; + + String? get updateNow => localizedValues['updateNow']![locale.languageCode]; + String? get updateTheApp => localizedValues['updateTheApp']![locale.languageCode]; + String? get admissionDate => localizedValues['admission-date']![locale.languageCode]; + String? get noOfDays => localizedValues['noOfDays']![locale.languageCode]; + String? get numOfDays => localizedValues['numOfDays']![locale.languageCode]; + String? get replayBefore => localizedValues['replayBefore']![locale.languageCode]; + String? get trySaying => localizedValues["try-saying"]![locale.languageCode]; + String? get acknowledged => localizedValues['acknowledged']![locale.languageCode]; + String? get didntCatch => localizedValues["didntCatch"]![locale.languageCode]; + String? get pleaseEnterProcedure => localizedValues["pleaseEnterProcedure"]![locale.languageCode]; + String? get fillTheMandatoryProcedureDetails => + localizedValues["fillTheMandatoryProcedureDetails"]![locale.languageCode]; + String? get atLeastThreeCharacters => localizedValues["atLeastThreeCharacters"]![locale.languageCode]; + String? get searchProcedureHere => localizedValues["searchProcedureHere"]![locale.languageCode]; + String? get noInsuranceApprovalFound => localizedValues["noInsuranceApprovalFound"]![locale.languageCode]; + String? get procedure => localizedValues["procedure"]![locale.languageCode]; + String? get stopDate => localizedValues["stopDate"]![locale.languageCode]; + String? get processed => localizedValues["processed"]![locale.languageCode]; + String? get direction => localizedValues["direction"]![locale.languageCode]; + String? get refill => localizedValues["refill"]![locale.languageCode]; + String? get medicationHasBeenAdded => localizedValues["medicationHasBeenAdded"]![locale.languageCode]; + String? get newPrescriptionOrder => localizedValues["newPrescriptionOrder"]![locale.languageCode]; + String? get pleaseFillAllFields => localizedValues["pleaseFillAllFields"]![locale.languageCode]; + String? get narcoticMedicineCanOnlyBePrescribedFromVida => + localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"]![locale.languageCode]; + String? get only5DigitsAllowedForStrength => localizedValues["only5DigitsAllowedForStrength"]![locale.languageCode]; + String? get unit => localizedValues["unit"]![locale.languageCode]; + String? get boxQuantity => localizedValues["boxQuantity"]![locale.languageCode]; + String? get orderTestOr => localizedValues["orderTestOr"]![locale.languageCode]; + String? get applyForRadiologyOrder => localizedValues["applyForRadiologyOrder"]![locale.languageCode]; + String? get applyForNewLabOrder => localizedValues["applyForNewLabOrder"]![locale.languageCode]; + String? get addLabOrder => localizedValues["addLabOrder"]![locale.languageCode]; + String? get addRadiologyOrder => localizedValues["addRadiologyOrder"]![locale.languageCode]; + String? get newRadiologyOrder => localizedValues["newRadiologyOrder"]![locale.languageCode]; + String? get orderDate => localizedValues["orderDate"]![locale.languageCode]; + String? get examType => localizedValues["examType"]![locale.languageCode]; + String? get health => localizedValues["health"]![locale.languageCode]; + String? get summary => localizedValues["summary"]![locale.languageCode]; + String? get applyForNewPrescriptionsOrder => localizedValues["applyForNewPrescriptionsOrder"]![locale.languageCode]; + String? get noPrescriptionsFound => localizedValues["noPrescriptionsFound"]![locale.languageCode]; + String? get noMedicalFileFound => localizedValues["noMedicalFileFound"]![locale.languageCode]; + String? get insurance22 => localizedValues["insurance22"]![locale.languageCode]; + String? get approvals22 => localizedValues["approvals22"]![locale.languageCode]; + String? get severe => localizedValues["severe"]![locale.languageCode]; + String? get graphDetails => localizedValues["graphDetails"]![locale.languageCode]; + String? get discharged => localizedValues["discharged"]![locale.languageCode]; + String? get addNewOrderSheet => localizedValues["addNewOrderSheet"]![locale.languageCode]; + String? get addNewProgressNote => localizedValues["addNewProgressNote"]![locale.languageCode]; + String? get notePending => localizedValues["notePending"]![locale.languageCode]; + String? get noteCanceled => localizedValues["noteCanceled"]![locale.languageCode]; + String? get noteVerified => localizedValues["noteVerified"]![locale.languageCode]; + String? get noteVerify => localizedValues["noteVerify"]![locale.languageCode]; + String? get noteConfirm => localizedValues["noteConfirm"]![locale.languageCode]; + String? get noteAdd => localizedValues["noteAdd"]![locale.languageCode]; + + String? get noteUpdate => localizedValues["noteUpdate"]![locale.languageCode]; + + String? get orderSheet => localizedValues["orderSheet"]![locale.languageCode]; + String? get order => localizedValues["order"]![locale.languageCode]; + String? get sheet => localizedValues["sheet"]![locale.languageCode]; + String? get medical => localizedValues["medical"]![locale.languageCode]; + String? get report => localizedValues["report"]![locale.languageCode]; + String? get discharge => localizedValues["discharge"]![locale.languageCode]; + String? get none => localizedValues["none"]![locale.languageCode]; + String? get notRepliedYet => localizedValues["notRepliedYet"]![locale.languageCode]; + String? get clearText => localizedValues["clearText"]![locale.languageCode]; + String? get medicalReportAdd => localizedValues['medicalReportAdd']![locale.languageCode]; + String? get medicalReportVerify => localizedValues['medicalReportVerify']![locale.languageCode]; + String? get comments => localizedValues['comments']![locale.languageCode]; + String? get initiateCall => localizedValues['initiateCall']![locale.languageCode]; + String? get endCall => localizedValues['endCall']![locale.languageCode]; + + String? get transferTo => localizedValues['transferTo']![locale.languageCode]; + String? get admin => localizedValues['admin']![locale.languageCode]; + String? get instructions => localizedValues['instructions']![locale.languageCode]; + String? get sendLC => localizedValues['sendLC']![locale.languageCode]; + String? get endLC => localizedValues['endLC']![locale.languageCode]; + String? get consultation => localizedValues['consultation']![locale.languageCode]; + String? get resume => localizedValues['resume']![locale.languageCode]; + String? get theCall => localizedValues['theCall']![locale.languageCode]; + String? get createNewMedicalReport => localizedValues['createNewMedicalReport']![locale.languageCode]; + String? get historyPhysicalFinding => localizedValues['historyPhysicalFinding']![locale.languageCode]; + String? get laboratoryPhysicalData => localizedValues['laboratoryPhysicalData']![locale.languageCode]; + String? get impressionRecommendation => localizedValues['impressionRecommendation']![locale.languageCode]; + String? get onHold => localizedValues['onHold']![locale.languageCode]; + String? get verified => localizedValues['verified']![locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 6d091756..a43d37e9 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -4,13 +4,14 @@ import 'package:hexcolor/hexcolor.dart'; class MethodTypeCard extends StatelessWidget { const MethodTypeCard({ - Key key, - this.assetPath, - this.onTap, - this.label, this.height = 20, + Key? key, + required this.assetPath, + required this.onTap, + required this.label, + this.height = 20, }) : super(key: key); final String assetPath; - final Function onTap; + final GestureTapCallback onTap; final String label; final double height; @@ -25,9 +26,7 @@ class MethodTypeCard extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10), ), - border: Border.all( - color: HexColor('#707070'), - width: 0.1), + border: Border.all(color: HexColor('#707070'), width: 0.1), ), height: 170, child: Padding( @@ -46,7 +45,7 @@ class MethodTypeCard extends StatelessWidget { ], ), SizedBox( - height:height , + height: height, ), AppText( label, diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 0c374e58..ca8f8075 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -9,6 +9,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; @@ -16,7 +17,7 @@ class SMSOTP { final Function onFailure; final context; - int remainingTime = 600; + late int remainingTime = 600; SMSOTP( this.context, @@ -26,7 +27,7 @@ class SMSOTP { this.onFailure, ); - final verifyAccountForm = GlobalKey(); + late final verifyAccountForm = GlobalKey(); TextEditingController digit1 = TextEditingController(text: ""); TextEditingController digit2 = TextEditingController(text: ""); @@ -43,10 +44,10 @@ class SMSOTP { final focusD2 = FocusNode(); final focusD3 = FocusNode(); final focusD4 = FocusNode(); - String errorMsg; - ProjectViewModel projectProvider; - String displayTime = ''; - bool isClosed = false; + late String errorMsg; + late ProjectViewModel projectProvider; + late String displayTime = ''; + late bool isClosed = false; displayDialog(BuildContext context) async { return showDialog( context: context, @@ -70,50 +71,45 @@ class SMSOTP { 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), - ), - 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(); - }, - )) - ], - ) - ])), + 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), + ), + 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 + + TranslationBase.of(context).verificationMessage! + ' XXXXXX' + - mobileNo - .toString() - .substring(mobileNo.toString().length - 3), + mobileNo.toString().substring(mobileNo.toString().length - 3), textAlign: TextAlign.start, fontWeight: FontWeight.bold, fontSize: 14, @@ -143,15 +139,12 @@ class SMSOTP { onSaved: (val) {}, validator: validateCodeDigit, onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD2); + FocusScope.of(context).requestFocus(focusD2); }, onChanged: (val) { if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD2); - verifyAccountFormValue['digit1'] = - val.trim(); + FocusScope.of(context).requestFocus(focusD2); + verifyAccountFormValue['digit1'] = val.trim(); checkValue(); } }, @@ -171,15 +164,12 @@ class SMSOTP { decoration: buildInputDecoration(context), onSaved: (val) {}, onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD3); + FocusScope.of(context).requestFocus(focusD3); }, onChanged: (val) { if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD3); - verifyAccountFormValue['digit2'] = - val.trim(); + FocusScope.of(context).requestFocus(focusD3); + verifyAccountFormValue['digit2'] = val.trim(); checkValue(); } }, @@ -196,19 +186,15 @@ class SMSOTP { textAlign: TextAlign.center, style: buildTextStyle(), keyboardType: TextInputType.number, - decoration: - buildInputDecoration(context), + decoration: buildInputDecoration(context), onSaved: (val) {}, onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD4); + FocusScope.of(context).requestFocus(focusD4); }, onChanged: (val) { if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD4); - verifyAccountFormValue['digit3'] = - val.trim(); + FocusScope.of(context).requestFocus(focusD4); + verifyAccountFormValue['digit3'] = val.trim(); checkValue(); } }, @@ -223,16 +209,13 @@ class SMSOTP { style: buildTextStyle(), controller: digit4, keyboardType: TextInputType.number, - decoration: - buildInputDecoration(context), + decoration: buildInputDecoration(context), onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD4); + FocusScope.of(context).requestFocus(focusD4); }, onChanged: (val) { if (val.length == 1) { - verifyAccountFormValue['digit4'] = - val.trim(); + verifyAccountFormValue['digit4'] = val.trim(); checkValue(); } }, @@ -248,8 +231,7 @@ class SMSOTP { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).validationMessage + - ' ', + TranslationBase.of(context).validationMessage! + ' ', fontWeight: FontWeight.w600, fontSize: 14, ), @@ -281,15 +263,15 @@ class SMSOTP { counterText: " ", enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -299,7 +281,7 @@ class SMSOTP { } // ignore: missing_return - String validateCodeDigit(value) { + String? validateCodeDigit(value) { if (value.isEmpty) { return ' '; } else if (value.length == 3) { @@ -310,28 +292,21 @@ class SMSOTP { } checkValue() async { - if (verifyAccountForm.currentState.validate()) { - onSuccess(digit1.text.toString() + - digit2.text.toString() + - digit3.text.toString() + - digit4.text.toString()); + if (verifyAccountForm.currentState!.validate()) { + onSuccess(digit1.text.toString() + digit2.text.toString() + digit3.text.toString() + digit4.text.toString()); this.isClosed = true; - } } getSecondsAsDigitalClock(int inputSeconds) { - var sec_num = - int.parse(inputSeconds.toString()); // don't forget the second param + var sec_num = int.parse(inputSeconds.toString()); // don't forget the second param var hours = (sec_num / 3600).floor(); var minutes = ((sec_num - hours * 3600) / 60).floor(); var seconds = sec_num - hours * 3600 - minutes * 60; var minutesString = ""; var secondsString = ""; - minutesString = - minutes < 10 ? "0" + minutes.toString() : minutes.toString(); - secondsString = - seconds < 10 ? "0" + seconds.toString() : seconds.toString(); + minutesString = minutes < 10 ? "0" + minutes.toString() : minutes.toString(); + secondsString = seconds < 10 ? "0" + seconds.toString() : seconds.toString(); return minutesString + ":" + secondsString; } @@ -341,7 +316,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); diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 27dbe8bf..8d69edd3 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -9,26 +9,25 @@ import 'package:provider/provider.dart'; class VerificationMethodsList extends StatefulWidget { final AuthMethodTypes authMethodType; - final Function(AuthMethodTypes type, bool isActive) authenticateUser; - final Function onShowMore; + final Function(AuthMethodTypes type, bool isActive)? authenticateUser; + final GestureTapCallback? onShowMore; final AuthenticationViewModel authenticationViewModel; const VerificationMethodsList( - {Key key, - this.authMethodType, + {Key? key, + required this.authMethodType, this.authenticateUser, this.onShowMore, - this.authenticationViewModel}) + required this.authenticationViewModel}) : super(key: key); @override - _VerificationMethodsListState createState() => - _VerificationMethodsListState(); + _VerificationMethodsListState createState() => _VerificationMethodsListState(); } class _VerificationMethodsListState extends State { final LocalAuthentication auth = LocalAuthentication(); - ProjectViewModel projectsProvider; + ProjectViewModel? projectsProvider; @override Widget build(BuildContext context) { @@ -38,57 +37,45 @@ class _VerificationMethodsListState extends State { case AuthMethodTypes.WhatsApp: return MethodTypeCard( assetPath: 'assets/images/verify-whtsapp.png', - onTap: () => - {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, - label: TranslationBase - .of(context) - .verifyWith+ TranslationBase.of(context).verifyWhatsApp, + onTap: () => {widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)}, + label: TranslationBase.of(context).verifyWith ?? "" + TranslationBase.of(context).verifyWhatsApp!, ); break; case AuthMethodTypes.SMS: return MethodTypeCard( assetPath: "assets/images/verify-sms.png", - onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)}, - label:TranslationBase - .of(context) - .verifyWith+ TranslationBase.of(context).verifySMS, + onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)}, + label: TranslationBase.of(context).verifyWith ?? "" + TranslationBase.of(context).verifySMS!, ); break; case AuthMethodTypes.Fingerprint: return MethodTypeCard( assetPath: 'assets/images/verification_fingerprint_icon.png', onTap: () async { - if (await widget.authenticationViewModel - .checkIfBiometricAvailable(BiometricType.fingerprint)) { - - widget.authenticateUser(AuthMethodTypes.Fingerprint, true); + if (await widget.authenticationViewModel.checkIfBiometricAvailable(BiometricType.fingerprint)) { + widget.authenticateUser!(AuthMethodTypes.Fingerprint, true); } }, - label: TranslationBase - .of(context) - .verifyWith+TranslationBase.of(context).verifyFingerprint, + label: TranslationBase.of(context).verifyWith ?? "" + TranslationBase.of(context).verifyFingerprint!, ); break; case AuthMethodTypes.FaceID: return MethodTypeCard( assetPath: 'assets/images/verification_faceid_icon.png', onTap: () async { - if (await widget.authenticationViewModel - .checkIfBiometricAvailable(BiometricType.face)) { - widget.authenticateUser(AuthMethodTypes.FaceID, true); + if (await widget.authenticationViewModel.checkIfBiometricAvailable(BiometricType.face)) { + widget.authenticateUser!(AuthMethodTypes.FaceID, true); } }, - label: TranslationBase - .of(context) - .verifyWith+TranslationBase.of(context).verifyFaceID, + label: TranslationBase.of(context).verifyWith ?? "" + TranslationBase.of(context).verifyFaceID!, ); break; default: return MethodTypeCard( assetPath: 'assets/images/login/more_icon.png', - onTap: widget.onShowMore, - label: TranslationBase.of(context).moreVerification, + onTap: widget.onShowMore!, + label: TranslationBase.of(context).moreVerification!, height: 0, ); } diff --git a/lib/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart deleted file mode 100644 index aa532306..00000000 --- a/lib/widgets/charts/app_bar_chart.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:flutter/material.dart'; - -class AppBarChart extends StatelessWidget { - const AppBarChart({ - Key key, - @required this.seriesList, - }) : super(key: key); - - final List seriesList; - - @override - Widget build(BuildContext context) { - return Container( - height: 400, - margin: EdgeInsets.only(top: 60), - child: charts.BarChart( - seriesList, - // animate: animate, - - /// Customize the primary measure axis using a small tick renderer. - /// Use String instead of num for ordinal domain axis - /// (typically bar charts). - primaryMeasureAxis: new charts.NumericAxisSpec( - renderSpec: new charts.GridlineRendererSpec( - // Display the measure axis labels below the gridline. - // - // 'Before' & 'after' follow the axis value direction. - // Vertical axes draw 'before' below & 'after' above the tick. - // Horizontal axes draw 'before' left & 'after' right the tick. - labelAnchor: charts.TickLabelAnchor.before, - - // Left justify the text in the axis. - // - // Note: outside means that the secondary measure axis would right - // justify. - labelJustification: - charts.TickLabelJustification.outside, - )), - ), - ); - } -} diff --git a/lib/widgets/charts/app_line_chart.dart b/lib/widgets/charts/app_line_chart.dart index 1a29b1e6..e3265595 100644 --- a/lib/widgets/charts/app_line_chart.dart +++ b/lib/widgets/charts/app_line_chart.dart @@ -15,9 +15,9 @@ class AppLineChart extends StatelessWidget { final bool stacked; AppLineChart( - {Key key, - @required this.seriesList, - this.chartTitle, + {Key? key, + required this.seriesList, + required this.chartTitle, this.animate = true, this.includeArea = false, this.stacked = true}); @@ -33,9 +33,7 @@ class AppLineChart extends StatelessWidget { ), Expanded( child: charts.LineChart(seriesList, - defaultRenderer: charts.LineRendererConfig( - includeArea: false, stacked: true), - animate: animate), + defaultRenderer: charts.LineRendererConfig(includeArea: false, stacked: true), animate: animate), ), ], ), diff --git a/lib/widgets/charts/app_time_series_chart.dart b/lib/widgets/charts/app_time_series_chart.dart index 670284a1..eed6289f 100644 --- a/lib/widgets/charts/app_time_series_chart.dart +++ b/lib/widgets/charts/app_time_series_chart.dart @@ -12,11 +12,11 @@ import 'package:flutter/material.dart'; /// [endDate] the end date class AppTimeSeriesChart extends StatelessWidget { AppTimeSeriesChart({ - Key key, - @required this.seriesList, + Key? key, + required this.seriesList, this.chartName = '', - this.startDate, - this.endDate, + required this.startDate, + required this.endDate, }); final String chartName; @@ -41,8 +41,7 @@ class AppTimeSeriesChart extends StatelessWidget { behaviors: [ charts.RangeAnnotation( [ - charts.RangeAnnotationSegment(startDate, endDate, - charts.RangeAnnotationAxisType.domain ), + charts.RangeAnnotationSegment(startDate, endDate, charts.RangeAnnotationAxisType.domain), ], ), ], diff --git a/lib/widgets/dashboard/dashboard_item_texts_widget.dart b/lib/widgets/dashboard/dashboard_item_texts_widget.dart deleted file mode 100644 index 659e4562..00000000 --- a/lib/widgets/dashboard/dashboard_item_texts_widget.dart +++ /dev/null @@ -1,66 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -import '../shared/app_texts_widget.dart'; -import '../shared/rounded_container_widget.dart'; - -class DashboardItemTexts extends StatefulWidget { - final String label; - final String value; - final Color backgroundColor; - final bool showBorder; - final Color borderColor; - -// OWNER : Ibrahim albitar -// DATE : 05-04-2020 -// DESCRIPTION : Custom widget for dashboard items has texts widgets - - DashboardItemTexts(this.label, this.value, - {this.backgroundColor = Colors.white, - this.showBorder = false, - this.borderColor = Colors.white}); - - @override - _DashboardItemTextsState createState() => _DashboardItemTextsState(); -} - -class _DashboardItemTextsState extends State { - ProjectViewModel projectsProvider; - @override - Widget build(BuildContext context) { - projectsProvider = Provider.of(context); - return new RoundedContainer( - child: Stack( - children: [ - Align( - alignment: projectsProvider.isArabic - ? FractionalOffset.topRight - : FractionalOffset.topLeft, - child: Container( - margin: EdgeInsets.all(5), - child: AppText( - widget.label, - fontSize: 12, - ), - )), - Align( - alignment: projectsProvider.isArabic - ? FractionalOffset.bottomLeft - : FractionalOffset.bottomRight, - child: Container( - margin: EdgeInsets.all(10), - child: AppText( - widget.value, - fontWeight: FontWeight.bold, - ), - )), - ], - ), - backgroundColor: widget.backgroundColor, - showBorder: widget.showBorder, - borderColor: widget.borderColor, - margin: EdgeInsets.all(4), - ); - } -} diff --git a/lib/widgets/dashboard/guage_chart.dart b/lib/widgets/dashboard/guage_chart.dart index 6769c568..1980fe61 100644 --- a/lib/widgets/dashboard/guage_chart.dart +++ b/lib/widgets/dashboard/guage_chart.dart @@ -1,10 +1,9 @@ - import 'package:charts_flutter/flutter.dart' as charts; import 'package:flutter/material.dart'; class GaugeChart extends StatelessWidget { final List seriesList; - final bool animate; + final bool? animate; GaugeChart(this.seriesList, {this.animate}); @@ -19,19 +18,16 @@ class GaugeChart extends StatelessWidget { @override Widget build(BuildContext context) { return new charts.PieChart(seriesList, - animate: animate, - defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10)); + animate: animate, defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10)); //); } static List> _createSampleData() { final data = [ new GaugeSegment('Low', 75, charts.MaterialPalette.blue.shadeDefault), - new GaugeSegment( - 'Acceptable', 100, charts.MaterialPalette.blue.shadeDefault), + new GaugeSegment('Acceptable', 100, charts.MaterialPalette.blue.shadeDefault), new GaugeSegment('High', 50, charts.MaterialPalette.blue.shadeDefault), - new GaugeSegment( - 'Highly Unusual', 55, charts.MaterialPalette.blue.shadeDefault), + new GaugeSegment('Highly Unusual', 55, charts.MaterialPalette.blue.shadeDefault), ]; return [ diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index fe05d69d..bd9722e3 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -9,12 +9,10 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { - value.summaryoptions - .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + value.summaryoptions.sort((Summaryoptions a, Summaryoptions b) => b.value! - a.value!); - var list = new List(); - value.summaryoptions.forEach((result) => - {list.add(getStack(result, value.summaryoptions.first.value,context))}); + var list = []; + value.summaryoptions.forEach((result) => {list.add(getStack(result, value.summaryoptions.first.value, context))}); return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -32,16 +30,15 @@ class GetOutPatientStack extends StatelessWidget { ); } - getStack(Summaryoptions value, max,context) { + getStack(Summaryoptions value, max, context) { return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, - end: Alignment( - 0.0, 1.0), // 10% of the width, so there are ten blinds. - colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow + end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds. + colors: [Color(0x8FF5F6FA), Colors.red[50]!], // red to yellow tileMode: TileMode.mirror, // repeats the gradient over the canvas ), borderRadius: BorderRadius.circular(8), @@ -55,7 +52,7 @@ class GetOutPatientStack extends StatelessWidget { child: Container( child: SizedBox(), padding: EdgeInsets.all(10), - height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24 )* value.value) / max : 0, + height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24) * value.value!) / max : 0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), color: Color(0x63D02127), @@ -63,7 +60,7 @@ class GetOutPatientStack extends StatelessWidget { ), ), Container( - height: (MediaQuery.of(context).size.height * 0.24 ), + height: (MediaQuery.of(context).size.height * 0.24), margin: EdgeInsets.only(left: 5, top: 5), padding: EdgeInsets.all(10), child: RotatedBox( diff --git a/lib/widgets/data_display/list/custom_Item.dart b/lib/widgets/data_display/list/custom_Item.dart index c11af999..4361749c 100644 --- a/lib/widgets/data_display/list/custom_Item.dart +++ b/lib/widgets/data_display/list/custom_Item.dart @@ -27,17 +27,17 @@ class CustomItem extends StatelessWidget { final BoxDecoration decoration; CustomItem( - {Key key, - this.startIcon, + {Key? key, + required this.startIcon, this.disabled: false, - this.onTap, - this.startIconColor, + required this.onTap, + required this.startIconColor, this.endIcon = EvaIcons.chevronRight, - this.padding, - this.child, - this.endIconColor, + required this.padding, + required this.child, + required this.endIconColor, this.endIconSize = 20, - this.decoration, + required this.decoration, this.startIconSize = 19}) : super(key: key); @@ -52,9 +52,7 @@ class CustomItem extends StatelessWidget { if (onTap != null) onTap(); }, child: Padding( - padding: padding != null - ? padding - : const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), + padding: padding != null ? padding : const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), child: Row( children: [ if (startIcon != null) @@ -77,9 +75,7 @@ class CustomItem extends StatelessWidget { flex: 1, child: Icon( endIcon, - color: endIconColor != null - ? endIconColor - : Colors.grey[500], + color: endIconColor != null ? endIconColor : Colors.grey[500], size: endIconSize, ), ) diff --git a/lib/widgets/data_display/list/flexible_container.dart b/lib/widgets/data_display/list/flexible_container.dart index a35fa279..7faf32b4 100644 --- a/lib/widgets/data_display/list/flexible_container.dart +++ b/lib/widgets/data_display/list/flexible_container.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + /// Flexible container widget /// [widthFactor] If non-null, the fraction of the incoming width given to the child. /// If non-null, the child is given a tight width constraint that is the max @@ -14,15 +15,15 @@ import 'package:flutter/material.dart'; class FlexibleContainer extends StatelessWidget { final double widthFactor; final double heightFactor; - final EdgeInsets padding; + final EdgeInsets? padding; final Widget child; FlexibleContainer({ - Key key, + Key? key, this.widthFactor = 0.9, this.heightFactor = 1, this.padding, - this.child, + required this.child, }) : super(key: key); @override @@ -38,8 +39,7 @@ class FlexibleContainer extends StatelessWidget { padding: padding, width: double.infinity, decoration: BoxDecoration( - border: Border.all( - color: Theme.of(context).dividerColor, width: 2.0), + border: Border.all(color: Theme.of(context).dividerColor, width: 2.0), borderRadius: BorderRadius.circular(8.0)), child: child, ), diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index 7817ba3c..042a963f 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -16,7 +16,7 @@ class DoctorReplyWidget extends StatefulWidget { final ListGtMyPatientsQuestions reply; bool isShowMore = false; - DoctorReplyWidget({Key key, this.reply}); + DoctorReplyWidget({Key? key, required this.reply}); @override _DoctorReplyWidgetState createState() => _DoctorReplyWidgetState(); @@ -29,10 +29,7 @@ class _DoctorReplyWidgetState extends State { return Container( child: CardWithBgWidget( - bgColor: - widget.reply.status == 2 - ? Color(0xFF2E303A) - : Color(0xFFD02127), + bgColor: widget.reply.status == 2 ? Color(0xFF2E303A) : Color(0xFFD02127), hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -45,17 +42,16 @@ class _DoctorReplyWidgetState extends State { children: [ RichText( text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), + style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( - text: widget.reply.status==2 ? "Active":widget.reply.status==1?"Hold":"Cancelled",//TranslationBase.of(context).replied :TranslationBase.of(context).unReplied , + text: widget.reply.status == 2 + ? "Active" + : widget.reply.status == 1 + ? "Hold" + : "Cancelled", //TranslationBase.of(context).replied :TranslationBase.of(context).unReplied , style: TextStyle( - color: widget.reply.status == 2 - ? Color(0xFF2E303A) - : Color(0xFFD02127), - + color: widget.reply.status == 2 ? Color(0xFF2E303A) : Color(0xFFD02127), fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 2.0 * SizeConfig.textMultiplier)), @@ -66,39 +62,24 @@ class _DoctorReplyWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .day - .toString() + + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).day.toString() + " " + AppDateUtils.getMonth( - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .month) + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).month) .toString() .substring(0, 3) + ' ' + - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .year - .toString(), + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).year.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ), AppText( - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .hour - .toString() - + ":"+ - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .minute - .toString(), + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).hour.toString() + + ":" + + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).minute.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) - ], ), ], @@ -108,7 +89,7 @@ class _DoctorReplyWidgetState extends State { children: [ Expanded( child: AppText( - Helpers.capitalize( widget.reply.patientName), + Helpers.capitalize(widget.reply.patientName), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -118,7 +99,7 @@ class _DoctorReplyWidgetState extends State { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" +widget.reply.mobileNumber); + launch("tel://" + widget.reply.mobileNumber!); }, child: Icon( Icons.phone, @@ -162,7 +143,6 @@ class _DoctorReplyWidgetState extends State { fit: BoxFit.cover, ), ), - ], ), SizedBox( @@ -172,89 +152,80 @@ class _DoctorReplyWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ // SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - - children: [ - - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).fileNumber, - style: TextStyle( - fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold, fontFamily: 'Poppins')), - new TextSpan( - text: widget.reply.patientID.toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], - ), - ), - Container( - width: MediaQuery.of(context).size.width*0.45, - child: RichText( + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RichText( text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), + style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context).age + - " : ", - style: TextStyle(fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold)), + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 14, + color: Color(0xFF575757), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins')), new TextSpan( - text: - "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + text: widget.reply.patientID.toString(), style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 15)), + fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 15)), ], ), ), - ) - ], - ), - - - ], - ), - Container( - width: MediaQuery.of(context).size.width * 0.5, - child: RichText( - maxLines: 3, - overflow: TextOverflow.ellipsis, - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text:"Patient Question :" ,//TranslationBase.of(context).doctorResponse + " : ", - style: - TextStyle(fontSize: 14, fontFamily: 'Poppins', color: Color(0xFF575757),fontWeight: FontWeight.bold)), - new TextSpan( - text: widget.reply?.remarks?.trim()??'', - style: TextStyle( - fontFamily: 'Poppins', - color: Color(0xFF575757), - fontSize: 12)), - ], + Container( + width: MediaQuery.of(context).size.width * 0.45, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of(context).age! + " : ", + style: TextStyle( + fontSize: 14, color: Color(0xFF575757), fontWeight: FontWeight.bold)), + new TextSpan( + text: "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth!, context)}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)), + ], + ), + ), + ) + ], + ), + ], + ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + text: new TextSpan( + style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), + children: [ + new TextSpan( + text: "Patient Question :", //TranslationBase.of(context).doctorResponse + " : ", + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins', + color: Color(0xFF575757), + fontWeight: FontWeight.bold)), + new TextSpan( + text: widget.reply?.remarks?.trim() ?? '', + style: TextStyle(fontFamily: 'Poppins', color: Color(0xFF575757), fontSize: 12)), + ], + ), ), ), - ), - ],) + ], + ) ], ), // Container( diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart index c4343a4b..0a63a4e3 100644 --- a/lib/widgets/doctor/lab_result_widget.dart +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class LabResultWidget extends StatefulWidget { final List labResult; - LabResultWidget({Key key, this.labResult}); + LabResultWidget({Key? key, required this.labResult}); @override _LabResultWidgetState createState() => _LabResultWidgetState(); @@ -41,9 +41,7 @@ class _LabResultWidgetState extends State { _showDetails = !_showDetails; }); }, - child: Icon(_showDetails - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down)), + child: Icon(_showDetails ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), ], ), Divider( @@ -84,9 +82,7 @@ class _LabResultWidgetState extends State { child: Container( color: HexColor('#515B5D'), child: Center( - child: AppText( - TranslationBase.of(context).value, - color: Colors.white), + child: AppText(TranslationBase.of(context).value, color: Colors.white), ), height: 60), ), @@ -99,9 +95,7 @@ class _LabResultWidgetState extends State { ), ), child: Center( - child: AppText( - TranslationBase.of(context).range, - color: Colors.white), + child: AppText(TranslationBase.of(context).range, color: Colors.white), ), height: 60), ), @@ -114,8 +108,7 @@ class _LabResultWidgetState extends State { decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10)), border: Border( - bottom: - BorderSide(color: Colors.grey, width: 0.5), + bottom: BorderSide(color: Colors.grey, width: 0.5), top: BorderSide(color: Colors.grey, width: 0.5), left: BorderSide(color: Colors.grey, width: 0.5), right: BorderSide(color: Colors.grey, width: 0.5), @@ -146,17 +139,14 @@ class _LabResultWidgetState extends State { Expanded( child: Container( child: Center( - child: AppText('${result.resultValue}', - color: Colors.grey[800]), + child: AppText('${result.resultValue}', color: Colors.grey[800]), ), height: 60), ), Expanded( child: Container( child: Center( - child: AppText( - '${result.referenceRange}', - color: Colors.grey[800]), + child: AppText('${result.referenceRange}', color: Colors.grey[800]), ), height: 60), ), diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index 453cff30..e6469186 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/referral_view_model.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import '../shared/text_fields/TextFields.dart'; 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/expandable-widget-header-body.dart'; @@ -19,27 +19,25 @@ class MyReferralPatientWidget extends StatefulWidget { final Function expandClick; MyReferralPatientWidget( - {Key key, - this.myReferralPatientModel, - this.model, - this.isExpand, - this.expandClick}); + {Key? key, + required this.myReferralPatientModel, + required this.model, + required this.isExpand, + required this.expandClick}); @override - _MyReferralPatientWidgetState createState() => - _MyReferralPatientWidgetState(); + _MyReferralPatientWidgetState createState() => _MyReferralPatientWidgetState(); } class _MyReferralPatientWidgetState extends State { bool _isLoading = false; final _formKey = GlobalKey(); - String error; - TextEditingController answerController; + late String error; + late TextEditingController answerController; @override void initState() { - answerController = new TextEditingController( - text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); + answerController = new TextEditingController(text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); super.initState(); } @@ -65,8 +63,7 @@ class _MyReferralPatientWidgetState extends State { headerWidget: Column( children: [ Container( - padding: - EdgeInsets.only(left: 16, top: 8, right: 8, bottom: 0), + padding: EdgeInsets.only(left: 16, top: 8, right: 8, bottom: 0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -76,8 +73,7 @@ class _MyReferralPatientWidgetState extends State { children: [ Container( color: Color(0xFFB8382C), - padding: EdgeInsets.symmetric( - vertical: 4, horizontal: 4), + padding: EdgeInsets.symmetric(vertical: 4, horizontal: 4), child: AppText( '${widget.myReferralPatientModel.priorityDescription}', fontSize: 1.7 * SizeConfig.textMultiplier, @@ -124,10 +120,9 @@ class _MyReferralPatientWidgetState extends State { ), ), Container( - margin: - EdgeInsets.symmetric(horizontal: 8, vertical: 8), + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 8), child: InkWell( - onTap: widget.expandClick, + onTap: widget.expandClick(), child: Image.asset( "assets/images/ic_circle_arrow.png", width: 25, @@ -156,8 +151,7 @@ class _MyReferralPatientWidgetState extends State { ), Container( height: 1.8 * SizeConfig.textMultiplier * 6, - padding: - EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), + padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( child: Row( children: [ @@ -254,8 +248,7 @@ class _MyReferralPatientWidgetState extends State { ), Container( height: 1.8 * SizeConfig.textMultiplier * 6, - padding: - EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), + padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( child: Row( children: [ @@ -323,7 +316,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime)}', + '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime!)}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.normal, textAlign: TextAlign.start, @@ -351,8 +344,7 @@ class _MyReferralPatientWidgetState extends State { height: 10, ), Container( - padding: - EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), + padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( child: Row( children: [ @@ -365,8 +357,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - TranslationBase.of(context) - .clinicDetailsandRemarks, + TranslationBase.of(context).clinicDetailsandRemarks, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -414,13 +405,12 @@ class _MyReferralPatientWidgetState extends State { controller: answerController, maxLines: 3, minLines: 2, - hintText: TranslationBase.of(context).answerThePatient, + hintText: TranslationBase.of(context).answerThePatient ?? "", fontWeight: FontWeight.normal, readOnly: _isLoading, validator: (value) { if (value.isEmpty) - return TranslationBase.of(context) - .pleaseEnterAnswer; + return TranslationBase.of(context).pleaseEnterAnswer; else return null; }, @@ -431,16 +421,13 @@ class _MyReferralPatientWidgetState extends State { width: double.infinity, margin: EdgeInsets.only(left: 10, right: 10), child: AppButton( - title : TranslationBase.of(context).replay, + title: TranslationBase.of(context).replay, onPressed: () async { final form = _formKey.currentState; - if (form.validate()) { + if (form!.validate()) { try { - await widget.model.replay( - answerController.text.toString(), - widget.myReferralPatientModel); - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).replySuccessfully); + await widget.model.replay(answerController.text.toString(), widget.myReferralPatientModel); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).replySuccessfully); } catch (e) { DrAppToastMsg.showErrorToast(e); } diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 54df8cd9..53c8e4cb 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -12,13 +12,13 @@ import 'package:provider/provider.dart'; class MyScheduleWidget extends StatelessWidget { final ListDoctorWorkingHoursTable workingHoursTable; - MyScheduleWidget({Key key, this.workingHoursTable}); + MyScheduleWidget({Key? key, required this.workingHoursTable}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); List workingHours = Helpers.getWorkingHours( - workingHoursTable.workingHours, + workingHoursTable.workingHours!, ); return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -33,13 +33,15 @@ class MyScheduleWidget extends StatelessWidget { height: 10, ), AppText( - projectViewModel.isArabic?AppDateUtils.getWeekDayArabic(workingHoursTable.date.weekday): AppDateUtils.getWeekDay(workingHoursTable.date.weekday) , + projectViewModel.isArabic + ? AppDateUtils.getWeekDayArabic(workingHoursTable.date!.weekday) + : AppDateUtils.getWeekDay(workingHoursTable.date!.weekday), fontSize: 16, fontFamily: 'Poppins', // fontSize: 18 ), AppText( - ' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', + ' ${workingHoursTable.date!.day} ${(AppDateUtils.getMonth(workingHoursTable.date!.month).toString().substring(0, 3))}', fontSize: 14, fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -51,15 +53,14 @@ class MyScheduleWidget extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.55, child: CardWithBgWidget( - bgColor: AppDateUtils.isToday(workingHoursTable.date) - ? Colors.green[500] - : Colors.transparent, + bgColor: AppDateUtils.isToday(workingHoursTable.date!) ? Colors.green[500]! : Colors.transparent, + // hasBorder: false, widget: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (AppDateUtils.isToday(workingHoursTable.date)) + if (AppDateUtils.isToday(workingHoursTable.date!)) AppText( "Today", fontSize: 1.8 * SizeConfig.textMultiplier, @@ -74,33 +75,33 @@ class MyScheduleWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: workingHours.map((work) { return Container( - margin: EdgeInsets.only(bottom:workingHours.length>1? 15:0), + margin: EdgeInsets.only(bottom: workingHours.length > 1 ? 15 : 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 5, ), - if(workingHoursTable.clinicName!=null) - AppText( - workingHoursTable.clinicName??"", - fontSize: 15, - fontWeight: FontWeight.w700, - ), + if (workingHoursTable!.clinicName != null) + AppText( + workingHoursTable!.clinicName ?? "", + fontSize: 15, + fontWeight: FontWeight.w700, + ), Container( - width: MediaQuery.of(context).size.width*0.55, + width: MediaQuery.of(context).size.width * 0.55, child: AppText( - '${work.from} - ${work.to}', + '${work.from} - ${work.to}', fontSize: 15, fontWeight: FontWeight.w300, ), ), - if(workingHoursTable.projectName!=null) - AppText( - workingHoursTable.projectName??"", - fontSize: 15, - fontWeight: FontWeight.w700, - ), + if (workingHoursTable.projectName != null) + AppText( + workingHoursTable.projectName ?? "", + fontSize: 15, + fontWeight: FontWeight.w700, + ), ], ), ); diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index f4f78c08..482a251b 100644 --- a/lib/widgets/medicine/medicine_item_widget.dart +++ b/lib/widgets/medicine/medicine_item_widget.dart @@ -18,11 +18,11 @@ import '../shared/rounded_container_widget.dart'; */ class MedicineItemWidget extends StatefulWidget { - final String label; + final String? label; final Color backgroundColor; final bool showBorder; final Color borderColor; - final String url; + final String? url; MedicineItemWidget( {@required this.label, @@ -52,7 +52,7 @@ class _MedicineItemWidgetState extends State { child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(7)), child: Image.network( - widget.url, + widget.url!, height: SizeConfig.imageSizeMultiplier * 15, width: SizeConfig.imageSizeMultiplier * 15, fit: BoxFit.cover, @@ -62,9 +62,7 @@ class _MedicineItemWidgetState extends State { Expanded( child: Padding( padding: EdgeInsets.all(5), - child: Align( - alignment: Alignment.centerLeft, - child: AppText(widget.label)))), + child: Align(alignment: Alignment.centerLeft, child: AppText(widget.label)))), Icon(EvaIcons.eye) ], ), diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 2174e6d5..e4673741 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -20,12 +20,12 @@ class PatientCard extends StatelessWidget { final bool isFromLiveCare; const PatientCard( - {Key key, - this.patientInfo, - this.onTap, - this.patientType, - this.arrivalType, - this.isInpatient, + {Key? key, + required this.patientInfo, + required this.onTap, + required this.patientType, + required this.arrivalType, + required this.isInpatient, this.isMyPatient = false, this.isFromSearch = false, this.isFromLiveCare = false}) @@ -49,16 +49,16 @@ class PatientCard extends StatelessWidget { bgColor: isFromLiveCare ? Colors.white : (isMyPatient && !isFromSearch) - ? Colors.green[500] + ? Colors.green[500]! : patientInfo.patientStatusType == 43 - ? Colors.green[500] + ? Colors.green[500]! : isMyPatient - ? Colors.green[500] + ? Colors.green[500]! : isInpatient - ? Colors.white + ? Colors.white! : !isFromSearch - ? Colors.red[800] - : Colors.white, + ? Colors.red[800]! + : Colors.white!, widget: Container( color: Colors.white, // padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), @@ -78,8 +78,7 @@ class PatientCard extends StatelessWidget { ? Row( children: [ AppText( - TranslationBase.of(context) - .arrivedP, + TranslationBase.of(context).arrivedP, color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -99,12 +98,8 @@ class PatientCard extends StatelessWidget { width: 8, ), AppText( - patientInfo.status == 2 - ? 'Confirmed' - : 'Booked', - color: patientInfo.status == 2 - ? Colors.green - : Colors.grey, + patientInfo.status == 2 ? 'Confirmed' : 'Booked', + color: patientInfo.status == 2 ? Colors.green : Colors.grey, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 10, @@ -115,8 +110,7 @@ class PatientCard extends StatelessWidget { ? Row( children: [ AppText( - TranslationBase.of(context) - .notArrived, + TranslationBase.of(context).notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -136,27 +130,19 @@ class PatientCard extends StatelessWidget { width: 8, ), AppText( - patientInfo.status == 2 - ? 'Confirmed' - : 'Booked', - color: patientInfo.status == 2 - ? Colors.green - : Colors.grey, + patientInfo.status == 2 ? 'Confirmed' : 'Booked', + color: patientInfo.status == 2 ? Colors.green : Colors.grey, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 10, ), ], ) - : !isFromSearch && - !isFromLiveCare && - patientInfo.patientStatusType == - null + : !isFromSearch && !isFromLiveCare && patientInfo.patientStatusType == null ? Row( children: [ AppText( - TranslationBase.of(context) - .notArrived, + TranslationBase.of(context).notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -176,13 +162,8 @@ class PatientCard extends StatelessWidget { width: 8, ), AppText( - patientInfo.status == 2 - ? 'Booked' - : 'Confirmed', - color: - patientInfo.status == 2 - ? Colors.grey - : Colors.green, + patientInfo.status == 2 ? 'Booked' : 'Confirmed', + color: patientInfo.status == 2 ? Colors.grey : Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, @@ -192,33 +173,27 @@ class PatientCard extends StatelessWidget { : SizedBox(), this.arrivalType == '1' ? AppText( - patientInfo.startTime != null - ? patientInfo.startTime - : patientInfo.startTimes, + patientInfo.startTime != null ? patientInfo.startTime : patientInfo.startTimes, fontFamily: 'Poppins', fontWeight: FontWeight.w400, ) : patientInfo.arrivedOn != null ? AppText( - AppDateUtils.getDayMonthYearDate( - AppDateUtils - .convertStringToDate( - patientInfo.arrivedOn, + AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( + patientInfo.arrivedOn ?? "", )) + " " + - "${AppDateUtils.getStartTime(patientInfo.startTime)}", + "${AppDateUtils.getStartTime(patientInfo.startTime ?? "")}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, ) - : (patientInfo.appointmentDate != - null && - patientInfo - .appointmentDate.isNotEmpty) + : (patientInfo.appointmentDate != null && + patientInfo.appointmentDate!.isNotEmpty) ? AppText( "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( - patientInfo.appointmentDate, - ))} ${AppDateUtils.getStartTime(patientInfo.startTime)}", + patientInfo.appointmentDate ?? "", + ))} ${AppDateUtils.getStartTime(patientInfo.startTime ?? "")}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, @@ -253,13 +228,10 @@ class PatientCard extends StatelessWidget { // width: MediaQuery.of(context).size.width*0.51, child: AppText( isFromLiveCare - ? Helpers.capitalize( - patientInfo.fullName) - : (Helpers.capitalize( - patientInfo.firstName) + + ? Helpers.capitalize(patientInfo.fullName) + : (Helpers.capitalize(patientInfo.firstName) + " " + - Helpers.capitalize( - patientInfo.lastName)), + Helpers.capitalize(patientInfo.lastName)), fontSize: 16, color: Color(0xff2e303a), fontWeight: FontWeight.w700, @@ -283,9 +255,9 @@ class PatientCard extends StatelessWidget { children: [ AppText( patientInfo.nationalityName != null - ? patientInfo.nationalityName.trim() + ? patientInfo.nationalityName!.trim() : patientInfo.nationality != null - ? patientInfo.nationality.trim() + ? patientInfo.nationality!.trim() : patientInfo.nationalityId != null ? patientInfo.nationalityId : "", @@ -293,20 +265,15 @@ class PatientCard extends StatelessWidget { fontSize: 14, textOverflow: TextOverflow.ellipsis, ), - patientInfo.nationality != null || - patientInfo.nationalityId != null + patientInfo.nationality != null || patientInfo.nationalityId != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( - patientInfo.nationalityFlagURL != null - ? patientInfo.nationalityFlagURL - : '', + patientInfo.nationalityFlagURL != null ? patientInfo.nationalityFlagURL! : '', height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: + (BuildContext context, Object exception, StackTrace? stackTrace) { return AppText( 'No Image', fontSize: 10, @@ -341,135 +308,107 @@ class PatientCard extends StatelessWidget { width: 10, ), Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context) - .fileNumber, - style: TextStyle( - fontSize: 12, - fontFamily: 'Poppins')), - new TextSpan( - text: patientInfo.patientId.toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 13)), - ], - ), - ), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.patientId.toString(), + style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 13)), + ], ), - //if (isInpatient) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of(context).age + - " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: - "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 13)), - ], - ), + ), + ), + //if (isInpatient) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', ), + children: [ + new TextSpan( + text: TranslationBase.of(context).age ?? "" + " : ", + style: TextStyle(fontSize: 12)), + new TextSpan( + text: + "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 13)), + ], ), - if (isInpatient) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: patientInfo.admissionDate == null - ? "" - : TranslationBase.of(context) - .admissionDate + - " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: patientInfo.admissionDate == null - ? "" - : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 13)), - ]))), - if (patientInfo.admissionDate != null) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of(context) - .numOfDays + - " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 13)), - ]))), - if (isFromLiveCare) - Column( - children: [ - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: - TranslationBase.of(context).clinic + - " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: - patientInfo.clinicName, - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 13)), - ], + ), + ), + if (isInpatient) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: patientInfo.admissionDate == null + ? "" + : TranslationBase.of(context).admissionDate ?? "" + " : ", + style: TextStyle(fontSize: 12)), + new TextSpan( + text: patientInfo.admissionDate == null + ? "" + : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 13)), + ]))), + if (patientInfo.admissionDate != null) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', ), + children: [ + new TextSpan( + text: TranslationBase.of(context).numOfDays ?? "" + " : ", + style: TextStyle(fontSize: 12)), + new TextSpan( + text: + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate ?? "")).inDays + 1}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 13)), + ]))), + if (isFromLiveCare) + Column( + children: [ + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', ), + children: [ + new TextSpan( + text: TranslationBase.of(context).clinic ?? "" + " : ", + style: TextStyle(fontSize: 12)), + new TextSpan( + text: patientInfo.clinicName, + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 13)), + ], ), - ], + ), ), - ])) + ], + ), + ])) ]), isFromLiveCare ? Row( @@ -486,40 +425,33 @@ class PatientCard extends StatelessWidget { ], ) : !isInpatient && !isFromSearch - ? Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ + ? Row(mainAxisAlignment: MainAxisAlignment.end, children: [ + Container( + padding: EdgeInsets.all(4), + child: Image.asset( + patientInfo.appointmentType == 'Regular' && patientInfo.visitTypeId == 100 + ? 'assets/images/livecare.png' + : patientInfo.appointmentType == 'Walkin' + ? 'assets/images/walkin.png' + : 'assets/images/booked.png', + height: 25, + width: 35, + )), + ]) + : (isInpatient == true) + ? Row(mainAxisAlignment: MainAxisAlignment.end, children: [ Container( padding: EdgeInsets.all(4), child: Image.asset( - patientInfo.appointmentType == - 'Regular' && - patientInfo.visitTypeId == 100 - ? 'assets/images/livecare.png' - : patientInfo.appointmentType == - 'Walkin' - ? 'assets/images/walkin.png' - : 'assets/images/booked.png', + 'assets/images/inpatient.png', height: 25, width: 35, )), ]) - : (isInpatient == true) - ? Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - padding: EdgeInsets.all(4), - child: Image.asset( - 'assets/images/inpatient.png', - height: 25, - width: 35, - )), - ]) : SizedBox() ], ), - onTap: onTap, + onTap: onTap(), )), )); } diff --git a/lib/widgets/patients/clinic_list_dropdwon.dart b/lib/widgets/patients/clinic_list_dropdwon.dart deleted file mode 100644 index c903bd7b..00000000 --- a/lib/widgets/patients/clinic_list_dropdwon.dart +++ /dev/null @@ -1,99 +0,0 @@ -// ignore: must_be_immutable -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/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 ClinicList extends StatelessWidget { - - ProjectViewModel projectsProvider; - final int clinicId; - final Function (int value) onClinicChange; - - ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); - - @override - Widget build(BuildContext context) { - // authProvider = Provider.of(context); - - projectsProvider = Provider.of(context); - return Container( - child: - projectsProvider - .doctorClinicsList.length > - 0 - ? FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width *0.8, - child: Center( - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: - Colors.white, - iconEnabledColor: - Colors.black, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[ - 0] - .clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return projectsProvider - .doctorClinicsList - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( - item.clinicName, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors - .black, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue){ - onClinicChange(newValue); - }, - items: projectsProvider - .doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: - TextAlign.end, - ), - value: item.clinicID, - ); - }).toList(), - )), - ), - ), - ], - ), - ) - : AppText( - TranslationBase - .of(context) - .noClinic), - ); - } -} \ No newline at end of file diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart deleted file mode 100644 index d2a68acd..00000000 --- a/lib/widgets/patients/dynamic_elements.dart +++ /dev/null @@ -1,163 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; - -class DynamicElements extends StatefulWidget { - final PatientModel _patientSearchFormValues; - final bool isFormSubmitted; - DynamicElements(this._patientSearchFormValues, this.isFormSubmitted); - @override - _DynamicElementsState createState() => _DynamicElementsState(); -} - -class _DynamicElementsState extends State { - TextEditingController _toDateController = new TextEditingController(); - TextEditingController _fromDateController = new TextEditingController(); - void _presentDatePicker(id) { - showDatePicker( - context: context, - initialDate: DateTime.now(), - firstDate: DateTime(2019), - lastDate: DateTime.now(), - ).then((pickedDate) { - if (pickedDate == null) { - return; - } - setState(() { - print(id); - var selectedDate = DateFormat.yMd().format(pickedDate); - - if (id == '_selectedFromDate') { - // _fromDateController.text = selectedDate; - selectedDate = pickedDate.year.toString() + - "-" + - pickedDate.month.toString().padLeft(2, '0') + - "-" + - pickedDate.day.toString().padLeft(2, '0'); - - _fromDateController.text = selectedDate; - } else { - selectedDate = pickedDate.year.toString() + - "-" + - pickedDate.month.toString().padLeft(2, '0') + - "-" + - pickedDate.day.toString().padLeft(2, '0'); - - _toDateController.text = selectedDate; - // _toDateController.text = selectedDate; - } - }); - }); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - InputDecoration textFieldSelectorDecoration( - {String hintText, - String selectedText, - bool isDropDown, - IconData icon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - - return LayoutBuilder( - builder: (ctx, constraints) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - borderColor: Colors.white, - onTap: () => _presentDatePicker('_selectedFromDate'), - hintText: TranslationBase.of(context).fromDate, - controller: _fromDateController, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_fromDateController.text.toString().trim().isEmpty) { - widget._patientSearchFormValues.From = "0"; - } else { - widget._patientSearchFormValues.From = - _fromDateController.text.replaceAll("/", "-"); - } - }, - readOnly: true, - )), - SizedBox( - height: 5, - ), - if (widget._patientSearchFormValues.From == "0" && - widget.isFormSubmitted) - CustomValidationError(), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), - borderRadius: BorderRadius.all(Radius.circular(6.0))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - readOnly: true, - borderColor: Colors.white, - hintText: TranslationBase.of(context).toDate, - controller: _toDateController, - onTap: () { - _presentDatePicker('_selectedToDate'); - }, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_toDateController.text.toString().trim().isEmpty) { - widget._patientSearchFormValues.To = "0"; - } else { - widget._patientSearchFormValues.To = - _toDateController.text.replaceAll("/", "-"); - } - }, - )), - if (widget._patientSearchFormValues.To == "0" && - widget.isFormSubmitted) - CustomValidationError(), - SizedBox( - height: 10, - ), - ], - ); - }, - ); - } -} diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index a08282c0..de4d821c 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -9,24 +9,24 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PatientReferralItemWidget extends StatelessWidget { - final String referralStatus; - final int referralStatusCode; - final String patientName; - final int patientGender; - final String referredDate; - final String referredTime; - final String patientID; + final String? referralStatus; + final int? referralStatusCode; + final String? patientName; + final int? patientGender; + final String? referredDate; + final String? referredTime; + final String? patientID; final isSameBranch; - final bool isReferral; - final bool isReferralClinic; - final String referralClinic; - final String remark; - final String nationality; - final String nationalityFlag; - final String doctorAvatar; - final String referralDoctorName; - final String clinicDescription; - final Widget infoIcon; + final bool? isReferral; + final bool? isReferralClinic; + final String? referralClinic; + final String? remark; + final String? nationality; + final String? nationalityFlag; + final String? doctorAvatar; + final String? referralDoctorName; + final String? clinicDescription; + final Widget? infoIcon; PatientReferralItemWidget( {this.referralStatus, @@ -44,7 +44,9 @@ class PatientReferralItemWidget extends StatelessWidget { this.doctorAvatar, this.referralDoctorName, this.clinicDescription, - this.infoIcon,this.isReferralClinic=false,this.referralClinic}); + this.infoIcon, + this.isReferralClinic = false, + this.referralClinic}); @override Widget build(BuildContext context) { @@ -59,8 +61,8 @@ class PatientReferralItemWidget extends StatelessWidget { bgColor: referralStatusCode == 1 ? Color(0xffc4aa54) : referralStatusCode == 46 - ? Colors.green[700] - : Colors.red[700], + ? Colors.green[700]! + : Colors.red[700]!, hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -74,7 +76,7 @@ class PatientReferralItemWidget extends StatelessWidget { AppText( referralStatus != null ? referralStatus : "", fontFamily: 'Poppins', - fontSize: 1.9 * SizeConfig.textMultiplier, + fontSize: 1.9 * SizeConfig.textMultiplier!, fontWeight: FontWeight.w700, color: referralStatusCode == 1 ? Color(0xffc4aa54) @@ -83,10 +85,10 @@ class PatientReferralItemWidget extends StatelessWidget { : Colors.red[700], ), AppText( - referredDate, + referredDate!, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 2.0 * SizeConfig.textMultiplier, + fontSize: 2.0 * SizeConfig.textMultiplier!, color: Color(0XFF28353E), ) ], @@ -96,8 +98,8 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ Expanded( child: AppText( - patientName, - fontSize: SizeConfig.textMultiplier * 2.2, + patientName!, + fontSize: SizeConfig.textMultiplier! * 2.2, fontWeight: FontWeight.bold, color: Colors.black, fontFamily: 'Poppins', @@ -119,10 +121,10 @@ class PatientReferralItemWidget extends StatelessWidget { width: 4, ), AppText( - referredTime, + referredTime!, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ) ], @@ -141,14 +143,14 @@ class PatientReferralItemWidget extends StatelessWidget { TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ), AppText( - patientID, + patientID!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), ), ], @@ -157,15 +159,20 @@ class PatientReferralItemWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - isSameBranch ? TranslationBase.of(context).referredFrom :TranslationBase.of(context).refClinic, + isSameBranch + ? TranslationBase.of(context).referredFrom + : TranslationBase.of(context).refClinic, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ), - AppText( - !isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic, + !isReferralClinic! + ? isSameBranch + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context).otherBranch + : " " + referralClinic!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -179,7 +186,7 @@ class PatientReferralItemWidget extends StatelessWidget { Row( children: [ AppText( - nationality != null ? nationality : "", + nationality != null ? nationality! : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), fontSize: 1.4 * SizeConfig.textMultiplier, @@ -188,12 +195,10 @@ class PatientReferralItemWidget extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - nationalityFlag, + nationalityFlag!, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -207,18 +212,18 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).remarks + " : ", + TranslationBase.of(context).remarks ?? "" + " : ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ), Expanded( child: AppText( - remark, + remark ?? "", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), maxLines: 1, ), @@ -231,7 +236,7 @@ class PatientReferralItemWidget extends StatelessWidget { Container( margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( - isReferral + isReferral! ? 'assets/images/patient/ic_ref_arrow_up.png' : 'assets/images/patient/ic_ref_arrow_left.png', height: 50, @@ -239,8 +244,7 @@ class PatientReferralItemWidget extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only( - left: 0, top: 25, right: 0, bottom: 0), + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: Container( width: 40, @@ -249,46 +253,43 @@ class PatientReferralItemWidget extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - doctorAvatar, + doctorAvatar!, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) : Container( - child: Image.asset( - patientGender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), + child: Image.asset( + patientGender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), ), ), Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, top: 25, right: 10, bottom: 0), + margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - referralDoctorName, + referralDoctorName!, fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Colors.black, ), if (clinicDescription != null) AppText( - clinicDescription, + clinicDescription!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.4 * SizeConfig.textMultiplier, + fontSize: 1.4 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), ), ], @@ -297,10 +298,7 @@ class PatientReferralItemWidget extends StatelessWidget { ), ], ), - Container( - width: double.infinity, - alignment: Alignment.centerRight, - child: infoIcon ?? Container()) + Container(width: double.infinity, alignment: Alignment.centerRight, child: infoIcon ?? Container()) ], ), // onTap: onTap, diff --git a/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart b/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart index aef7a161..d1385d0e 100644 --- a/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart +++ b/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart @@ -21,7 +21,7 @@ class PatientHeaderWidgetNoAvatar extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - patient.firstName + ' ' + patient.lastName, + patient.firstName! + ' ' + patient.lastName!, fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.2, ), diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index ef285150..9c5b057d 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -17,26 +17,26 @@ class PatientProfileButton extends StatelessWidget { final String patientType; String arrivalType; final bool isInPatient; - String from; - String to; + String? from; + String? to; final String url = "assets/images/"; final bool isDisable; final bool isLoading; - final Function onTap; + final GestureTapCallback? onTap; final bool isDischargedPatient; final bool isSelectInpatient; final bool isDartIcon; - final IconData dartIcon; + final IconData? dartIcon; final bool isFromLiveCare; PatientProfileButton({ - Key key, - this.patient, - this.patientType, - this.arrivalType, - this.nameLine1, - this.nameLine2, - this.icon, + Key? key, + required this.patient, + required this.patientType, + required this.arrivalType, + required this.nameLine1, + required this.nameLine2, + required this.icon, this.route, this.isDisable = false, this.onTap, @@ -47,7 +47,8 @@ class PatientProfileButton extends StatelessWidget { this.isDischargedPatient = false, this.isSelectInpatient = false, this.isDartIcon = false, - this.dartIcon, this.isFromLiveCare = false, + this.dartIcon, + this.isFromLiveCare = false, }) : super(key: key); @override @@ -72,21 +73,23 @@ class PatientProfileButton extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - child: isDartIcon ? Icon( - dartIcon, size: 30, color: Color(0xFF333C45),) : new Image - .asset( - url + icon, - width: 30, - height: 30, - fit: BoxFit.contain, - ), + child: isDartIcon + ? Icon( + dartIcon, + size: 30, + color: Color(0xFF333C45), + ) + : new Image.asset( + url + icon, + width: 30, + height: 30, + fit: BoxFit.contain, + ), ) ], )), Container( - alignment: projectsProvider.isArabic - ? Alignment.topRight - : Alignment.topLeft, + alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, padding: EdgeInsets.symmetric(horizontal: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -144,7 +147,7 @@ class PatientProfileButton extends StatelessWidget { 'isInpatient': isInPatient, 'isDischargedPatient': isDischargedPatient, 'isSelectInpatient': isSelectInpatient, - "isFromLiveCare":isFromLiveCare + "isFromLiveCare": isFromLiveCare }); } } diff --git a/lib/widgets/patients/profile/Profile_general_info_Widget.dart b/lib/widgets/patients/profile/Profile_general_info_Widget.dart deleted file mode 100644 index e0eb5b12..00000000 --- a/lib/widgets/patients/profile/Profile_general_info_Widget.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:flutter/material.dart'; - -import './profile_general_info_content_widget.dart'; -import '../../../config/size_config.dart'; -import '../../shared/rounded_container_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:21/4/2020 - *@param: - *@return: ProfileGeneralInfoWidget - *@desc: Profile General Info Widget class - */ -class ProfileGeneralInfoWidget extends StatelessWidget { - ProfileGeneralInfoWidget({Key key, this.patient}) : super(key: key); - - PatiantInformtion patient; - - @override - Widget build(BuildContext context) { - // PatientsProvider patientsProv = Provider.of(context); - // patient = patientsProv.getSelectedPatient(); - return RoundedContainer( - child: ListView( - children: [ - ProfileGeneralInfoContentWidget( - title: "Age", - info: '${patient.age}', - ), - ProfileGeneralInfoContentWidget( - title: "Contact Number", - info: '${patient.mobileNumber}', - ), - ProfileGeneralInfoContentWidget( - title: "Email", - info: '${patient.emailAddress}', - ), - ], - ), - width: SizeConfig.screenWidth * 0.70, - height: SizeConfig.screenHeight * 0.25, - ); - } -} diff --git a/lib/widgets/patients/profile/add-order/addNewOrder.dart b/lib/widgets/patients/profile/add-order/addNewOrder.dart index 275888e3..56570bb1 100644 --- a/lib/widgets/patients/profile/add-order/addNewOrder.dart +++ b/lib/widgets/patients/profile/add-order/addNewOrder.dart @@ -3,8 +3,9 @@ import 'package:flutter/material.dart'; class AddNewOrder extends StatelessWidget { const AddNewOrder({ - Key key, - this.onTap, this.label, + Key? key, + required this.onTap, + required this.label, }) : super(key: key); final Function onTap; @@ -13,7 +14,7 @@ class AddNewOrder extends StatelessWidget { @override Widget build(BuildContext context) { return InkWell( - onTap: onTap, + onTap: onTap(), child: Container( width: double.maxFinite, height: 140, @@ -45,7 +46,7 @@ class AddNewOrder extends StatelessWidget { height: 10, ), AppText( - label ??'', + label ?? '', color: Colors.grey[600], fontWeight: FontWeight.w600, ) diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index 80f54e12..62c23c6a 100644 --- a/lib/widgets/patients/profile/large_avatar.dart +++ b/lib/widgets/patients/profile/large_avatar.dart @@ -5,8 +5,8 @@ import 'package:flutter/material.dart'; class LargeAvatar extends StatelessWidget { LargeAvatar( - {Key key, - this.name, + {Key? key, + required this.name, this.url, this.disableProfileView: false, this.radius = 60.0, @@ -15,23 +15,21 @@ class LargeAvatar extends StatelessWidget { : super(key: key); final String name; - final String url; + final String? url; final bool disableProfileView; final double radius; final double width; final double height; Widget _getAvatar() { - if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { + if (url != null && url!.isNotEmpty && Uri.parse(url!).isAbsolute) { return CircleAvatar( - radius: - SizeConfig.imageSizeMultiplier * 12, + radius: SizeConfig.imageSizeMultiplier * 12, // radius: (52) child: ClipRRect( - borderRadius:BorderRadius.circular(50), - + borderRadius: BorderRadius.circular(50), child: Image.network( - url, + url!, fit: BoxFit.fill, width: 700, ), @@ -67,19 +65,11 @@ class LargeAvatar extends StatelessWidget { }, child: Container( decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment(-1, -1), - end: Alignment(1, 1), - colors: [ - Colors.grey[100], - Colors.grey[800], - ]), - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], + gradient: LinearGradient(begin: Alignment(-1, -1), end: Alignment(1, 1), colors: [ + Colors.grey[100]!, + Colors.grey[800]!, + ]), + boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)], borderRadius: BorderRadius.all(Radius.circular(50.0)), ), width: width, diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index 49ad8f4e..b3915b2c 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -12,7 +12,6 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PatientPageHeaderWidget extends StatelessWidget { - final PatiantInformtion patient; PatientPageHeaderWidget(this.patient); @@ -22,10 +21,8 @@ class PatientPageHeaderWidget extends StatelessWidget { return BaseView( onModelReady: (model) async { - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: patient.patientMRN??patient.patientId, - doctorID: '', - editedBy: ''); + GeneralGetReqForSOAP generalGetReqForSOAP = + GeneralGetReqForSOAP(patientMRN: patient.patientMRN ?? patient.patientId, doctorID: '', editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); if (model.allergiesList.length == 0) { await model.getMasterLookup(MasterKeysService.Allergies); @@ -33,7 +30,6 @@ class PatientPageHeaderWidget extends StatelessWidget { if (model.allergySeverityList.length == 0) { await model.getMasterLookup(MasterKeysService.AllergySeverity); } - }, builder: (_, model, w) => Container( child: Column( @@ -47,9 +43,7 @@ class PatientPageHeaderWidget extends StatelessWidget { children: [ AvatarWidget( Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, + patient.genderDescription == "Male" ? DoctorApp.male : DoctorApp.female_icon, size: 70, color: Colors.white, ), @@ -66,7 +60,9 @@ class PatientPageHeaderWidget extends StatelessWidget { height: 5, ), AppText( - patient.patientDetails.fullName != null ? patient.patientDetails.fullName : patient.firstName, + patient.patientDetails!.fullName != null + ? patient.patientDetails!.fullName + : patient.firstName, color: Colors.black, fontWeight: FontWeight.bold, ), @@ -74,7 +70,7 @@ class PatientPageHeaderWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).age , + TranslationBase.of(context).age, color: Colors.black, fontWeight: FontWeight.bold, ), @@ -88,11 +84,15 @@ class PatientPageHeaderWidget extends StatelessWidget { ), ], ), - model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?AppText( - TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, - ) : AppText(''), + model.patientAllergiesList.isNotEmpty && + model.getAllergicNames(projectViewModel.isArabic) != '' + ? AppText( + TranslationBase.of(context).allergicTO ?? + "" + " : " + model.getAllergicNames(projectViewModel.isArabic), + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ) + : AppText(''), ], ), ) diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 995ac57a..39b5ed35 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -11,8 +11,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; import 'package:url_launcher/url_launcher.dart'; -class PatientProfileHeaderNewDesignAppBar extends StatelessWidget - with PreferredSizeWidget { +class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; @@ -21,16 +20,16 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final bool isDischargedPatient; final bool isFromLiveCare; - PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false, this.isFromLiveCare = false}); + PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType, + {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false}); @override Widget build(BuildContext context) { int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + gender = patient.patientDetails!.gender!; } else { - gender = patient.gender; + gender = patient.gender!; } return Container( padding: EdgeInsets.only( @@ -41,7 +40,11 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? isInpatient? 215:200 : height, + height: height == 0 + ? isInpatient + ? 215 + : 200 + : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), @@ -58,10 +61,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget Expanded( child: AppText( patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.fullName??patient.patientDetails.fullName), + ? (Helpers.capitalize(patient.firstName) + " " + Helpers.capitalize(patient.lastName)) + : Helpers.capitalize(patient.fullName ?? patient.patientDetails!.fullName), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -80,7 +81,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient.mobileNumber!); }, child: Icon( Icons.phone, @@ -97,9 +98,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget width: 60, height: 60, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -111,8 +110,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + SERVICES_PATIANT2[int.parse(patientType)] == "patientArrivalList" ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -132,19 +130,16 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget fontFamily: 'Poppins', fontSize: 12, ), - arrivalType == '1'|| patient.arrivedOn == null + arrivalType == '1' || patient.arrivedOn == null ? AppText( - patient.startTime != null - ? patient.startTime - : '', + patient.startTime != null ? patient.startTime : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) : AppText( patient.arrivedOn != null ? AppDateUtils.convertStringToDateFormat( - patient.arrivedOn, - 'MM-dd-yyyy HH:mm') + patient.arrivedOn ?? "", 'MM-dd-yyyy HH:mm') : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -152,15 +147,13 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ], )) : SizedBox(), - if (SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient" && !isFromLiveCare) + if (SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" && !isFromLiveCare) Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + - " : ", + TranslationBase.of(context).appointmentDate! + " : ", fontSize: 14, ), patient.startTime != null @@ -172,7 +165,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget color: HexColor("#20A169"), ), child: AppText( - patient.startTime??"", + patient.startTime ?? "", color: Colors.white, fontSize: 1.5 * SizeConfig.textMultiplier, textAlign: TextAlign.center, @@ -183,14 +176,13 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget SizedBox( width: 3.5, ), - Container( - child: AppText( - convertDateFormat2( - patient.appointmentDate ?? ''), - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), + Container( + child: AppText( + convertDateFormat2(patient.appointmentDate ?? ''), + fontSize: 1.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), + ), SizedBox( height: 0.5, ) @@ -205,27 +197,21 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget children: [ RichText( text: TextSpan( - style: TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black), + style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( text: TranslationBase.of(context).fileNumber, - style: TextStyle( - fontSize: 12, fontFamily: 'Poppins')), + style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), new TextSpan( text: patient.patientId.toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 14)), + style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 14)), ], ), ), Row( children: [ AppText( - patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '', + patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: 12, ), @@ -233,12 +219,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient.nationalityFlagURL ?? "", height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -257,18 +241,16 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age+ " : ", - style: TextStyle(fontSize: 14)), + text: TranslationBase.of(context).age! + " : ", style: TextStyle(fontSize: 14)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context,isServerFormat: !isFromLiveCare)}", - style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 14)), + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 14)), ], ), ), ), - if(isInpatient) + if (isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -276,27 +258,22 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, + fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black, fontFamily: 'Poppins', ), children: [ - new TextSpan( - text: patient.admissionDate == null - ? "" - : TranslationBase.of(context) - .admissionDate + - " : ", - style: TextStyle(fontSize: 14)), - new TextSpan( - text: patient.admissionDate == null - ? "" - : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 15)), - ]))), + new TextSpan( + text: patient.admissionDate == null + ? "" + : TranslationBase.of(context).admissionDate! + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: patient.admissionDate == null + ? "" + : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)), + ]))), if (patient.admissionDate != null) Row( children: [ @@ -304,14 +281,14 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget "${TranslationBase.of(context).numOfDays}: ", fontSize: 15, ), - if(isDischargedPatient && patient.dischargeDate!=null) - AppText( - "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", - fontSize: 15, - fontWeight: FontWeight.w700) + if (isDischargedPatient && patient.dischargeDate != null) + AppText( + "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate ?? "").difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate ?? "")).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700) else AppText( - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate ?? "")).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700), ], @@ -329,7 +306,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget } convertDateFormat2(String str) { - String newDate; + String? newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -337,8 +314,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final startIndex = str.indexOf(start); final endIndex = str.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); + var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex))); newDate = date.year.toString() + "/" + date.month.toString().padLeft(2, '0') + @@ -346,13 +322,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget date.day.toString().padLeft(2, '0'); } - return newDate??''; + return newDate ?? ''; } isToday(date) { DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); + return DateFormat("yyyy-MM-dd").format(tempDate) == DateFormat("yyyy-MM-dd").format(DateTime.now()); } myBoxDecoration() { diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index 1db29087..825d02a4 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -18,17 +18,16 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { final double height; final bool isHaveMargin; - PatientProfileHeaderNewDesign( - this.patient, this.patientType, this.arrivalType, - {this.height = 0.0, this.isHaveMargin=true}); + PatientProfileHeaderNewDesign(this.patient, this.patientType, this.arrivalType, + {this.height = 0.0, this.isHaveMargin = true}); @override Widget build(BuildContext context) { int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + gender = patient.patientDetails!.gender!; } else { - gender = patient.gender; + gender = patient.gender!; } return Container( @@ -57,10 +56,8 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { Expanded( child: AppText( patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.patientDetails.fullName), + ? (Helpers.capitalize(patient.firstName) + " " + Helpers.capitalize(patient.lastName)) + : Helpers.capitalize(patient.patientDetails!.fullName), fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -79,7 +76,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient.mobileNumber!); }, child: Icon( Icons.phone, @@ -96,9 +93,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { width: 60, height: 60, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -110,8 +105,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + SERVICES_PATIANT2[int.parse(patientType)] == "patientArrivalList" ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -133,29 +127,26 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { ), arrivalType == '1' || patient.arrivedOn == null ? AppText( - patient.startTime != null - ? patient.startTime - : '', + patient.startTime != null ? patient.startTime : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) : AppText( - AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.arrivedOn)), + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate(patient.arrivedOn ?? "")), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) ], )) : SizedBox(), - if (SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient") + if (SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient") Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + - " : ", + TranslationBase.of(context).appointmentDate! + " : ", fontSize: 14, ), patient.startTime != null @@ -180,8 +171,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { ), Container( child: AppText( - convertDateFormat2( - patient.appointmentDate.toString() ?? ''), + convertDateFormat2(patient.appointmentDate.toString() ?? ''), fontSize: 1.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -200,30 +190,21 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { children: [ RichText( text: TextSpan( - style: TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black), + style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( text: TranslationBase.of(context).fileNumber, - style: TextStyle( - fontSize: 12, fontFamily: 'Poppins')), + style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), new TextSpan( text: patient.patientId.toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 14)), + style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 14)), ], ), ), Row( children: [ AppText( - patient.nationalityName ?? - patient.nationality ?? - patient.nationalityId ?? - '', + patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: 12, ), @@ -231,12 +212,10 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient.nationalityFlagURL ?? "", height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -255,13 +234,11 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { ), children: [ new TextSpan( - text: TranslationBase.of(context).age + " : ", - style: TextStyle(fontSize: 14)), + text: TranslationBase.of(context).age! + " : ", style: TextStyle(fontSize: 14)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context)}", - style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 14)), + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context)}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 14)), ], ), ), @@ -277,7 +254,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { } convertDateFormat2(String str) { - String newDate; + String? newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -285,8 +262,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { final startIndex = str.indexOf(start); final endIndex = str.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); + var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex))); newDate = date.year.toString() + "/" + date.month.toString().padLeft(2, '0') + @@ -299,8 +275,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { isToday(date) { DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); + return DateFormat("yyyy-MM-dd").format(tempDate) == DateFormat("yyyy-MM-dd").format(DateTime.now()); } myBoxDecoration() { diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart deleted file mode 100644 index c3a8638f..00000000 --- a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart +++ /dev/null @@ -1,242 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/util/date-utils.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/shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; -import 'package:url_launcher/url_launcher.dart'; - -class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final double height; - - PatientProfileHeaderNewDesignInPatient( - this.patient, this.patientType, this.arrivalType, - {this.height = 0.0}); - - @override - Widget build(BuildContext context) { - int gender = 1; - if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; - } else { - gender = patient.gender; - } - - return Container( - padding: EdgeInsets.only( - left: 0, - right: 5, - bottom: 5, - ), - decoration: BoxDecoration( - color: Colors.white, - ), - height: height == 0 ? 200 : height, - child: Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - // margin: EdgeInsets.only(top: 50), - child: Column( - children: [ - Container( - padding: EdgeInsets.only(left: 12.0), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ), - Expanded( - child: AppText( - patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier * 2.2, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - ), - ), - gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 4), - child: InkWell( - onTap: () { - launch("tel://" + patient.mobileNumber); - }, - child: Icon( - Icons.phone, - color: Colors.black87, - ), - ), - ), - ]), - ), - Row(children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).fileNumber, - fontSize: 1.2 * SizeConfig.textMultiplier, - ), - AppText(patient.patientId.toString(), - fontSize: 1.4 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w700), - ], - ), - if(patient.admissionDate!=null) - Row( - children: [ - AppText( - AppDateUtils.convertDateFromServerFormat( - patient.admissionDate, "hh:mm a"), - fontWeight: FontWeight.bold, - fontSize: 1.4 * SizeConfig.textMultiplier, - ), - ], - ) - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - if(patient.admissionDate!=null) - Row( - children: [ - AppText( - "${TranslationBase.of(context).admissionDate}: ", - fontSize: 1.2 * SizeConfig.textMultiplier, - ), - AppText( - AppDateUtils.convertDateFromServerFormat( - patient.admissionDate, "dd MMM,yyyy"), - fontSize: 1.4 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w700), - ], - ), - Row( - children: [ - AppText( - patient.nationalityName ?? - patient.nationality ?? - patient.nationalityId ?? - '', - fontWeight: FontWeight.bold, - fontSize: 1.4 * SizeConfig.textMultiplier, - ), - patient.nationalityFlagURL != null - ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - patient.nationalityFlagURL, - height: 25, - width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { - return Text('No Image'); - }, - )) - : SizedBox() - ], - ) - ], - ), - if(patient.admissionDate!=null) - Row( - children: [ - AppText( - "${TranslationBase.of(context).numOfDays}: ", - fontSize: 1.2 * SizeConfig.textMultiplier, - ), - AppText( - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", - fontSize: 1.4 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w700), - ], - ), - ], - ), - ), - ]), - ], - ), - ), - ); - } - - convertDateFormat2(String str) { - String newDate; - const start = "/Date("; - if (str.isNotEmpty) { - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); - } - - return newDate.toString(); - } - - isToday(date) { - DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); - } - - myBoxDecoration() { - return BoxDecoration( - border: Border( - top: BorderSide( - color: Colors.green, - width: 5, - ), - ), - borderRadius: BorderRadius.circular(10)); - } -} diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart deleted file mode 100644 index f3e01316..00000000 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart +++ /dev/null @@ -1,507 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -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/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/util/date-utils.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/shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; -import 'package:provider/provider.dart'; -import 'package:url_launcher/url_launcher.dart'; - -import 'large_avatar.dart'; - -class PatientProfileHeaderWhitAppointment extends StatelessWidget { - - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final bool isPrescriptions; - final String clinic; - PatientProfileHeaderWhitAppointment( - {this.patient, - this.patientType, - this.arrivalType, - this.doctorName, - this.branch, - this.appointmentDate, - this.profileUrl, - this.invoiceNO, - this.orderNo, this.isPrescriptions = false, this.clinic}); - - @override - Widget build(BuildContext context) { - int gender = 1; - if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; - } else { - gender = patient.gender; - } - - ProjectViewModel projectViewModel = Provider.of(context); - return Container( - padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - color: Colors.white, - ), - //height: 300, - child: Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.only(left: 12.0), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ), - Expanded( - child: AppText( - patient.firstName != null ? - (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize( - patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier *2.2, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - ), - ), - gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 4), - child: InkWell( - onTap: () { - launch("tel://" + patient.mobileNumber); - }, - child: Icon( - Icons.phone, - color: Colors.black87, - ), - ), - ) - ]), - ), - Row(children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SERVICES_PATIANT2[ - int.parse(patientType)] == - "patientArrivalList" - ? Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - patient.patientStatusType == - 43 - ? AppText( - TranslationBase.of( - context) - .arrivedP, - color: Colors.green, - fontWeight: - FontWeight.bold, - fontFamily: - 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of( - context) - .notArrived, - color: - Colors.red[800], - fontWeight: - FontWeight.bold, - fontFamily: - 'Poppins', - fontSize: 12, - ), - arrivalType == '1' || patient.arrivedOn == null - ? AppText( - patient.startTime != - null - ? patient - .startTime - : '', - fontFamily: - 'Poppins', - fontWeight: - FontWeight.w600, - ) - : AppText( - AppDateUtils.convertStringToDateFormat( - patient - .arrivedOn, - 'MM-dd-yyyy HH:mm'), - fontFamily: - 'Poppins', - fontWeight: - FontWeight.w600, - ) - ], - )) - : SizedBox(), - if (SERVICES_PATIANT2[ - int.parse(patientType)] == - "List_MyOutPatient") - Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .appointmentDate + - " : ", - fontSize: 14, - ), - patient.startTime != null - ? Container( - height: 15, - width: 60, - decoration: - BoxDecoration( - borderRadius: - BorderRadius - .circular( - 25), - color: HexColor( - "#20A169"), - ), - child: AppText( - patient.startTime, - color: Colors.white, - fontSize: 1.5 * - SizeConfig - .textMultiplier, - textAlign: TextAlign - .center, - fontWeight: - FontWeight.bold, - ), - ) - : SizedBox(), - SizedBox( - width: 3.5, - ), - Container( - child: AppText( - convertDateFormat2(patient.appointmentDate.toString()?? ''), - fontSize: 1.5 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight.bold, - ), - ), - SizedBox( - height: 0.5, - ) - ], - ), - margin: EdgeInsets.only( - top: 8, - ), - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 1.6 * - SizeConfig - .textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: - TranslationBase.of( - context) - .fileNumber, - style: TextStyle( - fontSize: 12, - fontFamily: - 'Poppins')), - new TextSpan( - text: patient.patientId - .toString(), - style: TextStyle( - fontWeight: - FontWeight.w700, - fontFamily: - 'Poppins', - fontSize: 14)), - ], - ), - ), - Row( - children: [ - AppText( - patient.nationalityName ?? - patient.nationality??"", - fontWeight: FontWeight.bold, - fontSize: 12, - ), - patient.nationality != null - ? ClipRRect( - borderRadius: - BorderRadius - .circular( - 20.0), - child: Image.network( - patient.nationalityFlagURL, - height: 25, - width: 30, - errorBuilder: - (BuildContext - context, - Object - exception, - StackTrace - stackTrace) { - return Text( - 'No Image'); - }, - )) - : SizedBox() - ], - ) - ], - ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 1.6 * - SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .age + - " : ", - style: TextStyle( - fontSize: 14)), - new TextSpan( - text: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ??"": patient.dateofBirth??"", context)}", - style: TextStyle( - fontWeight: - FontWeight.w700, - fontSize: 14)), - ], - ), - ), - ), - ], - ), - ), - ]), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 30, - height: 30, - margin: EdgeInsets.only(left: projectViewModel.isArabic?10:85, right: projectViewModel.isArabic?85:10,top: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border( - bottom:BorderSide(color: Colors.grey[400],width: 2.5), - left: BorderSide(color: Colors.grey[400],width: 2.5), - ) - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.only(top: 10), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: LargeAvatar( - name: doctorName, - url: profileUrl, - ), - width: 25, - height: 25, - margin: EdgeInsets.only(top: 10), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - '${TranslationBase.of(context).dr}.$doctorName', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 14, - ), - if (orderNo != null && !isPrescriptions) - Row( - children: [ - AppText( - 'Order No:', - color: Colors.grey[800], - ), - AppText( - orderNo ?? '', - ) - ], - ), - if (invoiceNO != null && !isPrescriptions) - Row( - children: [ - AppText( - 'Invoice:', - color: Colors.grey[800], - ), - AppText( - invoiceNO, - ) - ], - ), - if(isPrescriptions) - Row( - children: [ - AppText( - 'Branch:', - color: Colors.grey[800], - ), - AppText( - branch?? '', - ) - ], - ), - if(isPrescriptions) - Row( - children: [ - AppText( - 'Clinic:', - color: Colors.grey[800], - ), - AppText( - clinic?? '', - ) - ], - ), - Row( - children: [ - AppText( - !isPrescriptions? 'Result Date:': 'Prescriptions Date', - color: Colors.grey[800], - ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', - ), - ) - ], - ) - ]), - ), - ), - - ], - ), - ), - ), - ], - ) - ], - ), - ), - ); - } - - convertDateFormat2(String str) { - String newDate =""; - const start = "/Date("; - const end = "+0300)"; - - if (str.isNotEmpty) { - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); - } - - return newDate.toString(); - } - - isToday(date) { - DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); - } - - myBoxDecoration() { - return BoxDecoration( - border: Border( - top: BorderSide( - color: Colors.green, - width: 5, - ), - ), - borderRadius: BorderRadius.circular(10)); - } -} diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 5d46e745..24f71be0 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -15,23 +15,22 @@ import 'package:url_launcher/url_launcher.dart'; import 'large_avatar.dart'; -class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget - with PreferredSizeWidget { - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; +class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with PreferredSizeWidget { + final PatiantInformtion? patient; + final String? patientType; + final String? arrivalType; + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; final bool isPrescriptions; final bool isMedicalFile; - final String episode; - final String vistDate; + final String? episode; + final String? vistDate; - final String clinic; + final String? clinic; PatientProfileHeaderWhitAppointmentAppBar( {this.patient, this.patientType, @@ -52,10 +51,10 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); int gender = 1; - if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + if (patient!.patientDetails! != null) { + gender = patient!.patientDetails!.gender!; } else { - gender = patient.gender; + gender = patient!.gender!; } return Container( @@ -80,11 +79,9 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), Expanded( child: AppText( - patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.fullName??patient?.patientDetails?.fullName??""), + patient!.firstName != null + ? (Helpers.capitalize(patient!.firstName) + " " + Helpers.capitalize(patient!.lastName)) + : Helpers.capitalize(patient!.fullName ?? patient?.patientDetails?.fullName ?? ""), fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -103,7 +100,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient?.mobileNumber??""); + launch("tel://" + patient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -120,9 +117,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget width: 60, height: 60, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -134,13 +129,12 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + SERVICES_PATIANT2[int.parse(patientType ?? "")] == "patientArrivalList" ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - patient.patientStatusType == 43 + patient!.patientStatusType == 43 ? AppText( TranslationBase.of(context).arrivedP, color: Colors.green, @@ -155,36 +149,31 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget fontFamily: 'Poppins', fontSize: 12, ), - arrivalType == '1' || patient.arrivedOn == null + arrivalType == '1' || patient!.arrivedOn == null ? AppText( - patient.startTime != null - ? patient.startTime - : '', + patient!.startTime != null ? patient!.startTime : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) : AppText( AppDateUtils.convertStringToDateFormat( - patient.arrivedOn, - 'MM-dd-yyyy HH:mm'), + patient!.arrivedOn ?? "", 'MM-dd-yyyy HH:mm'), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) ], )) : SizedBox(), - if (SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient") + if (SERVICES_PATIANT2[int.parse(patientType ?? "")] == "List_MyOutPatient") Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + - " : ", + TranslationBase.of(context).appointmentDate! + " : ", fontSize: 14, ), - patient.startTime != null + patient!.startTime != null ? Container( height: 15, width: 60, @@ -193,7 +182,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget color: HexColor("#20A169"), ), child: AppText( - patient.startTime ?? "", + patient!.startTime ?? "", color: Colors.white, fontSize: 1.5 * SizeConfig.textMultiplier, textAlign: TextAlign.center, @@ -206,8 +195,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), Container( child: AppText( - convertDateFormat2( - patient.appointmentDate.toString() ?? ''), + convertDateFormat2(patient!.appointmentDate.toString() ?? ''), fontSize: 1.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -226,42 +214,32 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget children: [ RichText( text: TextSpan( - style: TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black), + style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( text: TranslationBase.of(context).fileNumber, - style: TextStyle( - fontSize: 12, fontFamily: 'Poppins')), + style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), new TextSpan( text: patient?.patientId?.toString() ?? "", - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 14)), + style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 14)), ], ), ), Row( children: [ AppText( - patient.nationalityName ?? - patient.nationality ?? - "", + patient!.nationalityName ?? patient!.nationality ?? "", fontWeight: FontWeight.bold, fontSize: 12, ), - patient.nationality != null + patient!.nationality != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient?.nationalityFlagURL??"", + patient?.nationalityFlagURL ?? "", height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -280,13 +258,11 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age + " : ", - style: TextStyle(fontSize: 14)), + text: TranslationBase.of(context).age ?? "" + " : ", style: TextStyle(fontSize: 14)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}", - style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 14)), + "${AppDateUtils.getAgeByBirthday(patient!.patientDetails != null ? patient!.patientDetails!.dateofBirth! : patient!.dateofBirth!, context)}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 14)), ], ), ), @@ -302,14 +278,12 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget width: 30, height: 30, margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 85, - right: projectViewModel.isArabic ? 85 : 10, - top: 5), + left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5), decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border( - bottom: BorderSide(color: Colors.grey[400], width: 2.5), - left: BorderSide(color: Colors.grey[400], width: 2.5), + bottom: BorderSide(color: Colors.grey[400]!, width: 2.5), + left: BorderSide(color: Colors.grey[400]!, width: 2.5), )), ), Expanded( @@ -331,89 +305,72 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget flex: 5, child: Container( margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - '${TranslationBase.of(context).dr}$doctorName', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 9, - ), - if (orderNo != null && !isPrescriptions) - Row( - children: [ - AppText('Order No: ', - color: Colors.grey[800], - fontSize: 12), - AppText(orderNo ?? '', fontSize: 12) - ], - ), - if (invoiceNO != null && !isPrescriptions) - Row( - children: [ - AppText('Invoice: ', - color: Colors.grey[800], - fontSize: 12), - AppText(invoiceNO??"", fontSize: 12) - ], - ), - if (branch != null) - Row( - children: [ - AppText('Branch: ', - color: Colors.grey[800], - fontSize: 12), - AppText(branch ?? '', fontSize: 12) - ], - ), - - if (clinic != null) - Row( - children: [ - AppText('Clinic: ', - color: Colors.grey[800], - fontSize: 12), - AppText(clinic ?? '', fontSize: 12) - ], + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + AppText( + '${TranslationBase.of(context).dr}$doctorName', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 9, + ), + if (orderNo != null && !isPrescriptions) + Row( + children: [ + AppText('Order No: ', color: Colors.grey[800], fontSize: 12), + AppText(orderNo ?? '', fontSize: 12) + ], + ), + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + AppText('Invoice: ', color: Colors.grey[800], fontSize: 12), + AppText(invoiceNO ?? "", fontSize: 12) + ], + ), + if (branch != null) + Row( + children: [ + AppText('Branch: ', color: Colors.grey[800], fontSize: 12), + AppText(branch ?? '', fontSize: 12) + ], + ), + if (clinic != null) + Row( + children: [ + AppText('Clinic: ', color: Colors.grey[800], fontSize: 12), + AppText(clinic ?? '', fontSize: 12) + ], + ), + if (isMedicalFile && episode != null) + Row( + children: [ + AppText('Episode: ', color: Colors.grey[800], fontSize: 12), + AppText(episode ?? '', fontSize: 12) + ], + ), + if (isMedicalFile && vistDate != null) + Row( + children: [ + AppText('Visit Date: ', color: Colors.grey[800], fontSize: 12), + AppText(vistDate ?? '', fontSize: 12) + ], + ), + if (!isMedicalFile) + Row( + children: [ + Expanded( + child: AppText( + !isPrescriptions ? 'Result Date: ' : 'Prescriptions Date ', + color: Colors.grey[800], + fontSize: 12, ), - if (isMedicalFile && episode != null) - Row( - children: [ - AppText('Episode: ', - color: Colors.grey[800], - fontSize: 12), - AppText(episode ?? '', fontSize: 12) - ], - ), - if (isMedicalFile && vistDate != null) - Row( - children: [ - AppText('Visit Date: ', - color: Colors.grey[800], - fontSize: 12), - AppText(vistDate ?? '', fontSize: 12) - ], ), - if (!isMedicalFile) - Row( - children: [ - Expanded( - child: AppText( - !isPrescriptions - ? 'Result Date: ' - : 'Prescriptions Date ', - color: Colors.grey[800], - fontSize: 12, - ), - ), - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', - fontSize: 14, - ) - ], + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', + fontSize: 14, ) - ]), + ], + ) + ]), ), ), ], @@ -437,8 +394,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget final startIndex = str.indexOf(start); final endIndex = str.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); + var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex))); newDate = date.year.toString() + "/" + date.month.toString().padLeft(2, '0') + @@ -449,8 +405,6 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget return newDate.toString(); } - - @override Size get preferredSize => Size(double.maxFinite, 310); } diff --git a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart index 9d22962a..37a0d90a 100644 --- a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart @@ -13,8 +13,7 @@ import 'large_avatar.dart'; class PrescriptionInPatientWidget extends StatelessWidget { final List prescriptionReportForInPatientList; - PrescriptionInPatientWidget( - {Key key, this.prescriptionReportForInPatientList}); + PrescriptionInPatientWidget({Key? key, required this.prescriptionReportForInPatientList}); @override Widget build(BuildContext context) { @@ -28,8 +27,7 @@ class PrescriptionInPatientWidget extends StatelessWidget { Container( padding: EdgeInsets.all(40), decoration: BoxDecoration( - border: - Border.all(color: HexColor('#B8382C'), width: 4), + border: Border.all(color: HexColor('#B8382C'), width: 4), borderRadius: BorderRadius.all(Radius.circular(100))), child: IconButton( icon: Icon( @@ -56,19 +54,14 @@ class PrescriptionInPatientWidget extends StatelessWidget { ), )) : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, - SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), child: ListView.builder( itemCount: prescriptionReportForInPatientList.length, itemBuilder: (BuildContext context, int index) { return InkWell( onTap: () { - Navigator.of(context).pushNamed( - IN_PATIENT_PRESCRIPTIONS_DETAILS, - arguments: { - 'prescription': - prescriptionReportForInPatientList[index] - }); + Navigator.of(context).pushNamed(IN_PATIENT_PRESCRIPTIONS_DETAILS, + arguments: {'prescription': prescriptionReportForInPatientList[index]}); }, child: CardWithBgWidgetNew( widget: Column( @@ -77,34 +70,26 @@ class PrescriptionInPatientWidget extends StatelessWidget { Row( children: [ LargeAvatar( - name: - prescriptionReportForInPatientList[index] - .createdByName, + name: prescriptionReportForInPatientList[index].createdByName ?? "", radius: 10, width: 70, ), Expanded( child: Container( - margin: - EdgeInsets.only(left: 15, right: 15), + margin: EdgeInsets.only(left: 15, right: 15), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( '${prescriptionReportForInPatientList[index].createdByName}', - fontSize: - 2.5 * SizeConfig.textMultiplier, + fontSize: 2.5 * SizeConfig.textMultiplier, ), SizedBox( height: 8, ), - AppText( - '${prescriptionReportForInPatientList[index].itemDescription}', - fontSize: - 2.5 * SizeConfig.textMultiplier, - color: - Theme.of(context).primaryColor), + AppText('${prescriptionReportForInPatientList[index].itemDescription}', + fontSize: 2.5 * SizeConfig.textMultiplier, + color: Theme.of(context).primaryColor), SizedBox( height: 8, ), diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index bd40c3ca..3f117410 100644 --- a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart @@ -14,7 +14,7 @@ import 'large_avatar.dart'; class PrescriptionOutPatientWidget extends StatelessWidget { final List patientPrescriptionsList; - PrescriptionOutPatientWidget({Key key, this.patientPrescriptionsList}); + PrescriptionOutPatientWidget({Key? key, required this.patientPrescriptionsList}); @override Widget build(BuildContext context) { @@ -28,8 +28,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Container( padding: EdgeInsets.all(40), decoration: BoxDecoration( - border: - Border.all(color: HexColor('#B8382C'), width: 4), + border: Border.all(color: HexColor('#B8382C'), width: 4), borderRadius: BorderRadius.all(Radius.circular(100))), child: IconButton( icon: Icon( @@ -56,8 +55,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget { ), )) : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, - SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), child: ListView.builder( itemCount: patientPrescriptionsList.length, itemBuilder: (BuildContext context, int index) { @@ -66,10 +64,8 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Navigator.push( context, MaterialPageRoute( - builder: (context) => - OutPatientPrescriptionDetailsScreen( - prescriptionResModel: - patientPrescriptionsList[index], + builder: (context) => OutPatientPrescriptionDetailsScreen( + prescriptionResModel: patientPrescriptionsList[index], ), ), ); @@ -81,35 +77,27 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Row( children: [ LargeAvatar( - url: patientPrescriptionsList[index] - .doctorImageURL, - name: patientPrescriptionsList[index] - .doctorName, + url: patientPrescriptionsList[index].doctorImageURL, + name: patientPrescriptionsList[index].doctorName ?? "", radius: 10, width: 70, ), Expanded( child: Container( - margin: - EdgeInsets.only(left: 15, right: 15), + margin: EdgeInsets.only(left: 15, right: 15), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( '${patientPrescriptionsList[index].name}', - fontSize: - 2.5 * SizeConfig.textMultiplier, + fontSize: 2.5 * SizeConfig.textMultiplier, ), SizedBox( height: 8, ), - AppText( - '${patientPrescriptionsList[index].clinicDescription}', - fontSize: - 2.5 * SizeConfig.textMultiplier, - color: - Theme.of(context).primaryColor), + AppText('${patientPrescriptionsList[index].clinicDescription}', + fontSize: 2.5 * SizeConfig.textMultiplier, + color: Theme.of(context).primaryColor), SizedBox( height: 8, ), diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 53228bc2..656dfd73 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -6,8 +6,7 @@ class ProfileWelcomeWidget extends StatelessWidget { final Widget clinicWidget; final double height; final bool isClinic; - ProfileWelcomeWidget(this.clinicWidget, - {this.height = 150, this.isClinic = false}); + ProfileWelcomeWidget(this.clinicWidget, {this.height = 150, this.isClinic = false}); @override Widget build(BuildContext context) { @@ -27,24 +26,23 @@ class ProfileWelcomeWidget extends StatelessWidget { SizedBox( width: 20, ), - if(authenticationViewModel.doctorProfile!=null) - CircleAvatar( - // radius: (52) - child: ClipRRect( - borderRadius: BorderRadius.circular(20), - child: Image.network( - authenticationViewModel.doctorProfile.doctorImageURL, - fit: BoxFit.fill, - width: 75, - height: 75, + if (authenticationViewModel.doctorProfile != null) + CircleAvatar( + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(20), + child: Image.network( + authenticationViewModel.doctorProfile!.doctorImageURL ?? "", + fit: BoxFit.fill, + width: 75, + height: 75, + ), ), + backgroundColor: Colors.transparent, ), - backgroundColor: Colors.transparent, - ), SizedBox( height: 20, ), - ], )), ); diff --git a/lib/widgets/patients/profile/profile_general_info_content_widget.dart b/lib/widgets/patients/profile/profile_general_info_content_widget.dart deleted file mode 100644 index f5c70ae6..00000000 --- a/lib/widgets/patients/profile/profile_general_info_content_widget.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import '../../../config/size_config.dart'; -import '../../shared/app_texts_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:22/4/2020 - *@param: title, info - *@return:ProfileGeneralInfoContentWidget - *@desc: Profile General Info Content Widget - */ -class ProfileGeneralInfoContentWidget extends StatelessWidget { - String title; - String info; - - ProfileGeneralInfoContentWidget({this.title, this.info}); - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 14), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - AppText( - title, - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.w700, - color: HexColor('#58434F'), - ), - AppText( - info, - color: HexColor('#707070'), - fontSize: SizeConfig.textMultiplier * 2, - ) - ], - ), - ); - } -} diff --git a/lib/widgets/patients/profile/profile_header_widget.dart b/lib/widgets/patients/profile/profile_header_widget.dart deleted file mode 100644 index df958106..00000000 --- a/lib/widgets/patients/profile/profile_header_widget.dart +++ /dev/null @@ -1,39 +0,0 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import '../../../config/size_config.dart'; -import '../../shared/profile_image_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:21/4/2020 - *@param: - *@return: - *@desc: Profile Header Widget class - */ -class ProfileHeaderWidget extends StatelessWidget { - ProfileHeaderWidget({ - Key key, - this.patient - }) : super(key: key); - - PatiantInformtion patient; - - @override - Widget build(BuildContext context) { - // PatientsProvider patientsProv = Provider.of(context); - // patient = patientsProv.getSelectedPatient(); - return Container( - height: SizeConfig.heightMultiplier * 30, - child: ProfileImageWidget( - url: - "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", - name: patient.firstName + ' ' + patient.lastName, - des: patient.patientId.toString(), - height: SizeConfig.heightMultiplier * 17, - width: SizeConfig.heightMultiplier * 17, - color: HexColor('#58434F')), - ); - } -} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart deleted file mode 100644 index c5417d85..00000000 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ /dev/null @@ -1,184 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/routes.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class ProfileMedicalInfoWidget extends StatelessWidget { - final String from; - final String to; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final bool isInpatient; - - ProfileMedicalInfoWidget( - {Key key, - this.patient, - this.patientType, - this.arrivalType, - this.from, - this.to, this.isInpatient}); - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: HEALTH_SUMMARY, - nameLine1: "Health" ,//TranslationBase.of(context).medicalReport, - nameLine2: "Summary",//TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient:isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo!=null && patient.appointmentNo!=0) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo!=null && patient.appointmentNo!=0) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo!=null && patient.appointmentNo!=0) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - if (isInpatient) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - if (isInpatient) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - nameLine1:"Order", //"Text", - nameLine2: "Sheet", - icon: 'patient/Progress_notes.png'), - ], - ), - ); - } -} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart deleted file mode 100644 index 17feaf0a..00000000 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ /dev/null @@ -1,176 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/routes.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { - final String from; - final String to; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final bool isInpatient; - final bool isDischargedPatient; - - ProfileMedicalInfoWidgetInPatient( - {Key key, - this.patient, - this.patientType, - this.arrivalType, - this.from, - this.to, - this.isInpatient, - this.isDischargedPatient = false}); - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: HEALTH_SUMMARY, - nameLine1: "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: HEALTH_SUMMARY, - nameLine1: "Medical", //Health - //TranslationBase.of(context).medicalReport, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ), - ); - } -} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index ac33eb82..3e457a8d 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -8,27 +8,35 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class ProfileMedicalInfoWidgetSearch extends StatelessWidget { +class ProfileMedicalInfoWidgetSearch extends StatefulWidget { final String from; final String to; final PatiantInformtion patient; final String patientType; - final String arrivalType; - final bool isInpatient; - final bool isDischargedPatient; + final String? arrivalType; + final bool? isInpatient; + final bool? isDischargedPatient; ProfileMedicalInfoWidgetSearch( - {Key key, - this.patient, - this.patientType, + {Key? key, + required this.patient, + required this.patientType, this.arrivalType, - this.from, - this.to, + required this.from, + required this.to, this.isInpatient, this.isDischargedPatient}); - TabController _tabController; + + @override + _ProfileMedicalInfoWidgetSearchState createState() => _ProfileMedicalInfoWidgetSearchState(); +} + +class _ProfileMedicalInfoWidgetSearchState extends State + with SingleTickerProviderStateMixin { + late TabController _tabController; + void initState() { - _tabController = TabController(length: 2); + _tabController = TabController(length: 2, vsync: this); } void dispose() { @@ -41,7 +49,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { onModelReady: (model) async {}, builder: (_, model, w) => DefaultTabController( length: 2, - initialIndex: isInpatient ? 0 : 1, + initialIndex: widget.isInpatient! ? 0 : 1, child: SizedBox( height: MediaQuery.of(context).size.height * 1.0, width: double.infinity, @@ -98,81 +106,72 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { crossAxisCount: 3, children: [ PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", + from: widget.from, + to: widget.to, + nameLine1: TranslationBase.of(context).vital ?? "", + nameLine2: TranslationBase.of(context).signs ?? "", route: VITAL_SIGN_DETAILS, isInPatient: true, icon: 'patient/vital_signs.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: LAB_RESULT, isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context).lab ?? "", + nameLine2: TranslationBase.of(context).result ?? "", icon: 'patient/lab_results.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", + isInPatient: widget.isInpatient!, route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context).radiology ?? "", + nameLine2: TranslationBase.of(context).result ?? "", icon: 'patient/health_summary.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, + nameLine1: TranslationBase.of(context).patient!, + nameLine2: TranslationBase.of(context).prescription!, icon: 'patient/order_prescription.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, + isDischargedPatient: widget.isDischargedPatient!, + nameLine1: TranslationBase.of(context).progress ?? "", + nameLine2: TranslationBase.of(context).note ?? "", icon: 'patient/Progress_notes.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, + isDischargedPatient: widget.isDischargedPatient!, nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, + nameLine2: "Sheet", //TranslationBase.of(context).orders, icon: 'patient/Progress_notes.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, + nameLine1: TranslationBase.of(context).orders ?? "", + nameLine2: TranslationBase.of(context).procedures ?? "", icon: 'patient/Order_Procedures.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: HEALTH_SUMMARY, nameLine1: "Health", //TranslationBase.of(context).medicalReport, @@ -180,10 +179,9 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", isDisable: true, route: HEALTH_SUMMARY, nameLine1: "Medical", //Health @@ -192,42 +190,38 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: REFER_IN_PATIENT_TO_DOCTOR, isInPatient: true, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, + nameLine1: TranslationBase.of(context).referral ?? "", + nameLine2: TranslationBase.of(context).patient ?? "", icon: 'patient/refer_patient.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, + nameLine1: TranslationBase.of(context).insurance ?? "", + nameLine2: TranslationBase.of(context).approvals ?? "", icon: 'patient/vital_signs.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", isDisable: true, route: null, nameLine1: "Discharge", nameLine2: "Summery", icon: 'patient/patient_sick_leave.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, + nameLine1: TranslationBase.of(context).patientSick ?? "", + nameLine2: TranslationBase.of(context).leave ?? "", icon: 'patient/patient_sick_leave.png'), ], ), @@ -240,151 +234,129 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { crossAxisCount: 3, children: [ PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", + from: widget.from, + to: widget.to, + nameLine1: TranslationBase.of(context).vital ?? "", + nameLine2: TranslationBase.of(context).signs ?? "", route: VITAL_SIGN_DETAILS, icon: 'patient/vital_signs.png'), // if (selectedPatientType != 7) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: HEALTH_SUMMARY, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, + nameLine1: "Health", //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context).lab ?? "", + nameLine2: TranslationBase.of(context).result ?? "", icon: 'patient/lab_results.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", + isInPatient: widget.isInpatient!, route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, + nameLine1: TranslationBase.of(context).radiology ?? "", + nameLine2: TranslationBase.of(context).service ?? "", icon: 'patient/health_summary.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, + nameLine1: TranslationBase.of(context).patient ?? "", nameLine2: "ECG", icon: 'patient/patient_sick_leave.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, + nameLine1: TranslationBase.of(context).orders ?? "", + nameLine2: TranslationBase.of(context).prescription ?? "", icon: 'patient/order_prescription.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, + nameLine1: TranslationBase.of(context).orders ?? "", + nameLine2: TranslationBase.of(context).procedures ?? "", icon: 'patient/Order_Procedures.png'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, + nameLine1: TranslationBase.of(context).insurance ?? "", + nameLine2: TranslationBase.of(context).service ?? "", icon: 'patient/vital_signs.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, + nameLine1: TranslationBase.of(context).patientSick ?? "", + nameLine2: TranslationBase.of(context).leave ?? "", icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + if (widget.patient.appointmentNo != null && widget.patient.appointmentNo != 0) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, + isDisable: widget.patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient ?? "", + nameLine2: TranslationBase.of(context).ucaf ?? "", icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + if (widget.patient.appointmentNo != null && widget.patient.appointmentNo != 0) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, + isDisable: widget.patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral ?? "", + nameLine2: TranslationBase.of(context).patient ?? "", icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + if (widget.patient.appointmentNo != null && widget.patient.appointmentNo != 0) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, + isDisable: widget.patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission ?? "", + nameLine2: TranslationBase.of(context).request ?? "", icon: 'patient/admission_req.png'), - if (isInpatient) + if (widget.isInpatient!) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, + nameLine1: TranslationBase.of(context).progress ?? "", + nameLine2: TranslationBase.of(context).note ?? "", icon: 'patient/Progress_notes.png'), - if (isInpatient) + if (widget.isInpatient!) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ORDER_NOTE, nameLine1: "Order", //"Text", nameLine2: "Sheet", @@ -406,7 +378,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { // crossAxisCount: 3, // children: [ // PatientProfileButton( - // key: key, + // // patient: patient, // patientType: patientType, // arrivalType: arrivalType, diff --git a/lib/widgets/patients/profile/profile_status_info_widget.dart b/lib/widgets/patients/profile/profile_status_info_widget.dart index d616c36f..56ffdca3 100644 --- a/lib/widgets/patients/profile/profile_status_info_widget.dart +++ b/lib/widgets/patients/profile/profile_status_info_widget.dart @@ -5,8 +5,7 @@ import '../../../config/size_config.dart'; import '../../shared/app_texts_widget.dart'; import '../../shared/rounded_container_widget.dart'; - -/* +/* *@author: Elham Rababah *@Date:13/4/2020 *@param: @@ -15,7 +14,7 @@ import '../../shared/rounded_container_widget.dart'; */ class ProfileStatusInfoWidget extends StatelessWidget { const ProfileStatusInfoWidget({ - Key key, + Key? key, }) : super(key: key); @override diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index b8314b03..3426bcf2 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -12,7 +12,7 @@ class VitalSignDetailsWidget extends StatefulWidget { final String viewKey; VitalSignDetailsWidget( - {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); + {Key? key, required this.vitalList, required this.title1, required this.title2, required this.viewKey}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -24,10 +24,7 @@ class _VitalSignDetailsWidgetState extends State { return Container( decoration: BoxDecoration( color: Colors.transparent, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), - topRight: Radius.circular(10.0) - ), + borderRadius: BorderRadius.only(topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), border: Border.all(color: Colors.grey, width: 1), ), margin: EdgeInsets.all(20), @@ -38,7 +35,7 @@ class _VitalSignDetailsWidgetState extends State { children: [ Table( border: TableBorder.symmetric( - inside: BorderSide(width: 2.0,color: Colors.grey[300]), + inside: BorderSide(width: 2.0, color: Colors.grey[300]!), ), children: fullData(), ), @@ -48,7 +45,7 @@ class _VitalSignDetailsWidgetState extends State { ); } - List fullData(){ + List fullData() { List tableRow = []; tableRow.add(TableRow(children: [ Container( @@ -90,7 +87,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: AppText( - '${AppDateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${AppDateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + '${AppDateUtils.getWeekDay(vital.vitalSignDate!.weekday)}, ${vital.vitalSignDate!.day} ${AppDateUtils.getMonth(vital.vitalSignDate!.month)}, ${vital.vitalSignDate!.year} ', textAlign: TextAlign.center, ), ), @@ -112,5 +109,4 @@ class _VitalSignDetailsWidgetState extends State { }); return tableRow; } - } diff --git a/lib/widgets/shared/StarRating.dart b/lib/widgets/shared/StarRating.dart index f391e7bf..88b6a970 100644 --- a/lib/widgets/shared/StarRating.dart +++ b/lib/widgets/shared/StarRating.dart @@ -8,28 +8,19 @@ class StarRating extends StatelessWidget { final int totalCount; final bool forceStars; - StarRating( - {Key key, - this.totalAverage: 0.0, - this.size: 16.0, - this.totalCount = 5, - this.forceStars = false}) + StarRating({Key? key, this.totalAverage: 0.0, this.size: 16.0, this.totalCount = 5, this.forceStars = false}) : super(key: key); @override Widget build(BuildContext context) { return Row(mainAxisAlignment: MainAxisAlignment.start, children: [ - if (!forceStars && (totalAverage == null || totalAverage == 0)) - AppText("New", style: "caption"), + if (!forceStars && (totalAverage == null || totalAverage == 0)) AppText("New", style: "caption"), if (forceStars || (totalAverage != null && totalAverage > 0)) ...List.generate( 5, (index) => Padding( padding: EdgeInsets.only(right: 1.0), - child: Icon( - (index + 1) <= (totalAverage ?? 0) - ? EvaIcons.star - : EvaIcons.starOutline, + child: Icon((index + 1) <= (totalAverage ?? 0) ? EvaIcons.star : EvaIcons.starOutline, size: size, color: (index + 1) <= (totalAverage ?? 0) ? Color.fromRGBO(255, 186, 0, 1.0) diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index b13a4f10..7c7c9aba 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -17,7 +17,6 @@ import 'app_texts_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - class AppDrawer extends StatefulWidget { @override _AppDrawerState createState() => _AppDrawerState(); @@ -25,7 +24,7 @@ class AppDrawer extends StatefulWidget { class _AppDrawerState extends State { Helpers helpers = new Helpers(); - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { @@ -85,8 +84,8 @@ class _AppDrawerState extends State { Padding( padding: EdgeInsets.only(top: 10), child: AppText( - TranslationBase.of(context).dr + - authenticationViewModel.doctorProfile?.doctorName, + TranslationBase.of(context).dr ?? + "" + authenticationViewModel.doctorProfile!.doctorName!, fontWeight: FontWeight.bold, color: Color(0xFF2E303A), fontFamily: 'Poppins', @@ -108,7 +107,7 @@ class _AppDrawerState extends State { SizedBox(height: 40), InkWell( child: DrawerItem( - TranslationBase.of(context).applyOrRescheduleLeave, + TranslationBase.of(context).applyOrRescheduleLeave!, icon: DoctorApp.reschedule__1, // subTitle: , ), @@ -125,7 +124,7 @@ class _AppDrawerState extends State { SizedBox(height: 15), InkWell( child: DrawerItem( - TranslationBase.of(context).myQRCode, + TranslationBase.of(context).myQRCode!, icon: DoctorApp.qr_code_3, // subTitle: , ), @@ -151,8 +150,8 @@ class _AppDrawerState extends State { InkWell( child: DrawerItem( projectsProvider.isArabic - ? TranslationBase.of(context).lanEnglish - : TranslationBase.of(context).lanArabic, + ? TranslationBase.of(context).lanEnglish ?? "" + : TranslationBase.of(context).lanArabic ?? "", // icon: DoctorApp.qr_code, assetLink: projectsProvider.isArabic ? 'assets/images/usa-flag.png' @@ -168,13 +167,12 @@ class _AppDrawerState extends State { SizedBox(height: 10), InkWell( child: DrawerItem( - TranslationBase.of(context).logout, + TranslationBase.of(context).logout!, icon: DoctorApp.logout_1, ), onTap: () async { Navigator.pop(context); await authenticationViewModel.logout(isFromLogin: false); - }, ), ], diff --git a/lib/widgets/shared/app_expandable_notifier.dart b/lib/widgets/shared/app_expandable_notifier.dart deleted file mode 100644 index 76a7f57e..00000000 --- a/lib/widgets/shared/app_expandable_notifier.dart +++ /dev/null @@ -1,58 +0,0 @@ -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:expandable/expandable.dart'; -import 'package:flutter/material.dart'; - -class AppExpandableNotifier extends StatelessWidget { - final Widget headerWid; - final Widget bodyWid; - - AppExpandableNotifier({this.headerWid, this.bodyWid}); - - @override - Widget build(BuildContext context) { - return ExpandableNotifier( - child: Padding( - padding: const EdgeInsets.all(10), - child: Card( - clipBehavior: Clip.antiAlias, - child: Column( - children: [ - SizedBox( - child: headerWid, - ), - ScrollOnExpand( - scrollOnExpand: true, - scrollOnCollapse: false, - child: ExpandablePanel( - theme: const ExpandableThemeData( - headerAlignment: ExpandablePanelHeaderAlignment.center, - tapBodyToCollapse: true, - ), - header: Padding( - padding: EdgeInsets.all(10), - child: Text( - "${TranslationBase.of(context).graphDetails}", - style: TextStyle(fontWeight: FontWeight.bold), - )), - collapsed: Text(''), - expanded: bodyWid, - builder: (_, collapsed, expanded) { - return Padding( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - child: Expandable( - collapsed: collapsed, - expanded: expanded, - theme: const ExpandableThemeData(crossFadePoint: 0), - ), - ); - }, - ), - ), - ], - ), - ), - ), - initialExpanded: true, - ); - } -} diff --git a/lib/widgets/shared/app_expandable_notifier_new.dart b/lib/widgets/shared/app_expandable_notifier_new.dart deleted file mode 100644 index 1e825b6c..00000000 --- a/lib/widgets/shared/app_expandable_notifier_new.dart +++ /dev/null @@ -1,127 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:expandable/expandable.dart'; -import 'package:flutter/material.dart'; - - -/// App Expandable Notifier with animation -/// [headerWidget] widget want to show in the header -/// [bodyWidget] widget want to show in the body -/// [title] the widget title -/// [collapsed] The widget shown in the collapsed state -class AppExpandableNotifier extends StatefulWidget { - final Widget headerWidget; - final Widget bodyWidget; - final String title; - final Widget collapsed; - final bool isExpand; - bool expandFlag = false; - var controller = new ExpandableController(); - AppExpandableNotifier( - {this.headerWidget, - this.bodyWidget, - this.title, - this.collapsed, - this.isExpand = false}); - - _AppExpandableNotifier createState() => _AppExpandableNotifier(); -} - -class _AppExpandableNotifier extends State { - - @override - void initState() { - setState(() { - if (widget.isExpand) { - widget.expandFlag = widget.isExpand; - widget.controller.expanded = true; - } - }); - super.initState(); - } - - @override - Widget build(BuildContext context) { - - return ExpandableNotifier( - child: Padding( - padding: const EdgeInsets.only(left: 10, right: 10, top: 4), - child: Card( - color: Colors.grey[200], - clipBehavior: Clip.antiAlias, - child: Column( - children: [ - SizedBox( - child: widget.headerWidget, - ), - ScrollOnExpand( - scrollOnExpand: true, - scrollOnCollapse: false, - child: ExpandablePanel( - // hasIcon: false, - theme: const ExpandableThemeData( - headerAlignment: ExpandablePanelHeaderAlignment.center, - tapBodyToCollapse: true, - ), - header: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.all(10), - child: Text( - widget.title ?? TranslationBase.of(context).details, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2, - ), - ), - ), - ), - IconButton( - icon: new Container( - height: 28.0, - width: 30.0, - decoration: new BoxDecoration( - color: Theme.of(context).primaryColor, - shape: BoxShape.circle, - ), - child: new Center( - child: new Icon( - widget.expandFlag - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.white, - size: 30.0, - ), - ), - ), - onPressed: () { - setState(() { - widget.expandFlag = !widget.expandFlag; - widget.controller.expanded = widget.expandFlag; - }); - }), - ]), - collapsed: widget.collapsed ?? Container(), - expanded: widget.bodyWidget, - builder: (_, collapsed, expanded) { - return Padding( - padding: EdgeInsets.only(left: 5, right: 5, bottom: 5), - child: Expandable( - controller: widget.controller, - collapsed: collapsed, - expanded: expanded, - theme: const ExpandableThemeData(crossFadePoint: 0), - ), - ); - }, - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/app_loader_widget.dart b/lib/widgets/shared/app_loader_widget.dart index 4b6d753b..789f1cd2 100644 --- a/lib/widgets/shared/app_loader_widget.dart +++ b/lib/widgets/shared/app_loader_widget.dart @@ -4,30 +4,27 @@ import 'package:progress_hud_v2/progress_hud.dart'; import 'loader/gif_loader_container.dart'; class AppLoaderWidget extends StatefulWidget { - AppLoaderWidget({Key key, this.title, this.containerColor}) : super(key: key); + AppLoaderWidget({Key? key, this.title, this.containerColor}) : super(key: key); - final String title; - final Color containerColor; + final String? title; + final Color? containerColor; @override _AppLoaderWidgetState createState() => new _AppLoaderWidgetState(); } class _AppLoaderWidgetState extends State { - - @override Widget build(BuildContext context) { return Container( height: MediaQuery.of(context).size.height, - child: Stack( children: [ Container( - color: widget.containerColor??Colors.grey.withOpacity(0.6), + color: widget.containerColor ?? Colors.grey.withOpacity(0.6), ), - Container(child: GifLoaderContainer(), margin: EdgeInsets.only( - bottom: MediaQuery.of(context).size.height * 0.09)) + Container( + child: GifLoaderContainer(), margin: EdgeInsets.only(bottom: MediaQuery.of(context).size.height * 0.09)) ], ), ); diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index e957b5d4..7500145d 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -12,14 +12,14 @@ import 'network_base_view.dart'; class AppScaffold extends StatelessWidget { final String appBarTitle; - final Widget body; + final Widget? body; final bool isLoading; final bool isShowAppBar; - final BaseViewModel baseViewModel; - final Widget bottomSheet; - final Color backgroundColor; - final Widget appBar; - final String subtitle; + final BaseViewModel? baseViewModel; + final Widget? bottomSheet; + final Color? backgroundColor; + final PreferredSizeWidget? appBar; + final String? subtitle; final bool isHomeIcon; AppScaffold( {this.appBarTitle = '', @@ -30,7 +30,8 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - this.appBar, this.subtitle}); + this.appBar, + this.subtitle}); @override Widget build(BuildContext context) { @@ -56,8 +57,11 @@ class AppScaffold extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Text(appBarTitle.toUpperCase()), - if(subtitle!=null) - Text(subtitle,style: TextStyle(fontSize: 12,color: Colors.red),), + if (subtitle != null) + Text( + subtitle!, + style: TextStyle(fontSize: 12, color: Colors.red), + ), ], ), leading: Builder(builder: (BuildContext context) { @@ -73,8 +77,7 @@ class AppScaffold extends StatelessWidget { ? IconButton( icon: Icon(DoctorApp.home_icon_active), color: Colors.black, //Colors.black, - onPressed: () => Navigator.pushNamedAndRemoveUntil( - context, HOME, (r) => false), + onPressed: () => Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false), ) : SizedBox() ], @@ -87,8 +90,7 @@ class AppScaffold extends StatelessWidget { baseViewModel: baseViewModel, child: body, ) - : Stack( - children: [body, buildAppLoaderWidget(isLoading)]) + : Stack(children: [body!, buildAppLoaderWidget(isLoading)]) : Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 48661a32..ff9e8e4a 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -4,31 +4,31 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class AppText extends StatefulWidget { - final String text; - final String variant; - final Color color; - final FontWeight fontWeight; - final double fontSize; - final double fontHeight; - final String fontFamily; - final int maxLength; - final bool italic; - final double margin; - final double marginTop; - final double marginRight; - final double marginBottom; - final double marginLeft; - final TextAlign textAlign; - final bool bold; - final bool regular; - final bool medium; - final int maxLines; - final bool readMore; - final String style; - final bool allowExpand; - final bool visibility; - final TextOverflow textOverflow; - final TextDecoration textDecoration; + final String? text; + final String? variant; + final Color? color; + final FontWeight? fontWeight; + final double? fontSize; + final double? fontHeight; + final String? fontFamily; + final int? maxLength; + final bool? italic; + final double? margin; + final double? marginTop; + final double? marginRight; + final double? marginBottom; + final double? marginLeft; + final TextAlign? textAlign; + final bool? bold; + final bool? regular; + final bool? medium; + final int? maxLines; + final bool? readMore; + final String? style; + final bool? allowExpand; + final bool? visibility; + final TextOverflow? textOverflow; + final TextDecoration? textDecoration; AppText( this.text, { @@ -70,9 +70,9 @@ class _AppTextState extends State { void didUpdateWidget(covariant AppText oldWidget) { setState(() { if (widget.style == "overline") - text = widget.text.toUpperCase(); + text = widget.text!.toUpperCase(); else { - text = widget.text; + text = widget.text!; } }); super.didUpdateWidget(oldWidget); @@ -80,11 +80,11 @@ class _AppTextState extends State { @override void initState() { - hidden = widget.readMore; + hidden = widget.readMore!; if (widget.style == "overline") - text = widget.text.toUpperCase(); + text = widget.text!.toUpperCase(); else { - text = widget.text; + text = widget.text!; } super.initState(); } @@ -93,12 +93,12 @@ class _AppTextState extends State { Widget build(BuildContext context) { return Container( margin: widget.margin != null - ? EdgeInsets.all(widget.margin) + ? EdgeInsets.all(widget.margin!) : EdgeInsets.only( - top: widget.marginTop, - right: widget.marginRight, - bottom: widget.marginBottom, - left: widget.marginLeft), + top: widget.marginTop!, + right: widget.marginRight!, + bottom: widget.marginBottom!, + left: widget.marginLeft!), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -106,60 +106,45 @@ class _AppTextState extends State { Stack( children: [ Text( - !hidden - ? text - : (text.substring( - 0, - text.length > widget.maxLength - ? widget.maxLength - : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)), textAlign: widget.textAlign, overflow: widget.maxLines != null - ? ((widget.maxLines > 1) - ? TextOverflow.fade - : TextOverflow.ellipsis) + ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, style: widget.style != null ? _getFontStyle().copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( - fontStyle: widget.italic ? FontStyle.italic : null, - color: - widget.color != null ? widget.color : Colors.black, + fontStyle: widget.italic! ? FontStyle.italic : null, + color: widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), - letterSpacing: - widget.variant == "overline" ? 1.5 : null, + letterSpacing: widget.variant == "overline" ? 1.5 : null, fontWeight: widget.fontWeight ?? _getFontWeight(), fontFamily: widget.fontFamily ?? 'Poppins', decoration: widget.textDecoration, height: widget.fontHeight), ), - if (widget.readMore && text.length > widget.maxLength && hidden) + if (widget.readMore! && text.length > widget.maxLength! && hidden) Positioned( bottom: 0, left: 0, right: 0, child: Container( decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - Theme.of(context).backgroundColor, - Theme.of(context).backgroundColor.withOpacity(0), - ], - begin: Alignment.bottomCenter, - end: Alignment.topCenter)), + gradient: LinearGradient(colors: [ + Theme.of(context).backgroundColor, + Theme.of(context).backgroundColor.withOpacity(0), + ], begin: Alignment.bottomCenter, end: Alignment.topCenter)), height: 30, ), ) ], ), - if (widget.allowExpand && - widget.readMore && - text.length > widget.maxLength) + if (widget.allowExpand! && widget.readMore! && text.length > widget.maxLength!) Padding( padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), child: InkWell( @@ -184,27 +169,27 @@ class _AppTextState extends State { TextStyle _getFontStyle() { switch (widget.style) { case "headline2": - return Theme.of(context).textTheme.headline2; + return Theme.of(context).textTheme.headline2!; case "headline3": - return Theme.of(context).textTheme.headline3; + return Theme.of(context).textTheme.headline3!; case "headline4": - return Theme.of(context).textTheme.headline4; + return Theme.of(context).textTheme.headline4!; case "headline5": - return Theme.of(context).textTheme.headline5; + return Theme.of(context).textTheme.headline5!; case "headline6": - return Theme.of(context).textTheme.headline6; + return Theme.of(context).textTheme.headline6!; case "bodyText2": - return Theme.of(context).textTheme.bodyText2; + return Theme.of(context).textTheme.bodyText2!; case "bodyText_15": - return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0); + return Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: 15.0); case "bodyText1": - return Theme.of(context).textTheme.bodyText1; + return Theme.of(context).textTheme.bodyText1!; case "caption": - return Theme.of(context).textTheme.caption; + return Theme.of(context).textTheme.caption!; case "overline": - return Theme.of(context).textTheme.overline; + return Theme.of(context).textTheme.overline!; case "button": - return Theme.of(context).textTheme.button; + return Theme.of(context).textTheme.button!; default: return TextStyle(); } @@ -289,7 +274,7 @@ class _AppTextState extends State { return FontWeight.w500; } } else { - return null; + return FontWeight.normal; } } } diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index dd64958a..04a83c3f 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -8,7 +8,7 @@ import 'bottom_navigation_item.dart'; class BottomNavBar extends StatefulWidget { final ValueChanged changeIndex; final int index; - BottomNavBar({Key key, this.changeIndex, this.index}) : super(key: key); + BottomNavBar({Key? key, required this.changeIndex, required this.index}) : super(key: key); @override _BottomNavBarState createState() => _BottomNavBarState(); diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index e69ff690..4a20864b 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -2,20 +2,15 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class BottomNavigationItem extends StatelessWidget { - final IconData icon; - final IconData activeIcon; + final IconData? icon; + final IconData? activeIcon; final ValueChanged changeIndex; - final int index; + final int? index; final int currentIndex; - final String name; + final String? name; BottomNavigationItem( - {this.icon, - this.activeIcon, - this.changeIndex, - this.index, - this.currentIndex, - this.name}); + {this.icon, this.activeIcon, required this.changeIndex, this.index, required this.currentIndex, this.name}); @override Widget build(BuildContext context) { @@ -32,22 +27,21 @@ class BottomNavigationItem extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - SizedBox(height: 15,), + SizedBox( + height: 15, + ), Container( child: Icon(currentIndex == index ? activeIcon : icon, - color: currentIndex == index - ? Color(0xFF333C45) - : Theme.of(context).dividerColor, - size: 22.0), + color: currentIndex == index ? Color(0xFF333C45) : Theme.of(context).dividerColor, size: 22.0), + ), + SizedBox( + height: 5, ), - SizedBox(height: 5,), Expanded( child: Text( - name, + name ?? "", style: TextStyle( - color: currentIndex == index - ? Theme.of(context).primaryColor - : Theme.of(context).dividerColor, + color: currentIndex == index ? Theme.of(context).primaryColor : Theme.of(context).dividerColor, ), ), ), diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index ed3e6e98..682be89b 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -6,22 +6,22 @@ import 'package:hexcolor/hexcolor.dart'; import '../app_texts_widget.dart'; class AppButton extends StatefulWidget { - final GestureTapCallback onPressed; - final String title; - final IconData iconData; - final Widget icon; - final Color color; - final double fontSize; - final double padding; - final Color fontColor; - final bool loading; - final bool disabled; - final FontWeight fontWeight; - final bool hasBorder; - final Color borderColor; - final double radius; - final double vPadding; - final double hPadding; + final GestureTapCallback? onPressed; + final String? title; + final IconData? iconData; + final Widget? icon; + final Color? color; + final double? fontSize; + final double? padding; + final Color? fontColor; + final bool? loading; + final bool? disabled; + final FontWeight? fontWeight; + final bool? hasBorder; + final Color? borderColor; + final double? radius; + final double? vPadding; + final double? hPadding; AppButton({ @required this.onPressed, @@ -51,18 +51,20 @@ class _AppButtonState extends State { return Container( // height: MediaQuery.of(context).size.height * 0.075, child: IgnorePointer( - ignoring: widget.loading ||widget.disabled, + ignoring: widget.loading! || widget.disabled!, child: RawMaterialButton( - fillColor: widget.disabled - ? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"), + fillColor: widget.disabled! + ? Colors.grey + : widget.color != null + ? widget.color + : HexColor("#B8382C"), splashColor: widget.color, child: Padding( - padding: (widget.hPadding > 0 || widget.vPadding > 0) - ? EdgeInsets.symmetric( - vertical: widget.vPadding, horizontal: widget.hPadding) + padding: (widget.hPadding! > 0 || widget.vPadding! > 0) + ? EdgeInsets.symmetric(vertical: widget.vPadding!, horizontal: widget.hPadding!) : EdgeInsets.only( - top: widget.padding, - bottom: widget.padding, + top: widget.padding!, + bottom: widget.padding!, //right: SizeConfig.widthMultiplier * widget.padding, //left: SizeConfig.widthMultiplier * widget.padding ), @@ -70,8 +72,7 @@ class _AppButtonState extends State { mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, children: [ - if (widget.icon != null) - Container(width: 25, height: 25, child: widget.icon), + if (widget.icon != null) Container(width: 25, height: 25, child: widget.icon), if (widget.iconData != null) Icon( widget.iconData, @@ -81,7 +82,7 @@ class _AppButtonState extends State { SizedBox( width: 5.0, ), - widget.loading + widget.loading! ? Padding( padding: EdgeInsets.all(2.6), child: SizedBox( @@ -90,7 +91,7 @@ class _AppButtonState extends State { child: CircularProgressIndicator( backgroundColor: Colors.white, valueColor: AlwaysStoppedAnimation( - Colors.grey[300], + Colors.grey[300]!, ), ), ), @@ -99,22 +100,24 @@ class _AppButtonState extends State { child: AppText( widget.title, color: widget.fontColor, - fontSize: SizeConfig.textMultiplier * widget.fontSize, + fontSize: SizeConfig.textMultiplier * widget.fontSize!, fontWeight: widget.fontWeight, ), ), ], ), ), - onPressed: widget.disabled ? (){} : widget.onPressed, + onPressed: widget.disabled! ? () {} : widget.onPressed, shape: RoundedRectangleBorder( side: BorderSide( - color: - widget.hasBorder ? widget.borderColor : widget.disabled - ? Colors.grey : widget.color ?? Color(0xFFB8382C), + color: widget.hasBorder! + ? widget.borderColor! + : widget.disabled! + ? Colors.grey + : widget.color ?? Color(0xFFB8382C), width: 0.8, ), - borderRadius: BorderRadius.all(Radius.circular(widget.radius))), + borderRadius: BorderRadius.all(Radius.circular(widget.radius!))), ), ), ); diff --git a/lib/widgets/shared/buttons/button_bottom_sheet.dart b/lib/widgets/shared/buttons/button_bottom_sheet.dart index 3c5cc32d..883a6a9b 100644 --- a/lib/widgets/shared/buttons/button_bottom_sheet.dart +++ b/lib/widgets/shared/buttons/button_bottom_sheet.dart @@ -3,25 +3,25 @@ import 'package:flutter/material.dart'; import 'app_buttons_widget.dart'; class ButtonBottomSheet extends StatelessWidget { + final GestureTapCallback? onPressed; + final String? title; + final IconData? iconData; + final Widget? icon; + final Color? color; + final double? fontSize; + final double? padding; + final Color? fontColor; + final bool? loading; + final bool? disabled; + final FontWeight? fontWeight; + final bool? hasBorder; + final Color? borderColor; + final double? radius; + final double? vPadding; + final double? hPadding; - final GestureTapCallback onPressed; - final String title; - final IconData iconData; - final Widget icon; - final Color color; - final double fontSize; - final double padding; - final Color fontColor; - final bool loading; - final bool disabled; - final FontWeight fontWeight; - final bool hasBorder; - final Color borderColor; - final double radius; - final double vPadding; - final double hPadding; - - ButtonBottomSheet({@required this.onPressed, + ButtonBottomSheet({ + @required this.onPressed, this.title, this.iconData, this.icon, @@ -36,7 +36,8 @@ class ButtonBottomSheet extends StatelessWidget { this.hPadding = 0, this.radius = 8.0, this.hasBorder = false, - this.borderColor,}); + this.borderColor, + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/buttons/secondary_button.dart b/lib/widgets/shared/buttons/secondary_button.dart index 48c65baf..320f4402 100644 --- a/lib/widgets/shared/buttons/secondary_button.dart +++ b/lib/widgets/shared/buttons/secondary_button.dart @@ -15,7 +15,7 @@ import 'package:provider/provider.dart'; /// [noBorderRadius] remove border radius class SecondaryButton extends StatefulWidget { SecondaryButton( - {Key key, + {Key? key, this.label = "", this.icon, this.iconOnly = false, @@ -30,12 +30,12 @@ class SecondaryButton extends StatefulWidget { : super(key: key); final String label; - final Widget icon; - final VoidCallback onTap; + final Widget? icon; + final VoidCallback? onTap; final bool loading; - final Color color; + final Color? color; final Color textColor; - final Color borderColor; + final Color? borderColor; final bool small; final bool iconOnly; final bool disabled; @@ -45,15 +45,14 @@ class SecondaryButton extends StatefulWidget { _SecondaryButtonState createState() => _SecondaryButtonState(); } -class _SecondaryButtonState extends State - with TickerProviderStateMixin { +class _SecondaryButtonState extends State with TickerProviderStateMixin { double _buttonSize = 1.0; - AnimationController _animationController; - Animation _animation; + late AnimationController _animationController; + late Animation _animation; double _rippleSize = 0.0; - AnimationController _rippleController; - Animation _rippleAnimation; + late AnimationController _rippleController; + late Animation _rippleAnimation; @override void initState() { @@ -62,28 +61,19 @@ class _SecondaryButtonState extends State _rippleSize = 1.0; }); } - _animationController = AnimationController( - vsync: this, - lowerBound: 0.7, - upperBound: 1.0, - duration: Duration(milliseconds: 120)); - _animation = CurvedAnimation( - parent: _animationController, - curve: Curves.easeOutQuad, - reverseCurve: Curves.easeOutQuad); + _animationController = + AnimationController(vsync: this, lowerBound: 0.7, upperBound: 1.0, duration: Duration(milliseconds: 120)); + _animation = + CurvedAnimation(parent: _animationController, curve: Curves.easeOutQuad, reverseCurve: Curves.easeOutQuad); _animation.addListener(() { setState(() { _buttonSize = _animation.value; }); }); - _rippleController = AnimationController( - vsync: this, - lowerBound: 0.0, - upperBound: 1.0, - duration: Duration(seconds: 1)); - _rippleAnimation = CurvedAnimation( - parent: _rippleController, curve: Curves.easeInOutQuint); + _rippleController = + AnimationController(vsync: this, lowerBound: 0.0, upperBound: 1.0, duration: Duration(seconds: 1)); + _rippleAnimation = CurvedAnimation(parent: _rippleController, curve: Curves.easeInOutQuint); _rippleAnimation.addListener(() { setState(() { _rippleSize = _rippleAnimation.value; @@ -102,8 +92,7 @@ class _SecondaryButtonState extends State Widget _buildIcon() { if (widget.icon != null && (widget.label != null && widget.label != "")) { return Container(height: 25.0, child: widget.icon); - } else if (widget.icon != null && - (widget.label == null || widget.label == "")) { + } else if (widget.icon != null && (widget.label == null || widget.label == "")) { return Container(height: 25.0, width: 25, child: widget.icon); } else { return Container(); @@ -142,7 +131,7 @@ class _SecondaryButtonState extends State _animationController.forward(); }, onTap: () => { - widget.disabled ? null : widget.onTap(), + widget.disabled ? null : widget.onTap!(), }, // onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context), behavior: HitTestBehavior.opaque, @@ -151,16 +140,12 @@ class _SecondaryButtonState extends State child: Container( decoration: BoxDecoration( border: widget.borderColor != null - ? Border.all( - color: widget.borderColor.withOpacity(0.1), width: 2.0) + ? Border.all(color: widget.borderColor!.withOpacity(0.1), width: 2.0) : null, borderRadius: BorderRadius.all(Radius.circular(100.0)), boxShadow: [ BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.04), - spreadRadius: -0.0, - offset: Offset(0, 4.0), - blurRadius: 18.0) + color: Color.fromRGBO(0, 0, 0, 0.04), spreadRadius: -0.0, offset: Offset(0, 4.0), blurRadius: 18.0) ], ), child: ClipRRect( @@ -176,9 +161,7 @@ class _SecondaryButtonState extends State width: MediaQuery.of(context).size.width, height: 100, decoration: BoxDecoration( - color: widget.disabled - ? Colors.grey - : widget.color ?? Theme.of(context).buttonColor), + color: widget.disabled ? Colors.grey : widget.color ?? Theme.of(context).buttonColor), ), ), Positioned( @@ -191,9 +174,7 @@ class _SecondaryButtonState extends State height: MediaQuery.of(context).size.width * 2.2, decoration: BoxDecoration( shape: BoxShape.circle, - color: widget.disabled - ? Colors.grey - : widget.color ?? Theme.of(context).buttonColor, + color: widget.disabled ? Colors.grey : widget.color ?? Theme.of(context).buttonColor, ), ), ), @@ -202,10 +183,7 @@ class _SecondaryButtonState extends State padding: widget.iconOnly ? EdgeInsets.symmetric(vertical: 4.0, horizontal: 5.0) : EdgeInsets.only( - top: widget.small ? 8.0 : 14.0, - bottom: widget.small ? 6.0 : 14.0, - left: 18.0, - right: 18.0), + top: widget.small ? 8.0 : 14.0, bottom: widget.small ? 6.0 : 14.0, left: 18.0, right: 18.0), child: Stack( children: [ Positioned( @@ -224,22 +202,20 @@ class _SecondaryButtonState extends State width: 19.0, child: CircularProgressIndicator( backgroundColor: Colors.white, - valueColor: - AlwaysStoppedAnimation( - Colors.grey[300], + valueColor: AlwaysStoppedAnimation( + Colors.grey[300]!, ), ), ), ) : Padding( - padding: EdgeInsets.only( - bottom: widget.small ? 4.0 : 3.0), + padding: EdgeInsets.only(bottom: widget.small ? 4.0 : 3.0), child: Text( widget.label, style: TextStyle( color: widget.textColor, fontSize: 16, - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w700, fontFamily: 'Poppins'), ), ) diff --git a/lib/widgets/shared/card_with_bgNew_widget.dart b/lib/widgets/shared/card_with_bgNew_widget.dart index 00b836bc..1b17236a 100644 --- a/lib/widgets/shared/card_with_bgNew_widget.dart +++ b/lib/widgets/shared/card_with_bgNew_widget.dart @@ -1,18 +1,10 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; -/* - *@author: Amjad Amireh Modify for new design created by Mohammad Aljammal - *@Date:Modify date 21/5/2020 Original date 27/4/2020 - *@param: Widget - *@return: - *@desc: Card With Bg Widget - */ - class CardWithBgWidgetNew extends StatelessWidget { final Widget widget; - CardWithBgWidgetNew({@required this.widget}); + CardWithBgWidgetNew({required this.widget}); @override Widget build(BuildContext context) { @@ -21,10 +13,10 @@ class CardWithBgWidgetNew extends StatelessWidget { margin: EdgeInsets.symmetric(vertical: 10.0), width: double.infinity, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), + ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), color: HexColor('#FFFFFF'), @@ -33,18 +25,16 @@ class CardWithBgWidgetNew extends StatelessWidget { Center( child: Container( - // padding:EdgeInsets.fromLTRB(0, 10,0, 10), //EdgeInsets.all(10.0),//10 - // margin: EdgeInsets.only(left: 10), + // padding:EdgeInsets.fromLTRB(0, 10,0, 10), //EdgeInsets.all(10.0),//10 + // margin: EdgeInsets.only(left: 10), child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center(child: widget), - )), + padding: const EdgeInsets.all(8.0), + child: Center(child: widget), + )), ) ], ), ), ); } - - } diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index deeff358..1e2e19c2 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; - class CardWithBgWidget extends StatelessWidget { final Widget widget; final Color bgColor; @@ -13,7 +12,12 @@ class CardWithBgWidget extends StatelessWidget { final double marginSymmetric; CardWithBgWidget( - {@required this.widget, this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, this.marginSymmetric=10.0}); + {required this.widget, + required this.bgColor, + this.hasBorder = true, + this.padding = 15.0, + this.marginLeft = 10.0, + this.marginSymmetric = 10.0}); @override Widget build(BuildContext context) { @@ -25,9 +29,7 @@ class CardWithBgWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: hasBorder ? HexColor('#707070') : Colors.transparent, - width: hasBorder ? 0.30 : 0), + border: Border.all(color: hasBorder ? HexColor('#707070') : Colors.transparent, width: hasBorder ? 0.30 : 0), ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -35,13 +37,14 @@ class CardWithBgWidget extends StatelessWidget { children: [ if (projectProvider.isArabic) Positioned( - child: Container( + child: Container( decoration: BoxDecoration( color: bgColor ?? HexColor('#58434F'), - borderRadius: BorderRadius.only( topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10),),), + bottomLeft: Radius.circular(10), + ), + ), width: 10, ), bottom: 1, @@ -52,21 +55,19 @@ class CardWithBgWidget extends StatelessWidget { Positioned( child: Container( decoration: BoxDecoration( - color: bgColor ?? HexColor('#58434F'), - - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10),),), + color: bgColor ?? HexColor('#58434F'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10), + ), + ), width: 7, ), bottom: 1, top: 1, left: 1, ), - Container( - padding: EdgeInsets.all(padding), - margin: EdgeInsets.only(left: marginLeft), - child: widget) + Container(padding: EdgeInsets.all(padding), margin: EdgeInsets.only(left: marginLeft), child: widget) ], ), ), diff --git a/lib/widgets/shared/charts/app_line_chart.dart b/lib/widgets/shared/charts/app_line_chart.dart deleted file mode 100644 index 422468d7..00000000 --- a/lib/widgets/shared/charts/app_line_chart.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:flutter/material.dart'; - -/* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: AppLineChart - */ -class AppLineChart extends StatelessWidget { - const AppLineChart({ - Key key, - @required this.seriesList, - this.chartTitle, - }) : super(key: key); - - final List seriesList; - - final String chartTitle; - - @override - Widget build(BuildContext context) { - return Container( - child: Column( - children: [ - Text( - 'Body Mass Index', - style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold), - ), - Expanded( - child: charts.LineChart(seriesList, - defaultRenderer: new charts.LineRendererConfig( - includeArea: false, stacked: true), - animate: true), - ), - ], - ), - ); - } -} diff --git a/lib/widgets/shared/charts/app_time_series_chart.dart b/lib/widgets/shared/charts/app_time_series_chart.dart deleted file mode 100644 index f4bd354e..00000000 --- a/lib/widgets/shared/charts/app_time_series_chart.dart +++ /dev/null @@ -1,121 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:flutter/material.dart'; - -import '../../../config/size_config.dart'; -import '../../../models/patient/vital_sign/vital_sign_res_model.dart'; -import '../../../widgets/shared/rounded_container_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: AppTimeSeriesChart - */ -class AppTimeSeriesChart extends StatelessWidget { - AppTimeSeriesChart( - {Key key, - @required this.vitalList, - @required this.viewKey, - this.chartName = ''}); - - final List vitalList; - final String chartName; - final String viewKey; - List seriesList; - - @override - Widget build(BuildContext context) { - seriesList = generateData(); - return RoundedContainer( - height: SizeConfig.realScreenHeight * 0.47, - child: Column( - children: [ - Text( - chartName, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 3), - ), - Container( - height: SizeConfig.realScreenHeight * 0.37, - child: Center( - child: Container( - child: charts.TimeSeriesChart( - seriesList, - animate: true, - behaviors: [ - new charts.RangeAnnotation( - [ - new charts.RangeAnnotationSegment( - DateTime( - vitalList[vitalList.length - 1] - .vitalSignDate - .year, - vitalList[vitalList.length - 1] - .vitalSignDate - .month + - 3, - vitalList[vitalList.length - 1] - .vitalSignDate - .day), - vitalList[0].vitalSignDate, - charts.RangeAnnotationAxisType.domain), - ], - ), - ], - ), - ), - ), - ), - ], - ), - ); - } - - /* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: generateData - */ - generateData() { - final List data = []; - if (vitalList.length > 0) { - vitalList.forEach( - (element) { - data.add( - TimeSeriesSales( - new DateTime(element.vitalSignDate.year, - element.vitalSignDate.month, element.vitalSignDate.day), - element.toJson()[viewKey].toInt(), - ), - ); - }, - ); - } - return [ - new charts.Series( - id: 'Sales', - domainFn: (TimeSeriesSales sales, _) => sales.time, - measureFn: (TimeSeriesSales sales, _) => sales.sales, - data: data, - ) - ]; - } -} - -/* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: TimeSeriesSales - */ -class TimeSeriesSales { - final DateTime time; - final int sales; - - TimeSeriesSales(this.time, this.sales); -} diff --git a/lib/widgets/shared/custom_shape_clipper.dart b/lib/widgets/shared/custom_shape_clipper.dart deleted file mode 100644 index 81f5ee20..00000000 --- a/lib/widgets/shared/custom_shape_clipper.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:flutter/material.dart'; - -class CustomShapeClipper extends CustomClipper { - @override - Path getClip(Size size) { - final Path path = Path(); - path.lineTo(0.0, size.height); - - var firstEndPoint = Offset(size.width * .5, size.height / 2); - var firstControlpoint = Offset(size.width * 0.25, size.height * 0.95 + 30); - path.quadraticBezierTo(firstControlpoint.dx, firstControlpoint.dy, - firstEndPoint.dx, firstEndPoint.dy); - - var secondEndPoint = Offset(size.width, size.height * 0.10); - var secondControlPoint = Offset(size.width * .75, size.height * .10 - 20); - path.quadraticBezierTo(secondControlPoint.dx, secondControlPoint.dy, - secondEndPoint.dx, secondEndPoint.dy); - - path.lineTo(size.width, 0.0); - path.close(); - return path; - } - - @override - bool shouldReclip(CustomClipper oldClipper) => true; -} diff --git a/lib/widgets/shared/dialogs/ShowImageDialog.dart b/lib/widgets/shared/dialogs/ShowImageDialog.dart index 302366b7..06875fb4 100644 --- a/lib/widgets/shared/dialogs/ShowImageDialog.dart +++ b/lib/widgets/shared/dialogs/ShowImageDialog.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; class ShowImageDialog extends StatelessWidget { final String imageUrl; - const ShowImageDialog({Key key, this.imageUrl}) : super(key: key); + const ShowImageDialog({Key? key, required this.imageUrl}) : super(key: key); @override Widget build(BuildContext context) { return SimpleDialog( @@ -12,10 +12,8 @@ class ShowImageDialog extends StatelessWidget { Container( width: 340, height: 340, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12) - ), - child: Image.network( + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12)), + child: Image.network( imageUrl, fit: BoxFit.fill, ), @@ -23,4 +21,4 @@ class ShowImageDialog extends StatelessWidget { ], ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index 76932ecd..0a1ecb76 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -9,16 +9,16 @@ class ListSelectDialog extends StatefulWidget { final okText; final Function(dynamic) okFunction; dynamic selectedValue; - final Widget searchWidget; + final Widget? searchWidget; final bool usingSearch; - final String hintSearchText; + final String? hintSearchText; ListSelectDialog({ - @required this.list, - @required this.attributeName, - @required this.attributeValueId, + required this.list, + required this.attributeName, + required this.attributeValueId, @required this.okText, - @required this.okFunction, + required this.okFunction, this.searchWidget, this.usingSearch = false, this.hintSearchText, @@ -29,7 +29,7 @@ class ListSelectDialog extends StatefulWidget { } class _ListSelectDialogState extends State { - List items = List(); + List items = []; @override void initState() { @@ -46,7 +46,7 @@ class _ListSelectDialogState extends State { showAlertDialog(BuildContext context) { // set up the buttons Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel), + child: Text(TranslationBase.of(context).cancel ?? ""), onPressed: () { Navigator.of(context).pop(); }); @@ -74,15 +74,16 @@ class _ListSelectDialogState extends State { child: SingleChildScrollView( child: Column( children: [ - if (widget.searchWidget != null) widget.searchWidget, - if(widget.usingSearch) + if (widget.searchWidget != null) widget.searchWidget!, + if (widget.usingSearch) Container( - height: MediaQuery.of(context).size.height * 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: TextField( decoration: Helpers.textFieldSelectorDecoration( - widget.hintSearchText ?? TranslationBase - .of(context) - .search, null, false, suffixIcon: Icon(Icons.search,)), + widget.hintSearchText ?? TranslationBase.of(context).search ?? "", "", false, + suffixIcon: Icon( + Icons.search, + )), enabled: true, keyboardType: TextInputType.text, onChanged: (value) { @@ -92,13 +93,11 @@ class _ListSelectDialogState extends State { ...items .map((item) => RadioListTile( title: Text("${item[widget.attributeName].toString()}"), - groupValue: widget.selectedValue[widget.attributeValueId] - .toString(), + groupValue: widget.selectedValue[widget.attributeValueId].toString(), value: item[widget.attributeValueId].toString(), activeColor: Colors.blue.shade700, selected: item[widget.attributeValueId].toString() == - widget.selectedValue[widget.attributeValueId] - .toString(), + widget.selectedValue[widget.attributeValueId].toString(), onChanged: (val) { setState(() { widget.selectedValue = item; @@ -117,10 +116,10 @@ class _ListSelectDialogState extends State { } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.list); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { if ("${item[widget.attributeName].toString()}".toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 55046c3c..0ef95900 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -9,15 +9,11 @@ class MasterKeyDailog extends StatefulWidget { final List list; final okText; final Function(MasterKeyModel) okFunction; - MasterKeyModel selectedValue; + MasterKeyModel? selectedValue; final bool isICD; MasterKeyDailog( - {@required this.list, - @required this.okText, - @required this.okFunction, - this.selectedValue, - this.isICD = false}); + {required this.list, required this.okText, required this.okFunction, this.selectedValue, this.isICD = false}); @override _MasterKeyDailogState createState() => _MasterKeyDailogState(); @@ -33,20 +29,20 @@ class _MasterKeyDailogState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return showAlertDialog(context, projectViewModel); + return showAlertDialog(context, projectViewModel); } showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { // set up the buttons Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel), + child: Text(TranslationBase.of(context).cancel!), onPressed: () { Navigator.of(context).pop(); }); Widget continueButton = FlatButton( child: Text(this.widget.okText), onPressed: () { - this.widget.okFunction(widget.selectedValue); + this.widget.okFunction(widget.selectedValue!); Navigator.of(context).pop(); }); // set up the AlertDialog @@ -69,23 +65,21 @@ class _MasterKeyDailogState extends State { children: [ ...widget.list .map((item) => RadioListTile( - title: Text( - '${projectViewModel.isArabic?item.nameAr:item.nameEn}' + (widget.isICD ? '/${item.code}' : '')), - groupValue: widget.isICD - ? widget.selectedValue.code.toString() - : widget.selectedValue.id.toString(), - value: widget.isICD ? widget.selectedValue.code.toString() : item - .id.toString(), - activeColor: Colors.blue.shade700, - selected: widget.isICD ? item.code.toString() == - widget.selectedValue.code.toString() : item.id.toString() == - widget.selectedValue.id.toString(), - onChanged: (val) { - setState(() { - widget.selectedValue = item; - }); - }, - )) + title: Text('${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + + (widget.isICD ? '/${item.code}' : '')), + groupValue: + widget.isICD ? widget.selectedValue!.code.toString() : widget.selectedValue!.id.toString(), + value: widget.isICD ? widget.selectedValue!.code.toString() : item.id.toString(), + activeColor: Colors.blue.shade700, + selected: widget.isICD + ? item.code.toString() == widget.selectedValue!.code.toString() + : item.id.toString() == widget.selectedValue!.id.toString(), + onChanged: (val) { + setState(() { + widget.selectedValue = item; + }); + }, + )) .toList() ], ), diff --git a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart deleted file mode 100644 index 68dce5a4..00000000 --- a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart +++ /dev/null @@ -1,92 +0,0 @@ -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:flutter/material.dart'; - -class ListSelectDialog extends StatefulWidget { - final List list; - final String attributeName; - final String attributeValueId; - final okText; - final Function(dynamic) okFunction; - dynamic selectedValue; - - ListSelectDialog( - {@required this.list, - @required this.attributeName, - @required this.attributeValueId, - @required this.okText, - @required this.okFunction}); - - @override - _ListSelectDialogState createState() => _ListSelectDialogState(); -} - -class _ListSelectDialogState extends State { - @override - void initState() { - super.initState(); - widget.selectedValue = widget.selectedValue ?? widget.list[0]; - } - - @override - Widget build(BuildContext context) { - return showAlertDialog(context); - } - - showAlertDialog(BuildContext context) { - // set up the buttons - Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel), - onPressed: () { - Navigator.of(context).pop(); - }); - Widget continueButton = FlatButton( - child: Text(this.widget.okText), - onPressed: () { - this.widget.okFunction(widget.selectedValue); - Navigator.of(context).pop(); - }); -// set up the AlertDialog - AlertDialog alert = AlertDialog( - // title: Text(widget.title), - content: createDialogList(), - actions: [ - cancelButton, - continueButton, - ], - ); - return alert; - } - - Widget createDialogList() { - return Container( - height: MediaQuery.of(context).size.height * 0.5, - child: SingleChildScrollView( - child: Column( - children: [ - ...widget.list - .map((item) => RadioListTile( - title: Text("${item[widget.attributeName].toString()}"), - groupValue: widget.selectedValue[widget.attributeValueId] - .toString(), - value: item[widget.attributeValueId].toString(), - activeColor: Colors.blue.shade700, - selected: item[widget.attributeValueId].toString() == - widget.selectedValue[widget.attributeValueId] - .toString(), - onChanged: (val) { - setState(() { - widget.selectedValue = item; - }); - }, - )) - .toList() - ], - ), - ), - ); - } - - static closeAlertDialog(BuildContext context) { - Navigator.of(context).pop(); - } -} diff --git a/lib/widgets/shared/divider_with_spaces_around.dart b/lib/widgets/shared/divider_with_spaces_around.dart index b43557cb..63a5380e 100644 --- a/lib/widgets/shared/divider_with_spaces_around.dart +++ b/lib/widgets/shared/divider_with_spaces_around.dart @@ -2,9 +2,10 @@ import 'package:flutter/material.dart'; class DividerWithSpacesAround extends StatelessWidget { DividerWithSpacesAround({ - Key key, this.height = 0, + Key? key, + this.height = 0, }); - final double height ; + final double height; @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index faa4379a..7ee26c2f 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -13,9 +13,9 @@ class DoctorCard extends StatelessWidget { final String branch; final DateTime appointmentDate; final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; + final String? invoiceNO; + final String? orderNo; + final GestureTapCallback? onTap; final bool isPrescriptions; final String clinic; final bool isShowEye; @@ -23,22 +23,24 @@ class DoctorCard extends StatelessWidget { final bool isNoMargin; DoctorCard( - {this.doctorName, - this.branch, - this.profileUrl, + {required this.doctorName, + required this.branch, + required this.profileUrl, this.invoiceNO, this.onTap, - this.appointmentDate, + required this.appointmentDate, this.orderNo, this.isPrescriptions = false, - this.clinic, - this.isShowEye = true, this.isShowTime= true, this.isNoMargin =false}); + required this.clinic, + this.isShowEye = true, + this.isShowTime = true, + this.isNoMargin = false}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - margin: EdgeInsets.all(!isNoMargin? 10:0), + margin: EdgeInsets.all(!isNoMargin ? 10 : 0), decoration: BoxDecoration( border: Border.all( width: 0.5, @@ -73,7 +75,7 @@ class DoctorCard extends StatelessWidget { fontWeight: FontWeight.w600, fontSize: 14, ), - if (!isPrescriptions&& isShowTime) + if (!isPrescriptions && isShowTime) AppText( '${AppDateUtils.getHour(appointmentDate)}', fontWeight: FontWeight.w600, @@ -103,74 +105,67 @@ class DoctorCard extends StatelessWidget { Expanded( child: Container( margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (orderNo != null && !isPrescriptions) - Row( - children: [ - AppText( - TranslationBase.of(context).orderNo + - " ", - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - orderNo ?? '', - fontSize: 14, - ) - ], + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + if (orderNo != null && !isPrescriptions) + Row( + children: [ + AppText( + TranslationBase.of(context).orderNo ?? "" + " ", + color: Colors.grey[500], + fontSize: 14, ), - if (invoiceNO != null && !isPrescriptions) - Row( - children: [ - AppText( - TranslationBase.of(context) - .invoiceNo + - " ", - fontSize: 14, - color: Colors.grey[500], - ), - AppText( - invoiceNO, - fontSize: 14, - ) - ], + AppText( + orderNo ?? '', + fontSize: 14, + ) + ], + ), + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + AppText( + TranslationBase.of(context).invoiceNo ?? "" + " ", + fontSize: 14, + color: Colors.grey[500], + ), + AppText( + invoiceNO, + fontSize: 14, + ) + ], + ), + if (clinic != null) + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).clinic ?? "" + ": ", + color: Colors.grey[500], + fontSize: 14, ), - if (clinic != null) - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).clinic + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - Expanded( - child: AppText( - clinic, - fontSize: 14, - ), - ) - ], + Expanded( + child: AppText( + clinic, + fontSize: 14, + ), + ) + ], + ), + if (branch != null) + Row( + children: [ + AppText( + TranslationBase.of(context).branch ?? "" + ": ", + fontSize: 14, + color: Colors.grey[500], ), - if (branch != null) - Row( - children: [ - AppText( - TranslationBase.of(context).branch + - ": ", - fontSize: 14, - color: Colors.grey[500], - ), - AppText( - branch, - fontSize: 14, - ) - ], + AppText( + branch, + fontSize: 14, ) - ]), + ], + ) + ]), ), ), if (isShowEye) diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index 2b0aae7c..c843875d 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -8,18 +8,18 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class DoctorCardInsurance extends StatelessWidget { - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; + final GestureTapCallback? onTap; final bool isPrescriptions; - final String clinic; - final String approvalStatus; - final String patientOut; - final String branch2; + final String? clinic; + final String? approvalStatus; + final String? patientOut; + final String? branch2; DoctorCardInsurance( {this.doctorName, @@ -59,8 +59,7 @@ class DoctorCardInsurance extends StatelessWidget { topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), - color: approvalStatus == "Approved" || - approvalStatus == "تمت الموافقة" + color: approvalStatus == "Approved" || approvalStatus == "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127), ), @@ -68,8 +67,7 @@ class DoctorCardInsurance extends StatelessWidget { Expanded( child: Container( padding: EdgeInsets.only( - left: projectViewModel.isArabic ? 0 : 15, - right: projectViewModel.isArabic ? 15 : 0), + left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0), child: InkWell( onTap: onTap, child: Column( @@ -80,8 +78,7 @@ class DoctorCardInsurance extends StatelessWidget { children: [ AppText( "$approvalStatus", - color: approvalStatus == "Approved" || - approvalStatus == "تمت الموافقة" + color: approvalStatus == "Approved" || approvalStatus == "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127), ), @@ -116,7 +113,7 @@ class DoctorCardInsurance extends StatelessWidget { children: [ Container( child: LargeAvatar( - name: doctorName, + name: doctorName ?? "", url: profileUrl, ), width: 55, @@ -126,90 +123,83 @@ class DoctorCardInsurance extends StatelessWidget { flex: 4, child: Container( margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (orderNo != null && !isPrescriptions) - Row( - children: [ - AppText( - 'order No:', - color: Colors.grey[500], - ), - AppText( - orderNo ?? '', - ) - ], - ), - if (invoiceNO != null && !isPrescriptions) - Row( - children: [ - AppText( - 'Invoice:', - color: Colors.grey[500], - ), - AppText( - invoiceNO, - ) - ], + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + if (orderNo != null && !isPrescriptions) + Row( + children: [ + AppText( + 'order No:', + color: Colors.grey[500], ), - if (isPrescriptions) - Row( - children: [ - AppText( - TranslationBase.of(context).clinic + - ": ", - color: Colors.grey[500], - fontSize: 14, - //fontWeight: FontWeight.w600, - //color: Colors.grey[500], - ), - Expanded( - child: AppText( - clinic, - //fontWeight: FontWeight.w700, - fontSize: 14.0, - ), - ) - ], + AppText( + orderNo ?? '', + ) + ], + ), + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + AppText( + 'Invoice:', + color: Colors.grey[500], ), - if (branch2 != null) - Row( - children: [ - AppText( - TranslationBase.of(context).branch + - ": ", - fontSize: 14, - color: Colors.grey[500], - ), - AppText( - branch2, - fontSize: 14.0, - ) - ], + AppText( + invoiceNO, + ) + ], + ), + if (isPrescriptions) + Row( + children: [ + AppText( + TranslationBase.of(context).clinic ?? "" + ": ", + color: Colors.grey[500], + fontSize: 14, + //fontWeight: FontWeight.w600, + //color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .approvalNo + - ": ", - fontSize: 14, - color: Colors.grey[500], - //color: Colors.grey[500], - ), - AppText( - branch, + Expanded( + child: AppText( + clinic, + //fontWeight: FontWeight.w700, fontSize: 14.0, - ) - ], + ), + ) + ], + ), + if (branch2 != null) + Row( + children: [ + AppText( + TranslationBase.of(context).branch ?? "" + ": ", + fontSize: 14, + color: Colors.grey[500], + ), + AppText( + branch2, + fontSize: 14.0, + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).approvalNo ?? "" + ": ", + fontSize: 14, + color: Colors.grey[500], + //color: Colors.grey[500], ), - ]), + AppText( + branch, + fontSize: 14.0, + ) + ], + ), + ]), ), ), Padding( - padding: - const EdgeInsets.symmetric(horizontal: 15.0), + padding: const EdgeInsets.symmetric(horizontal: 15.0), child: Icon( EvaIcons.eye, ), diff --git a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart index 2c476ec8..1c7db539 100644 --- a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart +++ b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart @@ -1,7 +1,8 @@ import 'package:flutter/material.dart'; + class DrAppCircularProgressIndeicator extends StatelessWidget { const DrAppCircularProgressIndeicator({ - Key key, + Key? key, }) : super(key: key); @override @@ -11,4 +12,4 @@ class DrAppCircularProgressIndeicator extends StatelessWidget { child: Center(child: const CircularProgressIndicator()), ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 2b8ce40d..17c593f8 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -8,9 +8,9 @@ import '../shared/app_texts_widget.dart'; class DrawerItem extends StatefulWidget { final String title; final String subTitle; - final IconData icon; - final Color color; - final String assetLink; + final IconData? icon; + final Color? color; + final String? assetLink; DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink}); @@ -26,30 +26,30 @@ class _DrawerItemState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if(widget.assetLink!=null) + if (widget.assetLink != null) Container( height: 20, width: 20, - child: Image.asset(widget.assetLink), + child: Image.asset(widget.assetLink!), + ), + if (widget.assetLink == null) + Icon( + widget.icon, + color: widget.color ?? Colors.black87, + size: SizeConfig.imageSizeMultiplier * 5, ), - if(widget.assetLink==null) - Icon( - widget.icon, - color: widget.color ?? Colors.black87, - size: SizeConfig.imageSizeMultiplier * 5, - ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - width: MediaQuery.of(context).size.width *0.45, + width: MediaQuery.of(context).size.width * 0.45, child: AppText( widget.title, marginLeft: 5, marginRight: 5, - color:widget.color ??Color(0xFF2E303A), + color: widget.color ?? Color(0xFF2E303A), fontSize: 14, fontFamily: 'Poppins', fontWeight: FontWeight.w600, diff --git a/lib/widgets/shared/errors/dr_app_embedded_error.dart b/lib/widgets/shared/errors/dr_app_embedded_error.dart index de9fd698..9948ad2a 100644 --- a/lib/widgets/shared/errors/dr_app_embedded_error.dart +++ b/lib/widgets/shared/errors/dr_app_embedded_error.dart @@ -2,17 +2,10 @@ import 'package:flutter/material.dart'; import '../app_texts_widget.dart'; -/* - *@author: Elham Rababah - *@Date:12/5/2020 - *@param: error - *@return: StatelessWidget - *@desc: DrAppEmbeddedError class - */ class DrAppEmbeddedError extends StatelessWidget { const DrAppEmbeddedError({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); final String error; @@ -20,12 +13,12 @@ class DrAppEmbeddedError extends StatelessWidget { @override Widget build(BuildContext context) { return Center( - child: AppText( - error, - color: Theme.of(context).errorColor, - textAlign: TextAlign.center, - margin: 10, - ), - ); + child: AppText( + error, + color: Theme.of(context).errorColor, + textAlign: TextAlign.center, + margin: 10, + ), + ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/errors/error_message.dart b/lib/widgets/shared/errors/error_message.dart index 21e04e6c..76b7d515 100644 --- a/lib/widgets/shared/errors/error_message.dart +++ b/lib/widgets/shared/errors/error_message.dart @@ -4,8 +4,8 @@ import '../app_texts_widget.dart'; class ErrorMessage extends StatelessWidget { const ErrorMessage({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); final String error; @@ -17,17 +17,22 @@ class ErrorMessage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(height: 100,), + SizedBox( + height: 100, + ), Image.asset('assets/images/no-data.png'), Center( child: Center( child: Padding( - padding: const EdgeInsets.only(top: 12, bottom: 12,right: 20, left: 30), - child: Center(child: AppText(error??'' , textAlign: TextAlign.center,)), + padding: const EdgeInsets.only(top: 12, bottom: 12, right: 20, left: 30), + child: Center( + child: AppText( + error ?? '', + textAlign: TextAlign.center, + )), ), ), ) - ], ), ), diff --git a/lib/widgets/shared/expandable-widget-header-body.dart b/lib/widgets/shared/expandable-widget-header-body.dart index 20d95bcd..13b1438c 100644 --- a/lib/widgets/shared/expandable-widget-header-body.dart +++ b/lib/widgets/shared/expandable-widget-header-body.dart @@ -2,33 +2,30 @@ import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; class HeaderBodyExpandableNotifier extends StatefulWidget { - final Widget headerWidget; - final Widget bodyWidget; - final Widget collapsed; - final bool isExpand; + final Widget? headerWidget; + final Widget? bodyWidget; + final Widget? collapsed; + final bool? isExpand; bool expandFlag = false; var controller = new ExpandableController(); HeaderBodyExpandableNotifier({this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand}); @override - _HeaderBodyExpandableNotifierState createState() => - _HeaderBodyExpandableNotifierState(); + _HeaderBodyExpandableNotifierState createState() => _HeaderBodyExpandableNotifierState(); } -class _HeaderBodyExpandableNotifierState - extends State { - +class _HeaderBodyExpandableNotifierState extends State { @override void initState() { super.initState(); - } + @override Widget build(BuildContext context) { setState(() { if (widget.isExpand == true) { - widget.expandFlag = widget.isExpand; + widget.expandFlag = widget.isExpand!; widget.controller.expanded = true; } }); @@ -50,7 +47,7 @@ class _HeaderBodyExpandableNotifierState ), // header: widget.headerWidget, collapsed: Container(), - expanded: widget.bodyWidget, + expanded: widget.bodyWidget!, builder: (_, collapsed, expanded) { return Padding( padding: EdgeInsets.only(left: 0, right: 0, bottom: 0), diff --git a/lib/widgets/shared/expandable_item_widget.dart b/lib/widgets/shared/expandable_item_widget.dart deleted file mode 100644 index d369e72a..00000000 --- a/lib/widgets/shared/expandable_item_widget.dart +++ /dev/null @@ -1,91 +0,0 @@ -/* - *@author: Amjad Amireh - *@Date:27/5/2020 - *@param:listItems , headerTitle - *@return:ListItem Expand - - *@desc: - */ -import 'package:flutter/material.dart'; - -class ExpandableItem extends StatefulWidget{ - - final ListlistItems; - final String headerTitle; - - ExpandableItem(this.headerTitle,this.listItems); - - @override - _ExpandableItemState createState() => _ExpandableItemState(); - -} -class _ExpandableItemState extends State -{ - bool isExpand=false; - @override - void initState() { - super.initState(); - isExpand=false; - } - @override - Widget build(BuildContext context) { - ListlistItem=this.widget.listItems; - return Container( - child: Padding( - padding: (isExpand==true)?const EdgeInsets.all(6.0):const EdgeInsets.all(8.0), - child: Container( - decoration:BoxDecoration( - color: Colors.white, - borderRadius: (isExpand!=true)?BorderRadius.all(Radius.circular(50)):BorderRadius.all(Radius.circular(25)), - - - - - - ), - child: ExpansionTile( - key: PageStorageKey(this.widget.headerTitle), - title: Container( - width: double.infinity, - - child: Text(this.widget.headerTitle,style: TextStyle(fontSize: (isExpand!=true)?18:22,color: Colors.black,fontWeight: FontWeight.bold),)), - - trailing: (isExpand==true)?Icon(Icons.keyboard_arrow_up,color: Colors.black,):Icon(Icons.keyboard_arrow_down,color: Colors.black), - onExpansionChanged: (value){ - setState(() { - isExpand=value; - }); - }, - children: [ - for(final item in listItem) - Padding( - padding: const EdgeInsets.all(8.0), - child: InkWell( - onTap: (){ - print(Text("Selected Item $item "+this.widget.headerTitle )); - //========Stop Snak bar=========== Scaffold.of(context).showSnackBar(SnackBar(backgroundColor: Colors.black,duration:Duration(microseconds: 500),content: Text("Selected Item $item "+this.widget.headerTitle ))); - }, - child: Container( - width: double.infinity, - decoration:BoxDecoration( - color: Colors.white, - - border: Border(top: BorderSide(color: Theme.of(context).dividerColor)) - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text(item,style: TextStyle(color: Colors.black),), - - )), - ), - ) - - - ], - - ), - ), - ), - ); - } -} \ No newline at end of file diff --git a/lib/widgets/shared/in_patient_doctor_card.dart b/lib/widgets/shared/in_patient_doctor_card.dart new file mode 100644 index 00000000..483d040c --- /dev/null +++ b/lib/widgets/shared/in_patient_doctor_card.dart @@ -0,0 +1,194 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class InPatientDoctorCard extends StatelessWidget { + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; + final Function? onTap; + final bool isPrescriptions; + final String? clinic; + final createdBy; + + InPatientDoctorCard( + {this.doctorName, + this.branch, + this.profileUrl, + this.invoiceNO, + this.onTap, + this.appointmentDate, + this.orderNo, + this.isPrescriptions = false, + this.clinic, + this.createdBy}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: InkWell( + onTap: onTap!(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: AppText( + doctorName, + bold: true, + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate ?? DateTime.now(), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + if (!isPrescriptions) + AppText( + '${AppDateUtils.getHour(appointmentDate ?? DateTime.now())}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ), + ], + ), + Row( + children: [ + AppText( + 'CreatedBy ', + //bold: true, + ), + Expanded( + child: AppText( + createdBy, + bold: true, + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // Container( + // child: LargeAvatar( + // name: doctorName, + // url: profileUrl, + // ), + // width: 55, + // height: 55, + // ), + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(10), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + // if (orderNo != null && !isPrescriptions) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderNo + + // ": ", + // color: Colors.grey[500], + // fontSize: 14, + // ), + // AppText( + // orderNo ?? '', + // fontSize: 14, + // ) + // ], + // ), + // if (invoiceNO != null && !isPrescriptions) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context) + // .invoiceNo + + // ": ", + // fontSize: 14, + // color: Colors.grey[500], + // ), + // AppText( + // invoiceNO, + // fontSize: 14, + // ) + // ], + // ), + // if (clinic != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).clinic + + // ": ", + // color: Colors.grey[500], + // fontSize: 14, + // ), + // AppText( + // clinic, + // fontSize: 14, + // ) + // ], + // ), + // if (branch != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).branch + + // ": ", + // fontSize: 14, + // color: Colors.grey[500], + // ), + // AppText( + // branch, + // fontSize: 14, + // ) + // ], + // ) + ]), + ), + ), + Icon( + EvaIcons.eye, + ) + ], + ), + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/widgets/shared/loader/gif_loader_container.dart b/lib/widgets/shared/loader/gif_loader_container.dart index b2c2224b..0d7649ee 100644 --- a/lib/widgets/shared/loader/gif_loader_container.dart +++ b/lib/widgets/shared/loader/gif_loader_container.dart @@ -6,17 +6,15 @@ class GifLoaderContainer extends StatefulWidget { _GifLoaderContainerState createState() => _GifLoaderContainerState(); } -class _GifLoaderContainerState extends State - with TickerProviderStateMixin { - GifController controller1; +class _GifLoaderContainerState extends State with TickerProviderStateMixin { + late GifController controller1; @override void initState() { controller1 = GifController(vsync: this); - WidgetsBinding.instance.addPostFrameCallback((_) { - controller1.repeat( - min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); + WidgetsBinding.instance!.addPostFrameCallback((_) { + controller1.repeat(min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); }); super.initState(); } @@ -30,15 +28,14 @@ class _GifLoaderContainerState extends State @override Widget build(BuildContext context) { return Center( - //progress-loading.gif + //progress-loading.gif child: Container( - // margin: EdgeInsets.only(bottom: 40), - child: GifImage( - - controller: controller1, - image: AssetImage( - "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), - ), - )); + // margin: EdgeInsets.only(bottom: 40), + child: GifImage( + controller: controller1, + image: AssetImage( + "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), + ), + )); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index 7a1fc3f5..135642b4 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -25,31 +25,29 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy; final List masterList; - final String buttonName; - final String hintSearchText; + final String? buttonName; + final String? hintSearchText; MasterKeyCheckboxSearchAllergiesWidget( - {Key key, - this.model, - this.addSelectedAllergy, - this.removeAllergy, - this.masterList, - this.addAllergy, - this.isServiceSelected, + {Key? key, + required this.model, + required this.addSelectedAllergy, + required this.removeAllergy, + required this.masterList, + required this.addAllergy, + required this.isServiceSelected, this.buttonName, this.hintSearchText, - this.getServiceSelectedAllergy}) + required this.getServiceSelectedAllergy}) : super(key: key); @override - _MasterKeyCheckboxSearchAllergiesWidgetState createState() => - _MasterKeyCheckboxSearchAllergiesWidgetState(); + _MasterKeyCheckboxSearchAllergiesWidgetState createState() => _MasterKeyCheckboxSearchAllergiesWidgetState(); } -class _MasterKeyCheckboxSearchAllergiesWidgetState - extends State { - List items = List(); - MasterKeyModel _selectedAllergySeverity; +class _MasterKeyCheckboxSearchAllergiesWidgetState extends State { + List items = []; + late MasterKeyModel _selectedAllergySeverity; bool isSubmitted = false; @override @@ -69,16 +67,13 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState height: MediaQuery.of(context).size.height * 0.70, child: Center( child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( children: [ AppTextFieldCustom( // height: // MediaQuery.of(context).size.height * 0.070, - hintText: - TranslationBase.of(context).selectAllergy, + hintText: TranslationBase.of(context).selectAllergy, isTextFieldHasSuffix: true, hasBorder: false, // controller: filteredSearchController, @@ -86,10 +81,11 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState filterSearchResults(value); }, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( - Icons.search, - color: Colors.black, - )), + Icons.search, + color: Colors.black, + )), ), DividerWithSpacesAround(), SizedBox( @@ -99,134 +95,79 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: FractionallySizedBox( widthFactor: 0.9, child: Container( - height: - MediaQuery.of(context).size.height * 0.60, + height: MediaQuery.of(context).size.height * 0.60, child: ListView.builder( itemCount: items.length, itemBuilder: (context, index) { - bool isSelected = widget - .isServiceSelected(items[index]); - MySelectedAllergy mySelectedAllergy; + bool isSelected = widget.isServiceSelected(items[index]); + MySelectedAllergy? mySelectedAllergy; if (isSelected) { - mySelectedAllergy = - widget.getServiceSelectedAllergy( - items[index]); + mySelectedAllergy = widget.getServiceSelectedAllergy(items[index]); } TextEditingController remarkController = - TextEditingController( - text: isSelected - ? mySelectedAllergy.remark - : null); - TextEditingController severityController = - TextEditingController( - text: isSelected - ? mySelectedAllergy - .selectedAllergySeverity != - null - ? projectViewModel - .isArabic - ? mySelectedAllergy - .selectedAllergySeverity - .nameAr - : mySelectedAllergy - .selectedAllergySeverity - .nameEn - : null - : null); + TextEditingController(text: isSelected ? mySelectedAllergy!.remark : null); + TextEditingController severityController = TextEditingController( + text: isSelected + ? mySelectedAllergy!.selectedAllergySeverity != null + ? projectViewModel.isArabic + ? mySelectedAllergy.selectedAllergySeverity!.nameAr + : mySelectedAllergy.selectedAllergySeverity!.nameEn + : null + : null); return HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ Checkbox( - value: widget - .isServiceSelected( - items[index]), - activeColor: - Colors.red[800], - onChanged: (bool newValue) { + value: widget.isServiceSelected(items[index]), + activeColor: Colors.red[800], + onChanged: (bool? newValue) { setState(() { - if (widget - .isServiceSelected( - items[index])) { - widget.removeAllergy( - items[index]); + if (widget.isServiceSelected(items[index])) { + widget.removeAllergy(items[index]); } else { - MySelectedAllergy - mySelectedAllergy = - new MySelectedAllergy( - selectedAllergy: - items[ - index], - selectedAllergySeverity: - _selectedAllergySeverity, - remark: null, - isChecked: - true, - isExpanded: - true); - widget.addAllergy( - mySelectedAllergy); + MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( + selectedAllergy: items[index], + selectedAllergySeverity: _selectedAllergySeverity, + remark: null, + isChecked: true, + isExpanded: true); + widget.addAllergy(mySelectedAllergy); } }); }), InkWell( onTap: () { setState(() { - if (widget - .isServiceSelected( - items[index])) { - widget.removeAllergy( - items[index]); + if (widget.isServiceSelected(items[index])) { + widget.removeAllergy(items[index]); } else { - - MySelectedAllergy mySelectedAllergy = - new MySelectedAllergy( - selectedAllergy: - items[ - index], - selectedAllergySeverity: - _selectedAllergySeverity, - remark: null, - isChecked: true, - isExpanded: - true); - widget.addAllergy( - mySelectedAllergy); + MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( + selectedAllergy: items[index], + selectedAllergySeverity: _selectedAllergySeverity, + remark: null, + isChecked: true, + isExpanded: true); + widget.addAllergy(mySelectedAllergy); } }); }, child: Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), child: Container( child: AppText( - projectViewModel - .isArabic - ? items[index] - .nameAr != - "" - ? items[index] - .nameAr - : items[index] - .nameEn - : items[index] - .nameEn, - color: - Color(0xFF575757), + projectViewModel.isArabic + ? items[index].nameAr != "" + ? items[index].nameAr + : items[index].nameEn + : items[index].nameEn, + color: Color(0xFF575757), fontSize: 16, - fontWeight: - FontWeight.w600, + fontWeight: FontWeight.w600, ), - width: - MediaQuery.of(context) - .size - .width * - 0.55, + width: MediaQuery.of(context).size.width * 0.55, ), ), ), @@ -234,27 +175,20 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState ), InkWell( onTap: () { - if (mySelectedAllergy != - null) { + if (mySelectedAllergy != null) { setState(() { - mySelectedAllergy - .isExpanded = - mySelectedAllergy - .isExpanded - ? false - : true; + if (mySelectedAllergy!.isExpanded!) { + mySelectedAllergy.isExpanded = false; + } else { + mySelectedAllergy.isExpanded = true; + } }); } }, - child: Icon((mySelectedAllergy != - null - ? mySelectedAllergy - .isExpanded - : false) - ? EvaIcons - .arrowIosUpwardOutline - : EvaIcons - .arrowIosDownwardOutline)) + child: Icon( + (mySelectedAllergy != null ? mySelectedAllergy.isExpanded! : false) + ? EvaIcons.arrowIosUpwardOutline + : EvaIcons.arrowIosDownwardOutline)) ], ), bodyWidget: Center( @@ -264,104 +198,69 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: Column( children: [ AppTextFieldCustom( - onClick: widget.model - .allergySeverityList != - null + onClick: widget.model.allergySeverityList != null ? () { - MasterKeyDailog - dialog = - MasterKeyDailog( - list: widget.model - .allergySeverityList, - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { + MasterKeyDailog dialog = MasterKeyDailog( + list: widget.model.allergySeverityList, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { setState(() { - mySelectedAllergy - .selectedAllergySeverity = + mySelectedAllergy!.selectedAllergySeverity = selectedValue; }); }, ); showDialog( - barrierDismissible: - false, + barrierDismissible: false, context: context, - builder: - (BuildContext - context) { + builder: (BuildContext context) { return dialog; }, ); } : null, isTextFieldHasSuffix: true, - hintText: - TranslationBase.of( - context) - .selectSeverity, + hintText: TranslationBase.of(context).selectSeverity, enabled: false, maxLines: 2, minLines: 2, - controller: - severityController, + controller: severityController, ), SizedBox( height: 5, ), if (isSubmitted && - mySelectedAllergy != - null && - mySelectedAllergy - .selectedAllergySeverity == - null) + mySelectedAllergy != null && + mySelectedAllergy.selectedAllergySeverity == null) Row( children: [ CustomValidationError(), ], - mainAxisAlignment: - MainAxisAlignment - .start, + mainAxisAlignment: MainAxisAlignment.start, ), SizedBox( height: 10, ), Container( - margin: EdgeInsets.only( - left: 0, - right: 0, - top: 15), + margin: EdgeInsets.only(left: 0, right: 0, top: 15), child: NewTextFields( - hintText: - TranslationBase.of( - context) - .remarks, + hintText: TranslationBase.of(context).remarks ?? "", fontSize: 13.5, // hintColor: Colors.black, - fontWeight: - FontWeight.w600, + fontWeight: FontWeight.w600, maxLines: 25, minLines: 3, - initialValue: isSelected - ? mySelectedAllergy - .remark - : '', + initialValue: isSelected ? mySelectedAllergy!.remark ?? "" : '', // controller: remarkControlle onChanged: (value) { if (isSelected) { - mySelectedAllergy - .remark = value; + mySelectedAllergy!.remark = value; } }, validator: (value) { if (value == null) - return TranslationBase - .of(context) - .emptyMessage; + return TranslationBase.of(context).emptyMessage; else return null; }), @@ -374,9 +273,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState ), ), ), - isExpand: mySelectedAllergy != null - ? mySelectedAllergy.isExpanded - : false, + isExpand: mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false, ); }, ), @@ -396,13 +293,13 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((items) { - if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || - items.nameEn.toLowerCase().contains(query.toLowerCase())) { + if (items.nameAr!.toLowerCase().contains(query.toLowerCase()) || + items.nameEn!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(items); } }); diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 3a0a1525..6be27f94 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -17,29 +17,27 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget { final Function(MasterKeyModel) addHistory; final bool Function(MasterKeyModel) isServiceSelected; final List masterList; - final String buttonName; - final String hintSearchText; + final String? buttonName; + final String? hintSearchText; MasterKeyCheckboxSearchWidget( - {Key key, - this.model, - this.addSelectedHistories, - this.removeHistory, - this.masterList, - this.addHistory, - this.isServiceSelected, + {Key? key, + required this.model, + required this.addSelectedHistories, + required this.removeHistory, + required this.masterList, + required this.addHistory, + required this.isServiceSelected, this.buttonName, this.hintSearchText}) : super(key: key); @override - _MasterKeyCheckboxSearchWidgetState createState() => - _MasterKeyCheckboxSearchWidgetState(); + _MasterKeyCheckboxSearchWidgetState createState() => _MasterKeyCheckboxSearchWidgetState(); } -class _MasterKeyCheckboxSearchWidgetState - extends State { - List items = List(); +class _MasterKeyCheckboxSearchWidgetState extends State { + List items = []; @override void initState() { @@ -67,9 +65,7 @@ class _MasterKeyCheckboxSearchWidgetState height: MediaQuery.of(context).size.height * 0.60, child: Center( child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: ListView( children: [ AppTextFieldCustom( @@ -82,10 +78,11 @@ class _MasterKeyCheckboxSearchWidgetState filterSearchResults(value); }, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( - Icons.search, - color: Colors.black, - )), + Icons.search, + color: Colors.black, + )), ), // SizedBox(height: 15,), @@ -109,13 +106,11 @@ class _MasterKeyCheckboxSearchWidgetState child: Row( children: [ Checkbox( - value: widget - .isServiceSelected(historyInfo), + value: widget.isServiceSelected(historyInfo), activeColor: Colors.red[800], - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isServiceSelected( - historyInfo)) { + if (widget.isServiceSelected(historyInfo)) { widget.removeHistory(historyInfo); } else { widget.addHistory(historyInfo); @@ -124,8 +119,7 @@ class _MasterKeyCheckboxSearchWidgetState }), Expanded( child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), child: AppText( projectViewModel.isArabic ? historyInfo.nameAr != "" @@ -161,13 +155,13 @@ class _MasterKeyCheckboxSearchWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || - item.nameEn.toLowerCase().contains(query.toLowerCase())) { + if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || + item.nameEn!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/widgets/shared/network_base_view.dart b/lib/widgets/shared/network_base_view.dart index 32232628..68b6c1cd 100644 --- a/lib/widgets/shared/network_base_view.dart +++ b/lib/widgets/shared/network_base_view.dart @@ -7,10 +7,10 @@ import 'app_loader_widget.dart'; import 'errors/error_message.dart'; class NetworkBaseView extends StatelessWidget { - final BaseViewModel baseViewModel; - final Widget child; + final BaseViewModel? baseViewModel; + final Widget? child; - NetworkBaseView({Key key, this.baseViewModel, this.child}); + NetworkBaseView({Key? key, this.baseViewModel, this.child}); @override Widget build(BuildContext context) { @@ -21,7 +21,7 @@ class NetworkBaseView extends StatelessWidget { } buildBaseViewWidget() { - switch (baseViewModel.state) { + switch (baseViewModel!.state) { case ViewState.ErrorLocal: case ViewState.Idle: case ViewState.BusyLocal: @@ -31,7 +31,9 @@ class NetworkBaseView extends StatelessWidget { return AppLoaderWidget(); break; case ViewState.Error: - return ErrorMessage(error: baseViewModel.error ,); + return ErrorMessage( + error: baseViewModel!.error, + ); break; } } diff --git a/lib/widgets/shared/profile_image_widget.dart b/lib/widgets/shared/profile_image_widget.dart index 3db93f9d..804ffca8 100644 --- a/lib/widgets/shared/profile_image_widget.dart +++ b/lib/widgets/shared/profile_image_widget.dart @@ -10,21 +10,15 @@ import 'package:flutter/material.dart'; *@desc: Profile Image Widget class */ class ProfileImageWidget extends StatelessWidget { - String url; - String name; - String des; - double height; - double width; - Color color; - double fontsize; + String? url; + String? name; + String? des; + double? height; + double? width; + Color? color; + double? fontsize; ProfileImageWidget( - {this.url, - this.name, - this.des, - this.height, - this.width, - this.fontsize, - this.color = Colors.black}); + {this.url, this.name, this.des, this.height, this.width, this.fontsize, this.color = Colors.black}); @override Widget build(BuildContext context) { @@ -32,24 +26,21 @@ class ProfileImageWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - height: height, - width: width, - child:CircleAvatar( - radius: - SizeConfig.imageSizeMultiplier * 12, - // radius: (52) - child: ClipRRect( - borderRadius:BorderRadius.circular(50), - - child: Image.network( - url, - fit: BoxFit.fill, - width: 700, + height: height, + width: width, + child: CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(50), + child: Image.network( + url!, + fit: BoxFit.fill, + width: 700, + ), ), - ), - backgroundColor: Colors.transparent, - ) - ), + backgroundColor: Colors.transparent, + )), name == null || des == null ? SizedBox() : SizedBox( @@ -60,18 +51,14 @@ class ProfileImageWidget extends StatelessWidget { : AppText( name, fontWeight: FontWeight.bold, - fontSize: fontsize == null - ? SizeConfig.textMultiplier * 3.5 - : fontsize, + fontSize: fontsize == null ? SizeConfig.textMultiplier * 3.5 : fontsize, color: color, ), des == null ? SizedBox() : AppText( des, - fontSize: fontsize == null - ? SizeConfig.textMultiplier * 2.5 - : fontsize, + fontSize: fontsize == null ? SizeConfig.textMultiplier * 2.5 : fontsize, ) ], ); diff --git a/lib/widgets/shared/rounded_container_widget.dart b/lib/widgets/shared/rounded_container_widget.dart index 8364bb79..b63f4e10 100644 --- a/lib/widgets/shared/rounded_container_widget.dart +++ b/lib/widgets/shared/rounded_container_widget.dart @@ -1,24 +1,24 @@ import 'package:flutter/material.dart'; class RoundedContainer extends StatefulWidget { - final double width; - final double height; - final double raduis; - final Color backgroundColor; - final EdgeInsets margin; - final double elevation; - final bool showBorder; - final Color borderColor; - final double shadowWidth; - final double shadowSpreadRadius; - final double shadowDy; - final bool customCornerRaduis; - final double topLeft; - final double bottomRight; - final double topRight; - final double bottomLeft; - final Widget child; - final double borderWidth; + final double? width; + final double? height; + final double? raduis; + final Color? backgroundColor; + final EdgeInsets? margin; + final double? elevation; + final bool? showBorder; + final Color? borderColor; + final double? shadowWidth; + final double? shadowSpreadRadius; + final double? shadowDy; + final bool? customCornerRaduis; + final double? topLeft; + final double? bottomRight; + final double? topRight; + final double? bottomLeft; + final Widget? child; + final double? borderWidth; RoundedContainer( {@required this.child, @@ -54,34 +54,33 @@ class _RoundedContainerState extends State { decoration: widget.showBorder == true ? BoxDecoration( color: Theme.of(context).primaryColor, - border: Border.all( - color: widget.borderColor, width: widget.borderWidth), - borderRadius: widget.customCornerRaduis + border: Border.all(color: widget.borderColor!, width: widget.borderWidth!), + borderRadius: widget.customCornerRaduis! ? BorderRadius.only( - topLeft: Radius.circular(widget.topLeft), - topRight: Radius.circular(widget.topRight), - bottomRight: Radius.circular(widget.bottomRight), - bottomLeft: Radius.circular(widget.bottomLeft)) - : BorderRadius.circular(widget.raduis), + topLeft: Radius.circular(widget.topLeft!), + topRight: Radius.circular(widget.topRight!), + bottomRight: Radius.circular(widget.bottomRight!), + bottomLeft: Radius.circular(widget.bottomLeft!)) + : BorderRadius.circular(widget.raduis!), boxShadow: [ BoxShadow( - color: Colors.grey.withOpacity(widget.shadowWidth), - spreadRadius: widget.shadowSpreadRadius, + color: Colors.grey.withOpacity(widget.shadowWidth!), + spreadRadius: widget.shadowSpreadRadius!, blurRadius: 5, - offset: Offset(0, widget.shadowDy), // changes position of shadow + offset: Offset(0, widget.shadowDy!), // changes position of shadow ), ]) : null, child: Card( margin: EdgeInsets.all(0), shape: RoundedRectangleBorder( - borderRadius: widget.customCornerRaduis + borderRadius: widget.customCornerRaduis! ? BorderRadius.only( - topLeft: Radius.circular(widget.topLeft), - topRight: Radius.circular(widget.topRight), - bottomRight: Radius.circular(widget.bottomRight), - bottomLeft: Radius.circular(widget.bottomLeft)) - : BorderRadius.circular(widget.raduis), + topLeft: Radius.circular(widget.topLeft!), + topRight: Radius.circular(widget.topRight!), + bottomRight: Radius.circular(widget.bottomRight!), + bottomLeft: Radius.circular(widget.bottomLeft!)) + : BorderRadius.circular(widget.raduis!), ), color: widget.backgroundColor, child: widget.child, diff --git a/lib/widgets/shared/speech-text-popup.dart b/lib/widgets/shared/speech-text-popup.dart index dad7e2d1..48049274 100644 --- a/lib/widgets/shared/speech-text-popup.dart +++ b/lib/widgets/shared/speech-text-popup.dart @@ -15,7 +15,7 @@ class SpeechToText { static var dialog; static stt.SpeechToText speech = stt.SpeechToText(); SpeechToText({ - @required this.context, + required this.context, }); showAlertDialog(BuildContext context) { @@ -44,7 +44,7 @@ typedef Disposer = void Function(); class MyStatefulBuilder extends StatefulWidget { const MyStatefulBuilder({ // @required this.builder, - @required this.dispose, + required this.dispose, }); //final StatefulWidgetBuilder builder; @@ -57,15 +57,12 @@ class MyStatefulBuilder extends StatefulWidget { class _MyStatefulBuilderState extends State { var event = RobotProvider(); var searchText; - static StreamSubscription streamSubscription; + static StreamSubscription? streamSubscription; static var isClosed = false; @override void initState() { streamSubscription = event.controller.stream.listen((p) { - if ((p['searchText'] != 'null' && - p['searchText'] != null && - p['searchText'] != "" && - isClosed == false) && + if ((p['searchText'] != 'null' && p['searchText'] != null && p['searchText'] != "" && isClosed == false) && mounted) { setState(() { searchText = p['searchText']; @@ -104,8 +101,7 @@ class _MyStatefulBuilderState extends State { margin: EdgeInsets.all(20), padding: EdgeInsets.all(10), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100), - border: Border.all(width: 2, color: Colors.red)), + borderRadius: BorderRadius.circular(100), border: Border.all(width: 2, color: Colors.red)), child: Icon( Icons.mic, color: Colors.blue, @@ -134,8 +130,7 @@ class _MyStatefulBuilderState extends State { ? Center( child: InkWell( child: Container( - decoration: BoxDecoration( - border: Border.all(color: Colors.grey[300])), + decoration: BoxDecoration(border: Border.all(color: Colors.grey[300]!)), padding: EdgeInsets.all(5), child: AppText( 'Try Again', diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/text_fields/TextFields.dart similarity index 52% rename from lib/widgets/shared/TextFields.dart rename to lib/widgets/shared/text_fields/TextFields.dart index 18d8e778..26c2125b 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/text_fields/TextFields.dart @@ -4,8 +4,7 @@ import 'package:flutter/services.dart'; class NumberTextInputFormatter extends TextInputFormatter { @override - TextEditingValue formatEditUpdate( - TextEditingValue oldValue, TextEditingValue newValue) { + TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { final int newTextLength = newValue.text.length; int selectionIndex = newValue.selection.end; int usedSubstringIndex = 0; @@ -27,8 +26,7 @@ class NumberTextInputFormatter extends TextInputFormatter { if (newValue.selection.end >= 10) selectionIndex++; } // Dump the rest. - if (newTextLength >= usedSubstringIndex) - newText.write(newValue.text.substring(usedSubstringIndex)); + if (newTextLength >= usedSubstringIndex) newText.write(newValue.text.substring(usedSubstringIndex)); return TextEditingValue( text: newText.toString(), selection: TextSelection.collapsed(offset: selectionIndex), @@ -39,87 +37,90 @@ class NumberTextInputFormatter extends TextInputFormatter { final _mobileFormatter = NumberTextInputFormatter(); class TextFields extends StatefulWidget { - TextFields( - {Key key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction = TextInputAction.done, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 16.0, - this.fontWeight = FontWeight.w700, - this.autoValidate = false, - this.fillColor, - this.hintColor, - this.hasBorder = true, - this.onTapTextFields, - this.hasLabelText = false, - this.showLabelText = false, this.borderRadius= 8.0, this.borderColor, this.borderWidth = 1, }) - : super(key: key); + TextFields({ + Key? key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction = TextInputAction.done, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.fillColor, + this.hintColor, + this.hasBorder = true, + this.onTapTextFields, + this.hasLabelText = false, + this.showLabelText = false, + this.borderRadius = 8.0, + this.borderColor, + this.borderWidth = 1, + }) : super(key: key); - final String hintText; - final String initialValue; - final String type; - final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final Function onTapTextFields; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; - final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; - final bool maxLengthEnforced; - final bool bare; - final TextInputAction inputAction; - final double fontSize; - final FontWeight fontWeight; - final bool keepPadding; - final TextCapitalization textCapitalization; - final List inputFormatters; - final bool autoValidate; - final EdgeInsets padding; - final bool focus; - final bool borderOnlyError; - final Color hintColor; - final Color fillColor; - final bool hasBorder; - final bool showLabelText; - Color borderColor; - final double borderRadius; - final double borderWidth; - bool hasLabelText; + final String? hintText; + final String? initialValue; + final String? type; + final bool? autoFocus; + final IconData? suffixIcon; + final Color? suffixIconColor; + final Icon? prefixIcon; + final VoidCallback? onTap; + final GestureTapCallback? onTapTextFields; + final TextEditingController? controller; + final TextInputType? keyboardType; + final FormFieldValidator? validator; + final FormFieldSetter? onSaved; + final GestureTapCallback? onSuffixTap; + final Function? onChanged; + final ValueChanged? onSubmit; + final bool? readOnly; + final int? maxLength; + final int? minLines; + final int? maxLines; + final bool? maxLengthEnforced; + final bool? bare; + final TextInputAction? inputAction; + final double? fontSize; + final FontWeight? fontWeight; + final bool? keepPadding; + final TextCapitalization? textCapitalization; + final List? inputFormatters; + final bool? autoValidate; + final EdgeInsets? padding; + final bool? focus; + final bool? borderOnlyError; + final Color? hintColor; + final Color? fillColor; + final bool? hasBorder; + final bool? showLabelText; + Color? borderColor; + final double? borderRadius; + final double? borderWidth; + bool? hasLabelText; @override _TextFieldsState createState() => _TextFieldsState(); @@ -142,7 +143,7 @@ class _TextFieldsState extends State { @override void didUpdateWidget(TextFields oldWidget) { - if (widget.focus) _focusNode.requestFocus(); + if (widget.focus!) _focusNode.requestFocus(); super.didUpdateWidget(oldWidget); } @@ -152,7 +153,7 @@ class _TextFieldsState extends State { super.dispose(); } - Widget _buildSuffixIcon() { + Widget? _buildSuffixIcon() { switch (widget.type) { case "password": { @@ -165,35 +166,30 @@ class _TextFieldsState extends State { view = false; }); }, - child: Icon(EvaIcons.eye, - size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0))) + child: Icon(EvaIcons.eye, size: 24.0, color: Color?.fromRGBO(78, 62, 253, 1.0))) : InkWell( onTap: () { this.setState(() { view = true; }); }, - child: Icon(EvaIcons.eyeOff, - size: 24.0, color: Colors.grey[500]))); + child: Icon(EvaIcons.eyeOff, size: 24.0, color: Colors.grey[500]))); } break; default: if (widget.suffixIcon != null) return InkWell( - onTap: widget.onSuffixTap, + onTap: widget.onSuffixTap!, child: Icon(widget.suffixIcon, - size: 22.0, - color: widget.suffixIconColor != null - ? widget.suffixIconColor - : Colors.grey[500])); + size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500])); else return null; } } - bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly) { + bool? _determineReadOnly() { + if (widget.readOnly != null && widget.readOnly!) { _focusNode.unfocus(); return true; } else { @@ -203,19 +199,18 @@ class _TextFieldsState extends State { @override Widget build(BuildContext context) { - - widget.borderColor = widget.borderColor?? Colors.grey; + widget.borderColor = widget.borderColor ?? Colors.grey; return (AnimatedContainer( duration: Duration(milliseconds: 300), - decoration: widget.bare + decoration: widget.bare! ? null : BoxDecoration(boxShadow: [ // BoxShadow( - // color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), + // color: Color?.fromRGBO(70, 68, 167, focus ? 0.20 : 0), // offset: Offset(0.0, 13.0), // blurRadius: focus ? 34.0 : 12.0) BoxShadow( - color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0), + color: Color?.fromRGBO(110, 68, 80, focus ? 0.20 : 0), offset: Offset(0.0, 13.0), blurRadius: focus ? 34.0 : 12.0) ]), @@ -225,10 +220,10 @@ class _TextFieldsState extends State { onTap: widget.onTapTextFields, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, - textCapitalization: widget.textCapitalization, - onFieldSubmitted: widget.inputAction == TextInputAction.next - ? (widget.onSubmit != null + autovalidate: widget.autoValidate!, + textCapitalization: widget.textCapitalization!, + onFieldSubmitted: widget.inputAction! == TextInputAction.next + ? (widget.onSubmit! != null ? widget.onSubmit : (val) { _focusNode.nextFocus(); @@ -237,10 +232,10 @@ class _TextFieldsState extends State { textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, + maxLengthEnforced: widget.maxLengthEnforced!, initialValue: widget.initialValue, onChanged: (value) { - if (widget.showLabelText) { + if (widget.showLabelText!) { if ((value == null || value == '')) { setState(() { widget.hasLabelText = false; @@ -251,19 +246,21 @@ class _TextFieldsState extends State { }); } } - if (widget.onChanged != null) widget.onChanged(value); + if (widget.onChanged != null) widget.onChanged!(value); }, focusNode: _focusNode, maxLength: widget.maxLength ?? null, controller: widget.controller, keyboardType: widget.keyboardType, - readOnly: _determineReadOnly(), + readOnly: _determineReadOnly()!, obscureText: widget.type == "password" && !view ? true : false, autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.bodyText1.copyWith( - fontSize: widget.fontSize, fontWeight: widget.fontWeight), + style: Theme.of(context) + .textTheme + .bodyText1! + .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ WhitelistingTextInputFormatter.digitsOnly, @@ -271,7 +268,7 @@ class _TextFieldsState extends State { ] : widget.inputFormatters, decoration: InputDecoration( - labelText: widget.hasLabelText ? widget.hintText : null, + labelText: widget.hasLabelText! ? widget.hintText : null, labelStyle: TextStyle( fontSize: widget.fontSize, fontWeight: widget.fontWeight, @@ -281,68 +278,54 @@ class _TextFieldsState extends State { hintText: widget.hintText, hintStyle: TextStyle( fontSize: widget.fontSize, - fontWeight: widget.fontWeight, color: widget.hintColor ?? Theme.of(context).hintColor, ), contentPadding: widget.padding != null ? widget.padding : EdgeInsets.symmetric( - vertical: - (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, - horizontal: 16.0), + vertical: (widget.bare! && !widget.keepPadding!) ? 0.0 : 10.0, horizontal: 16.0), filled: true, - fillColor: widget.bare - ? Colors.transparent - : Theme.of(context).backgroundColor, + fillColor: widget.bare! ? Colors.transparent : Theme.of(context).backgroundColor, suffixIcon: _buildSuffixIcon(), prefixIcon: widget.prefixIcon, errorStyle: TextStyle( - fontSize: 12.0, - fontWeight: widget.fontWeight, - height: widget.borderOnlyError ? 0.0 : null), + fontSize: 12.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError! ? 0.0 : null), errorBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) + borderSide: widget.hasBorder! + ? BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + borderRadius: widget.hasBorder! + ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) : BorderRadius.circular(0.0), ), focusedErrorBorder: OutlineInputBorder( - borderSide: widget.hasBorder + borderSide: widget.hasBorder! ? BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) + color: Theme.of(context).errorColor.withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), + borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!)), focusedBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + borderSide: widget.hasBorder! + ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + borderRadius: widget.hasBorder! + ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) : BorderRadius.circular(0.0), ), disabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + borderSide: widget.hasBorder! + ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + borderRadius: widget.hasBorder! + ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) : BorderRadius.circular(0.0)), enabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + borderSide: widget.hasBorder! + ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + borderRadius: widget.hasBorder! + ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) : BorderRadius.circular(0.0), ), ), diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index fc7df189..8e8e24ca 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -9,24 +9,24 @@ import 'package:provider/provider.dart'; import '../app_texts_widget.dart'; class AppTextFieldCustom extends StatefulWidget { - final double height; - final Function onClick; - final String hintText; - final TextEditingController controller; - final bool isTextFieldHasSuffix; - final bool hasBorder; - final String dropDownText; - final IconButton suffixIcon; - final Color dropDownColor; - final bool enabled; - final TextInputType inputType; - final int minLines; - final int maxLines; - final List inputFormatters; - final Function(String) onChanged; - final String validationError; - final bool isPrscription; - final bool isSecure; + final double? height; + final GestureTapCallback? onClick; + final String? hintText; + final TextEditingController? controller; + final bool? isTextFieldHasSuffix; + final bool? hasBorder; + final String? dropDownText; + final IconButton? suffixIcon; + final Color? dropDownColor; + final bool? enabled; + final TextInputType? inputType; + final int? minLines; + final int? maxLines; + final List? inputFormatters; + final Function(String)? onChanged; + final String? validationError; + final bool? isPrscription; + final bool? isSecure; AppTextFieldCustom({ this.height = 0, @@ -61,18 +61,12 @@ class _AppTextFieldCustomState extends State { return Column( children: [ Container( - height: widget.height != 0 && widget.maxLines == 1 - ? widget.height + 8 - : null, - decoration: widget.hasBorder + height: widget.height != 0 && widget.maxLines == 1 ? widget.height! + 8 : null, + decoration: widget.hasBorder! ? TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), - widget.validationError == null - ? Color(0xFFEFEFEF) - : Colors.red.shade700) + Color(0Xffffffff), widget.validationError == null ? Color(0xFFEFEFEF) : Colors.red.shade700) : null, - padding: - EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), + padding: EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), child: InkWell( onTap: widget.onClick ?? null, child: Row( @@ -87,30 +81,19 @@ class _AppTextFieldCustomState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - if ((widget.controller != null && - widget.controller.text != "") || - widget.dropDownText != null) + if ((widget.controller != null && widget.controller!.text != "") || widget.dropDownText != null) AppText( widget.hintText, color: Color(0xFF2E303A), - fontSize: widget.isPrscription == false - ? SizeConfig.textMultiplier * 1.3 - : 0, + fontSize: widget.isPrscription == false ? SizeConfig.textMultiplier * 1.3 : 0, fontWeight: FontWeight.w700, ), widget.dropDownText == null ? Container( - height: - widget.height != 0 && widget.maxLines == 1 - ? widget.height - 22 - : null, + height: widget.height != 0 && widget.maxLines == 1 ? widget.height! - 22 : null, child: TextField( - textAlign: projectViewModel.isArabic - ? TextAlign.right - : TextAlign.left, - decoration: TextFieldsUtils - .textFieldSelectorDecoration( - widget.hintText, null, true), + textAlign: projectViewModel.isArabic ? TextAlign.right : TextAlign.left, + decoration: TextFieldsUtils.textFieldSelectorDecoration(widget.hintText!, "", true), style: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, fontFamily: 'Poppins', @@ -118,23 +101,18 @@ class _AppTextFieldCustomState extends State { ), controller: widget.controller, keyboardType: widget.inputType ?? - (widget.maxLines == 1 - ? TextInputType.text - : TextInputType.multiline), + (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline), enabled: widget.enabled, minLines: widget.minLines, maxLines: widget.maxLines, - inputFormatters: - widget.inputFormatters != null - ? widget.inputFormatters - : [], + inputFormatters: widget.inputFormatters != null ? widget.inputFormatters : [], onChanged: (value) { setState(() {}); if (widget.onChanged != null) { - widget.onChanged(value); + widget.onChanged!(value); } }, - obscureText: widget.isSecure), + obscureText: widget.isSecure!), ) : AppText( widget.dropDownText, @@ -146,15 +124,13 @@ class _AppTextFieldCustomState extends State { ), ), ), - widget.isTextFieldHasSuffix + widget.isTextFieldHasSuffix! ? widget.suffixIcon != null - ? widget.suffixIcon + ? widget.suffixIcon! : InkWell( child: Icon( Icons.keyboard_arrow_down, - color: widget.dropDownColor != null - ? widget.dropDownColor - : Colors.black, + color: widget.dropDownColor != null ? widget.dropDownColor : Colors.black, ), ) : Container(), @@ -162,8 +138,7 @@ class _AppTextFieldCustomState extends State { ), ), ), - if (widget.validationError != null) - TextFieldsError(error: widget.validationError), + if (widget.validationError != null) TextFieldsError(error: widget.validationError!), ], ); } diff --git a/lib/widgets/shared/text_fields/app_text_form_field.dart b/lib/widgets/shared/text_fields/app_text_form_field.dart index cf5f0abf..1418b590 100644 --- a/lib/widgets/shared/text_fields/app_text_form_field.dart +++ b/lib/widgets/shared/text_fields/app_text_form_field.dart @@ -6,22 +6,22 @@ import 'package:hexcolor/hexcolor.dart'; class AppTextFormField extends FormField { AppTextFormField( - {FormFieldSetter onSaved, - String inputFormatter, - FormFieldValidator validator, - ValueChanged onChanged, - GestureTapCallback onTap, + {FormFieldSetter? onSaved, + String? inputFormatter, + FormFieldValidator? validator, + ValueChanged? onChanged, + GestureTapCallback? onTap, bool obscureText = false, - TextEditingController controller, + TextEditingController? controller, bool autovalidate = true, - TextInputType textInputType, - String hintText, - FocusNode focusNode, - TextInputAction textInputAction=TextInputAction.done, - ValueChanged onFieldSubmitted, - IconButton prefix, - String labelText, - IconData suffixIcon, + TextInputType? textInputType, + String? hintText, + FocusNode? focusNode, + TextInputAction textInputAction = TextInputAction.done, + ValueChanged? onFieldSubmitted, + IconButton? prefix, + String? labelText, + IconData? suffixIcon, bool readOnly = false, borderColor}) : super( @@ -55,24 +55,17 @@ class AppTextFormField extends FormField { hintStyle: TextStyle( fontSize: SizeConfig.textMultiplier * 1.8, ), - contentPadding: - EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + contentPadding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), labelText: labelText, labelStyle: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(6)), - borderSide: BorderSide( - color: borderColor != null - ? borderColor - : HexColor("#CCCCCC")), + borderSide: BorderSide(color: borderColor != null ? borderColor : HexColor("#CCCCCC")), ), focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: borderColor != null - ? borderColor - : HexColor("#CCCCCC")), + borderSide: BorderSide(color: borderColor != null ? borderColor : HexColor("#CCCCCC")), borderRadius: BorderRadius.all(Radius.circular(6)), ) //BorderRadius.all(Radius.circular(20)); @@ -83,7 +76,7 @@ class AppTextFormField extends FormField { ), state.hasError ? Text( - state.errorText, + state.errorText ?? "", style: TextStyle(color: Colors.red), ) : Container() diff --git a/lib/widgets/shared/text_fields/auto_complete_text_field.dart b/lib/widgets/shared/text_fields/auto_complete_text_field.dart index 3b563f3f..d5875d43 100644 --- a/lib/widgets/shared/text_fields/auto_complete_text_field.dart +++ b/lib/widgets/shared/text_fields/auto_complete_text_field.dart @@ -8,13 +8,11 @@ class CustomAutoCompleteTextField extends StatelessWidget { final Widget child; const CustomAutoCompleteTextField({ - Key key, - this.isShowError, - this.child, + Key? key, + required this.isShowError, + required this.child, }) : super(key: key); - - @override Widget build(BuildContext context) { return Container( @@ -25,13 +23,12 @@ class CustomAutoCompleteTextField extends StatelessWidget { Color(0Xffffffff), isShowError ? Colors.red.shade700 : Color(0xFFEFEFEF), ), - padding: - EdgeInsets.only(top: 0.2, bottom: 2.0, left: 8.0, right: 0.0), + padding: EdgeInsets.only(top: 0.2, bottom: 2.0, left: 8.0, right: 0.0), child: child, ), if (isShowError) TextFieldsError( - error: TranslationBase.of(context).emptyMessage, + error: TranslationBase.of(context).emptyMessage ?? "", ) ], ), diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart index 41cd0573..df174f47 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -13,12 +13,12 @@ import '../speech-text-popup.dart'; class HtmlRichEditor extends StatefulWidget { final String hint; - final String initialText; + final String? initialText; final double height; - final BoxDecoration decoration; + final BoxDecoration? decoration; final bool darkMode; final bool showBottomToolbar; - final List toolbar; + final List? toolbar; final HtmlEditorController controller; HtmlRichEditor({ @@ -30,7 +30,7 @@ class HtmlRichEditor extends StatefulWidget { this.darkMode = false, this.showBottomToolbar = false, this.toolbar, - @required this.controller, + required this.controller, }) : super(key: key); @override @@ -38,7 +38,7 @@ class HtmlRichEditor extends StatefulWidget { } class _HtmlRichEditorState extends State { - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); @@ -87,19 +87,16 @@ class _HtmlRichEditorState extends State { borderRadius: BorderRadius.all( Radius.circular(30.0), ), - border: Border.all(color: Colors.grey[200], width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), )), Positioned( top: 50, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, + right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, child: Column( children: [ IconButton( - icon: Icon(DoctorApp.speechtotext, - color: Colors.black, size: 35), + icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), onPressed: () { initSpeechState().then((value) => {onVoiceText()}); }, @@ -113,8 +110,7 @@ class _HtmlRichEditorState extends State { onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -158,8 +154,7 @@ class _HtmlRichEditorState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } diff --git a/lib/widgets/shared/text_fields/new_text_Field.dart b/lib/widgets/shared/text_fields/new_text_Field.dart index 9917b04f..ca5b417c 100644 --- a/lib/widgets/shared/text_fields/new_text_Field.dart +++ b/lib/widgets/shared/text_fields/new_text_Field.dart @@ -5,8 +5,7 @@ import 'package:hexcolor/hexcolor.dart'; class NumberTextInputFormatter extends TextInputFormatter { @override - TextEditingValue formatEditUpdate( - TextEditingValue oldValue, TextEditingValue newValue) { + TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { final int newTextLength = newValue.text.length; int selectionIndex = newValue.selection.end; int usedSubstringIndex = 0; @@ -28,8 +27,7 @@ class NumberTextInputFormatter extends TextInputFormatter { if (newValue.selection.end >= 10) selectionIndex++; } // Dump the rest. - if (newTextLength >= usedSubstringIndex) - newText.write(newValue.text.substring(usedSubstringIndex)); + if (newTextLength >= usedSubstringIndex) newText.write(newValue.text.substring(usedSubstringIndex)); return TextEditingValue( text: newText.toString(), selection: TextSelection.collapsed(offset: selectionIndex), @@ -41,77 +39,88 @@ final _mobileFormatter = NumberTextInputFormatter(); class NewTextFields extends StatefulWidget { NewTextFields( - {Key key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 15.0, - this.fontWeight = FontWeight.w500, - this.autoValidate = false, - this.hintColor, - this.isEnabled = true}) + {Key? key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 15.0, + this.fontWeight = FontWeight.w500, + this.autoValidate = false, + this.hintColor, + this.isEnabled = true, + this.onTapTextFields, + this.fillColor, + this.hasBorder, + this.showLabelText, + this.borderRadius, + this.borderWidth}) : super(key: key); - - final String hintText; - - // final String initialValue; - final String type; - final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; - final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; - final bool maxLengthEnforced; - final bool bare; - final bool isEnabled; - final TextInputAction inputAction; - final double fontSize; - final FontWeight fontWeight; - final bool keepPadding; - final TextCapitalization textCapitalization; - final List inputFormatters; - final bool autoValidate; - final EdgeInsets padding; - final bool focus; - final bool borderOnlyError; - final Color hintColor; - final String initialValue; + final String? hintText; + final String? initialValue; + final String? type; + final bool? autoFocus; + final bool? isEnabled; + final IconData? suffixIcon; + final Color? suffixIconColor; + final Icon? prefixIcon; + final VoidCallback? onTap; + final GestureTapCallback? onTapTextFields; + final TextEditingController? controller; + final TextInputType? keyboardType; + final FormFieldValidator? validator; + final FormFieldSetter? onSaved; + final GestureTapCallback? onSuffixTap; + final ValueChanged? onChanged; + final ValueChanged? onSubmit; + final bool? readOnly; + final int? maxLength; + final int? minLines; + final int? maxLines; + final bool? maxLengthEnforced; + final bool? bare; + final TextInputAction? inputAction; + final double? fontSize; + final FontWeight? fontWeight; + final bool? keepPadding; + final TextCapitalization? textCapitalization; + final List? inputFormatters; + final bool? autoValidate; + final EdgeInsets? padding; + final bool? focus; + final bool? borderOnlyError; + final Color? hintColor; + final Color? fillColor; + final bool? hasBorder; + final bool? showLabelText; + Color? borderColor; + final double? borderRadius; + final double? borderWidth; + bool? hasLabelText; @override _NewTextFieldsState createState() => _NewTextFieldsState(); } @@ -133,7 +142,7 @@ class _NewTextFieldsState extends State { @override void didUpdateWidget(NewTextFields oldWidget) { - if (widget.focus) _focusNode.requestFocus(); + if (widget.focus!) _focusNode.requestFocus(); super.didUpdateWidget(oldWidget); } @@ -144,7 +153,7 @@ class _NewTextFieldsState extends State { } bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly) { + if (widget.readOnly != null && widget.readOnly!) { _focusNode.unfocus(); return true; } else { @@ -158,34 +167,30 @@ class _NewTextFieldsState extends State { duration: Duration(milliseconds: 300), decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - border: Border.all( - color: HexColor('#707070'), - width: 0.30), + border: Border.all(color: HexColor('#707070'), width: 0.30), color: Colors.white), child: Container( margin: EdgeInsets.only(top: 8), padding: EdgeInsets.only(top: 8), - - child: TextFormField( enabled: widget.isEnabled, initialValue: widget.initialValue, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, - textCapitalization: widget.textCapitalization, + autovalidate: widget.autoValidate!, + textCapitalization: widget.textCapitalization!, onFieldSubmitted: widget.inputAction == TextInputAction.next ? (widget.onSubmit != null - ? widget.onSubmit - : (val) { - _focusNode.nextFocus(); - }) + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) : widget.onSubmit, textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, - onChanged: widget.onChanged, + maxLengthEnforced: widget.maxLengthEnforced!, + onChanged: widget.onChanged!, focusNode: _focusNode, maxLength: widget.maxLength ?? null, controller: widget.controller, @@ -195,34 +200,30 @@ class _NewTextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.body2.copyWith( - fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Color(0xFF575757), fontFamily: 'Poppins'), + style: Theme.of(context).textTheme.body2!.copyWith( + fontSize: widget.fontSize, + fontWeight: widget.fontWeight, + color: Color(0xFF575757), + fontFamily: 'Poppins'), inputFormatters: widget.keyboardType == TextInputType.phone ? [ - WhitelistingTextInputFormatter.digitsOnly, - _mobileFormatter, - ] + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] : widget.inputFormatters, decoration: InputDecoration( labelText: widget.hintText, - labelStyle: - TextStyle(color: Color(0xFF2E303A), fontSize:15,fontWeight: FontWeight.w700), + labelStyle: TextStyle(color: Color(0xFF2E303A), fontSize: 15, fontWeight: FontWeight.w700), errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context).errorColor.withOpacity(0.5), - width: 1.0), + borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(12.0)), focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context).errorColor.withOpacity(0.5), - width: 1.0), + borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(8.0)), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), + borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), + borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12), diff --git a/lib/widgets/shared/text_fields/text_field_error.dart b/lib/widgets/shared/text_fields/text_field_error.dart index 9c781db0..b327388c 100644 --- a/lib/widgets/shared/text_fields/text_field_error.dart +++ b/lib/widgets/shared/text_fields/text_field_error.dart @@ -6,8 +6,8 @@ import '../app_texts_widget.dart'; class TextFieldsError extends StatelessWidget { const TextFieldsError({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); final String error; diff --git a/lib/widgets/shared/text_fields/text_fields_utils.dart b/lib/widgets/shared/text_fields/text_fields_utils.dart index 54c7e494..37c4beb2 100644 --- a/lib/widgets/shared/text_fields/text_fields_utils.dart +++ b/lib/widgets/shared/text_fields/text_fields_utils.dart @@ -1,9 +1,7 @@ import 'package:flutter/material.dart'; -class TextFieldsUtils{ - - static BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor, +class TextFieldsUtils { + static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, {double borderWidth = -1, double borderRadius = 12}) { return BoxDecoration( color: containerColor, @@ -16,9 +14,8 @@ class TextFieldsUtils{ ); } - static InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData suffixIcon, Color dropDownColor}) { + static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {IconData? suffixIcon, Color? dropDownColor}) { return InputDecoration( isDense: true, contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0), @@ -47,12 +44,14 @@ class TextFieldsUtils{ borderRadius: BorderRadius.circular(8), ),*/ hintText: selectedText != null ? selectedText : hintText, - suffixIcon: Icon(suffixIcon??null, color: Colors.grey.shade600,), - + suffixIcon: Icon( + suffixIcon ?? null, + color: Colors.grey.shade600, + ), hintStyle: TextStyle( fontSize: 14, color: Colors.grey.shade600, ), ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart b/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart deleted file mode 100644 index 8a4891fd..00000000 --- a/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:flutter/material.dart'; - -/// Displays an overlay Widget anchored directly above the center of this -/// [AnchoredOverlay]. -/// -/// The overlay Widget is created by invoking the provided [overlayBuilder]. -/// -/// The [anchor] position is provided to the [overlayBuilder], but the builder -/// does not have to respect it. In other words, the [overlayBuilder] can -/// interpret the meaning of "anchor" however it wants - the overlay will not -/// be forced to be centered about the [anchor]. -/// -/// The overlay built by this [AnchoredOverlay] can be conditionally shown -/// and hidden by settings the [showOverlay] property to true or false. -/// -/// The [overlayBuilder] is invoked every time this Widget is rebuilt. -/// -class AnchoredOverlay extends StatelessWidget { - final bool showOverlay; - final Widget Function(BuildContext, Rect anchorBounds, Offset anchor) - overlayBuilder; - final Widget child; - - AnchoredOverlay({ - key, - this.showOverlay = false, - this.overlayBuilder, - this.child, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { - return OverlayBuilder( - showOverlay: showOverlay, - overlayBuilder: (BuildContext overlayContext) { - // To calculate the "anchor" point we grab the render box of - // our parent Container and then we find the center of that box. - RenderBox box = context.findRenderObject() as RenderBox; - final topLeft = - box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - final Rect anchorBounds = Rect.fromLTRB( - topLeft.dx, - topLeft.dy, - bottomRight.dx, - bottomRight.dy, - ); - final anchorCenter = box.size.center(topLeft); - return overlayBuilder(overlayContext, anchorBounds, anchorCenter); - }, - child: child, - ); - }, - ); - } -} - -// -// Displays an overlay Widget as constructed by the given [overlayBuilder]. -// -// The overlay built by the [overlayBuilder] can be conditionally shown and hidden by settings the [showOverlay] -// property to true or false. -// -// The [overlayBuilder] is invoked every time this Widget is rebuilt. -// -// Implementation note: the reason we rebuild the overlay every time our state changes is because there doesn't seem -// to be any better way to invalidate the overlay itself than to invalidate this Widget. -// Remember, overlay Widgets exist in [OverlayEntry]s which are inaccessible to outside Widgets. -// But if a better approach is found then feel free to use it. -// -class OverlayBuilder extends StatefulWidget { - final bool showOverlay; - final Widget Function(BuildContext) overlayBuilder; - final Widget child; - - OverlayBuilder({ - key, - this.showOverlay = false, - this.overlayBuilder, - this.child, - }) : super(key: key); - - @override - _OverlayBuilderState createState() => _OverlayBuilderState(); -} - -class _OverlayBuilderState extends State { - OverlayEntry _overlayEntry; - - @override - void initState() { - super.initState(); - - if (widget.showOverlay) { - WidgetsBinding.instance.addPostFrameCallback((_) => showOverlay()); - } - } - - @override - void didUpdateWidget(OverlayBuilder oldWidget) { - super.didUpdateWidget(oldWidget); - WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay()); - } - - @override - void reassemble() { - super.reassemble(); - WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay()); - } - - @override - void dispose() { - if (isShowingOverlay()) { - hideOverlay(); - } - - super.dispose(); - } - - bool isShowingOverlay() => _overlayEntry != null; - - void showOverlay() { - if (_overlayEntry == null) { - // Create the overlay. - _overlayEntry = OverlayEntry( - builder: widget.overlayBuilder, - ); - addToOverlay(_overlayEntry); - } else { - // Rebuild overlay. - buildOverlay(); - } - } - - void addToOverlay(OverlayEntry overlayEntry) async { - Overlay.of(context).insert(overlayEntry); - final overlay = Overlay.of(context); - if (overlayEntry == null) - WidgetsBinding.instance - .addPostFrameCallback((_) => overlay.insert(overlayEntry)); - } - - void hideOverlay() { - if (_overlayEntry != null) { - _overlayEntry.remove(); - _overlayEntry = null; - } - } - - void syncWidgetAndOverlay() { - if (isShowingOverlay() && !widget.showOverlay) { - hideOverlay(); - } else if (!isShowingOverlay() && widget.showOverlay) { - showOverlay(); - } - } - - void buildOverlay() async { - WidgetsBinding.instance - .addPostFrameCallback((_) => _overlayEntry?.markNeedsBuild()); - } - - @override - Widget build(BuildContext context) { - buildOverlay(); - - return widget.child; - } -} diff --git a/lib/widgets/shared/user-guid/app_get_position.dart b/lib/widgets/shared/user-guid/app_get_position.dart deleted file mode 100644 index c0430994..00000000 --- a/lib/widgets/shared/user-guid/app_get_position.dart +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ -import 'package:flutter/material.dart'; - -class GetPosition { - final GlobalKey key; - - GetPosition({this.key}); - - Rect getRect() { - RenderBox box = key.currentContext.findRenderObject(); - - final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - - Rect rect = Rect.fromLTRB( - topLeft.dx, - topLeft.dy, - bottomRight.dx, - bottomRight.dy, - ); - return rect; - } - - ///Get the bottom position of the widget - double getBottom() { - RenderBox box = key.currentContext.findRenderObject(); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - return bottomRight.dy; - } - - ///Get the top position of the widget - double getTop() { - RenderBox box = key.currentContext.findRenderObject(); - final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - return topLeft.dy; - } - - ///Get the left position of the widget - double getLeft() { - RenderBox box = key.currentContext.findRenderObject(); - final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - return topLeft.dx; - } - - ///Get the right position of the widget - double getRight() { - RenderBox box = key.currentContext.findRenderObject(); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - return bottomRight.dx; - } - - double getHeight() { - return getBottom() - getTop(); - } - - double getWidth() { - return getRight() - getLeft(); - } - - double getCenter() { - return (getLeft() + getRight()) / 2; - } -} diff --git a/lib/widgets/shared/user-guid/app_shape_painter.dart b/lib/widgets/shared/user-guid/app_shape_painter.dart deleted file mode 100644 index 925d18d0..00000000 --- a/lib/widgets/shared/user-guid/app_shape_painter.dart +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:flutter/material.dart'; - -class ShapePainter extends CustomPainter { - Rect rect; - final ShapeBorder shapeBorder; - final Color color; - final double opacity; - - ShapePainter({ - @required this.rect, - this.color, - this.shapeBorder, - this.opacity, - }); - - @override - void paint(Canvas canvas, Size size) { - final paint = Paint(); - paint.color = color.withOpacity(opacity); - RRect outer = - RRect.fromLTRBR(0, 0, size.width, size.height, Radius.circular(0)); - - double radius = shapeBorder == CircleBorder() ? 50 : 3; - - RRect inner = RRect.fromRectAndRadius(rect, Radius.circular(radius)); - canvas.drawDRRect(outer, inner, paint); - } - - @override - bool shouldRepaint(CustomPainter oldDelegate) => false; -} diff --git a/lib/widgets/shared/user-guid/app_showcase.dart b/lib/widgets/shared/user-guid/app_showcase.dart deleted file mode 100644 index 38625279..00000000 --- a/lib/widgets/shared/user-guid/app_showcase.dart +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; - -import 'app_anchored_overlay_widget.dart'; -import 'app_get_position.dart'; -import 'app_shape_painter.dart'; -import 'app_showcase_widget.dart'; -import 'app_tool_tip_widget.dart'; - -class AppShowcase extends StatefulWidget { - final Widget child; - final String title; - final String description; - final ShapeBorder shapeBorder; - final TextStyle titleTextStyle; - final TextStyle descTextStyle; - final GlobalKey key; - final Color overlayColor; - final double overlayOpacity; - final Widget container; - final Color showcaseBackgroundColor; - final Color textColor; - final bool showArrow; - final double height; - final double width; - final Duration animationDuration; - final VoidCallback onToolTipClick; - final VoidCallback onTargetClick; - final VoidCallback onSkipClick; - final bool disposeOnTap; - final bool disableAnimation; - - const AppShowcase( - {@required this.key, - @required this.child, - this.title, - @required this.description, - this.shapeBorder, - this.overlayColor = Colors.black, - this.overlayOpacity = 0.75, - this.titleTextStyle, - this.descTextStyle, - this.showcaseBackgroundColor = Colors.white, - this.textColor = Colors.black, - this.showArrow = true, - this.onTargetClick, - this.onSkipClick, - this.disposeOnTap, - this.animationDuration = const Duration(milliseconds: 2000), - this.disableAnimation = false}) - : height = null, - width = null, - container = null, - this.onToolTipClick = null, - assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0, - "overlay opacity should be >= 0.0 and <= 1.0."), - assert( - onTargetClick == null - ? true - : (disposeOnTap == null ? false : true), - "disposeOnTap is required if you're using onTargetClick"), - assert( - disposeOnTap == null - ? true - : (onTargetClick == null ? false : true), - "onTargetClick is required if you're using disposeOnTap"), - assert(key != null || - child != null || - title != null || - showArrow != null || - description != null || - shapeBorder != null || - overlayColor != null || - titleTextStyle != null || - descTextStyle != null || - showcaseBackgroundColor != null || - textColor != null || - shapeBorder != null || - animationDuration != null); - - const AppShowcase.withWidget( - {this.key, - @required this.child, - @required this.container, - @required this.height, - @required this.width, - this.title, - this.description, - this.shapeBorder, - this.overlayColor = Colors.black, - this.overlayOpacity = 0.75, - this.titleTextStyle, - this.descTextStyle, - this.showcaseBackgroundColor = Colors.white, - this.textColor = Colors.black, - this.onTargetClick, - this.onSkipClick, - this.disposeOnTap, - this.animationDuration = const Duration(milliseconds: 2000), - this.disableAnimation = false}) - : this.showArrow = false, - this.onToolTipClick = null, - assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0, - "overlay opacity should be >= 0.0 and <= 1.0."), - assert(key != null || - child != null || - title != null || - description != null || - shapeBorder != null || - overlayColor != null || - titleTextStyle != null || - descTextStyle != null || - showcaseBackgroundColor != null || - textColor != null || - shapeBorder != null || - animationDuration != null); - - @override - _AppShowcaseState createState() => _AppShowcaseState(); -} - -class _AppShowcaseState extends State - with TickerProviderStateMixin { - bool _showShowCase = false; - Animation _slideAnimation; - AnimationController _slideAnimationController; - - GetPosition position; - - @override - void initState() { - super.initState(); - - _slideAnimationController = AnimationController( - duration: widget.animationDuration, - vsync: this, - )..addStatusListener((AnimationStatus status) { - if (status == AnimationStatus.completed) { - _slideAnimationController.reverse(); - } - if (_slideAnimationController.isDismissed) { - if (!widget.disableAnimation) { - _slideAnimationController.forward(); - } - } - }); - - _slideAnimation = CurvedAnimation( - parent: _slideAnimationController, - curve: Curves.easeInOut, - ); - - position = GetPosition(key: widget.key); - } - - @override - void dispose() { - _slideAnimationController.dispose(); - super.dispose(); - } - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - showOverlay(); - } - - /// - /// show overlay if there is any target widget - /// - void showOverlay() { - GlobalKey activeStep = ShowCaseWidget.activeTargetWidget(context); - setState(() { - _showShowCase = activeStep == widget.key; - }); - - if (activeStep == widget.key) { - if (!widget.disableAnimation) { - _slideAnimationController.forward(); - } - } - } - - @override - Widget build(BuildContext context) { - Size size = MediaQuery.of(context).size; - return AnchoredOverlay( - overlayBuilder: (BuildContext context, Rect rectBound, Offset offset) => - buildOverlayOnTarget(offset, rectBound.size, rectBound, size), - showOverlay: true, - child: widget.child, - ); - } - - _nextIfAny() { - ShowCaseWidget.of(context).completed(widget.key); - if (!widget.disableAnimation) { - _slideAnimationController.forward(); - } - } - - _getOnTargetTap() { - if (widget.disposeOnTap == true) { - return widget.onTargetClick == null - ? () { - ShowCaseWidget.of(context).dismiss(); - } - : () { - ShowCaseWidget.of(context).dismiss(); - widget.onTargetClick(); - }; - } else { - return widget.onTargetClick ?? _nextIfAny; - } - } - - _getOnTooltipTap() { - if (widget.disposeOnTap == true) { - return widget.onToolTipClick == null - ? () { - ShowCaseWidget.of(context).dismiss(); - } - : () { - ShowCaseWidget.of(context).dismiss(); - widget.onToolTipClick(); - }; - } else { - return widget.onToolTipClick ?? () {}; - } - } - - buildOverlayOnTarget( - Offset offset, - Size size, - Rect rectBound, - Size screenSize, - ) => - Visibility( - visible: _showShowCase, - maintainAnimation: true, - maintainState: true, - child: Stack( - children: [ - GestureDetector( - onTap: _nextIfAny, - child: Container( - width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height, - child: CustomPaint( - painter: ShapePainter( - opacity: widget.overlayOpacity, - rect: position.getRect(), - shapeBorder: widget.shapeBorder, - color: widget.overlayColor), - ), - ), - ), - _TargetWidget( - offset: offset, - size: size, - onTap: _getOnTargetTap(), - shapeBorder: widget.shapeBorder, - ), - AppToolTipWidget( - position: position, - offset: offset, - screenSize: screenSize, - title: widget.title, - description: widget.description, - animationOffset: _slideAnimation, - titleTextStyle: widget.titleTextStyle, - descTextStyle: widget.descTextStyle, - container: widget.container, - tooltipColor: widget.showcaseBackgroundColor, - textColor: widget.textColor, - showArrow: widget.showArrow, - contentHeight: widget.height, - contentWidth: widget.width, - onTooltipTap: _getOnTooltipTap(), - ), - GestureDetector( - child: AppText( - "Skip", - color: Colors.white, - fontSize: 20, - marginRight: 15, - marginLeft: 15, - marginTop: 15, - ), - onTap: widget.onSkipClick) - ], - ), - ); -} - -class _TargetWidget extends StatelessWidget { - final Offset offset; - final Size size; - final Animation widthAnimation; - final VoidCallback onTap; - final ShapeBorder shapeBorder; - - _TargetWidget({ - Key key, - @required this.offset, - this.size, - this.widthAnimation, - this.onTap, - this.shapeBorder, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return Positioned( - top: offset.dy, - left: offset.dx, - child: FractionalTranslation( - translation: const Offset(-0.5, -0.5), - child: GestureDetector( - onTap: onTap, - child: Container( - height: size.height + 16, - width: size.width + 16, - decoration: ShapeDecoration( - shape: shapeBorder ?? - RoundedRectangleBorder( - borderRadius: const BorderRadius.all( - Radius.circular(8), - ), - ), - ), - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/user-guid/app_showcase_widget.dart b/lib/widgets/shared/user-guid/app_showcase_widget.dart deleted file mode 100644 index 07577b3b..00000000 --- a/lib/widgets/shared/user-guid/app_showcase_widget.dart +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:flutter/material.dart'; - -class ShowCaseWidget extends StatefulWidget { - final Builder builder; - final VoidCallback onFinish; - - const ShowCaseWidget({@required this.builder, this.onFinish}); - - static activeTargetWidget(BuildContext context) { - return context - .dependOnInheritedWidgetOfExactType<_InheritedShowCaseView>() - .activeWidgetIds; - } - - static ShowCaseWidgetState of(BuildContext context) { - ShowCaseWidgetState state = - context.findAncestorStateOfType(); - if (state != null) { - return context.findAncestorStateOfType(); - } else { - throw Exception('Please provide ShowCaseView context'); - } - } - - @override - ShowCaseWidgetState createState() => ShowCaseWidgetState(); -} - -class ShowCaseWidgetState extends State { - List ids; - int activeWidgetId; - - void startShowCase(List widgetIds) { - setState(() { - this.ids = widgetIds; - activeWidgetId = 0; - }); - } - - void completed(GlobalKey id) { - if (ids != null && ids[activeWidgetId] == id) { - setState(() { - ++activeWidgetId; - - if (activeWidgetId >= ids.length) { - _cleanupAfterSteps(); - if (widget.onFinish != null) { - widget.onFinish(); - } - } - }); - } - } - - void dismiss() { - setState(() { - _cleanupAfterSteps(); - }); - } - - void _cleanupAfterSteps() { - ids = null; - activeWidgetId = null; - } - - @override - Widget build(BuildContext context) { - return _InheritedShowCaseView( - child: widget.builder, - activeWidgetIds: ids?.elementAt(activeWidgetId), - ); - } -} - -class _InheritedShowCaseView extends InheritedWidget { - final GlobalKey activeWidgetIds; - - _InheritedShowCaseView({ - @required this.activeWidgetIds, - @required child, - }) : super(child: child); - - @override - bool updateShouldNotify(_InheritedShowCaseView oldWidget) => - oldWidget.activeWidgetIds != activeWidgetIds; -} diff --git a/lib/widgets/shared/user-guid/app_tool_tip_widget.dart b/lib/widgets/shared/user-guid/app_tool_tip_widget.dart deleted file mode 100644 index 285caa8e..00000000 --- a/lib/widgets/shared/user-guid/app_tool_tip_widget.dart +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; - -import 'app_get_position.dart'; - -class AppToolTipWidget extends StatelessWidget { - final GetPosition position; - final Offset offset; - final Size screenSize; - final String title; - final String description; - final Animation animationOffset; - final TextStyle titleTextStyle; - final TextStyle descTextStyle; - final Widget container; - final Color tooltipColor; - final Color textColor; - final bool showArrow; - final double contentHeight; - final double contentWidth; - static bool isArrowUp; - final VoidCallback onTooltipTap; - - AppToolTipWidget({ - this.position, - this.offset, - this.screenSize, - this.title, - this.description, - this.animationOffset, - this.titleTextStyle, - this.descTextStyle, - this.container, - this.tooltipColor, - this.textColor, - this.showArrow, - this.contentHeight, - this.contentWidth, - this.onTooltipTap, - }); - - bool isCloseToTopOrBottom(Offset position) { - double height = 120; - if (contentHeight != null) { - height = contentHeight; - } - return (screenSize.height - position.dy) <= height; - } - - String findPositionForContent(Offset position) { - if (isCloseToTopOrBottom(position)) { - return 'ABOVE'; - } else { - return 'BELOW'; - } - } - - double _getTooltipWidth() { - double titleLength = title == null ? 0 : (title.length * 10.0); - double descriptionLength = (description.length * 7.0); - if (titleLength > descriptionLength) { - return titleLength + 10; - } else { - return descriptionLength + 10; - } - } - - bool _isLeft() { - double screenWidth = screenSize.width / 3; - return !(screenWidth <= position.getCenter()); - } - - bool _isRight() { - double screenWidth = screenSize.width / 3; - return ((screenWidth * 2) <= position.getCenter()); - } - - double _getLeft() { - if (_isLeft()) { - double leftPadding = position.getCenter() - (_getTooltipWidth() * 0.1); - if (leftPadding + _getTooltipWidth() > screenSize.width) { - leftPadding = (screenSize.width - 20) - _getTooltipWidth(); - } - if (leftPadding < 20) { - leftPadding = 14; - } - return leftPadding; - } else if (!(_isRight())) { - return position.getCenter() - (_getTooltipWidth() * 0.5); - } else { - return null; - } - } - - double _getRight() { - if (_isRight()) { - double rightPadding = position.getCenter() + (_getTooltipWidth() / 2); - if (rightPadding + _getTooltipWidth() > screenSize.width) { - rightPadding = 14; - } - return rightPadding; - } else if (!(_isLeft())) { - return position.getCenter() - (_getTooltipWidth() * 0.5); - } else { - return null; - } - } - - double _getSpace() { - double space = position.getCenter() - (contentWidth / 2); - if (space + contentWidth > screenSize.width) { - space = screenSize.width - contentWidth - 8; - } else if (space < (contentWidth / 2)) { - space = 16; - } - return space; - } - - @override - Widget build(BuildContext context) { - final contentOrientation = findPositionForContent(offset); - final contentOffsetMultiplier = contentOrientation == "BELOW" ? 1.0 : -1.0; - isArrowUp = contentOffsetMultiplier == 1.0 ? true : false; - - final contentY = isArrowUp - ? position.getBottom() + (contentOffsetMultiplier * 3) - : position.getTop() + (contentOffsetMultiplier * 3); - - final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0); - - double paddingTop = isArrowUp ? 22 : 0; - double paddingBottom = isArrowUp ? 0 : 27; - - if (!showArrow) { - paddingTop = 10; - paddingBottom = 10; - } - - if (container == null) { - return Stack( - children: [ - showArrow ? _getArrow(contentOffsetMultiplier) : Container(), - Positioned( - top: contentY, - left: _getLeft(), - right: _getRight(), - child: FractionalTranslation( - translation: Offset(0.0, contentFractionalOffset), - child: SlideTransition( - position: Tween( - begin: Offset(0.0, contentFractionalOffset / 10), - end: Offset(0.0, 0.100), - ).animate(animationOffset), - child: Material( - color: Colors.transparent, - child: Container( - padding: - EdgeInsets.only(top: paddingTop, bottom: paddingBottom), - child: ClipRRect( - borderRadius: BorderRadius.circular(8), - child: GestureDetector( - onTap: onTooltipTap, - child: Container( - width: _getTooltipWidth(), - padding: EdgeInsets.symmetric(vertical: 8), - color: tooltipColor, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - child: Column( - crossAxisAlignment: title != null - ? CrossAxisAlignment.start - : CrossAxisAlignment.center, - children: [ - title != null - ? Row( - children: [ - Padding( - padding: - const EdgeInsets.all(8.0), - child: Icon( - DoctorApp.search_patient), - ), - AppText( - title, - color: textColor, - margin: 2, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ], - ) - : Container(), - AppText( - description, - color: textColor, - margin: 8, - ), - ], - ), - ) - ], - ), - ), - ), - ), - ), - ), - ), - ), - ) - ], - ); - } else { - return Stack( - children: [ - Positioned( - left: _getSpace(), - top: contentY - 10, - child: FractionalTranslation( - translation: Offset(0.0, contentFractionalOffset), - child: SlideTransition( - position: Tween( - begin: Offset(0.0, contentFractionalOffset / 5), - end: Offset(0.0, 0.100), - ).animate(animationOffset), - child: Material( - color: Colors.transparent, - child: GestureDetector( - onTap: onTooltipTap, - child: Container( - padding: EdgeInsets.only( - top: paddingTop, - ), - color: Colors.transparent, - child: Center( - child: container, - ), - ), - ), - ), - ), - ), - ), - ], - ); - } - } - - Widget _getArrow(contentOffsetMultiplier) { - final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0); - return Positioned( - top: isArrowUp ? position.getBottom() : position.getTop() - 1, - left: position.getCenter() - 24, - child: FractionalTranslation( - translation: Offset(0.0, contentFractionalOffset), - child: SlideTransition( - position: Tween( - begin: Offset(0.0, contentFractionalOffset / 5), - end: Offset(0.0, 0.150), - ).animate(animationOffset), - child: isArrowUp - ? Icon( - Icons.arrow_drop_up, - color: tooltipColor, - size: 50, - ) - : Icon( - Icons.arrow_drop_down, - color: tooltipColor, - size: 50, - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/user-guid/custom_validation_error.dart b/lib/widgets/shared/user-guid/custom_validation_error.dart index a05d52a2..bbdb1f1a 100644 --- a/lib/widgets/shared/user-guid/custom_validation_error.dart +++ b/lib/widgets/shared/user-guid/custom_validation_error.dart @@ -1,21 +1,18 @@ - 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'; // ignore: must_be_immutable class CustomValidationError extends StatelessWidget { - String error; + String? error; CustomValidationError({ - Key key, this.error, + Key? key, + this.error, }) : super(key: key); @override Widget build(BuildContext context) { - if(error == null ) - error = TranslationBase - .of(context) - .emptyMessage; + if (error == null) error = TranslationBase.of(context).emptyMessage; return Column( children: [ SizedBox( @@ -23,11 +20,13 @@ class CustomValidationError extends StatelessWidget { ), Container( margin: EdgeInsets.symmetric(horizontal: 3), - child: AppText(error, color: Theme - .of(context) - .errorColor, fontSize: 14,), + child: AppText( + error, + color: Theme.of(context).errorColor, + fontSize: 14, + ), ), ], ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart deleted file mode 100644 index 9197a4a1..00000000 --- a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart +++ /dev/null @@ -1,196 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class InPatientDoctorCard extends StatelessWidget { - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; - final bool isPrescriptions; - final String clinic; - final createdBy; - - InPatientDoctorCard( - {this.doctorName, - this.branch, - this.profileUrl, - this.invoiceNO, - this.onTap, - this.appointmentDate, - this.orderNo, - this.isPrescriptions = false, - this.clinic, - this.createdBy}); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(15.0), - ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: InkWell( - onTap: onTap, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Expanded( - child: AppText( - doctorName, - bold: true, - )), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 14, - ), - if (!isPrescriptions) - AppText( - '${AppDateUtils.getHour(appointmentDate)}', - fontWeight: FontWeight.w600, - color: Colors.grey[700], - fontSize: 14, - ), - ], - ), - ), - ], - ), - Row( - children: [ - AppText( - 'CreatedBy ', - //bold: true, - ), - Expanded( - child: AppText( - createdBy, - bold: true, - ), - ), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - // Container( - // child: LargeAvatar( - // name: doctorName, - // url: profileUrl, - // ), - // width: 55, - // height: 55, - // ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // if (orderNo != null && !isPrescriptions) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).orderNo + - // ": ", - // color: Colors.grey[500], - // fontSize: 14, - // ), - // AppText( - // orderNo ?? '', - // fontSize: 14, - // ) - // ], - // ), - // if (invoiceNO != null && !isPrescriptions) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context) - // .invoiceNo + - // ": ", - // fontSize: 14, - // color: Colors.grey[500], - // ), - // AppText( - // invoiceNO, - // fontSize: 14, - // ) - // ], - // ), - // if (clinic != null) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).clinic + - // ": ", - // color: Colors.grey[500], - // fontSize: 14, - // ), - // AppText( - // clinic, - // fontSize: 14, - // ) - // ], - // ), - // if (branch != null) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).branch + - // ": ", - // fontSize: 14, - // color: Colors.grey[500], - // ), - // AppText( - // branch, - // fontSize: 14, - // ) - // ], - // ) - ]), - ), - ), - Icon( - EvaIcons.eye, - ) - ], - ), - ), - ], - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/widgets/transitions/fade_page.dart b/lib/widgets/transitions/fade_page.dart index 97a37ce1..01c40cff 100644 --- a/lib/widgets/transitions/fade_page.dart +++ b/lib/widgets/transitions/fade_page.dart @@ -4,29 +4,25 @@ import 'package:flutter/material.dart'; /// [page] class FadePage extends PageRouteBuilder { final Widget page; - FadePage({this.page}) - : super( - opaque: false, - fullscreenDialog: true, - barrierDismissible: true, - barrierColor: Colors.black.withOpacity(0.8), - pageBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - ) => - page, - transitionDuration: Duration(milliseconds: 300), - transitionsBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - Widget child, - ) { - return FadeTransition( - opacity: animation, - child: child - ); - } - ); -} \ No newline at end of file + FadePage({required this.page}) + : super( + opaque: false, + fullscreenDialog: true, + barrierDismissible: true, + barrierColor: Colors.black.withOpacity(0.8), + pageBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + ) => + page, + transitionDuration: Duration(milliseconds: 300), + transitionsBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + Widget child, + ) { + return FadeTransition(opacity: animation, child: child); + }); +} diff --git a/lib/widgets/transitions/slide_up_page.dart b/lib/widgets/transitions/slide_up_page.dart index 2c138b9e..49e2e0de 100644 --- a/lib/widgets/transitions/slide_up_page.dart +++ b/lib/widgets/transitions/slide_up_page.dart @@ -10,8 +10,7 @@ class SlideUpPageRoute extends PageRouteBuilder { final bool fullscreenDialog; final bool opaque; - SlideUpPageRoute( - {this.widget, this.fullscreenDialog = false, this.opaque = true}) + SlideUpPageRoute({required this.widget, this.fullscreenDialog = false, this.opaque = true}) : super( pageBuilder: ( BuildContext context, @@ -25,19 +24,15 @@ class SlideUpPageRoute extends PageRouteBuilder { barrierColor: Color.fromRGBO(0, 0, 0, 0.5), barrierDismissible: true, transitionDuration: Duration(milliseconds: 800), - transitionsBuilder: ((BuildContext context, - Animation animation, - Animation secondaryAnimation, - Widget child) { + transitionsBuilder: + ((BuildContext context, Animation animation, Animation secondaryAnimation, Widget child) { var begin = Offset(0.0, 1.0); var end = Offset.zero; var curve = Curves.easeInOutQuint; - var tween = - Tween(begin: begin, end: end).chain(CurveTween(curve: curve)); + var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve)); - return SlideTransition( - position: animation.drive(tween), child: child); + return SlideTransition(position: animation.drive(tween), child: child); }), ); } diff --git a/pubspec.lock b/pubspec.lock index 2ff9dca7..fc0e350b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -345,7 +345,7 @@ packages: source: hosted version: "6.1.1" file_picker: - dependency: transitive + dependency: "direct main" description: name: file_picker url: "https://pub.dartlang.org" diff --git a/pubspec.yaml b/pubspec.yaml index ce9d34be..0953574e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -85,6 +85,7 @@ dependencies: # Flutter Html View flutter_html: ^2.1.0 sticky_headers: ^0.2.0 + file_picker: ^3.0.2+2 #speech to text speech_to_text: From ea2a635925dc976091a72cb9b9e70e5dc5147268 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 13 Jun 2021 12:48:30 +0300 Subject: [PATCH 07/18] hot fix --- lib/client/base_app_client.dart | 28 ++++++++++--------- lib/core/viewModel/project_view_model.dart | 2 +- lib/widgets/shared/app_loader_widget.dart | 1 - pubspec.lock | 31 +++++++++------------- pubspec.yaml | 2 +- 5 files changed, 29 insertions(+), 35 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index e2de1f86..5d55c03e 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -33,20 +33,22 @@ class BaseAppClient { try { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; - if (body['DoctorID'] == "") body['DoctorID'] = null; - if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile?.doctorID; - if (body['ProjectID'] == null) { - body['ProjectID'] = doctorProfile?.projectID; - } + DoctorProfileModel ? doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile!=null) { + if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile.doctorID; + if (body['DoctorID'] == "") body['DoctorID'] = null; + if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID; + if (body['ProjectID'] == null) { + body['ProjectID'] = doctorProfile?.projectID; + } - if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; - if (body['DoctorID'] == '') { - body['DoctorID'] = null; - } - if (body['EditedBy'] == '') { - body.remove("EditedBy"); + if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; + if (body['DoctorID'] == '') { + body['DoctorID'] = null; + } + if (body['EditedBy'] == '') { + body.remove("EditedBy"); + } } if (body['TokenID'] == null) { body['TokenID'] = token ?? ''; diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index e8e5a4fe..75eecbc6 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -17,7 +17,7 @@ Helpers helpers = Helpers(); class ProjectViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); - late Locale _appLocale; + late Locale _appLocale = Locale(currentLanguage ); String currentLanguage = 'ar'; bool _isArabic = false; bool isInternetConnection = true; diff --git a/lib/widgets/shared/app_loader_widget.dart b/lib/widgets/shared/app_loader_widget.dart index 789f1cd2..40f87654 100644 --- a/lib/widgets/shared/app_loader_widget.dart +++ b/lib/widgets/shared/app_loader_widget.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:progress_hud_v2/progress_hud.dart'; import 'loader/gif_loader_container.dart'; diff --git a/pubspec.lock b/pubspec.lock index fc0e350b..859b1ad7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -126,7 +126,7 @@ packages: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "5.1.0" built_value: dependency: transitive description: @@ -175,7 +175,7 @@ packages: name: chewie url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.2" chewie_audio: dependency: transitive description: @@ -301,7 +301,7 @@ packages: name: dropdown_search url: "https://pub.dartlang.org" source: hosted - version: "0.6.1" + version: "0.6.2" equatable: dependency: transitive description: @@ -357,7 +357,7 @@ packages: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.3.0" firebase_core_platform_interface: dependency: transitive description: @@ -378,21 +378,21 @@ packages: name: firebase_messaging url: "https://pub.dartlang.org" source: hosted - version: "10.0.1" + version: "10.0.2" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" fixnum: dependency: transitive description: @@ -545,7 +545,7 @@ packages: name: font_awesome_flutter url: "https://pub.dartlang.org" source: hosted - version: "9.0.0" + version: "9.1.0" frontend_server_client: dependency: transitive description: @@ -797,14 +797,14 @@ packages: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "8.0.1" + version: "8.1.0" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.5.1" + version: "3.6.0" petitparser: dependency: transitive description: @@ -847,13 +847,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.2.1" - 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: @@ -1110,7 +1103,7 @@ packages: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "2.1.6" video_player_platform_interface: dependency: transitive description: @@ -1194,7 +1187,7 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "2.1.5" xdg_directories: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 0953574e..bc205213 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,7 +36,7 @@ dependencies: flutter_flexible_toast: ^0.1.4 local_auth: ^1.1.6 http_interceptor: ^0.4.1 - progress_hud_v2: ^2.0.0 + connectivity: ^3.0.6 maps_launcher: ^2.0.0 url_launcher: ^6.0.6 From bb20b4d582f0c65f5960d93df4954c5877a4e2a9 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 16 Jun 2021 11:46:24 +0300 Subject: [PATCH 08/18] flutter 2 migration --- lib/client/base_app_client.dart | 7 +++-- ...on_code_for_doctor_app_response_model.dart | 28 ++++++------------- .../viewModel/authentication_view_model.dart | 14 +++++----- .../auth/verification_methods_screen.dart | 6 ++-- lib/screens/home/home_page_card.dart | 4 +-- lib/screens/home/home_patient_card.dart | 2 +- .../out_patient/out_patient_screen.dart | 6 ++-- .../prescription/add_prescription_form.dart | 24 ++++++++-------- .../procedures/ExpansionProcedure.dart | 22 +++++++-------- lib/screens/procedures/ProcedureCard.dart | 4 +-- lib/widgets/patients/PatientCard.dart | 4 +-- 11 files changed, 55 insertions(+), 66 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 5d55c03e..bba61c2a 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -31,10 +31,11 @@ class BaseAppClient { bool callLog = true; try { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map? profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); - DoctorProfileModel ? doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile!=null) { + DoctorProfileModel? doctorProfile; + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile.doctorID; if (body['DoctorID'] == "") body['DoctorID'] = null; if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID; diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart index 0d9e5149..0ae3008e 100644 --- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart @@ -3,16 +3,13 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; class CheckActivationCodeForDoctorAppResponseModel { late String? authenticationTokenID; late List? listDoctorsClinic; - late List? listDoctorProfile; + List? listDoctorProfile; late MemberInformation? memberInformation; CheckActivationCodeForDoctorAppResponseModel( - {this.authenticationTokenID, - this.listDoctorsClinic, - this.memberInformation}); + {this.authenticationTokenID, this.listDoctorsClinic, this.memberInformation}); - CheckActivationCodeForDoctorAppResponseModel.fromJson( - Map json) { + CheckActivationCodeForDoctorAppResponseModel.fromJson(Map json) { authenticationTokenID = json['AuthenticationTokenID']; if (json['List_DoctorsClinic'] != null) { listDoctorsClinic = []; @@ -28,22 +25,19 @@ class CheckActivationCodeForDoctorAppResponseModel { }); } - memberInformation = json['memberInformation'] != null - ? new MemberInformation.fromJson(json['memberInformation']) - : null; + memberInformation = + json['memberInformation'] != null ? new MemberInformation.fromJson(json['memberInformation']) : null; } Map toJson() { final Map data = new Map(); data['AuthenticationTokenID'] = this.authenticationTokenID; if (this.listDoctorsClinic != null) { - data['List_DoctorsClinic'] = - this.listDoctorsClinic!.map((v) => v.toJson()).toList(); + data['List_DoctorsClinic'] = this.listDoctorsClinic!.map((v) => v.toJson()).toList(); } if (this.listDoctorProfile != null) { - data['List_DoctorProfile'] = - this.listDoctorProfile!.map((v) => v.toJson()).toList(); + data['List_DoctorProfile'] = this.listDoctorProfile!.map((v) => v.toJson()).toList(); } if (this.memberInformation != null) { data['memberInformation'] = this.memberInformation!.toJson(); @@ -60,13 +54,7 @@ class ListDoctorsClinic { late bool? isActive; late String? clinicName; - ListDoctorsClinic( - {this.setupID, - this.projectID, - this.doctorID, - this.clinicID, - this.isActive, - this.clinicName}); + ListDoctorsClinic({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName}); ListDoctorsClinic.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index bf7a20ec..a6692563 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -56,8 +56,8 @@ class AuthenticationViewModel extends BaseViewModel { CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; - late NewLoginInformationModel loggedUser; - late GetIMEIDetailsModel? user; + NewLoginInformationModel? loggedUser; + GetIMEIDetailsModel? user; UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); @@ -165,9 +165,9 @@ class AuthenticationViewModel extends BaseViewModel { int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( facilityId: projectID, - memberID: loggedUser.listMemberInformation![0].memberID, - zipCode: loggedUser.zipCode, - mobileNumber: loggedUser.mobileNumber, + memberID: loggedUser!.listMemberInformation![0].memberID, + zipCode: loggedUser!.zipCode, + mobileNumber: loggedUser!.mobileNumber, otpSendType: authMethodType.getTypeIdService().toString(), password: password); await _authService.sendActivationCodeForDoctorApp(activationCodeModel); @@ -182,8 +182,8 @@ class AuthenticationViewModel extends BaseViewModel { Future checkActivationCodeForDoctorApp({required String activationCode}) async { setState(ViewState.BusyLocal); CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( - zipCode: loggedUser != null ? loggedUser.zipCode : user!.zipCode, - mobileNumber: loggedUser != null ? loggedUser.mobileNumber : user!.mobile, + zipCode: loggedUser != null ? loggedUser!.zipCode : user!.zipCode, + mobileNumber: loggedUser != null ? loggedUser!.mobileNumber : user!.mobile, projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID, logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), activationCode: activationCode ?? '0000', diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 94404bc1..03d6a6e6 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -47,7 +47,7 @@ class _VerificationMethodsScreenState extends State { late ProjectViewModel projectsProvider; bool isMoreOption = false; bool onlySMSBox = false; - late AuthMethodTypes fingerPrintBefore; + AuthMethodTypes? fingerPrintBefore; late AuthMethodTypes selectedOption; late AuthenticationViewModel authenticationViewModel; @@ -410,7 +410,7 @@ class _VerificationMethodsScreenState extends State { if (authMethodType == AuthMethodTypes.Fingerprint || authMethodType == AuthMethodTypes.FaceID) { fingerPrintBefore = authMethodType; } - this.selectedOption = fingerPrintBefore != null ? fingerPrintBefore : authMethodType; + this.selectedOption = (fingerPrintBefore != null ? fingerPrintBefore : authMethodType)!; switch (authMethodType) { case AuthMethodTypes.SMS: @@ -444,7 +444,7 @@ class _VerificationMethodsScreenState extends State { context, type, authenticationViewModel.loggedUser != null - ? authenticationViewModel.loggedUser.mobileNumber + ? authenticationViewModel.loggedUser!.mobileNumber : authenticationViewModel.user!.mobile, (value) { showDialog( diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 383e7a9e..c4743f3b 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -15,14 +15,14 @@ class HomePageCard extends StatelessWidget { final bool hasBorder; final String? imageName; final Widget child; - final Function onTap; + final GestureTapCallback onTap; final Color color; final double opacity; final EdgeInsets margin; @override Widget build(BuildContext context) { return InkWell( - onTap: onTap(), + onTap: onTap, child: Container( width: 120, height: MediaQuery.of(context).orientation == Orientation.portrait ? 100 : 200, diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 63b998bc..f0bee0cb 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -9,7 +9,7 @@ class HomePatientCard extends StatelessWidget { final Color backgroundIconColor; final String text; final Color textColor; - final Function onTap; + final GestureTapCallback onTap; HomePatientCard({ required this.backgroundColor, diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index bb211329..ad4c3fbf 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -68,7 +68,7 @@ class _OutPatientsScreenState extends State { List _times = []; int _activeLocation = 1; - late String patientType; + String? patientType; late String patientTypeTitle; var selectedFilter = 1; late String arrivalType; @@ -252,8 +252,8 @@ class _OutPatientsScreenState extends State { padding: EdgeInsets.all(8.0), child: PatientCard( patientInfo: model.filterData[index], - patientType: patientType, - arrivalType: arrivalType, + patientType: "1", + arrivalType: "1", isFromSearch: widget.isSearchAndOut, isInpatient: widget.isInpatient, onTap: () { diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 4f15871d..d83ea0ee 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -121,9 +121,9 @@ class _PrescriptionFormWidgetState extends State { bool visbiltySearch = true; final myController = TextEditingController(); - late DateTime selectedDate; - late int strengthChar; - late GetMedicationResponseModel _selectedMedication; + DateTime? selectedDate; + int? strengthChar; + GetMedicationResponseModel? _selectedMedication; GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); @@ -358,7 +358,7 @@ class _PrescriptionFormWidgetState extends State { visbiltyPrescriptionForm = true; visbiltySearch = false; _selectedMedication = model.allMedicationList[index]; - uom = _selectedMedication.uom; + uom = _selectedMedication!.uom; }, ); }, @@ -417,7 +417,7 @@ class _PrescriptionFormWidgetState extends State { setState(() { strengthChar = value.length; }); - if (strengthChar >= 5) { + if (strengthChar! >= 5) { DrAppToastMsg.showErrorToast( TranslationBase.of(context).only5DigitsAllowedForStrength, ); @@ -483,7 +483,7 @@ class _PrescriptionFormWidgetState extends State { model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId!, + itemCode: _selectedMedication!.itemId!, strength: double.parse(strengthController.text)); return; @@ -577,7 +577,7 @@ class _PrescriptionFormWidgetState extends State { model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId!, + itemCode: _selectedMedication!.itemId!, strength: double.parse(strengthController.text), ); box = model.boxQuintity; @@ -661,7 +661,7 @@ class _PrescriptionFormWidgetState extends State { units != null && selectedDate != null && strengthController.text != "") { - if (_selectedMedication.isNarcotic == true) { + if (_selectedMedication!.isNarcotic == true) { DrAppToastMsg.showErrorToast(TranslationBase.of(context) .narcoticMedicineCanOnlyBePrescribedFromVida); Navigator.pop(context); @@ -922,7 +922,7 @@ class _PrescriptionFormWidgetState extends State { route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), - drugId: _selectedMedication.itemId.toString(), + drugId: _selectedMedication!.itemId.toString(), strength: strengthController.text, indication: indicationController.text, instruction: instructionController.text, @@ -958,10 +958,10 @@ class _PrescriptionFormWidgetState extends State { } }); } - if (_selectedMedication.mediSpanGPICode != null) { + if (_selectedMedication!.mediSpanGPICode != null) { prescriptionDetails.add({ - 'DrugId': _selectedMedication.mediSpanGPICode, - 'DrugName': _selectedMedication.description, + 'DrugId': _selectedMedication!.mediSpanGPICode, + 'DrugName': _selectedMedication!.description, 'Dose': strengthController.text, 'DoseType': model.itemMedicineListUnit.length == 1 ? model.itemMedicineListUnit[0]['parameterCode'].toString() diff --git a/lib/screens/procedures/ExpansionProcedure.dart b/lib/screens/procedures/ExpansionProcedure.dart index c1901411..740ae8e6 100644 --- a/lib/screens/procedures/ExpansionProcedure.dart +++ b/lib/screens/procedures/ExpansionProcedure.dart @@ -15,10 +15,10 @@ class ExpansionProcedure extends StatefulWidget { final ProcedureViewModel model; final Function(ProcedureTempleteDetailsModel) removeFavProcedure; final Function(ProcedureTempleteDetailsModel) addFavProcedure; - final Function(ProcedureTempleteDetailsModel) selectProcedures; + final Function(ProcedureTempleteDetailsModel)? selectProcedures; - final bool Function(ProcedureTempleteModel) isEntityListSelected; - final bool Function(ProcedureTempleteDetailsModel) isEntityFavListSelected; + final bool Function(ProcedureTempleteModel)? isEntityListSelected; + final bool Function(ProcedureTempleteDetailsModel)? isEntityFavListSelected; final bool isProcedure; final ProcedureTempleteDetailsModel groupProcedures; @@ -28,9 +28,9 @@ class ExpansionProcedure extends StatefulWidget { required this.model, required this.removeFavProcedure, required this.addFavProcedure, - required this.selectProcedures, - required this.isEntityListSelected, - required this.isEntityFavListSelected, + this.selectProcedures, + this.isEntityListSelected, + this.isEntityFavListSelected, this.isProcedure = true, required this.groupProcedures}) : super(key: key); @@ -118,14 +118,14 @@ class _ExpansionProcedureState extends State { onTap: () { if (widget.isProcedure) { setState(() { - if (widget.isEntityFavListSelected(itemProcedure)) { + if (widget.isEntityFavListSelected!(itemProcedure)) { widget.removeFavProcedure(itemProcedure); } else { widget.addFavProcedure(itemProcedure); } }); } else { - widget.selectProcedures(itemProcedure); + widget.selectProcedures!(itemProcedure); } }, child: Container( @@ -140,11 +140,11 @@ class _ExpansionProcedureState extends State { padding: const EdgeInsets.symmetric(horizontal: 11), child: widget.isProcedure ? Checkbox( - value: widget.isEntityFavListSelected(itemProcedure), + value: widget.isEntityFavListSelected!(itemProcedure), activeColor: Color(0xffD02127), onChanged: (bool? newValue) { setState(() { - if (widget.isEntityFavListSelected(itemProcedure)) { + if (widget.isEntityFavListSelected!(itemProcedure)) { widget.removeFavProcedure(itemProcedure); } else { widget.addFavProcedure(itemProcedure); @@ -156,7 +156,7 @@ class _ExpansionProcedureState extends State { groupValue: widget.groupProcedures, activeColor: Color(0xffD02127), onChanged: (ProcedureTempleteDetailsModel? newValue) { - widget.selectProcedures(newValue!); + widget.selectProcedures!(newValue!); })), Expanded( child: Padding( diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index ef9478d5..f110f931 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -12,7 +12,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class ProcedureCard extends StatelessWidget { - final Function onTap; + final GestureTapCallback onTap; final EntityList entityList; final String? categoryName; final int categoryID; @@ -248,7 +248,7 @@ class ProcedureCard extends StatelessWidget { doctorID == entityList.doctorID) InkWell( child: Icon(DoctorApp.edit), - onTap: onTap(), + onTap: onTap, ) ], ), diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index e4673741..1ff05222 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -11,7 +11,7 @@ import 'package:flutter/material.dart'; class PatientCard extends StatelessWidget { final PatiantInformtion patientInfo; - final Function onTap; + final GestureTapCallback onTap; final String patientType; final String arrivalType; final bool isInpatient; @@ -451,7 +451,7 @@ class PatientCard extends StatelessWidget { : SizedBox() ], ), - onTap: onTap(), + onTap: onTap, )), )); } From 52eef31e2ef9a00a51804ec8ef69f8ab6a8b96a3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Jun 2021 09:26:36 +0300 Subject: [PATCH 09/18] change ios file to make it version 2 works on ios --- ios/Podfile | 91 ----- ios/Podfile.lock | 327 ------------------ ios/Runner.xcodeproj/project.pbxproj | 69 ++++ .../contents.xcworkspacedata | 2 +- 4 files changed, 70 insertions(+), 419 deletions(-) delete mode 100644 ios/Podfile delete mode 100644 ios/Podfile.lock diff --git a/ios/Podfile b/ios/Podfile deleted file mode 100644 index 62207805..00000000 --- a/ios/Podfile +++ /dev/null @@ -1,91 +0,0 @@ -# Uncomment this line to define a global platform for your project - platform :ios, '11.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def parse_KV_file(file, separator='=') - file_abs_path = File.expand_path(file) - if !File.exists? file_abs_path - return []; - end - generated_key_values = {} - skip_line_start_symbols = ["#", "/"] - File.foreach(file_abs_path) do |line| - next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } - plugin = line.split(pattern=separator) - if plugin.length == 2 - podname = plugin[0].strip() - path = plugin[1].strip() - podpath = File.expand_path("#{path}", file_abs_path) - generated_key_values[podname] = podpath - else - puts "Invalid plugin specification: #{line}" - end - end - generated_key_values -end - -target 'Runner' do - use_frameworks! - use_modular_headers! - - # Flutter Pod - - copied_flutter_dir = File.join(__dir__, 'Flutter') - copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') - copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') - unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) - # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. - # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. - # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. - - generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') - unless File.exist?(generated_xcode_build_settings_path) - raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) - cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; - - unless File.exist?(copied_framework_path) - FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) - end - unless File.exist?(copied_podspec_path) - FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) - end - end - - # Keep pod path relative so it can be checked into Podfile.lock. - pod 'Flutter', :path => 'Flutter' - pod 'OpenTok' - pod 'Alamofire', '~> 5.2' - # Plugin Pods - - # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock - # referring to absolute paths on developers' machines. - system('rm -rf .symlinks') - system('mkdir -p .symlinks/plugins') - plugin_pods = parse_KV_file('../.flutter-plugins') - plugin_pods.each do |name, path| - symlink = File.join('.symlinks', 'plugins', name) - File.symlink(path, symlink) - pod name, :path => File.join(symlink, 'ios') - end -end - -# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. -install! 'cocoapods', :disable_input_output_paths => true - -post_install do |installer| - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['ENABLE_BITCODE'] = 'NO' - end - end -end diff --git a/ios/Podfile.lock b/ios/Podfile.lock deleted file mode 100644 index 44151727..00000000 --- a/ios/Podfile.lock +++ /dev/null @@ -1,327 +0,0 @@ -PODS: - - Alamofire (5.4.3) - - barcode_scan_fix (0.0.1): - - Flutter - - MTBBarcodeScanner - - connectivity (0.0.1): - - Flutter - - Reachability - - connectivity_for_web (0.1.0): - - Flutter - - connectivity_macos (0.0.1): - - Flutter - - device_info (0.0.1): - - Flutter - - Firebase/CoreOnly (6.33.0): - - FirebaseCore (= 6.10.3) - - Firebase/Messaging (6.33.0): - - Firebase/CoreOnly - - FirebaseMessaging (~> 4.7.0) - - firebase_core (0.5.3): - - Firebase/CoreOnly (~> 6.33.0) - - Flutter - - firebase_core_web (0.1.0): - - Flutter - - firebase_messaging (7.0.3): - - Firebase/CoreOnly (~> 6.33.0) - - Firebase/Messaging (~> 6.33.0) - - firebase_core - - Flutter - - FirebaseCore (6.10.3): - - FirebaseCoreDiagnostics (~> 1.6) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - FirebaseCoreDiagnostics (1.7.0): - - GoogleDataTransport (~> 7.4) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - nanopb (~> 1.30906.0) - - FirebaseInstallations (1.7.0): - - FirebaseCore (~> 6.10) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - PromisesObjC (~> 1.2) - - FirebaseInstanceID (4.8.0): - - FirebaseCore (~> 6.10) - - FirebaseInstallations (~> 1.6) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - FirebaseMessaging (4.7.1): - - FirebaseCore (~> 6.10) - - FirebaseInstanceID (~> 4.7) - - GoogleUtilities/AppDelegateSwizzler (~> 6.7) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Reachability (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - Protobuf (>= 3.9.2, ~> 3.9) - - Flutter (1.0.0) - - flutter_flexible_toast (0.0.1): - - Flutter - - flutter_inappwebview (0.0.1): - - Flutter - - flutter_plugin_android_lifecycle (0.0.1): - - Flutter - - GoogleDataTransport (7.5.1): - - nanopb (~> 1.30906.0) - - GoogleUtilities/AppDelegateSwizzler (6.7.2): - - GoogleUtilities/Environment - - GoogleUtilities/Logger - - GoogleUtilities/Network - - GoogleUtilities/Environment (6.7.2): - - PromisesObjC (~> 1.2) - - GoogleUtilities/Logger (6.7.2): - - GoogleUtilities/Environment - - GoogleUtilities/Network (6.7.2): - - GoogleUtilities/Logger - - "GoogleUtilities/NSData+zlib" - - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (6.7.2)" - - GoogleUtilities/Reachability (6.7.2): - - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (6.7.2): - - GoogleUtilities/Logger - - hexcolor (0.0.1): - - Flutter - - imei_plugin (0.0.1): - - Flutter - - local_auth (0.0.1): - - Flutter - - maps_launcher (0.0.1): - - Flutter - - MTBBarcodeScanner (5.0.11) - - nanopb (1.30906.0): - - nanopb/decode (= 1.30906.0) - - nanopb/encode (= 1.30906.0) - - nanopb/decode (1.30906.0) - - nanopb/encode (1.30906.0) - - OpenTok (2.15.3) - - path_provider_linux (0.0.1): - - Flutter - - path_provider_windows (0.0.1): - - Flutter - - "permission_handler (5.1.0+2)": - - Flutter - - PromisesObjC (1.2.12) - - Protobuf (3.17.0) - - Reachability (3.2) - - screen (0.0.1): - - Flutter - - shared_preferences (0.0.1): - - Flutter - - shared_preferences_linux (0.0.1): - - Flutter - - shared_preferences_macos (0.0.1): - - Flutter - - shared_preferences_web (0.0.1): - - Flutter - - shared_preferences_windows (0.0.1): - - Flutter - - speech_to_text (0.0.1): - - Flutter - - Try - - Try (2.1.1) - - url_launcher (0.0.1): - - Flutter - - url_launcher_linux (0.0.1): - - Flutter - - url_launcher_macos (0.0.1): - - Flutter - - url_launcher_web (0.0.1): - - Flutter - - url_launcher_windows (0.0.1): - - Flutter - - video_player (0.0.1): - - Flutter - - video_player_web (0.0.1): - - Flutter - - wakelock (0.0.1): - - Flutter - - webview_flutter (0.0.1): - - Flutter - -DEPENDENCIES: - - Alamofire (~> 5.2) - - barcode_scan_fix (from `.symlinks/plugins/barcode_scan_fix/ios`) - - connectivity (from `.symlinks/plugins/connectivity/ios`) - - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) - - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) - - device_info (from `.symlinks/plugins/device_info/ios`) - - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`) - - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - - Flutter (from `Flutter`) - - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) - - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) - - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) - - hexcolor (from `.symlinks/plugins/hexcolor/ios`) - - imei_plugin (from `.symlinks/plugins/imei_plugin/ios`) - - local_auth (from `.symlinks/plugins/local_auth/ios`) - - maps_launcher (from `.symlinks/plugins/maps_launcher/ios`) - - OpenTok - - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`) - - path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`) - - permission_handler (from `.symlinks/plugins/permission_handler/ios`) - - screen (from `.symlinks/plugins/screen/ios`) - - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - - shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`) - - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) - - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) - - shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`) - - speech_to_text (from `.symlinks/plugins/speech_to_text/ios`) - - url_launcher (from `.symlinks/plugins/url_launcher/ios`) - - url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`) - - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) - - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) - - url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`) - - video_player (from `.symlinks/plugins/video_player/ios`) - - video_player_web (from `.symlinks/plugins/video_player_web/ios`) - - wakelock (from `.symlinks/plugins/wakelock/ios`) - - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) - -SPEC REPOS: - trunk: - - Alamofire - - Firebase - - FirebaseCore - - FirebaseCoreDiagnostics - - FirebaseInstallations - - FirebaseInstanceID - - FirebaseMessaging - - GoogleDataTransport - - GoogleUtilities - - MTBBarcodeScanner - - nanopb - - OpenTok - - PromisesObjC - - Protobuf - - Reachability - - Try - -EXTERNAL SOURCES: - barcode_scan_fix: - :path: ".symlinks/plugins/barcode_scan_fix/ios" - connectivity: - :path: ".symlinks/plugins/connectivity/ios" - connectivity_for_web: - :path: ".symlinks/plugins/connectivity_for_web/ios" - connectivity_macos: - :path: ".symlinks/plugins/connectivity_macos/ios" - device_info: - :path: ".symlinks/plugins/device_info/ios" - firebase_core: - :path: ".symlinks/plugins/firebase_core/ios" - firebase_core_web: - :path: ".symlinks/plugins/firebase_core_web/ios" - firebase_messaging: - :path: ".symlinks/plugins/firebase_messaging/ios" - Flutter: - :path: Flutter - flutter_flexible_toast: - :path: ".symlinks/plugins/flutter_flexible_toast/ios" - flutter_inappwebview: - :path: ".symlinks/plugins/flutter_inappwebview/ios" - flutter_plugin_android_lifecycle: - :path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios" - hexcolor: - :path: ".symlinks/plugins/hexcolor/ios" - imei_plugin: - :path: ".symlinks/plugins/imei_plugin/ios" - local_auth: - :path: ".symlinks/plugins/local_auth/ios" - maps_launcher: - :path: ".symlinks/plugins/maps_launcher/ios" - path_provider_linux: - :path: ".symlinks/plugins/path_provider_linux/ios" - path_provider_windows: - :path: ".symlinks/plugins/path_provider_windows/ios" - permission_handler: - :path: ".symlinks/plugins/permission_handler/ios" - screen: - :path: ".symlinks/plugins/screen/ios" - shared_preferences: - :path: ".symlinks/plugins/shared_preferences/ios" - shared_preferences_linux: - :path: ".symlinks/plugins/shared_preferences_linux/ios" - shared_preferences_macos: - :path: ".symlinks/plugins/shared_preferences_macos/ios" - shared_preferences_web: - :path: ".symlinks/plugins/shared_preferences_web/ios" - shared_preferences_windows: - :path: ".symlinks/plugins/shared_preferences_windows/ios" - speech_to_text: - :path: ".symlinks/plugins/speech_to_text/ios" - url_launcher: - :path: ".symlinks/plugins/url_launcher/ios" - url_launcher_linux: - :path: ".symlinks/plugins/url_launcher_linux/ios" - url_launcher_macos: - :path: ".symlinks/plugins/url_launcher_macos/ios" - url_launcher_web: - :path: ".symlinks/plugins/url_launcher_web/ios" - url_launcher_windows: - :path: ".symlinks/plugins/url_launcher_windows/ios" - video_player: - :path: ".symlinks/plugins/video_player/ios" - video_player_web: - :path: ".symlinks/plugins/video_player_web/ios" - wakelock: - :path: ".symlinks/plugins/wakelock/ios" - webview_flutter: - :path: ".symlinks/plugins/webview_flutter/ios" - -SPEC CHECKSUMS: - Alamofire: e447a2774a40c996748296fa2c55112fdbbc42f9 - barcode_scan_fix: 80dd65de55f27eec6591dd077c8b85f2b79e31f1 - connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 - connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b - connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 - device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 - Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 - firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 - firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 - firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 - FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd - FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 - FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2 - FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1 - FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a - Flutter: 0e3d915762c693b495b44d77113d4970485de6ec - flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 - flutter_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189 - flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 - GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 - GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 - hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 - imei_plugin: cb1af7c223ac2d82dcd1457a7137d93d65d2a3cd - local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd - maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 - MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb - nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc - OpenTok: fde03ecc5ea31fe0a453242847c4ee1f47e1d735 - path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 - path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b - permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 - PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97 - Protobuf: 7327d4444215b5f18e560a97f879ff5503c4581c - Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 - screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0 - shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d - shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 - shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 - shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 - shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae - speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe - Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 - url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef - url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 - url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 - url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c - url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5 - video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e - video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7 - wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4 - webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 - -PODFILE CHECKSUM: d0a3789a37635365b4345e456835ed9d30398217 - -COCOAPODS: 1.10.1 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index f0784432..9efb7e0d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -224,9 +224,78 @@ files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/DKImagePickerController/DKImagePickerController.framework", + "${BUILT_PRODUCTS_DIR}/DKPhotoGallery/DKPhotoGallery.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework", + "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework", + "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", + "${BUILT_PRODUCTS_DIR}/MTBBarcodeScanner/MTBBarcodeScanner.framework", + "${BUILT_PRODUCTS_DIR}/OrderedSet/OrderedSet.framework", + "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework", + "${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework", + "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", + "${BUILT_PRODUCTS_DIR}/SwiftyGif/SwiftyGif.framework", + "${BUILT_PRODUCTS_DIR}/Try/Try.framework", + "${BUILT_PRODUCTS_DIR}/barcode_scan_fix/barcode_scan_fix.framework", + "${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework", + "${BUILT_PRODUCTS_DIR}/device_info/device_info.framework", + "${BUILT_PRODUCTS_DIR}/file_picker/file_picker.framework", + "${BUILT_PRODUCTS_DIR}/flutter_flexible_toast/flutter_flexible_toast.framework", + "${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework", + "${BUILT_PRODUCTS_DIR}/flutter_keyboard_visibility/flutter_keyboard_visibility.framework", + "${BUILT_PRODUCTS_DIR}/hexcolor/hexcolor.framework", + "${BUILT_PRODUCTS_DIR}/imei_plugin/imei_plugin.framework", + "${BUILT_PRODUCTS_DIR}/local_auth/local_auth.framework", + "${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework", + "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", + "${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework", + "${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework", + "${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework", + "${BUILT_PRODUCTS_DIR}/video_player/video_player.framework", + "${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework", + "${BUILT_PRODUCTS_DIR}/webview_flutter/webview_flutter.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DKImagePickerController.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DKPhotoGallery.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MTBBarcodeScanner.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OrderedSet.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyGif.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Try.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/barcode_scan_fix.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_picker.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_flexible_toast.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_keyboard_visibility.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hexcolor.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/imei_plugin.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a16..919434a6 100644 --- a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> From daf125b995331725258f05efb756293e1e7ad2e5 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 17 Jun 2021 09:30:09 +0300 Subject: [PATCH 10/18] flutter 2 migration --- .../profile/note/progress_note_screen.dart | 20 +++++++++---------- .../refer-patient-screen-in-patient.dart | 12 +++++------ .../profile/add-order/addNewOrder.dart | 4 ++-- ..._header_with_appointment_card_app_bar.dart | 10 +++++----- .../shared/text_fields/text_fields_utils.dart | 2 +- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index cb454172..939b6bf3 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -40,8 +40,8 @@ class _ProgressNoteState extends State { late List notesList; var filteredNotesList; bool isDischargedPatient = false; - late AuthenticationViewModel authenticationViewModel; - late ProjectViewModel projectViewModel; + AuthenticationViewModel? authenticationViewModel; + ProjectViewModel? projectViewModel; getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; @@ -65,8 +65,8 @@ class _ProgressNoteState extends State { @override Widget build(BuildContext context) { - authenticationViewModel = Provider.of(context); - projectViewModel = Provider.of(context); + // authenticationViewModel = Provider.of(context); + // projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; @@ -117,7 +117,7 @@ class _ProgressNoteState extends State { child: CardWithBgWidget( hasBorder: false, bgColor: model.patientProgressNoteList[index].status == 1 && - authenticationViewModel.doctorProfile!.doctorID != + authenticationViewModel!.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy ? Color(0xFFCC9B14) : model.patientProgressNoteList[index].status == 4 @@ -131,7 +131,7 @@ class _ProgressNoteState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ if (model.patientProgressNoteList[index].status == 1 && - authenticationViewModel.doctorProfile!.doctorID != + authenticationViewModel!.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy) AppText( TranslationBase.of(context).notePending, @@ -155,7 +155,7 @@ class _ProgressNoteState extends State { ), if (model.patientProgressNoteList[index].status != 2 && model.patientProgressNoteList[index].status != 4 && - authenticationViewModel.doctorProfile!.doctorID == + authenticationViewModel!.doctorProfile!.doctorID == model.patientProgressNoteList[index].createdBy) Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -350,9 +350,9 @@ class _ProgressNoteState extends State { ? AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDateTimeFromServerFormat( model.patientProgressNoteList[index].createdOn ?? ""), - isArabic: projectViewModel.isArabic) + isArabic: projectViewModel!.isArabic) : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), - isArabic: projectViewModel.isArabic), + isArabic: projectViewModel!.isArabic), fontWeight: FontWeight.w600, fontSize: 14, ), @@ -442,7 +442,7 @@ class _ProgressNoteState extends State { padding: EdgeInsets.all(20), color: Colors.white, child: AppText( - projectViewModel.isArabic + projectViewModel!.isArabic ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" : 'Are you sure you want $actionName this order?', fontSize: 15, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index dc7da44d..348c611a 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -41,11 +41,11 @@ class _PatientMakeInPatientReferralScreenState extends State Date: Thu, 17 Jun 2021 12:31:43 +0300 Subject: [PATCH 11/18] fix add sick leave --- .../sick_leave/sickleave_service.dart | 5 ++-- .../viewModel/patient-referral-viewmodel.dart | 2 +- lib/core/viewModel/sick_leave_view_model.dart | 5 ++-- .../AddVerifyMedicalReport.dart | 2 +- .../refer-patient-screen-in-patient.dart | 10 +++---- lib/screens/sick-leave/add-sickleave.dart | 9 ++---- lib/screens/sick-leave/sick_leave.dart | 30 ++++++++++++------- 7 files changed, 34 insertions(+), 29 deletions(-) diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index bbddbde2..0294c3e7 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -61,9 +61,8 @@ class SickLeaveService extends BaseService { return Future.value(response); }, onFailure: (String error, int statusCode) { - DrAppToastMsg.showErrorToast(error); - // hasError = true; - // super.error = error; + hasError = true; + super.error = error; }, body: addSickLeaveRequest.toJson(), ); diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 6e67aea3..a55f9732 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -200,7 +200,7 @@ class PatientReferralViewModel extends BaseViewModel { patientID: patient.patientId, roomID: patient.roomId, referralClinic: clinicID, - admissionNo: patient.appointmentNo, + admissionNo: patient.appointmentNo, /// TODO Elham* something in case inpateint since we send send appointmentNo for admissionNo which all time null referralDoctor: doctorID, patientTypeID: patient.patientType, referringDoctorRemarks: remarks, diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index c5a0bc73..60eebe88 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -17,12 +17,13 @@ class SickLeaveViewModel extends BaseViewModel { get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave; get postSechedule => _sickLeaveService.postReschedule; get sickleaveResponse => _sickLeaveService.sickLeaveResponse; + Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _sickLeaveService.addSickLeave(addSickLeaveRequest); if (_sickLeaveService.hasError) { error = _sickLeaveService.error!; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 3d9411a0..428ddf4a 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -86,7 +86,7 @@ class _AddVerifyMedicalReportState extends State { if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - model.insertMedicalReport(patient, txtOfMedicalReport); + await model.insertMedicalReport(patient, txtOfMedicalReport); GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 348c611a..8b066cbe 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -476,27 +476,27 @@ class _PatientMakeInPatientReferralScreenState extends State( onModelReady: (model) => model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( @@ -246,11 +246,6 @@ class AddSickLeavScreen extends StatelessWidget { } openSickLeave(BuildContext context, isExtend, {GetAllSickLeaveResponse? extendedData}) { - // showModalBottomSheet( - // context: context, - // builder: (context) { - // return new Container( - // child: Navigator.push( context, FadePage( @@ -260,7 +255,7 @@ class AddSickLeavScreen extends StatelessWidget { : patient.appointmentNo, //extendedData.appointmentNo, patientMRN: isExtend == true ? extendedData!.patientMRN : patient.patientMRN, isExtended: isExtend, - extendedData: extendedData!, + extendedData: extendedData??GetAllSickLeaveResponse(), patient: patient))); } } diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index f305caf8..a5ced00b 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.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/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; @@ -14,6 +15,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; 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/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -29,7 +31,7 @@ class SickLeaveScreen extends StatefulWidget { final patientMRN; final patient; SickLeaveScreen( - {this.appointmentNo, this.patientMRN, this.isExtended = false, required this.extendedData, this.patient}); + {this.appointmentNo, this.patientMRN, this.isExtended = false, required this.extendedData, this.patient}); @override _SickLeaveScreenState createState() => _SickLeaveScreenState(); } @@ -69,7 +71,7 @@ class _SickLeaveScreenState extends State { @override Widget build(BuildContext context) { - return BaseView( + return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( onModelReady: (model2) => model2.preSickLeaveStatistics(widget.appointmentNo, widget.patientMRN), @@ -120,12 +122,12 @@ class _SickLeaveScreenState extends State { borderColor: Colors.white, onChanged: (value) { addSickLeave.noOfDays = value; - if (widget.extendedData != null) { + if (widget.extendedData.noOfDays != null) { widget.extendedData.noOfDays = int.parse(value); } }, hintText: - widget.extendedData != null ? widget.extendedData.noOfDays.toString() : '', + widget.extendedData.noOfDays != null ? widget.extendedData.noOfDays.toString() : '', // validator: (value) { // return TextValidator().validateName(value); // }, @@ -371,13 +373,21 @@ class _SickLeaveScreenState extends State { } else { addSickLeave.patientMRN = widget.patient.patientMRN.toString(); addSickLeave.appointmentNo = widget.patient.appointmentNo.toString(); - await model2.addSickLeave(addSickLeave).then((value) => print(value)); + GifLoaderDialogUtils.showMyDialog(context); + await model2.addSickLeave(addSickLeave); + if(model2.state == ViewState.ErrorLocal){ + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showErrorToast(model2.error); + } else { + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast("Sick leave created successfully"); + Navigator.of(context).popUntil((route) { + return route.settings.name == PATIENTS_PROFILE; + }); + Navigator.of(context).pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient}); + } + - DrAppToastMsg.showSuccesToast(model2.sickleaveResponse['ListSickLeavesToExtent']['success']); - Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; - }); - Navigator.of(context).pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient}); } } catch (err) { print(err); From e4fb83826acb7227d6da9ee1e4cd617780db4f0d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Jun 2021 15:30:21 +0300 Subject: [PATCH 12/18] fix referral screen in out patient --- .../viewModel/patient-referral-viewmodel.dart | 2 +- lib/models/patient/patiant_info_model.dart | 199 ++++++++++-------- .../referral/refer-patient-screen.dart | 12 +- .../patient-referral-item-widget.dart | 8 +- 4 files changed, 120 insertions(+), 101 deletions(-) diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index a55f9732..c1ae248a 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -200,7 +200,7 @@ class PatientReferralViewModel extends BaseViewModel { patientID: patient.patientId, roomID: patient.roomId, referralClinic: clinicID, - admissionNo: patient.appointmentNo, /// TODO Elham* something in case inpateint since we send send appointmentNo for admissionNo which all time null + admissionNo: int.parse(patient.admissionNo!), /// TODO Elham* something in case inpateint since we send send appointmentNo for admissionNo which all time null referralDoctor: doctorID, patientTypeID: patient.patientType, referringDoctorRemarks: remarks, diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 16377e7a..06936a59 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,7 +1,7 @@ // TODO : it have to be changed. class PatiantInformtion { - final PatiantInformtion? patientDetails; + PatiantInformtion? patientDetails; int? genderInt; dynamic age; String? appointmentDate; @@ -75,7 +75,8 @@ class PatiantInformtion { int? vcId; String? voipToken; - PatiantInformtion( + + PatiantInformtion( {this.patientDetails, this.projectId, this.clinicId, @@ -149,93 +150,111 @@ class PatiantInformtion { this.status, this.vcId, this.voipToken}); + PatiantInformtion.fromJson(Map json) { + try { + patientDetails = + json['patientDetails'] != null ? new PatiantInformtion.fromJson( + json['patientDetails']) : null; + projectId = json["ProjectID"] ?? json["projectID"]; + clinicId = json["ClinicID"] ?? json["clinicID"]; + doctorId = json["DoctorID"] ?? json["doctorID"]; + patientId = json["PatientID"] != null + ? json["PatientID"] is String + ? int?.parse(json["PatientID"]) + : json["PatientID"] + : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN']; + doctorName = json["DoctorName"] ?? json["doctorName"]; + doctorNameN = json["DoctorNameN"] ?? json["doctorNameN"]; + firstName = json["FirstName"] ?? json["firstName"]; + middleName = json["MiddleName"] ?? json["middleName"]; + lastName = json["LastName"] ?? json["lastName"]; + firstNameN = json["FirstNameN"] ?? json["firstNameN"]; + middleNameN = json["MiddleNameN"] ?? json["middleNameN"]; + lastNameN = json["LastNameN"] ?? json["lastNameN"]; + gender = json["Gender"] != null + ? json["Gender"] is String + ? int?.parse(json["Gender"]) + : json["Gender"] + : json["gender"]; + fullName = json["fullName"] ?? json["fullName"] ?? json["PatientName"]; + fullNameN = + json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"]; + dateofBirth = json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth']; + nationalityId = json["NationalityID"] ?? json["nationalityID"]; + mobileNumber = json["MobileNumber"] ?? json["mobileNumber"]; + emailAddress = json["EmailAddress"] ?? json["emailAddress"]; + patientIdentificationNo = + json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; + //TODO make 7 dynamic when the backend retrun it in patient arrival + patientType = json["PatientType"] ?? json["patientType"] ?? 1; + admissionNo = json["AdmissionNo"] ?? json["admissionNo"]; + admissionDate = json["AdmissionDate"] ?? json["admissionDate"]; + createdOn = json["CreatedOn"] ?? json["CreatedOn"]; + roomId = json["RoomID"] ?? json["roomID"]; + bedId = json["BedID"] ?? json["bedID"]; + nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; + description = json["Description"] ?? json["description"]; + clinicDescription = + json["ClinicDescription"] ?? json["clinicDescription"]; + clinicDescriptionN = + json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; + nationalityName = json["NationalityName"] ?? json["nationalityName"] ?? + json['NationalityName']; + nationalityNameN = + json["NationalityNameN"] ?? json["nationalityNameN"] ?? + json['NationalityNameN']; + age = json["Age"] ?? json["age"]; + genderDescription = json["GenderDescription"]; + nursingStationName = json["NursingStationName"]; + appointmentDate = json["AppointmentDate"] ?? ''; + startTime = json["startTime"] ?? json['StartTime']; + appointmentNo = json['appointmentNo'] ?? json['AppointmentNo']; + appointmentType = json['appointmentType']; + appointmentTypeId = + json['appointmentTypeId'] ?? json['appointmentTypeid']; + arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn']; + clinicGroupId = json['clinicGroupId']; + companyName = json['companyName']; + dischargeStatus = json['dischargeStatus']; + doctorDetails = json['doctorDetails']; + endTime = json['endTime']; + episodeNo = json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo']; + fallRiskScore = json['fallRiskScore']; + isSigned = json['isSigned']; + medicationOrders = json['medicationOrders']; + nationality = json['nationality'] ?? json['NationalityNameN']; + patientMRN = json['patientMRN'] ?? + json['PatientMRN'] ?? + (json["PatientID"] != null + ? int?.parse(json["PatientID"].toString()) + : json["patientID"] != null ? int?.parse( + json["patientID"].toString()) : json["patientId"] != null ? int + ?.parse(json["patientId"].toString()) : ''); + visitType = json['visitType'] ?? json['visitType'] ?? json['visitType']; + nationalityFlagURL = + json['NationalityFlagURL'] ?? json['NationalityFlagURL']; + patientStatusType = + json['patientStatusType'] ?? json['PatientStatusType']; + visitTypeId = + json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; + startTimes = json['StartTime'] ?? json['StartTime']; + dischargeDate = json['DischargeDate']; + status = json['Status']; + vcId = json['VC_ID']; - factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( - patientDetails: json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null, - projectId: json["ProjectID"] ?? json["projectID"], - clinicId: json["ClinicID"] ?? json["clinicID"], - doctorId: json["DoctorID"] ?? json["doctorID"], - patientId: json["PatientID"] != null - ? json["PatientID"] is String - ? int?.parse(json["PatientID"]) - : json["PatientID"] - : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN'], - doctorName: json["DoctorName"] ?? json["doctorName"], - doctorNameN: json["DoctorNameN"] ?? json["doctorNameN"], - firstName: json["FirstName"] ?? json["firstName"], - middleName: json["MiddleName"] ?? json["middleName"], - lastName: json["LastName"] ?? json["lastName"], - firstNameN: json["FirstNameN"] ?? json["firstNameN"], - middleNameN: json["MiddleNameN"] ?? json["middleNameN"], - lastNameN: json["LastNameN"] ?? json["lastNameN"], - gender: json["Gender"] != null - ? json["Gender"] is String - ? int?.parse(json["Gender"]) - : json["Gender"] - : json["gender"], - fullName: json["fullName"] ?? json["fullName"] ?? json["PatientName"], - fullNameN: json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"], - dateofBirth: json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth'], - nationalityId: json["NationalityID"] ?? json["nationalityID"], - mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], - emailAddress: json["EmailAddress"] ?? json["emailAddress"], - patientIdentificationNo: json["PatientIdentificationNo"] ?? json["patientIdentificationNo"], - //TODO make 7 dynamic when the backend retrun it in patient arrival - patientType: json["PatientType"] ?? json["patientType"] ?? 1, - admissionNo: json["AdmissionNo"] ?? json["admissionNo"], - admissionDate: json["AdmissionDate"] ?? json["admissionDate"], - createdOn: json["CreatedOn"] ?? json["CreatedOn"], - roomId: json["RoomID"] ?? json["roomID"], - bedId: json["BedID"] ?? json["bedID"], - nursingStationId: json["NursingStationID"] ?? json["nursingStationID"], - description: json["Description"] ?? json["description"], - clinicDescription: json["ClinicDescription"] ?? json["clinicDescription"], - clinicDescriptionN: json["ClinicDescriptionN"] ?? json["clinicDescriptionN"], - nationalityName: json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName'], - nationalityNameN: json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN'], - age: json["Age"] ?? json["age"], - genderDescription: json["GenderDescription"], - nursingStationName: json["NursingStationName"], - appointmentDate: json["AppointmentDate"] ?? '', - startTime: json["startTime"] ?? json['StartTime'], - appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], - appointmentType: json['appointmentType'], - appointmentTypeId: json['appointmentTypeId'] ?? json['appointmentTypeid'], - arrivedOn: json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'], - clinicGroupId: json['clinicGroupId'], - companyName: json['companyName'], - dischargeStatus: json['dischargeStatus'], - doctorDetails: json['doctorDetails'], - endTime: json['endTime'], - episodeNo: json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo'], - fallRiskScore: json['fallRiskScore'], - isSigned: json['isSigned'], - medicationOrders: json['medicationOrders'], - nationality: json['nationality'] ?? json['NationalityNameN'], - patientMRN: json['patientMRN'] ?? - json['PatientMRN'] ?? - (json["PatientID"] != null - ? int?.parse(json["PatientID"].toString()) - : int?.parse(json["patientID"].toString())), - visitType: json['visitType'] ?? json['visitType'] ?? json['visitType'], - nationalityFlagURL: json['NationalityFlagURL'] ?? json['NationalityFlagURL'], - patientStatusType: json['patientStatusType'] ?? json['PatientStatusType'], - visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], - startTimes: json['StartTime'] ?? json['StartTime'], - dischargeDate: json['DischargeDate'], - status: json['Status'], - vcId: json['VC_ID'], - - arrivalTime: json['ArrivalTime'], - arrivalTimeD: json['ArrivalTimeD'], - callStatus: json['CallStatus'], - callStatusDisc: json['CallStatusDisc'], - callTypeID: json['CallTypeID'], - clientRequestID: json['ClientRequestID'], - clinicName: json['ClinicName'], - consoltationEnd: json['ConsoltationEnd'], - consultationNotes: json['ConsultationNotes'], - patientStatus: json['PatientStatus'], - voipToken: json['VoipToken'], - ); + arrivalTime = json['ArrivalTime']; + arrivalTimeD = json['ArrivalTimeD']; + callStatus = json['CallStatus']; + callStatusDisc = json['CallStatusDisc']; + callTypeID = json['CallTypeID']; + clientRequestID = json['ClientRequestID']; + clinicName = json['ClinicName']; + consoltationEnd = json['ConsoltationEnd']; + consultationNotes = json['ConsultationNotes']; + patientStatus = json['PatientStatus']; + voipToken = json['VoipToken']; + } catch (e) { + print(e); + } + } } diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 772f2f90..92d3ba17 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -106,9 +106,9 @@ class _PatientMakeReferralScreenState extends State { patientGender: model.patientReferral[model.patientReferral.length - 1].patientDetails!.gender, referredDate: - model.patientReferral[model.patientReferral.length - 1].referredOn!.split(" ")[0], + model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[0], referredTime: - model.patientReferral[model.patientReferral.length - 1].referredOn!.split(" ")[1], + model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[1], patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}", isSameBranch: model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch, @@ -136,22 +136,22 @@ class _PatientMakeReferralScreenState extends State { if (_referTo == null) { branchError = TranslationBase.of(context).fieldRequired!; } else { - branchError = null!; + branchError = null; } if (_selectedBranch == null) { hospitalError = TranslationBase.of(context).fieldRequired!; } else { - hospitalError = null!; + hospitalError = null; } if (_selectedClinic == null) { clinicError = TranslationBase.of(context).fieldRequired!; } else { - clinicError = null!; + clinicError = null; } if (_selectedDoctor == null) { doctorError = TranslationBase.of(context).fieldRequired!; } else { - doctorError = null!; + doctorError = null; } }); if (appointmentDate == null || diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index de4d821c..6209e1fc 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -85,7 +85,7 @@ class PatientReferralItemWidget extends StatelessWidget { : Colors.red[700], ), AppText( - referredDate!, + referredDate??'', fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier!, @@ -98,7 +98,7 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ Expanded( child: AppText( - patientName!, + patientName??'', fontSize: SizeConfig.textMultiplier! * 2.2, fontWeight: FontWeight.bold, color: Colors.black, @@ -121,7 +121,7 @@ class PatientReferralItemWidget extends StatelessWidget { width: 4, ), AppText( - referredTime!, + referredTime??'', fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier!, @@ -278,7 +278,7 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - referralDoctorName!, + referralDoctorName??'', fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.7 * SizeConfig.textMultiplier!, From 73f2abbea2679da1837e24b86c718fcb8264176a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 17 Jun 2021 15:40:07 +0300 Subject: [PATCH 13/18] flutter 2 migration --- lib/config/config.dart | 4 +- .../admission-request_second-screen.dart | 6 +- .../profile/note/progress_note_screen.dart | 583 +++++++++--------- .../prescription/add_prescription_form.dart | 36 +- .../prescription/prescription_text_filed.dart | 8 +- 5 files changed, 329 insertions(+), 308 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index c8af8ad9..0283577e 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 = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 42fafd8e..0c9ccb4e 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -38,7 +38,7 @@ class _AdmissionRequestSecondScreenState extends State { late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel? authenticationViewModel; - ProjectViewModel? projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; @@ -65,8 +65,8 @@ class _ProgressNoteState extends State { @override Widget build(BuildContext context) { - // authenticationViewModel = Provider.of(context); - // projectViewModel = Provider.of(context); + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; @@ -90,308 +90,313 @@ class _ProgressNoteState extends State { child: Column( children: [ if (!isDischargedPatient) - AddNewOrder( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => UpdateNoteOrder( - patientModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: false, - )), - ); - }, - label: widget.visitType == 3 - ? TranslationBase.of(context).addNewOrderSheet! - : TranslationBase.of(context).addProgressNote!, - ), - Expanded( - child: Container( - child: ListView.builder( - itemCount: model.patientProgressNoteList.length, - itemBuilder: (BuildContext ctxt, int index) { - return FractionallySizedBox( - widthFactor: 0.95, - child: CardWithBgWidget( - hasBorder: false, - bgColor: model.patientProgressNoteList[index].status == 1 && - authenticationViewModel!.doctorProfile!.doctorID != - model.patientProgressNoteList[index].createdBy - ? Color(0xFFCC9B14) - : model.patientProgressNoteList[index].status == 4 - ? Colors.red.shade700 - : model.patientProgressNoteList[index].status == 2 - ? Colors.green[600]! - : Color(0xFFCC9B14)!, - widget: Column( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (model.patientProgressNoteList[index].status == 1 && - authenticationViewModel!.doctorProfile!.doctorID != - model.patientProgressNoteList[index].createdBy) - AppText( - TranslationBase.of(context).notePending, - fontWeight: FontWeight.bold, - color: Color(0xFFCC9B14), - fontSize: 12, - ), - if (model.patientProgressNoteList[index].status == 4) - AppText( - TranslationBase.of(context).noteCanceled, - fontWeight: FontWeight.bold, - color: Colors.red.shade700, - fontSize: 12, - ), - if (model.patientProgressNoteList[index].status == 2) - AppText( - TranslationBase.of(context).noteVerified, - fontWeight: FontWeight.bold, - color: Colors.green[600], - fontSize: 12, - ), - if (model.patientProgressNoteList[index].status != 2 && - model.patientProgressNoteList[index].status != 4 && - authenticationViewModel!.doctorProfile!.doctorID == - model.patientProgressNoteList[index].createdBy) - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => UpdateNoteOrder( - note: model.patientProgressNoteList[index], - patientModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: true, - )), - ); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: BorderRadius.circular(10), - ), - // color:Colors.red[600], + // AddNewOrder( + // onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => UpdateNoteOrder( + // patientModel: model, + // patient: patient, + // visitType: widget.visitType, + // isUpdate: false, + // )), + // ); + // }, + // label: widget.visitType == 3 + // ? TranslationBase.of(context).addNewOrderSheet! + // : TranslationBase.of(context).addProgressNote!, + // ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index].status == 1 && + authenticationViewModel!.doctorProfile!.doctorID != + model.patientProgressNoteList[index].createdBy + ? Color(0xFFCC9B14) + : model.patientProgressNoteList[index].status == 4 + ? Colors.red.shade700 + : model.patientProgressNoteList[index].status == 2 + ? Colors.green[600]! + : Color(0xFFCC9B14)!, + widget: Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (model.patientProgressNoteList[index].status == 1 && + authenticationViewModel!.doctorProfile!.doctorID != + model.patientProgressNoteList[index].createdBy) + AppText( + TranslationBase.of(context).notePending, + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status == 4) + AppText( + TranslationBase.of(context).noteCanceled, + fontWeight: FontWeight.bold, + color: Colors.red.shade700, + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status == 2) + AppText( + TranslationBase.of(context).noteVerified, + fontWeight: FontWeight.bold, + color: Colors.green[600], + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status != 2 && + model.patientProgressNoteList[index].status != 4 && + authenticationViewModel!.doctorProfile!.doctorID == + model.patientProgressNoteList[index].createdBy) + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateNoteOrder( + note: model.patientProgressNoteList[index], + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - DoctorApp.edit_1, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of(context).update, - fontSize: 10, - color: Colors.white, - ), - ], + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of(context).update, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - padding: EdgeInsets.all(6), ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: "verify", - confirmFun: () async { - GifLoaderDialogUtils.showMyDialog(context); - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(patient.admissionNo ?? ""), - cancelledNote: false, - lineItemNo: model.patientProgressNoteList[index].lineItemNo, - createdBy: model.patientProgressNoteList[index].createdBy, - notes: model.patientProgressNoteList[index].notes, - verifiedNote: true, - patientTypeID: patient.patientType, - patientOutSA: false, - ); - await model.updatePatientProgressNote(reqModel); - await getProgressNoteList(context, model, isLocalBusy: true); - GifLoaderDialogUtils.hideDialog(context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.green[600], - borderRadius: BorderRadius.circular(10), - ), - // color:Colors.red[600], + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: "verify", + confirmFun: () async { + GifLoaderDialogUtils.showMyDialog(context); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo ?? ""), + cancelledNote: false, + lineItemNo: + model.patientProgressNoteList[index].lineItemNo, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, + verifiedNote: true, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, + isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: BorderRadius.circular(10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - FontAwesomeIcons.check, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of(context).noteVerify, - fontSize: 10, - color: Colors.white, - ), - ], + child: Row( + children: [ + Icon( + FontAwesomeIcons.check, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of(context).noteVerify, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - padding: EdgeInsets.all(6), ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: TranslationBase.of(context).cancel!, - confirmFun: () async { - GifLoaderDialogUtils.showMyDialog( - context, - ); - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(patient.admissionNo ?? ""), - cancelledNote: true, - lineItemNo: model.patientProgressNoteList[index].lineItemNo, - createdBy: model.patientProgressNoteList[index].createdBy, - notes: model.patientProgressNoteList[index].notes, - verifiedNote: false, - patientTypeID: patient.patientType, - patientOutSA: false, - ); - await model.updatePatientProgressNote(reqModel); - await getProgressNoteList(context, model, isLocalBusy: true); - GifLoaderDialogUtils.hideDialog(context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.red[600], - borderRadius: BorderRadius.circular(10), - ), - // color:Colors.red[600], + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: TranslationBase.of(context).cancel!, + confirmFun: () async { + GifLoaderDialogUtils.showMyDialog( + context, + ); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo ?? ""), + cancelledNote: true, + lineItemNo: + model.patientProgressNoteList[index].lineItemNo, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, + verifiedNote: false, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, + isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red[600], + borderRadius: BorderRadius.circular(10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - FontAwesomeIcons.trash, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - 'Cancel', - fontSize: 10, - color: Colors.white, - ), - ], + child: Row( + children: [ + Icon( + FontAwesomeIcons.trash, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Cancel', + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - padding: EdgeInsets.all(6), ), - ), - SizedBox( - width: 10, - ) - ], + SizedBox( + width: 10, + ) + ], + ), + SizedBox( + height: 10, ), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.60, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).createdBy, - fontSize: 10, - ), - Expanded( - child: AppText( - model.patientProgressNoteList[index].doctorName ?? '', - fontWeight: FontWeight.w600, - fontSize: 12, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.60, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).createdBy, + fontSize: 10, ), - ), - ], + Expanded( + child: AppText( + model.patientProgressNoteList[index].doctorName ?? '', + fontWeight: FontWeight.w600, + fontSize: 12, + ), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model.patientProgressNoteList[index].createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.getDateTimeFromServerFormat( + model.patientProgressNoteList[index].createdOn ?? ""), + isArabic: projectViewModel!.isArabic) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), + isArabic: projectViewModel!.isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + model.patientProgressNoteList[index].createdOn != null + ? AppDateUtils.getHour( + AppDateUtils.getDateTimeFromServerFormat( + model.patientProgressNoteList[index].createdOn ?? "")) + : AppDateUtils.getHour(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, ), ], + crossAxisAlignment: CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row(mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + child: AppText( + model.patientProgressNoteList[index].notes, + fontSize: 10, ), ), - Column( - children: [ - AppText( - model.patientProgressNoteList[index].createdOn != null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.getDateTimeFromServerFormat( - model.patientProgressNoteList[index].createdOn ?? ""), - isArabic: projectViewModel!.isArabic) - : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), - isArabic: projectViewModel!.isArabic), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - AppText( - model.patientProgressNoteList[index].createdOn != null - ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat( - model.patientProgressNoteList[index].createdOn ?? "")) - : AppDateUtils.getHour(DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - ], - crossAxisAlignment: CrossAxisAlignment.end, - ) - ], - ), - SizedBox( - height: 8, - ), - Row(mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - child: AppText( - model.patientProgressNoteList[index].notes, - fontSize: 10, - ), - ), - ]) - ], - ), - SizedBox( - height: 20, - ), - ], + ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), ), - ), - ); - }), + ); + }), + ), ), - ), ], ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index d83ea0ee..260baee4 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -84,7 +84,7 @@ postPrescription( postProcedureReqModel.prescriptionRequestModel = prescriptionList; await model!.postPrescription(postProcedureReqModel, patient.patientMRN!); - if (model.state == ViewState.ErrorLocal) { + if (model.state == ViewState.Error) { Helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { model.getPrescriptions(patient); @@ -112,6 +112,7 @@ class _PrescriptionFormWidgetState extends State { String? strengthError; late int selectedType; + bool isSubmitted = false; TextEditingController strengthController = TextEditingController(); TextEditingController indicationController = TextEditingController(); @@ -211,7 +212,6 @@ class _PrescriptionFormWidgetState extends State { @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { x = model.patientAssessmentList.map((element) { @@ -432,8 +432,11 @@ class _PrescriptionFormWidgetState extends State { width: 5.0, ), PrescriptionTextFiled( + isSubmitted: isSubmitted, width: MediaQuery.of(context).size.width * 0.560, - element: units, + element: model.itemMedicineListUnit.length == 1 + ? units = model.itemMedicineListUnit[0] + : units, elementError: unitError ?? "", keyName: 'description', keyId: 'parameterCode', @@ -451,8 +454,11 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( + isSubmitted: isSubmitted, elementList: model.itemMedicineListRoute, - element: route, + element: model.itemMedicineListRoute.length == 1 + ? route = model.itemMedicineListRoute[0] + : route, elementError: routeError ?? "", keyId: 'parameterCode', keyName: 'description', @@ -466,9 +472,12 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( + isSubmitted: isSubmitted, hintText: TranslationBase.of(context).frequency ?? "", elementError: frequencyError ?? "", - element: frequency, + element: model.itemMedicineList.length == 1 + ? frequency = model.itemMedicineList[0] + : frequency, elementList: model.itemMedicineList, keyId: 'parameterCode', keyName: 'description', @@ -492,6 +501,7 @@ class _PrescriptionFormWidgetState extends State { }), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( + isSubmitted: isSubmitted, hintText: TranslationBase.of(context).doseTime ?? "", elementError: doseTimeError ?? "", element: doseTime, @@ -561,6 +571,7 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( + isSubmitted: isSubmitted, element: duration, elementError: durationError ?? "", hintText: TranslationBase.of(context).duration ?? "", @@ -664,7 +675,7 @@ class _PrescriptionFormWidgetState extends State { if (_selectedMedication!.isNarcotic == true) { DrAppToastMsg.showErrorToast(TranslationBase.of(context) .narcoticMedicineCanOnlyBePrescribedFromVida); - Navigator.pop(context); + // Navigator.pop(context); return; } @@ -766,35 +777,36 @@ class _PrescriptionFormWidgetState extends State { } } else { setState(() { + isSubmitted = true; if (duration == null) { durationError = TranslationBase.of(context).fieldRequired; } else { - durationError = null; + durationError = ""; } if (doseTime == null) { doseTimeError = TranslationBase.of(context).fieldRequired; } else { - doseTimeError = null; + doseTimeError = ""; } if (route == null) { routeError = TranslationBase.of(context).fieldRequired; } else { - routeError = null; + routeError = ""; } if (frequency == null) { frequencyError = TranslationBase.of(context).fieldRequired; } else { - frequencyError = null; + frequencyError = ""; } if (units == null) { unitError = TranslationBase.of(context).fieldRequired; } else { - unitError = null; + unitError = ""; } if (strengthController.text == "") { strengthError = TranslationBase.of(context).fieldRequired; } else { - strengthError = null; + strengthError = ""; } }); } diff --git a/lib/screens/prescription/prescription_text_filed.dart b/lib/screens/prescription/prescription_text_filed.dart index 38b6f3c3..f9803789 100644 --- a/lib/screens/prescription/prescription_text_filed.dart +++ b/lib/screens/prescription/prescription_text_filed.dart @@ -9,6 +9,7 @@ import 'package:flutter/material.dart'; class PrescriptionTextFiled extends StatefulWidget { dynamic element; final String elementError; + final bool? isSubmitted; final List elementList; final String keyName; final String keyId; @@ -25,7 +26,8 @@ class PrescriptionTextFiled extends StatefulWidget { required this.keyName, required this.keyId, required this.hintText, - required this.okFunction}) + required this.okFunction, + this.isSubmitted}) : super(key: key); @override @@ -65,7 +67,9 @@ class _PrescriptionTextFiledState extends State { ? widget.element['${widget.keyName}'] : null, isTextFieldHasSuffix: true, - validationError: widget.elementList.length != 1 ? widget.elementError : null, + validationError: widget.element == null && widget.isSubmitted == true && widget.elementList.length != 1 + ? widget.elementError + : null, enabled: false, ), ), From 764e2e29f52ed97bc978080511cc7db03dc2d2d5 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Jun 2021 15:44:32 +0300 Subject: [PATCH 14/18] first fix from procedure --- lib/config/config.dart | 4 ++-- lib/screens/procedures/entity_list_fav_procedure.dart | 8 ++++---- lib/widgets/shared/text_fields/TextFields.dart | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index c8af8ad9..0283577e 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 = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/screens/procedures/entity_list_fav_procedure.dart b/lib/screens/procedures/entity_list_fav_procedure.dart index 9d0835ae..97e3bcba 100644 --- a/lib/screens/procedures/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/entity_list_fav_procedure.dart @@ -112,11 +112,11 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State { default: if (widget.suffixIcon != null) return InkWell( - onTap: widget.onSuffixTap!, + onTap: widget.onSuffixTap??null, child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500])); else From bf54139647b04dc5925cf988991b502568a2b808 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Jun 2021 16:32:19 +0300 Subject: [PATCH 15/18] first procedure --- lib/screens/procedures/add-procedure-form.dart | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 53024aca..6c633960 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -27,7 +27,7 @@ valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, List { - late int selectedType; + int? selectedType; ProcedureViewModel model; PatiantInformtion patient; @@ -253,7 +253,7 @@ class _AddSelectedProcedureState extends State { title: TranslationBase.of(context).addSelectedProcedures, color: Color(0xff359846), fontWeight: FontWeight.w700, - onPressed: () { + onPressed: () async { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( TranslationBase.of(context).fillTheMandatoryProcedureDetails, @@ -261,13 +261,17 @@ class _AddSelectedProcedureState extends State { return; } - Navigator.pop(context); - postProcedure( - orderType: selectedType.toString(), + + + //TODO Elham* check the static value + postProcedure( + orderType: selectedType==null?"1":selectedType.toString(), entityList: entityList, patient: patient, model: widget.model, remarks: remarksController.text); + + Navigator.pop(context); }, ), ], From 329711a002354cf1c80fcd79dc6257b86ea7f647 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 20 Jun 2021 16:18:38 +0300 Subject: [PATCH 16/18] fix error to make the code work with flutter 2 --- lib/config/size_config.dart | 6 +- .../live_care/AlternativeServicesList.dart | 8 +- .../live_care_login_reguest_model.dart | 10 +- .../PatientSearchRequestModel.dart | 4 +- .../referral/MyReferralPatientModel.dart | 2 +- .../MyReferralPatientRequestModel.dart | 46 +++--- .../add_referred_remarks_request.dart | 30 ++-- lib/core/service/NavigationService.dart | 10 +- lib/core/service/VideoCallService.dart | 28 ++-- lib/core/service/home/scan_qr_service.dart | 8 +- .../patient/LiveCarePatientServices.dart | 4 +- .../patient/MyReferralPatientService.dart | 16 +- .../patient-doctor-referral-service.dart | 2 +- lib/core/service/patient/patient_service.dart | 8 +- .../procedure/procedure_service.dart | 2 +- .../viewModel/LiveCarePatientViewModel.dart | 32 ++-- .../viewModel/PatientSearchViewModel.dart | 2 +- .../viewModel/authentication_view_model.dart | 2 +- lib/core/viewModel/dashboard_view_model.dart | 8 +- .../viewModel/patient-referral-viewmodel.dart | 8 +- lib/core/viewModel/patient_view_model.dart | 2 +- lib/core/viewModel/procedure_View_model.dart | 30 ++-- lib/core/viewModel/scan_qr_view_model.dart | 2 +- ...cial_clinical_care_List_Respose_Model.dart | 10 +- ...nical_care_mapping_List_Respose_Model.dart | 12 +- lib/models/livecare/start_call_req.dart | 22 +-- .../patient_profile_app_bar_model.dart | 36 ++-- lib/screens/auth/login_screen.dart | 4 +- .../auth/verification_methods_screen.dart | 34 ++-- .../home/dashboard_referral_patient.dart | 64 ++++---- .../home/dashboard_slider-item-widget.dart | 2 +- lib/screens/home/home_page_card.dart | 2 +- lib/screens/home/home_screen.dart | 57 ++++--- lib/screens/home/home_screen_header.dart | 14 +- lib/screens/home/label.dart | 10 +- lib/screens/live_care/end_call_screen.dart | 46 +++--- .../live-care_transfer_to_admin.dart | 2 +- lib/screens/live_care/video_call.dart | 2 +- .../medical-file/medical_file_details.dart | 68 ++++---- .../patients/PatientsInPatientScreen.dart | 8 +- .../patients/insurance_approvals_details.dart | 155 ++++++++---------- .../lab_result/laboratory_result_page.dart | 2 +- .../AddVerifyMedicalReport.dart | 6 +- .../medical_report/MedicalReportPage.dart | 2 +- .../PatientProfileCardModel.dart | 3 +- .../patient_profile_screen.dart | 13 +- .../radiology/radiology_details_page.dart | 2 +- .../referral/AddReplayOnReferralPatient.dart | 4 +- .../ReplySummeryOnReferralPatient.dart | 2 +- .../referral_patient_detail_in-paint.dart | 4 +- .../referral/referred-patient-screen.dart | 10 +- .../prescription/prescription_items_page.dart | 8 +- lib/screens/procedures/ProcedureType.dart | 34 ++-- .../procedures/add-favourite-procedure.dart | 34 ++-- .../procedures/add-procedure-page.dart | 52 +++--- .../base_add_procedure_tab_page.dart | 28 ++-- lib/util/NotificationPermissionUtils.dart | 2 +- lib/util/VideoChannel.dart | 8 +- lib/util/date-utils.dart | 4 +- lib/util/helpers.dart | 6 +- lib/util/translations_delegate_base.dart | 20 +-- lib/widgets/dashboard/row_count.dart | 2 +- lib/widgets/dialog/AskPermissionDialog.dart | 2 +- .../patients/patient_card/ShowTimer.dart | 4 +- .../profile/PatientProfileButton.dart | 4 +- .../profile/patient-profile-app-bar.dart | 128 +++++++-------- ...ent-profile-header-new-design-app-bar.dart | 6 +- lib/widgets/shared/app_scaffold_widget.dart | 8 +- lib/widgets/shared/app_texts_widget.dart | 2 +- .../shared/buttons/app_buttons_widget.dart | 2 +- lib/widgets/shared/drawer_item_widget.dart | 2 +- 71 files changed, 608 insertions(+), 614 deletions(-) diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 8a9c7ac6..75c37643 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -75,7 +75,7 @@ class SizeConfig { print('isMobilePortrait $isMobilePortrait'); } - static getTextMultiplierBasedOnWidth({double width}){ + static getTextMultiplierBasedOnWidth({double? width}){ // TODO handel LandScape case if(width != null) { return width / 100; @@ -84,7 +84,7 @@ class SizeConfig { } - static getWidthMultiplier({double width}){ + static getWidthMultiplier({double? width}){ // TODO handel LandScape case if(width != null) { return width / 100; @@ -92,7 +92,7 @@ class SizeConfig { return widthMultiplier; } - static getHeightMultiplier({double height}){ + static getHeightMultiplier({double? height}){ // TODO handel LandScape case if(height != null) { return height / 100; diff --git a/lib/core/model/live_care/AlternativeServicesList.dart b/lib/core/model/live_care/AlternativeServicesList.dart index 11f27b95..28d70805 100644 --- a/lib/core/model/live_care/AlternativeServicesList.dart +++ b/lib/core/model/live_care/AlternativeServicesList.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; class AlternativeService { - int serviceID; - String serviceName; - bool isSelected; + int? serviceID; + String? serviceName; + bool? isSelected; AlternativeService( {this.serviceID, this.serviceName, this.isSelected = false}); @@ -23,7 +23,7 @@ class AlternativeService { } class AlternativeServicesList with ChangeNotifier { - List _alternativeServicesList; + late List _alternativeServicesList; getServicesList(){ return _alternativeServicesList; diff --git a/lib/core/model/live_care/live_care_login_reguest_model.dart b/lib/core/model/live_care/live_care_login_reguest_model.dart index e14d4223..90ea0ff1 100644 --- a/lib/core/model/live_care/live_care_login_reguest_model.dart +++ b/lib/core/model/live_care/live_care_login_reguest_model.dart @@ -1,9 +1,9 @@ class LiveCareUserLoginRequestModel { - String tokenID; - String generalid; - int doctorId; - int isOutKsa; - int isLogin; + String? tokenID; + String? generalid; + int? doctorId; + int? isOutKsa; + int? isLogin; LiveCareUserLoginRequestModel({this.tokenID, this.generalid, this.doctorId, this.isOutKsa, this.isLogin}); diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index 7117382c..d377916e 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -11,8 +11,8 @@ class PatientSearchRequestModel { int ?searchType; String? mobileNo; String? identificationNo; - int nursingStationID; - int clinicID=0; + int? nursingStationID; + int? clinicID=0; PatientSearchRequestModel( {this.doctorID = 0, diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index ec1f7758..86a0e9c7 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -61,7 +61,7 @@ class MyReferralPatientModel { String? priorityDescription; String? referringClinicDescription; String? referringDoctorName; - int referalStatus; + int? referalStatus; MyReferralPatientModel( {this.rowID, diff --git a/lib/core/model/referral/MyReferralPatientRequestModel.dart b/lib/core/model/referral/MyReferralPatientRequestModel.dart index 08b98a99..885653a1 100644 --- a/lib/core/model/referral/MyReferralPatientRequestModel.dart +++ b/lib/core/model/referral/MyReferralPatientRequestModel.dart @@ -1,27 +1,27 @@ class MyReferralPatientRequestModel { - int channel; - int clinicID; - int doctorID; - int editedBy; - String firstName; - String from; - String iPAdress; - bool isLoginForDoctorApp; - int languageID; - String lastName; - String middleName; - int patientID; - String patientIdentificationID; - String patientMobileNumber; - bool patientOutSA; - int patientTypeID; - int projectID; - String sessionID; - String stamp; - String to; - String tokenID; - double versionID; - String vidaAuthTokenID; + int? channel; + int? clinicID; + int? doctorID; + int? editedBy; + String? firstName; + String? from; + String? iPAdress; + bool? isLoginForDoctorApp; + int? languageID; + String? lastName; + String? middleName; + int? patientID; + String? patientIdentificationID; + String? patientMobileNumber; + bool? patientOutSA; + int? patientTypeID; + int? projectID; + String? sessionID; + String? stamp; + String? to; + String? tokenID; + double? versionID; + String? vidaAuthTokenID; MyReferralPatientRequestModel( {this.channel, diff --git a/lib/core/model/referral/add_referred_remarks_request.dart b/lib/core/model/referral/add_referred_remarks_request.dart index 14089513..5b7edbc6 100644 --- a/lib/core/model/referral/add_referred_remarks_request.dart +++ b/lib/core/model/referral/add_referred_remarks_request.dart @@ -1,19 +1,19 @@ class AddReferredRemarksRequestModel { - int projectID; - int admissionNo; - int lineItemNo; - String referredDoctorRemarks; - int editedBy; - int referalStatus; - bool isLoginForDoctorApp; - String iPAdress; - bool patientOutSA; - String tokenID; - int languageID; - double versionID; - int channel; - String sessionID; - int deviceTypeID; + int? projectID; + int? admissionNo; + int? lineItemNo; + String? referredDoctorRemarks; + int? editedBy; + int? referalStatus; + bool? isLoginForDoctorApp; + String? iPAdress; + bool? patientOutSA; + String? tokenID; + int? languageID; + double? versionID; + int? channel; + String? sessionID; + int? deviceTypeID; AddReferredRemarksRequestModel( {this.projectID, diff --git a/lib/core/service/NavigationService.dart b/lib/core/service/NavigationService.dart index 26191ffc..11b12ec5 100644 --- a/lib/core/service/NavigationService.dart +++ b/lib/core/service/NavigationService.dart @@ -3,16 +3,16 @@ import 'package:flutter/material.dart'; class NavigationService { final GlobalKey navigatorKey = new GlobalKey(); - Future navigateTo(String routeName,{Object arguments}) { - return navigatorKey.currentState.pushNamed(routeName,arguments: arguments); + Future navigateTo(String routeName,{required Object arguments}) { + return navigatorKey.currentState!.pushNamed(routeName,arguments: arguments); } - Future pushReplacementNamed(String routeName,{Object arguments}) { - return navigatorKey.currentState.pushReplacementNamed(routeName,arguments: arguments); + Future pushReplacementNamed(String routeName,{required Object arguments}) { + return navigatorKey.currentState!.pushReplacementNamed(routeName,arguments: arguments); } Future pushNamedAndRemoveUntil(String routeName) { - return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName,(asd)=>false); + return navigatorKey.currentState!.pushNamedAndRemoveUntil(routeName,(asd)=>false); } } \ No newline at end of file diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index f72544a0..d07c640d 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -18,14 +18,14 @@ import 'NavigationService.dart'; class VideoCallService extends BaseService{ - StartCallRes startCallRes; - PatiantInformtion patient; + late StartCallRes startCallRes; + late PatiantInformtion patient; LiveCarePatientServices _liveCarePatientServices = locator(); openVideo(StartCallRes startModel,PatiantInformtion patientModel,VoidCallback onCallConnected, VoidCallback onCallDisconnected)async{ this.startCallRes = startModel; this.patient = patientModel; - DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); + DoctorProfileModel? doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( kToken: startCallRes.openTokenID,//"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", kSessionId:startCallRes.openSessionID,//1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg @@ -34,15 +34,15 @@ class VideoCallService extends BaseService{ patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await sharedPref.getString(TOKEN), generalId: GENERAL_ID, - doctorId: doctorProfile.doctorID, + doctorId: doctorProfile!.doctorID, onFailure: (String error) { DrAppToastMsg.showErrorToast(error); },onCallConnected: onCallConnected, onCallEnd: () { - WidgetsBinding.instance.addPostFrameCallback((_) async { - GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext); - endCall(patient.vcId, false,).then((value) { - GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext); + WidgetsBinding.instance!.addPostFrameCallback((_) async { + GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext!); + endCall(patient.vcId!, false,).then((value) { + GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext!); if (hasError) { DrAppToastMsg.showErrorToast(error); }else @@ -54,10 +54,10 @@ class VideoCallService extends BaseService{ }); }, onCallNotRespond: (SessionStatusModel sessionStatusModel) { - WidgetsBinding.instance.addPostFrameCallback((_) { - GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext); - endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { - GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext); + WidgetsBinding.instance!.addPostFrameCallback((_) { + GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext!); + endCall(patient.vcId!, sessionStatusModel.sessionStatus == 3,).then((value) { + GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext!); if (hasError) { DrAppToastMsg.showErrorToast(error); } else { @@ -76,13 +76,13 @@ class VideoCallService extends BaseService{ hasError = false; await getDoctorProfile(isGetProfile: true); EndCallReq endCallReq = new EndCallReq(); - endCallReq.doctorId = doctorProfile.doctorID; + endCallReq.doctorId = doctorProfile!.doctorID; endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.vCID = vCID; endCallReq.isDestroy = isPatient; await _liveCarePatientServices.endCall(endCallReq); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; } } diff --git a/lib/core/service/home/scan_qr_service.dart b/lib/core/service/home/scan_qr_service.dart index bc6c8820..7a0033b9 100644 --- a/lib/core/service/home/scan_qr_service.dart +++ b/lib/core/service/home/scan_qr_service.dart @@ -4,15 +4,15 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class ScanQrService extends BaseService { - List myInPatientList = List(); - List inPatientList = List(); + List myInPatientList = []; + List inPatientList = []; Future getInPatient(PatientSearchRequestModel requestModel, bool isMyInpatient) async { hasError = false; await getDoctorProfile(); if (isMyInpatient) { - requestModel.doctorID = doctorProfile.doctorID; + requestModel.doctorID = doctorProfile!.doctorID!; } else { requestModel.doctorID = 0; } @@ -26,7 +26,7 @@ class ScanQrService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if (patient.doctorId == doctorProfile.doctorID) { + if (patient.doctorId == doctorProfile!.doctorID!) { myInPatientList.add(patient); } }); diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index d8e56db7..40968550 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -113,10 +113,10 @@ class LiveCarePatientServices extends BaseService { }, isLiveCare: _isLive); } - Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async { + Future isLogin({LiveCareUserLoginRequestModel? isLoginRequestModel, int? loginStatus}) async { hasError = false; await getDoctorProfile( ); - isLoginRequestModel.doctorId = super.doctorProfile.doctorID; + isLoginRequestModel!.doctorId = super.doctorProfile!.doctorID!; await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async { isLoginResponse = response; }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index c2e467d2..946d631f 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -13,7 +13,7 @@ class MyReferralInPatientService extends BaseService { await getDoctorProfile(); MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( - doctorID: doctorProfile!.doctorID, + doctorID: doctorProfile!.doctorID!, firstName: "0", middleName: "0", lastName: "0", @@ -48,7 +48,7 @@ class MyReferralInPatientService extends BaseService { await getDoctorProfile(); MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( - doctorID: doctorProfile.doctorID, + doctorID: doctorProfile!.doctorID!, firstName: "0", middleName: "0", lastName: "0", @@ -104,15 +104,15 @@ class MyReferralInPatientService extends BaseService { hasError = false; await getDoctorProfile(); AddReferredRemarksRequestModel _requestAddReferredDoctorRemarks = AddReferredRemarksRequestModel( - editedBy: doctorProfile.doctorID, - projectID: doctorProfile.projectID, + editedBy: doctorProfile!.doctorID!, + projectID: doctorProfile!.projectID!, referredDoctorRemarks: referredDoctorRemarks, referalStatus: referalStatus); - _requestAddReferredDoctorRemarks.projectID = referral.projectID; - _requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo); - _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; + _requestAddReferredDoctorRemarks.projectID = referral.projectID!; + _requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo!); + _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo!; _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; - _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; + _requestAddReferredDoctorRemarks.editedBy = doctorProfile!.doctorID!; _requestAddReferredDoctorRemarks.referalStatus = referalStatus; // _requestAddReferredDoctorRemarks.patientID = referral.patientID; diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index 08e17574..fd9e25b3 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -155,7 +155,7 @@ class PatientReferralService extends LookupService { hasError = false; RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); await baseAppClient.post( GET_MY_REFERRED_OUT_PATIENT, diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index 31632d27..52c10ad5 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -24,8 +24,8 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_mode class PatientService extends BaseService { List _patientVitalSignList = []; List patientVitalSignOrderdSubList = []; - List inPatientList = List(); - List myInPatientList = List(); + List inPatientList = []; + List myInPatientList = []; List get patientVitalSignList => _patientVitalSignList; @@ -141,7 +141,7 @@ class PatientService extends BaseService { await getDoctorProfile(); if (isMyInpatient) { - requestModel.doctorID = doctorProfile.doctorID; + requestModel.doctorID = doctorProfile!.doctorID!; } else { requestModel.doctorID = 0; } @@ -155,7 +155,7 @@ class PatientService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if (patient.doctorId == doctorProfile.doctorID) { + if (patient.doctorId == doctorProfile!.doctorID!) { myInPatientList.add(patient); } }); diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index 48a93853..51fdf98b 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -23,7 +23,7 @@ class ProcedureService extends BaseService { List procedureslist = []; List categoryList = []; - // List _templateList = List(); + // List _templateList = []; // List get templateList => _templateList; List templateList = []; diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 907bc1da..356a3826 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -71,15 +71,15 @@ class LiveCarePatientViewModel extends BaseViewModel { Future startCall({required int vCID, required bool isReCall}) async { StartCallReq startCallReq = new StartCallReq(); await getDoctorProfile(); - startCallReq.clinicId = super.doctorProfile!.clinicID; + startCallReq.clinicId = super.doctorProfile!.clinicID!; startCallReq.vCID = vCID; //["VC_ID"]; startCallReq.isrecall = isReCall; - startCallReq.doctorId = doctorProfile!.doctorID; + startCallReq.doctorId = doctorProfile!.doctorID!; startCallReq.isOutKsa = false; //["IsOutKSA"]; - startCallReq.projectName = doctorProfile!.projectName; - startCallReq.docotrName = doctorProfile!.doctorName; - startCallReq.clincName = doctorProfile!.clinicDescription; - startCallReq.docSpec = doctorProfile!.doctorTitleForProfile; + startCallReq.projectName = doctorProfile!.projectName!; + startCallReq.docotrName = doctorProfile!.doctorName!; + startCallReq.clincName = doctorProfile!.clinicDescription!; + startCallReq.docSpec = doctorProfile!.doctorTitleForProfile!; startCallReq.generalid = 'Cs2020@2016\$2958'; setState(ViewState.BusyLocal); @@ -92,9 +92,9 @@ class LiveCarePatientViewModel extends BaseViewModel { } } - setSelectedCheckboxValues(AlternativeService service, bool isSelected) { - int index = alternativeServicesList.indexOf(service); - if (index != -1) alternativeServicesList[index].isSelected = isSelected; + setSelectedCheckboxValues(AlternativeService? service, bool? isSelected) { + int index = alternativeServicesList.indexOf(service!); + if (index != -1) alternativeServicesList[index].isSelected = isSelected!; notifyListeners(); } @@ -118,10 +118,10 @@ class LiveCarePatientViewModel extends BaseViewModel { } List getSelectedAlternativeServices() { - List selectedServices = List(); + List selectedServices = []; for (AlternativeService service in alternativeServicesList) { - if (service.isSelected) { - selectedServices.add(service.serviceID); + if (service.isSelected!) { + selectedServices.add(service.serviceID!); } } return selectedServices; @@ -131,7 +131,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.getAlternativeServices(vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -154,7 +154,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.sendSMSInstruction(vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { await getPendingPatientERForDoctorApp(); @@ -186,14 +186,14 @@ class LiveCarePatientViewModel extends BaseViewModel { await getDoctorProfile(isGetProfile: true); LiveCareUserLoginRequestModel userLoginRequestModel = new LiveCareUserLoginRequestModel(); - userLoginRequestModel.isOutKsa = (doctorProfile.projectID == 2 || doctorProfile.projectID == 3) ? 1 : 0; + userLoginRequestModel.isOutKsa = (doctorProfile!.projectID! == 2 || doctorProfile!.projectID! == 3) ? 1 : 0; userLoginRequestModel.isLogin = loginStatus; userLoginRequestModel.generalid = "Cs2020@2016\$2958"; setState(ViewState.BusyLocal); await _liveCarePatientServices.isLogin(loginStatus: loginStatus, isLoginRequestModel: userLoginRequestModel); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index d0bd9862..1e77f9e1 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -199,7 +199,7 @@ class PatientSearchViewModel extends BaseViewModel { } await _specialClinicsService.getSpecialClinicalCareMappingList(clinicId); if (_specialClinicsService.hasError) { - error = _specialClinicsService.error; + error = _specialClinicsService.error!; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index f63220d4..52819e43 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -232,7 +232,7 @@ class AuthenticationViewModel extends BaseViewModel { /// add  token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess( SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { - print("VerificationCode : " +sendActivationCodeForDoctorAppResponseModel.verificationCode); + print("VerificationCode : " +sendActivationCodeForDoctorAppResponseModel!.verificationCode!); // DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode!); sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index e85c103c..27489733 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -66,7 +66,7 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Busy); await _specialClinicsService.getSpecialClinicalCareList(); if (_specialClinicsService.hasError) { - error = _specialClinicsService.error; + error = _specialClinicsService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -82,7 +82,7 @@ class DashboardViewModel extends BaseViewModel { ); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); if (authProvider.state == ViewState.ErrorLocal) { - error = authProvider.error; + error = authProvider.error!; } } @@ -94,8 +94,8 @@ class DashboardViewModel extends BaseViewModel { } - GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId){ - GetSpecialClinicalCareListResponseModel special ; + GetSpecialClinicalCareListResponseModel? getSpecialClinic(clinicId){ + GetSpecialClinicalCareListResponseModel? special ; specialClinicalCareList.forEach((element) { if(element.clinicID == 1){ special = element; diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 520004a4..8dd898bc 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -140,7 +140,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getMyReferredOutPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -183,7 +183,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.getMyReferralOutPatientService(); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; if (localBusy) setState(ViewState.ErrorLocal); else @@ -239,7 +239,7 @@ class PatientReferralViewModel extends BaseViewModel { patientID: patient.patientId, roomID: patient.roomId, referralClinic: clinicID, - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient.admissionNo!), referralDoctor: doctorID, patientTypeID: patient.patientType, referringDoctorRemarks: remarks, @@ -395,7 +395,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.replayReferred(referredDoctorRemarks, referral, referalStatus); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; setState(ViewState.ErrorLocal); } else getMyReferralPatientService(); diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index af0130d8..188e4be2 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -277,7 +277,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getInPatient(requestModel, false); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else { // setDefaultInPatientList(); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 6fc0f7e1..4d68ea52 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -315,27 +315,27 @@ class ProcedureViewModel extends BaseViewModel { } Future preparePostProcedure( - {String remarks, - String orderType, - PatiantInformtion patient, - List entityList, - ProcedureType procedureType}) async { + {String? remarks, + String? orderType, + PatiantInformtion? patient, + List ? entityList, + ProcedureType? procedureType}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); - procedureValadteRequestModel.patientMRN = patient.patientMRN; - procedureValadteRequestModel.episodeID = patient.episodeNo; - procedureValadteRequestModel.appointmentNo = patient.appointmentNo; + procedureValadteRequestModel.patientMRN = patient!.patientMRN; + procedureValadteRequestModel.episodeID = patient!.episodeNo; + procedureValadteRequestModel.appointmentNo = patient!.appointmentNo; - List controlsProcedure = List(); + List controlsProcedure = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; - entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); + entityList!.forEach((element) { + procedureValadteRequestModel.procedure = [element!.procedureId!]; + List controls = []; controls.add( Controls( code: "remarks", @@ -357,8 +357,8 @@ class ProcedureViewModel extends BaseViewModel { postProcedureReqModel.procedures = controlsProcedure; await valadteProcedure(procedureValadteRequestModel); if (state == ViewState.Idle) { - if (valadteProcedureList[0].entityList.length == 0) { - await postProcedure(postProcedureReqModel, patient.patientMRN); + if (valadteProcedureList[0].entityList!.length == 0) { + await postProcedure(postProcedureReqModel, patient!.patientMRN!); if (state == ViewState.ErrorLocal) { Helpers.showErrorToast(error); @@ -372,7 +372,7 @@ class ProcedureViewModel extends BaseViewModel { getProcedure(mrn: patient.patientMRN); } else if (state == ViewState.Idle) { Helpers.showErrorToast( - valadteProcedureList[0].entityList[0].warringMessages); + valadteProcedureList[0].entityList![0].warringMessages); } } } else { diff --git a/lib/core/viewModel/scan_qr_view_model.dart b/lib/core/viewModel/scan_qr_view_model.dart index 86e975e3..ea10d13c 100644 --- a/lib/core/viewModel/scan_qr_view_model.dart +++ b/lib/core/viewModel/scan_qr_view_model.dart @@ -15,7 +15,7 @@ class ScanQrViewModel extends BaseViewModel { await _scanQrService.getInPatient(requestModel, true); if (_scanQrService.hasError) { - error = _scanQrService.error; + error = _scanQrService.error!; setState(ViewState.ErrorLocal); } else { diff --git a/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart b/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart index ec19abb0..c732fa71 100644 --- a/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart +++ b/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart @@ -1,9 +1,9 @@ class GetSpecialClinicalCareListResponseModel { - int projectID; - int clinicID; - String clinicDescription; - String clinicDescriptionN; - bool isActive; + int? projectID; + int? clinicID; + String? clinicDescription; + String? clinicDescriptionN; + bool? isActive; GetSpecialClinicalCareListResponseModel( {this.projectID, diff --git a/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart b/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart index 287f40f1..a69f812f 100644 --- a/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart +++ b/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart @@ -1,10 +1,10 @@ class GetSpecialClinicalCareMappingListResponseModel { - int mappingProjectID; - int clinicID; - int nursingStationID; - bool isActive; - int projectID; - String description; + int? mappingProjectID; + int? clinicID; + int? nursingStationID; + bool? isActive; + int? projectID; + String? description; GetSpecialClinicalCareMappingListResponseModel( {this.mappingProjectID, diff --git a/lib/models/livecare/start_call_req.dart b/lib/models/livecare/start_call_req.dart index b3ceabb5..cdc8c924 100644 --- a/lib/models/livecare/start_call_req.dart +++ b/lib/models/livecare/start_call_req.dart @@ -1,15 +1,15 @@ class StartCallReq { - String clincName; - int clinicId; - String docSpec; - String docotrName; - int doctorId; - String generalid; - bool isOutKsa; - bool isrecall; - String projectName; - String tokenID; - int vCID; + String ?clincName; + int ?clinicId; + String ?docSpec; + String? docotrName; + int ?doctorId; + String? generalid; + bool? isOutKsa; + bool ? isrecall; + String? projectName; + String ?tokenID; + int ?vCID; StartCallReq( {this.clincName, diff --git a/lib/models/patient/profile/patient_profile_app_bar_model.dart b/lib/models/patient/profile/patient_profile_app_bar_model.dart index f4654a29..ea576abc 100644 --- a/lib/models/patient/profile/patient_profile_app_bar_model.dart +++ b/lib/models/patient/profile/patient_profile_app_bar_model.dart @@ -1,24 +1,24 @@ import '../patiant_info_model.dart'; class PatientProfileAppBarModel { - double height; - bool isInpatient; - bool isDischargedPatient; - bool isFromLiveCare; - PatiantInformtion patient; - String doctorName; - String branch; - DateTime appointmentDate; - String profileUrl; - String invoiceNO; - String orderNo; - bool isPrescriptions; - bool isMedicalFile; - String episode; - String visitDate; - String clinic; - bool isAppointmentHeader; - bool isFromLabResult; + double? height; + bool? isInpatient; + bool? isDischargedPatient; + bool? isFromLiveCare; + PatiantInformtion? patient; + String? doctorName; + String? branch; + DateTime? appointmentDate; + String? profileUrl; + String? invoiceNO; + String? orderNo; + bool? isPrescriptions; + bool? isMedicalFile; + String? episode; + String? visitDate; + String? clinic; + bool? isAppointmentHeader; + bool? isFromLabResult; PatientProfileAppBarModel( {this.height = 0.0, diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 6adbbfe0..ba6215f2 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -55,7 +55,7 @@ class _LoginScreenState extends State { height: 10, ), Text( - TranslationBase.of(context).welcomeTo, + TranslationBase.of(context).welcomeTo??"", style: TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -64,7 +64,7 @@ class _LoginScreenState extends State { fontFamily: 'Poppins'), ), Text( - TranslationBase.of(context).drSulaimanAlHabib, + TranslationBase.of(context).drSulaimanAlHabib!, style: TextStyle( color: Color(0xFF2B353E), fontWeight: FontWeight.bold, diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index f211781f..f8e62ea1 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -91,7 +91,7 @@ class _VerificationMethodsScreenState extends State { color: Color(0xFF2B353E), ), AppText( - Helpers.capitalize(authenticationViewModel.user.doctorName), + Helpers.capitalize(authenticationViewModel.user!.doctorName), fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6, color: Color(0xFF2B353E), fontWeight: FontWeight.bold, @@ -131,7 +131,7 @@ class _VerificationMethodsScreenState extends State { children: [ Text( TranslationBase.of(context) - .lastLoginAt, + .lastLoginAt!, overflow: TextOverflow.ellipsis, style: TextStyle( fontFamily: 'Poppins', @@ -164,7 +164,7 @@ class _VerificationMethodsScreenState extends State { .getType( authenticationViewModel .user - .logInTypeID, + !.logInTypeID, context), style: TextStyle( color: @@ -191,21 +191,21 @@ class _VerificationMethodsScreenState extends State { children: [ AppText( authenticationViewModel - .user.editedOn != + .user!.editedOn != null ? AppDateUtils .getDayMonthYearDateFormatted( AppDateUtils .convertStringToDate( authenticationViewModel - .user - .editedOn)) + ! .user + !.editedOn!)) : authenticationViewModel - .user.createdOn != + .user!.createdOn! != null ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) + AppDateUtils.convertStringToDate(authenticationViewModel!.user + !.createdOn!)) : '--', textAlign: TextAlign.right, @@ -214,17 +214,17 @@ class _VerificationMethodsScreenState extends State { fontWeight: FontWeight.w700, ), AppText( - authenticationViewModel.user.editedOn != + authenticationViewModel.user!.editedOn != null ? AppDateUtils.getHour( AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != + authenticationViewModel!.user + !.editedOn!)) + : authenticationViewModel.user!.createdOn != null ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) + AppDateUtils.convertStringToDate(authenticationViewModel!.user + !.createdOn!)) : '--', textAlign: TextAlign.right, @@ -308,8 +308,8 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel:authenticationViewModel, authMethodType: SelectedAuthMethodTypesService .getMethodsTypeService( - authenticationViewModel.user - .logInTypeID), + authenticationViewModel!.user + !.logInTypeID!!), authenticateUser: (AuthMethodTypes authMethodType, diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 0b9e6765..a7e4339d 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -13,11 +13,11 @@ import 'package:flutter/material.dart'; import 'label.dart'; class DashboardReferralPatient extends StatelessWidget { - final List dashboardItemList; - final double height; - final DashboardViewModel model; + final List? dashboardItemList; + final double? height; + final DashboardViewModel? model; - const DashboardReferralPatient({Key key, this.dashboardItemList, this.height, this.model}) : super(key: key); + const DashboardReferralPatient({Key? key, this.dashboardItemList, this.height, this.model}) : super(key: key); @override Widget build(BuildContext context) { return RoundedContainer( @@ -101,30 +101,30 @@ class DashboardReferralPatient extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ RowCounts( - dashboardItemList[2] - .summaryoptions[0] + dashboardItemList![2] + .summaryoptions![0] .kPIParameter, - dashboardItemList[2] - .summaryoptions[0] - .value, - Colors.black, height: height,), + dashboardItemList![2] + .summaryoptions![0] + .value!, + Colors.black, height: height!,), RowCounts( - dashboardItemList[2] - .summaryoptions[1] + dashboardItemList![2] + .summaryoptions![1] .kPIParameter, - dashboardItemList[2] - .summaryoptions[1] - .value, - Colors.grey, height: height,), + dashboardItemList![2] + .summaryoptions![1] + .value!, + Colors.grey, height: height!,), RowCounts( - dashboardItemList[2] - .summaryoptions[2] + dashboardItemList![2] + .summaryoptions![2] .kPIParameter, - dashboardItemList[2] - .summaryoptions[2] - .value, - Colors.red, height: height,), + dashboardItemList![2] + .summaryoptions![2] + .value!, + Colors.red, height: height!,), ], ), ) @@ -138,21 +138,21 @@ class DashboardReferralPatient extends StatelessWidget { padding:EdgeInsets.all(0), child: GaugeChart( - _createReferralData(dashboardItemList))), + _createReferralData(dashboardItemList!))), Positioned( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ AppText( - model - .getPatientCount(dashboardItemList[2]) + model! + .getPatientCount(dashboardItemList![2]) .toString(), fontSize: SizeConfig.textMultiplier * 3.0, fontWeight: FontWeight.bold, ) ], ), - top: height * (SizeConfig.isHeightVeryShort?0.35:0.40), + top: height! * (SizeConfig.isHeightVeryShort?0.35:0.40), left: 0, right: 0) ]), @@ -164,16 +164,16 @@ class DashboardReferralPatient extends StatelessWidget { static List> _createReferralData(List dashboardItemList) { final data = [ new GaugeSegment( - dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), + dashboardItemList![2].summaryoptions![0].kPIParameter!, + getValue(dashboardItemList![1].summaryoptions![0].value), charts.MaterialPalette.black), new GaugeSegment( - dashboardItemList[2].summaryoptions[1].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[1].value), + dashboardItemList![2].summaryoptions![1].kPIParameter!, + getValue(dashboardItemList[1].summaryoptions![1].value), charts.MaterialPalette.gray.shadeDefault), new GaugeSegment( - dashboardItemList[2].summaryoptions[2].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[2].value), + dashboardItemList[2].summaryoptions![2].kPIParameter!, + getValue(dashboardItemList[1].summaryoptions![2].value), charts.MaterialPalette.red.shadeDefault), ]; diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 0d1a0e73..a78cfd1f 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -18,7 +18,7 @@ class DashboardSliderItemWidget extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Label(firstLine:Helpers.getLabelFromKPI(item.kPIName) ,secondLine:Helpers.getNameFromKPI(item.kPIName), ), + Label(firstLine:Helpers.getLabelFromKPI(item!.kPIName!) ,secondLine:Helpers.getNameFromKPI(item!.kPIName!), ), ], ), diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 2dac78b9..75d1b713 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -18,7 +18,7 @@ class HomePageCard extends StatelessWidget { final GestureTapCallback onTap; final Color color; final double opacity; - final double width; + final double? width; final EdgeInsets margin; @override Widget build(BuildContext context) { diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index d0fb3569..95897dd3 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -38,12 +38,12 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { bool isLoading = false; - ProjectViewModel projectsProvider; - DoctorProfileModel profile; + ProjectViewModel ?projectsProvider; + DoctorProfileModel ?profile; bool isExpanded = false; bool isInpatient = false; int sliderActiveIndex = 0; - String clinicId; + String? clinicId; late AuthenticationViewModel authenticationViewModel; int colorIndex = 0; final GlobalKey scaffoldKey = new GlobalKey(); @@ -142,8 +142,8 @@ class _HomeScreenState extends State { ), Container( child: Label( - firstLine: TranslationBase.of(context).patients, - secondLine: TranslationBase.of(context).services, + firstLine: TranslationBase.of(context).patients!, + secondLine: TranslationBase.of(context).services!, )), SizedBox( height: SizeConfig.heightMultiplier * .6, @@ -177,21 +177,38 @@ class _HomeScreenState extends State { List homePatientsCardsWidget(DashboardViewModel model,projectsProvider) { colorIndex = 0; - List backgroundColors = List(3); - backgroundColors[0] = Color(0xffD02127); - backgroundColors[1] = Colors.grey[300]; - backgroundColors[2] = Color(0xff2B353E); - List backgroundIconColors = List(3); - backgroundIconColors[0] = Colors.white12; - backgroundIconColors[1] = Colors.white38; - backgroundIconColors[2] = Colors.white10; - List textColors = List(3); - textColors[0] = Colors.white; - textColors[1] = Color(0xFF353E47); - textColors[2] = Colors.white; + // List backgroundColors = List(3); + // backgroundColors[0] = Color(0xffD02127); + // backgroundColors[1] = Colors.grey[300]; + // backgroundColors[2] = Color(0xff2B353E); + // List backgroundIconColors = List(3); + // backgroundIconColors[0] = Colors.white12; + // backgroundIconColors[1] = Colors.white38; + // backgroundIconColors[2] = Colors.white10; + // List textColors = List(3); + // textColors[0] = Colors.white; + // textColors[1] = Color(0xFF353E47); + // textColors[2] = Colors.white; + // + // List patientCards = []; + // - List patientCards = List(); + List backgroundColors = []; + backgroundColors.add(Color(0xffD02127)); + backgroundColors.add(Colors.grey[300]!); + backgroundColors.add(Color(0xff2B353E)); + + List backgroundIconColors = []; + backgroundIconColors.add(Colors.white12); + backgroundIconColors.add(Colors.white38); + backgroundIconColors.add(Colors.white10); + + List textColors = []; + textColors.add(Colors.white); + textColors.add(Colors.black); + textColors.add(Colors.white); + List patientCards = []; if (model.hasVirtualClinic) { patientCards.add(HomePatientCard( backgroundColor: backgroundColors[colorIndex], @@ -222,8 +239,8 @@ class _HomeScreenState extends State { Navigator.push( context, FadePage( - page: PatientInPatientScreen(specialClinic: model.getSpecialClinic(clinicId??projectsProvider - .doctorClinicsList[0].clinicID),), + page: PatientInPatientScreen(specialClinic: model!.getSpecialClinic(clinicId??projectsProvider + !.doctorClinicsList[0]!.clinicID!),), ), ); }, diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart index 7284b659..9b1aa63c 100644 --- a/lib/screens/home/home_screen_header.dart +++ b/lib/screens/home/home_screen_header.dart @@ -23,7 +23,7 @@ class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { double height = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 10 : 6); - HomeScreenHeader({Key key, this.model, this.onOpenDrawer}) : super(key: key); + HomeScreenHeader({Key? key, required this.model, required this.onOpenDrawer}) : super(key: key); @override _HomeScreenHeaderState createState() => _HomeScreenHeaderState(); @@ -33,11 +33,11 @@ class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { } class _HomeScreenHeaderState extends State { - ProjectViewModel projectsProvider; - int clinicId; + ProjectViewModel? projectsProvider; + int? clinicId; - AuthenticationViewModel authenticationViewModel; + AuthenticationViewModel? authenticationViewModel; @override @@ -170,15 +170,15 @@ class _HomeScreenHeaderState extends State { ); }).toList(); }, - onChanged: (newValue) async { + onChanged: (int? newValue) async { setState(() { clinicId = newValue; }); GifLoaderDialogUtils.showMyDialog( context); - await widget.model.changeClinic(newValue, - authenticationViewModel); + await widget.model.changeClinic(newValue!, + authenticationViewModel!); GifLoaderDialogUtils.hideDialog( context); if (widget.model.state == diff --git a/lib/screens/home/label.dart b/lib/screens/home/label.dart index 7e853323..59c396ac 100644 --- a/lib/screens/home/label.dart +++ b/lib/screens/home/label.dart @@ -7,13 +7,13 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class Label extends StatelessWidget { Label({ - Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, + Key? key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, }) : super(key: key); - final String firstLine; - final String secondLine; + final String? firstLine; + final String? secondLine; Color color; - final double secondLineFontSize; - final double firstLineFontSize; + final double? secondLineFontSize; + final double? firstLineFontSize; @override Widget build(BuildContext context) { diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 19bc2a92..ceec4474 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -24,9 +24,9 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:hexcolor/hexcolor.dart'; class EndCallScreen extends StatefulWidget { - final PatiantInformtion patient; + final PatiantInformtion? patient; - const EndCallScreen({Key? key, required this.patient,}) : super(key: key); + const EndCallScreen({Key? key, this.patient,}) : super(key: key); @override _EndCallScreenState createState() => _EndCallScreenState(); @@ -34,7 +34,7 @@ class EndCallScreen extends StatefulWidget { class _EndCallScreenState extends State { bool isInpatient = false; - PatiantInformtion patient; + PatiantInformtion ?patient; bool isDischargedPatient = false; bool isSearchAndOut = false; late String patientType; @@ -53,7 +53,7 @@ class _EndCallScreenState extends State { @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; if(routeArgs.containsKey('patient')) patient = routeArgs['patient']; } @@ -64,10 +64,10 @@ class _EndCallScreenState extends State { PatientProfileCardModel( TranslationBase.of(context).resume!, TranslationBase.of(context).theCall!, '', 'patient/vital_signs.png', isInPatient: isInpatient, - color: Colors.green[800], + color: Colors.green[800]!, onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.startCall(isReCall: false, vCID: patient.vcId!).then((value) async { + await liveCareModel.startCall(isReCall: false, vCID: patient!.vcId!).then((value) async { await liveCareModel.getDoctorProfile(); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { @@ -77,8 +77,8 @@ class _EndCallScreenState extends State { kToken: liveCareModel.startCallRes.openTokenID, kSessionId: liveCareModel.startCallRes.openSessionID, kApiKey: '46209962', - vcId: patient.vcId, - patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), + vcId: patient!.vcId, + patientName: patient!.fullName ?? (patient!.firstName != null ? "${patient!.firstName} ${patient!.lastName}" : "-"), tokenID: await liveCareModel.getToken(), generalId: GENERAL_ID, doctorId: liveCareModel.doctorProfile!.doctorID, @@ -89,7 +89,7 @@ class _EndCallScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context); await liveCareModel.endCall( - patient.vcId!, + patient!.vcId!, false, );GifLoaderDialogUtils.hideDialog(context); @@ -101,7 +101,7 @@ class _EndCallScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context); await liveCareModel.endCall( - patient.vcId!, + patient!.vcId!, sessionStatusModel.sessionStatus == 3, ); GifLoaderDialogUtils.hideDialog(context); @@ -118,21 +118,21 @@ class _EndCallScreenState extends State { PatientProfileCardModel( TranslationBase.of(context).endLC!, TranslationBase.of(context).consultation!, '', 'patient/vital_signs.png', isInPatient: isInpatient, - color: Colors.red[800], + color: Colors.red[800]!, onTap: () { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?", () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.getAlternativeServices(patient.vcId!); + await liveCareModel.getAlternativeServices(patient!.vcId!); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); } else { showAlternativesDialog(context, liveCareModel, (bool isConfirmed) async { GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.endCallWithCharge(patient.vcId, isConfirmed); + await liveCareModel.endCallWithCharge(patient!.vcId!, isConfirmed); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -153,7 +153,7 @@ class _EndCallScreenState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.sendSMSInstruction(patient.vcId); + await liveCareModel.sendSMSInstruction(patient!.vcId!); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -170,7 +170,7 @@ class _EndCallScreenState extends State { TranslationBase.of(context).transferTo!, TranslationBase.of(context).admin!, '', 'patient/health_summary.png', onTap: () { Navigator.push(context, - MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient))); + MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient!))); }, isInPatient: isInpatient, isDartIcon: true, dartIcon: DoctorApp.transfer_to_admin), ]; @@ -187,9 +187,9 @@ class _EndCallScreenState extends State { .of(context) .scaffoldBackgroundColor, isShowAppBar: true, - appBar: PatientProfileAppBar(patientProfileAppBarModel :PatientProfileAppBarModel(patient: patient,isInpatient: isInpatient, + appBar: PatientProfileAppBar(patientProfileAppBarModel :PatientProfileAppBarModel(patient: patient!,isInpatient: isInpatient, isDischargedPatient: isDischargedPatient, - height: (patient.patientStatusType != null && patient.patientStatusType == 43) + height: (patient!.patientStatusType != null && patient!.patientStatusType == 43) ? 210 : isDischargedPatient ? 240 @@ -235,7 +235,7 @@ class _EndCallScreenState extends State { itemCount: cardsList.length, staggeredTileBuilder: (int index) => StaggeredTile.fit(1), itemBuilder: (BuildContext context, int index) => PatientProfileButton( - patient: patient, + patient: patient!, patientType: patientType, arrivalType: arrivalType, from: from, @@ -251,7 +251,7 @@ class _EndCallScreenState extends State { isLoading: cardsList[index].isLoading, isDartIcon: cardsList[index].isDartIcon, dartIcon: cardsList[index].dartIcon, - color: cardsList[index].color, + color: cardsList[index].color, ), ), ], @@ -351,10 +351,10 @@ class _EndCallScreenState extends State { } class CheckBoxListWidget extends StatefulWidget { - final LiveCarePatientViewModel model; + final LiveCarePatientViewModel? model; const CheckBoxListWidget({ - Key key, + Key? key, this.model, }) : super(key: key); @@ -368,7 +368,7 @@ class _CheckBoxListState extends State { return SingleChildScrollView( child: Column( children: [ - ...widget.model.alternativeServicesList + ...widget.model!.alternativeServicesList .map( (element) => Container( child: CheckboxListTile( @@ -380,7 +380,7 @@ class _CheckBoxListState extends State { value: element.isSelected, onChanged: (newValue) { setState(() { - widget.model + widget.model! .setSelectedCheckboxValues(element, newValue); }); }, diff --git a/lib/screens/live_care/live-care_transfer_to_admin.dart b/lib/screens/live_care/live-care_transfer_to_admin.dart index d30f996c..4b9200ad 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -113,7 +113,7 @@ class _LivaCareTransferToAdminState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await model.transferToAdmin(widget.patient.vcId, noteController.text); + await model.transferToAdmin(widget!.patient!.vcId!, noteController.text); GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index 10bab392..6c959f3a 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -66,7 +66,7 @@ class _VideoCallPageState extends State { //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', kApiKey: '46209962', vcId: widget.patientData.vcId, - patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", + patientName: widget.patientData.fullName != null ? widget.patientData.fullName! : widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", tokenID: token, //"hfkjshdf347r8743", generalId: "Cs2020@2016\$2958", doctorId: doctorprofile['DoctorID'], diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 2ea90f0d..6dff0abc 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -90,8 +90,8 @@ class _MedicalFileDetailsState extends State { bool isHistoryExpand = true; bool isAssessmentExpand = true; - PatientProfileAppBarModel patientProfileAppBarModel; - ProjectViewModel projectViewModel; + PatientProfileAppBarModel? patientProfileAppBarModel; + ProjectViewModel? projectViewModel; @override void didChangeDependencies() { @@ -129,13 +129,13 @@ class _MedicalFileDetailsState extends State { } }, builder: - (BuildContext context, MedicalFileViewModel model, Widget child) => + (BuildContext? context, MedicalFileViewModel? model, Widget ?child) => AppScaffold( - patientProfileAppBarModel: patientProfileAppBarModel, + patientProfileAppBarModel: patientProfileAppBarModel!, isShowAppBar: true, appBarTitle: TranslationBase - .of(context) - .medicalReport + .of(context!)! + .medicalReport! .toUpperCase(), body: NetworkBaseView( baseViewModel: model, @@ -144,13 +144,13 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - model.medicalFileList.length != 0 && + model!.medicalFileList!.length != 0 && model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations + .medicalFileList![0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations! .length != 0 ? Padding( @@ -160,7 +160,7 @@ class _MedicalFileDetailsState extends State { children: [ SizedBox(height: 25.0), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] + model.medicalFileList![0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -205,7 +205,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -224,7 +224,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -254,7 +254,7 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] + model.medicalFileList![0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -297,7 +297,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -319,7 +319,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -342,7 +342,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -361,7 +361,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -383,7 +383,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -401,7 +401,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -432,7 +432,7 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] + model.medicalFileList![0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -475,7 +475,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -498,7 +498,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -520,7 +520,7 @@ class _MedicalFileDetailsState extends State { AppText( AppDateUtils.getDateFormatted(DateTime.parse( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -544,7 +544,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -563,7 +563,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -600,7 +600,7 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] + model.medicalFileList![0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -645,7 +645,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -663,7 +663,7 @@ class _MedicalFileDetailsState extends State { AppText(TranslationBase.of(context).examType! + ": "), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -678,7 +678,7 @@ class _MedicalFileDetailsState extends State { children: [ AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -694,7 +694,7 @@ class _MedicalFileDetailsState extends State { AppText(TranslationBase.of(context).abnormal! + ": "), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -710,7 +710,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 88f85440..c1c96c95 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -18,9 +18,9 @@ import 'DischargedPatientPage.dart'; import 'InPatientPage.dart'; class PatientInPatientScreen extends StatefulWidget { - GetSpecialClinicalCareListResponseModel specialClinic; + GetSpecialClinicalCareListResponseModel? specialClinic; - PatientInPatientScreen({Key key, this.specialClinic}); + PatientInPatientScreen({Key? key, this.specialClinic}); @override _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); @@ -30,7 +30,7 @@ class _PatientInPatientScreenState extends State with Si late TabController _tabController; int _activeTab = 0; - int selectedMapId; + int? selectedMapId; @override @@ -182,7 +182,7 @@ class _PatientInPatientScreenState extends State with Si ); }).toList(); }, - onChanged: (newValue) async { + onChanged: (int? newValue) async { setState(() { selectedMapId = newValue; }); diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 5275eff6..1d039a72 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -32,8 +32,8 @@ class _InsuranceApprovalsDetailsState extends State { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + ProjectViewModel projectViewModel = Provider.of(context!); + final routeArgs = ModalRoute.of(context!)!.settings.arguments as Map; return BaseView( onModelReady: (model) => model.insuranceApprovalInPatient.length == 0 @@ -44,7 +44,7 @@ class _InsuranceApprovalsDetailsState extends State { appointmentNo: patient.appointmentNo, projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient) : null, - builder: (BuildContext context, InsuranceViewModel model, Widget child) => + builder: (BuildContext? context, InsuranceViewModel? model, Widget? child) => AppScaffold( isShowAppBar: true, baseViewModel: model, @@ -62,7 +62,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).insurance22, + TranslationBase.of(context!).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -72,7 +72,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).approvals22, + TranslationBase.of(context!).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -99,19 +99,16 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] .approvalStatusDescption != null - ? model - .insuranceApprovalInPatient[ + ? model!.insuranceApprovalInPatient[ indexInsurance] .approvalStatusDescption ?? "" : "", - color: model - .insuranceApprovalInPatient[ + color: model!.insuranceApprovalInPatient[ indexInsurance] .approvalStatusDescption != null @@ -128,10 +125,9 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - .doctorName + .doctorName! .toUpperCase(), color: Colors.black, fontSize: 18, @@ -159,10 +155,9 @@ class _InsuranceApprovalsDetailsState extends State { BorderRadius.circular( 50), child: Image.network( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - .doctorImage, + .doctorImage!, fit: BoxFit.fill, width: 700, ), @@ -191,15 +186,14 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .clinic + + .clinic! + ": ", color: Colors.grey[500], fontSize: 14, ), Expanded( child: AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] .clinicName, fontSize: 14, @@ -212,14 +206,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .approvalNo + + .approvalNo! + ": ", color: Colors.grey[500], fontSize: 14, ), AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] .approvalNo .toString(), @@ -235,8 +228,7 @@ class _InsuranceApprovalsDetailsState extends State { fontSize: 14, ), AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] .unUsedCount .toString(), @@ -249,7 +241,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .companyName + + .companyName! + ": ", color: Colors.grey[500], ), @@ -261,13 +253,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .receiptOn + + .receiptOn! + ": ", color: Colors.grey[500], ), Expanded( child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -280,12 +272,12 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .expiryDate + + .expiryDate! + ": ", color: Colors.grey[500], ), AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -312,21 +304,21 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .usageStatus, fontWeight: FontWeight.w700, ), @@ -343,10 +335,9 @@ class _InsuranceApprovalsDetailsState extends State { child: ListView.builder( shrinkWrap: true, physics: ScrollPhysics(), - itemCount: model - .insuranceApprovalInPatient[ + itemCount: model!.insuranceApprovalInPatient[ indexInsurance] - .apporvalDetails + .apporvalDetails! .length, itemBuilder: (BuildContext context, @@ -359,10 +350,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.procedureName ?? "", @@ -375,10 +365,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.status ?? "", @@ -391,10 +380,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.isInvoicedDesc ?? "", @@ -439,7 +427,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).insurance22, + TranslationBase.of(context!).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -449,7 +437,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).approvals22, + TranslationBase.of(context!).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -476,19 +464,16 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] .approvalStatusDescption != null - ? model - .insuranceApproval[ + ? model!.insuranceApproval[ indexInsurance] .approvalStatusDescption ?? "" : "", - color: model - .insuranceApproval[ + color: model!.insuranceApproval[ indexInsurance] .approvalStatusDescption != null @@ -503,9 +488,8 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApproval[indexInsurance] - .doctorName + model!.insuranceApproval[indexInsurance] + .doctorName! .toUpperCase(), color: Colors.black, fontSize: 18, @@ -533,10 +517,9 @@ class _InsuranceApprovalsDetailsState extends State { BorderRadius.circular( 50), child: Image.network( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] - .doctorImage, + .doctorImage!, fit: BoxFit.fill, width: 700, ), @@ -565,15 +548,14 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .clinic + + .clinic! + ": ", color: Colors.grey[500], fontSize: 14, ), Expanded( child: AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] .clinicName, fontSize: 14, @@ -586,14 +568,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .approvalNo + + .approvalNo! + ": ", color: Colors.grey[500], fontSize: 14, ), AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] .approvalNo .toString(), @@ -606,14 +587,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .unusedCount + + .unusedCount! + ": ", color: Colors.grey[500], fontSize: 14, ), AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] .unUsedCount .toString(), @@ -626,7 +606,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .companyName + + .companyName! + ": ", color: Colors.grey[500], ), @@ -638,13 +618,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .receiptOn + + .receiptOn! + ": ", color: Colors.grey[500], ), Expanded( child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -657,17 +637,16 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .expiryDate + + .expiryDate! + ": ", color: Colors.grey[500], ), - if (model - .insuranceApproval[ + if (model!.insuranceApproval[ indexInsurance] .expiryDate != null) AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model!.insuranceApproval[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -694,21 +673,21 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .usageStatus, fontWeight: FontWeight.w700, ), @@ -725,10 +704,9 @@ class _InsuranceApprovalsDetailsState extends State { child: ListView.builder( shrinkWrap: true, physics: ScrollPhysics(), - itemCount: model - .insuranceApproval[ + itemCount: model!.insuranceApproval[ indexInsurance] - .apporvalDetails + .apporvalDetails! .length, itemBuilder: (BuildContext context, @@ -741,10 +719,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.procedureName ?? "", @@ -757,10 +734,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.status ?? "", @@ -773,10 +749,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.isInvoicedDesc ?? "", diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 2f5f6e69..b9783a9b 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -39,7 +39,7 @@ class _LaboratoryResultPageState extends State { patientProfileAppBarModel: PatientProfileAppBarModel( patient:widget.patient,isInpatient:widget.isInpatient, isFromLabResult: true, - appointmentDate: widget.patientLabOrders.orderDate,), + appointmentDate: widget.patientLabOrders.orderDate!,), baseViewModel: model, body: AppScaffold( diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 06ca9256..1f78b242 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -59,10 +59,10 @@ class _AddVerifyMedicalReportState extends State { HtmlRichEditor( initialText: (medicalReport != null ? medicalReport.reportDataHtml - : model.medicalReportTemplate - .length > 0 ? model - .medicalReportTemplate[0] : ""), + : model!.medicalReportTemplate! + .length! > 0 ? model.medicalReportTemplate[0].templateTextHtml!: ""), hint: "Write the medical report ", + controller: _controller, height: MediaQuery .of(context) diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index 0d40f0a3..47ab7ac1 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -112,7 +112,7 @@ class MedicalReportPage extends StatelessWidget { hasBorder: false, bgColor: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) - : Colors.green[700], + : Colors.green[700]!, widget: Column( children: [ Row( diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart index 39148cf9..9808bb97 100644 --- a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart +++ b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart @@ -13,7 +13,8 @@ class PatientProfileCardModel { final bool isSelectInpatient; final bool isDartIcon; final IconData? dartIcon; - final Color color; + final Color? color; + PatientProfileCardModel(this.nameLine1, this.nameLine2, this.route, this.icon, {this.isInPatient = false, 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 228d87ae..a2ceb550 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -54,8 +54,8 @@ class _PatientProfileScreenState extends State with Single int index = 0; int _activeTab = 0; - StreamController videoCallDurationStreamController; - Stream videoCallDurationStream = (() async*{})(); + late StreamController videoCallDurationStreamController; + late Stream videoCallDurationStream; //= (() async*{})(); TODO Elham* @override void initState() { _tabController = TabController(length: 2, vsync: this); @@ -103,7 +103,7 @@ class _PatientProfileScreenState extends State with Single _activeTab = 1; } - StreamSubscription callTimer; + late StreamSubscription callTimer; callConnected(){ callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) ..onDone(() { @@ -117,7 +117,7 @@ class _PatientProfileScreenState extends State with Single callDisconnected(){ callTimer.cancel(); - videoCallDurationStreamController.sink.add(null); + videoCallDurationStreamController.sink.add(''); } @override @@ -299,7 +299,8 @@ class _PatientProfileScreenState extends State with Single onPressed: () async { // Navigator.push(context, MaterialPageRoute( // builder: (BuildContext context) => - // EndCallScreen(patient:patient)));if (isCallFinished) { + // EndCallScreen(patient:patient))) + if (isCallFinished) { Navigator.push( context, MaterialPageRoute( @@ -319,7 +320,7 @@ class _PatientProfileScreenState extends State with Single GifLoaderDialogUtils.hideDialog(context); AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); - }); + }, type: ''); } diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index db3d0bfd..79bb7614 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -33,7 +33,7 @@ class RadiologyDetailsPage extends StatelessWidget { builder: (_, model, widget) => AppScaffold( patientProfileAppBarModel: PatientProfileAppBarModel( patient: patient, - appointmentDate: finalRadiology.orderDate, + appointmentDate: finalRadiology.orderDate!, doctorName: finalRadiology.doctorName, clinic: finalRadiology.clinicDescription, branch: finalRadiology.projectName, diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 2069f446..76fabbbf 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -24,8 +24,8 @@ import 'ReplySummeryOnReferralPatient.dart'; class AddReplayOnReferralPatient extends StatefulWidget { final PatientReferralViewModel patientReferralViewModel; final MyReferralPatientModel myReferralInPatientModel; - final AddReferredRemarksRequestModel myReferralInPatientRequestModel; - final bool isEdited; + final AddReferredRemarksRequestModel? myReferralInPatientRequestModel; + final bool? isEdited; const AddReplayOnReferralPatient( {Key? key, required this.patientReferralViewModel, required this.myReferralInPatientModel, diff --git a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart index 2a48e079..cfd37cd0 100644 --- a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart @@ -37,7 +37,7 @@ class _ReplySummeryOnReferralPatientState builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).summeryReply, + appBarTitle: TranslationBase.of(context).summeryReply!, body: Container( child: Column( children: [ diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index 7d6bdb08..68194da5 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -428,7 +428,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), ), - if (referredPatient.referredDoctorRemarks.isNotEmpty) + if (referredPatient.referredDoctorRemarks!.isNotEmpty) Container( width: double.infinity, margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0), @@ -487,7 +487,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { widget: AddReplayOnReferralPatient( patientReferralViewModel: patientReferralViewModel, myReferralInPatientModel: referredPatient, - isEdited: referredPatient.referredDoctorRemarks.isNotEmpty, + isEdited: referredPatient.referredDoctorRemarks!.isNotEmpty, ), ), ); diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index c94de944..0848eee2 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -138,10 +138,10 @@ class _PatientTypeRadioWidgetState extends State { title: AppText(TranslationBase.of(context).inPatient), value: PatientType.IN_PATIENT, groupValue: patientType, - onChanged: (PatientType value) { + onChanged: (PatientType? value) { setState(() { - patientType = value; - radioOnChange(value); + patientType = value!; + radioOnChange(value!); }); }, ), @@ -151,9 +151,9 @@ class _PatientTypeRadioWidgetState extends State { title: AppText(TranslationBase.of(context).outpatient), value: PatientType.OUT_PATIENT, groupValue: patientType, - onChanged: (PatientType value) { + onChanged: (PatientType? value) { setState(() { - patientType = value; + patientType = value!; radioOnChange(value); }); }, diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 2d1d5c4d..bed9825f 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -34,13 +34,13 @@ class PrescriptionItemsPage extends StatelessWidget { baseViewModel: model, patientProfileAppBarModel: PatientProfileAppBarModel( patient: patient, - clinic: prescriptions.clinicDescription, - branch: prescriptions.name, + clinic: prescriptions.clinicDescription!, + branch: prescriptions.name!, isPrescriptions: true, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( prescriptions.appointmentDate!), - doctorName: prescriptions.doctorName, - profileUrl: prescriptions.doctorImageURL, + doctorName: prescriptions.doctorName!, + profileUrl: prescriptions.doctorImageURL!, isAppointmentHeader: true, ), body: SingleChildScrollView( diff --git a/lib/screens/procedures/ProcedureType.dart b/lib/screens/procedures/ProcedureType.dart index 28a72041..39b52a28 100644 --- a/lib/screens/procedures/ProcedureType.dart +++ b/lib/screens/procedures/ProcedureType.dart @@ -10,19 +10,19 @@ enum ProcedureType { extension procedureType on ProcedureType { String getFavouriteTabName(BuildContext context) { - return TranslationBase.of(context).favoriteTemplates; + return TranslationBase.of(context).favoriteTemplates!; } String getAllLabelName(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).allProcedures; + return TranslationBase.of(context).allProcedures!; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).allLab; + return TranslationBase.of(context).allLab!; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).allRadiology; + return TranslationBase.of(context).allRadiology!; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).allPrescription; + return TranslationBase.of(context).allPrescription!; default: return ""; } @@ -31,13 +31,13 @@ extension procedureType on ProcedureType { String getToolbarLabel(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).addProcedures; + return TranslationBase.of(context).addProcedures!; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addLabOrder; + return TranslationBase.of(context).addLabOrder!; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).addRadiologyOrder; + return TranslationBase.of(context).addRadiologyOrder!; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).addPrescription; + return TranslationBase.of(context).addPrescription!; default: return ""; } @@ -46,13 +46,13 @@ extension procedureType on ProcedureType { String getAddButtonTitle(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).addProcedures; + return TranslationBase.of(context).addProcedures!; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addLabOrder; + return TranslationBase.of(context).addLabOrder!; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).addRadiologyOrder; + return TranslationBase.of(context).addRadiologyOrder!; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).addPrescription; + return TranslationBase.of(context).addPrescription!; default: return ""; } @@ -61,7 +61,7 @@ extension procedureType on ProcedureType { String getCategoryId() { switch (this) { case ProcedureType.PROCEDURE: - return null; + return ''; case ProcedureType.LAB_RESULT: return "02"; case ProcedureType.RADIOLOGY: @@ -69,20 +69,20 @@ extension procedureType on ProcedureType { case ProcedureType.PRESCRIPTION: return "55"; default: - return null; + return ''; } } String getCategoryName() { switch (this) { case ProcedureType.PROCEDURE: - return null; + return ''; case ProcedureType.LAB_RESULT: return "Laboratory"; case ProcedureType.RADIOLOGY: return "Radiology"; default: - return null; + return ''; } } } diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 04194d80..6c9dfd8b 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -24,11 +24,11 @@ class AddFavouriteProcedure extends StatefulWidget { final ProcedureType procedureType; AddFavouriteProcedure({ - Key key, - this.model, - this.prescriptionModel, - this.patient, - @required this.procedureType, + Key? key, + required this.model, + required this.prescriptionModel, + required this.patient, + required this.procedureType, }); @override @@ -38,26 +38,26 @@ class AddFavouriteProcedure extends StatefulWidget { class _AddFavouriteProcedureState extends State { _AddFavouriteProcedureState({this.patient, this.model}); - ProcedureViewModel model; - PatiantInformtion patient; - List entityList = List(); - ProcedureTempleteDetailsModel groupProcedures; + ProcedureViewModel? model; + PatiantInformtion? patient; + List entityList = []; + late ProcedureTempleteDetailsModel groupProcedures; @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, baseViewModel: model, body: Column( children: [ Container( - height: MediaQuery.of(context).size.height * 0.070, + height: MediaQuery.of(context!).size.height * 0.070, ), - if (model.templateList.length != 0) + if (model!.templateList.length != 0) Expanded( child: EntityListCheckboxSearchFavProceduresWidget( isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), @@ -88,8 +88,8 @@ class _AddFavouriteProcedureState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: widget.procedureType.getAddButtonTitle(context) ?? - TranslationBase.of(context).addSelectedProcedures, + title: widget.procedureType.getAddButtonTitle(context!) ?? + TranslationBase.of(context!).addSelectedProcedures, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { @@ -114,7 +114,7 @@ class _AddFavouriteProcedureState extends State { } else { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context!) .fillTheMandatoryProcedureDetails, ); return; @@ -126,8 +126,8 @@ class _AddFavouriteProcedureState extends State { items: entityList, model: model, patient: widget.patient, - addButtonTitle: widget.procedureType.getAddButtonTitle(context), - toolbarTitle: widget.procedureType.getToolbarLabel(context), + addButtonTitle: widget.procedureType.getAddButtonTitle(context!), + toolbarTitle: widget.procedureType.getToolbarLabel(context!), ), ), ); diff --git a/lib/screens/procedures/add-procedure-page.dart b/lib/screens/procedures/add-procedure-page.dart index e0b7374f..9f953267 100644 --- a/lib/screens/procedures/add-procedure-page.dart +++ b/lib/screens/procedures/add-procedure-page.dart @@ -21,7 +21,7 @@ class AddProcedurePage extends StatefulWidget { final ProcedureType procedureType; const AddProcedurePage( - {Key key, this.model, this.patient, @required this.procedureType}) + {Key? key, required this.model, required this.patient, required this.procedureType}) : super(key: key); @override @@ -30,17 +30,17 @@ class AddProcedurePage extends StatefulWidget { } class _AddProcedurePageState extends State { - int selectedType; - ProcedureViewModel model; - PatiantInformtion patient; - ProcedureType procedureType; + int? selectedType; + ProcedureViewModel? model; + PatiantInformtion ?patient; + ProcedureType? procedureType; _AddProcedurePageState({this.patient, this.model, this.procedureType}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); + List entityList = []; + List entityListProcedure = []; TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; @@ -56,17 +56,17 @@ class _AddProcedurePageState extends State { return BaseView( onModelReady: (model) { model.getProcedureCategory( - categoryName: procedureType.getCategoryName(), - categoryID: procedureType.getCategoryId(), - patientId: patient.patientId); + categoryName: procedureType!.getCategoryName(), + categoryID: procedureType!.getCategoryId(), + patientId: patient!.patientId); }, - builder: (BuildContext context, ProcedureViewModel model, Widget child) => + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, body: Column( children: [ Container( - height: MediaQuery.of(context).size.height * 0.070, + height: MediaQuery.of(context!).size.height * 0.070, ), Expanded( child: NetworkBaseView( @@ -86,7 +86,7 @@ class _AddProcedurePageState extends State { MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .pleaseEnterProcedure, fontWeight: FontWeight.w700, fontSize: 20, @@ -95,15 +95,15 @@ class _AddProcedurePageState extends State { ), SizedBox( height: - MediaQuery.of(context).size.height * 0.02, + MediaQuery.of(context!).size.height * 0.02, ), Row( children: [ Container( - width: MediaQuery.of(context).size.width * + width: MediaQuery.of(context!).size.width * 0.79, child: AppTextFieldCustom( - hintText: TranslationBase.of(context) + hintText: TranslationBase.of(context!) .searchProcedureHere, isTextFieldHasSuffix: false, maxLines: 1, @@ -113,7 +113,7 @@ class _AddProcedurePageState extends State { ), ), SizedBox( - width: MediaQuery.of(context).size.width * + width: MediaQuery.of(context!).size.width * 0.02, ), Expanded( @@ -121,13 +121,13 @@ class _AddProcedurePageState extends State { onTap: () { if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) - model.getProcedureCategory( - patientId: patient.patientId, + model!.getProcedureCategory( + patientId: patient!.patientId, categoryName: procedureName.text); else DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context!) .atLeastThreeCharacters, ); }, @@ -144,13 +144,13 @@ class _AddProcedurePageState extends State { if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) && - model.categoriesList.length != 0) + model!.categoriesList.length != 0) NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchWidget( model: widget.model, masterList: - model.categoriesList[0].entityList, + model!.categoriesList[0].entityList!, removeHistory: (item) { setState(() { entityList.remove(item); @@ -181,24 +181,24 @@ class _AddProcedurePageState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: procedureType.getAddButtonTitle(context), + title: procedureType!.getAddButtonTitle(context!), fontWeight: FontWeight.w700, color: Color(0xff359846), onPressed: () async { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context!) .fillTheMandatoryProcedureDetails, ); return; } - await this.model.preparePostProcedure( + await this.model!.preparePostProcedure( orderType: selectedType.toString(), entityList: entityList, patient: patient, remarks: remarksController.text); - Navigator.pop(context); + Navigator.pop(context!); }, ), ], diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index bdf19051..202a261f 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -15,13 +15,13 @@ import 'add-favourite-procedure.dart'; import 'add-procedure-page.dart'; class BaseAddProcedureTabPage extends StatefulWidget { - final ProcedureViewModel model; - final PrescriptionViewModel prescriptionModel; - final PatiantInformtion patient; - final ProcedureType procedureType; + final ProcedureViewModel? model; + final PrescriptionViewModel? prescriptionModel; + final PatiantInformtion? patient; + final ProcedureType? procedureType; const BaseAddProcedureTabPage( - {Key key, + {Key? key, this.model, this.prescriptionModel, this.patient, @@ -30,7 +30,7 @@ class BaseAddProcedureTabPage extends StatefulWidget { @override _BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState( - patient: patient, model: model, procedureType: procedureType); + patient: patient!, model: model!, procedureType: procedureType!); } class _BaseAddProcedureTabPageState extends State @@ -39,9 +39,9 @@ class _BaseAddProcedureTabPageState extends State final PatiantInformtion patient; final ProcedureType procedureType; - _BaseAddProcedureTabPageState({this.patient, this.model, this.procedureType}); + _BaseAddProcedureTabPageState({required this.patient, required this.model, required this.procedureType}); - TabController _tabController; + late TabController _tabController; int _activeTab = 0; @override @@ -68,7 +68,7 @@ class _BaseAddProcedureTabPageState extends State final screenSize = MediaQuery.of(context).size; return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, body: NetworkBaseView( @@ -154,17 +154,17 @@ class _BaseAddProcedureTabPageState extends State AddFavouriteProcedure( model: this.model, prescriptionModel: - widget.prescriptionModel, + widget.prescriptionModel!, patient: patient, procedureType: procedureType, ), if (widget.procedureType == ProcedureType.PRESCRIPTION) PrescriptionFormWidget( - widget.prescriptionModel, - widget.patient, - widget.prescriptionModel - .prescriptionList) + widget.prescriptionModel!, + widget.patient!, + widget!.prescriptionModel! + .prescriptionList!) else AddProcedurePage( model: this.model, diff --git a/lib/util/NotificationPermissionUtils.dart b/lib/util/NotificationPermissionUtils.dart index 8950fae3..550fedc5 100644 --- a/lib/util/NotificationPermissionUtils.dart +++ b/lib/util/NotificationPermissionUtils.dart @@ -7,7 +7,7 @@ import 'package:permission_handler/permission_handler.dart'; class AppPermissionsUtils { - static requestVideoCallPermission({BuildContext context, String type,Function onTapGrant}) async { + static requestVideoCallPermission({required BuildContext context, required String type,required Function onTapGrant}) async { var cameraPermission = Permission.camera; var microphonePermission = Permission.microphone; diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index dc60efaf..d06e39c0 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -19,9 +19,9 @@ class VideoChannel { String? tokenID, String? generalId, int? doctorId, - String patientName, Function()? onCallEnd, + required String patientName, Function()? onCallEnd, Function(SessionStatusModel sessionStatusModel)? onCallNotRespond, - Function(String error)? onFailure, VoidCallback onCallConnected, VoidCallback onCallDisconnected}) async { + Function(String error)? onFailure, VoidCallback? onCallConnected, VoidCallback? onCallDisconnected}) async { onCallConnected = onCallConnected ?? (){}; onCallDisconnected = onCallDisconnected ?? (){}; @@ -29,10 +29,10 @@ class VideoChannel { try { _channel.setMethodCallHandler((call) { if(call.method == 'onCallConnected'){ - onCallConnected(); + onCallConnected!(); } if(call.method == 'onCallDisconnected'){ - onCallDisconnected(); + onCallDisconnected!(); } return true as dynamic; }); diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 9b00ba2b..55700a75 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -396,7 +396,7 @@ class AppDateUtils { static convertDateFormatImproved(String str) { - String newDate; + String newDate =''; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -413,6 +413,6 @@ class AppDateUtils { date.day.toString().padLeft(2, '0'); } - return newDate??''; + return newDate; } } diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 2376e191..a0e2acda 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -271,10 +271,10 @@ class Helpers { } - static String timeFrom({Duration duration}) { + static String timeFrom({Duration? duration}) { String twoDigits(int n) => n.toString().padLeft(2, "0"); - String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60)); - String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); + String twoDigitMinutes = twoDigits(duration!.inMinutes.remainder(60)); + String twoDigitSeconds = twoDigits(duration!.inSeconds.remainder(60)); return "$twoDigitMinutes:$twoDigitSeconds"; } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 270b4ad3..69f5eafe 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -847,8 +847,8 @@ class TranslationBase { String? get selectProcedures => localizedValues['selectProcedures']![locale.languageCode]; String? get addSelectedProcedures => localizedValues['addSelectedProcedures']![locale.languageCode]; - String get addProcedures => - localizedValues['addProcedures'][locale.languageCode]; + String? get addProcedures => + localizedValues['addProcedures']![locale.languageCode]; String? get updateProcedure => localizedValues['updateProcedure']![locale.languageCode]; @@ -1081,14 +1081,14 @@ class TranslationBase { String? get impressionRecommendation => localizedValues['impressionRecommendation']![locale.languageCode]; String? get onHold => localizedValues['onHold']![locale.languageCode]; String? get verified => localizedValues['verified']![locale.languageCode]; - String get favoriteTemplates => localizedValues['favoriteTemplates'][locale.languageCode]; - String get allProcedures => localizedValues['allProcedures'][locale.languageCode]; - String get allRadiology => localizedValues['allRadiology'][locale.languageCode]; - String get allLab => localizedValues['allLab'][locale.languageCode]; - String get allPrescription => localizedValues['allPrescription'][locale.languageCode]; - String get addPrescription => localizedValues['addPrescription'][locale.languageCode]; - String get edit => localizedValues['edit'][locale.languageCode]; - String get summeryReply => localizedValues['summeryReply'][locale.languageCode]; + String? get favoriteTemplates => localizedValues['favoriteTemplates']![locale.languageCode]; + String? get allProcedures => localizedValues['allProcedures']![locale.languageCode]; + String? get allRadiology => localizedValues['allRadiology']![locale.languageCode]; + String? get allLab => localizedValues['allLab']![locale.languageCode]; + String? get allPrescription => localizedValues['allPrescription']![locale.languageCode]; + String? get addPrescription => localizedValues['addPrescription']![locale.languageCode]; + String? get edit => localizedValues['edit']![locale.languageCode]; + String? get summeryReply => localizedValues['summeryReply']![locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index dcadb8be..ce401b2f 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; class RowCounts extends StatelessWidget { final name; final int count; - final double height; + final double? height; final Color c; RowCounts(this.name, this.count, this.c, {this.height}); @override diff --git a/lib/widgets/dialog/AskPermissionDialog.dart b/lib/widgets/dialog/AskPermissionDialog.dart index 58718373..f7a23925 100644 --- a/lib/widgets/dialog/AskPermissionDialog.dart +++ b/lib/widgets/dialog/AskPermissionDialog.dart @@ -10,7 +10,7 @@ class AskPermissionDialog extends StatefulWidget { final String type; final Function onTapGrant; - AskPermissionDialog({this.type, this.onTapGrant}); + AskPermissionDialog({required this.type, required this.onTapGrant}); @override _AskPermissionDialogState createState() => _AskPermissionDialogState(); diff --git a/lib/widgets/patients/patient_card/ShowTimer.dart b/lib/widgets/patients/patient_card/ShowTimer.dart index b769588b..022571fa 100644 --- a/lib/widgets/patients/patient_card/ShowTimer.dart +++ b/lib/widgets/patients/patient_card/ShowTimer.dart @@ -9,7 +9,7 @@ class ShowTimer extends StatefulWidget { const ShowTimer({ - Key key, this.patientInfo, + Key? key, required this.patientInfo, }) : super(key: key); @override @@ -50,7 +50,7 @@ class _ShowTimerState extends State { generateShowTimerString() { DateTime now = DateTime.now(); - DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime); + DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime!); String timer = AppDateUtils.differenceBetweenDateAndCurrent( liveCareDate, context, isShowSecond: true, isShowDays: false); diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 31d281ae..6191fd4d 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -27,8 +27,8 @@ class PatientProfileButton extends StatelessWidget { final bool isSelectInpatient; final bool isDartIcon; final IconData? dartIcon; - final bool isFromLiveCare; - final Color color; + final bool? isFromLiveCare; + final Color? color; PatientProfileButton({ Key? key, diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index c39caef1..8b7a4c05 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -16,20 +16,20 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final PatientProfileAppBarModel patientProfileAppBarModel; final bool isFromLabResult; - final VoidCallback onPressed; + final VoidCallback? onPressed; PatientProfileAppBar( - {this.patientProfileAppBarModel, this.isFromLabResult=false, this.onPressed}); + {required this.patientProfileAppBarModel, this.isFromLabResult=false, this.onPressed}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); int gender = 1; - if (patientProfileAppBarModel.patient.patientDetails != null) { - gender = patientProfileAppBarModel.patient.patientDetails.gender; + if (patientProfileAppBarModel.patient!.patientDetails != null) { + gender = patientProfileAppBarModel.patient!.patientDetails!.gender!; } else { - gender = patientProfileAppBarModel.patient.gender; + gender = patientProfileAppBarModel.patient!.gender!; } return Container( @@ -54,22 +54,22 @@ class PatientProfileAppBar extends StatelessWidget color: Color(0xFF2B353E), //Colors.black, onPressed: () { if(onPressed!=null) - onPressed(); + onPressed!(); Navigator.pop(context); }, ), Expanded( child: AppText( - patientProfileAppBarModel.patient.firstName != null + patientProfileAppBarModel.patient!.firstName != null ? (Helpers.capitalize( - patientProfileAppBarModel.patient.firstName) + + patientProfileAppBarModel.patient!.firstName) + " " + Helpers.capitalize( - patientProfileAppBarModel.patient.lastName)) + patientProfileAppBarModel.patient!.lastName)) : Helpers.capitalize( - patientProfileAppBarModel.patient.fullName ?? + patientProfileAppBarModel.patient!.fullName ?? patientProfileAppBarModel - .patient.patientDetails.fullName), + .patient!.patientDetails!.fullName!), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -90,7 +90,7 @@ class PatientProfileAppBar extends StatelessWidget child: InkWell( onTap: () { launch("tel://" + - patientProfileAppBarModel.patient.mobileNumber); + patientProfileAppBarModel.patient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -121,13 +121,13 @@ class PatientProfileAppBar extends StatelessWidget child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - patientProfileAppBarModel.patient.patientStatusType != null + patientProfileAppBarModel.patient!.patientStatusType != null ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ patientProfileAppBarModel - .patient.patientStatusType == + .patient!.patientStatusType == 43 ? AppText( TranslationBase.of(context).arrivedP, @@ -143,14 +143,14 @@ class PatientProfileAppBar extends StatelessWidget fontFamily: 'Poppins', fontSize: 12, ), - patientProfileAppBarModel.patient.startTime != + patientProfileAppBarModel.patient!.startTime != null ? AppText( patientProfileAppBarModel - .patient.startTime != + .patient!.startTime != null ? patientProfileAppBarModel - .patient.startTime + .patient!.startTime : '', fontWeight: FontWeight.w700, fontSize: 12, @@ -180,7 +180,7 @@ class PatientProfileAppBar extends StatelessWidget ), new TextSpan( text: patientProfileAppBarModel - .patient.patientId + .patient!.patientId .toString(), style: TextStyle( fontWeight: FontWeight.w700, @@ -194,28 +194,28 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText( - patientProfileAppBarModel.patient.nationalityName ?? + patientProfileAppBarModel.patient!.nationalityName ?? patientProfileAppBarModel - .patient.nationality ?? + .patient!.nationality ?? patientProfileAppBarModel - .patient.nationalityId ?? + .patient!.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: 12, ), patientProfileAppBarModel - .patient.nationalityFlagURL != + .patient!.nationalityFlagURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( patientProfileAppBarModel - .patient.nationalityFlagURL, + .patient!.nationalityFlagURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -234,7 +234,7 @@ class PatientProfileAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age + " : ", + text: TranslationBase.of(context).age! + " : ", style: TextStyle( fontSize: 10, fontWeight: FontWeight.w600, @@ -242,7 +242,7 @@ class PatientProfileAppBar extends StatelessWidget )), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient.patientDetails != null ? patientProfileAppBarModel.patient.patientDetails.dateofBirth ?? "" : patientProfileAppBarModel.patient.dateofBirth ?? "", context, isServerFormat: !patientProfileAppBarModel.isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient!.patientDetails != null ? patientProfileAppBarModel.patient!.patientDetails!.dateofBirth ?? "" : patientProfileAppBarModel.patient!.dateofBirth ?? "", context, isServerFormat: !patientProfileAppBarModel.isFromLiveCare!)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 12, @@ -253,15 +253,15 @@ class PatientProfileAppBar extends StatelessWidget ), ), - if (patientProfileAppBarModel.patient.appointmentDate != + if (patientProfileAppBarModel.patient!.appointmentDate != null && patientProfileAppBarModel - .patient.appointmentDate.isNotEmpty && !isFromLabResult) + .patient!.appointmentDate!.isNotEmpty && !isFromLabResult) Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + " : ", + TranslationBase.of(context).appointmentDate! + " : ", fontSize: 10, color: Color(0xFF575757), fontWeight: FontWeight.w600, @@ -274,7 +274,7 @@ class PatientProfileAppBar extends StatelessWidget AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.convertStringToDate( patientProfileAppBarModel - .patient.appointmentDate)), + .patient!.appointmentDate!)), fontWeight: FontWeight.w700, fontSize: 12, color: Color(0xFF2E303A), @@ -284,7 +284,7 @@ class PatientProfileAppBar extends StatelessWidget ) ], ), - if (patientProfileAppBarModel.isFromLabResult) + if (patientProfileAppBarModel.isFromLabResult!) Container( child: RichText( text: new TextSpan( @@ -304,7 +304,7 @@ class PatientProfileAppBar extends StatelessWidget )), new TextSpan( text: - '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}', style: TextStyle( fontWeight: FontWeight.w700, fontSize: 12)), @@ -316,10 +316,10 @@ class PatientProfileAppBar extends StatelessWidget Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (patientProfileAppBarModel.patient.admissionDate != + if (patientProfileAppBarModel.patient!.admissionDate != null && patientProfileAppBarModel - .patient.admissionDate.isNotEmpty) + .patient!.admissionDate!.isNotEmpty) Container( child: RichText( text: new TextSpan( @@ -332,26 +332,26 @@ class PatientProfileAppBar extends StatelessWidget children: [ new TextSpan( text: patientProfileAppBarModel - .patient.admissionDate == + .patient!.admissionDate == null ? "" : TranslationBase.of(context) - .admissionDate + + .admissionDate! + " : ", style: TextStyle(fontSize: 10)), new TextSpan( text: patientProfileAppBarModel - .patient.admissionDate == + .patient!.admissionDate == null ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate.toString())))}", + : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 12, color: Color(0xFF2E303A), )), ]))), - if (patientProfileAppBarModel.patient.admissionDate != + if (patientProfileAppBarModel.patient!.admissionDate != null) Row( children: [ @@ -360,20 +360,20 @@ class PatientProfileAppBar extends StatelessWidget fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), - if (patientProfileAppBarModel - .isDischargedPatient && + if (patientProfileAppBarModel! + .isDischargedPatient! && patientProfileAppBarModel - .patient.dischargeDate != + .patient!.dischargeDate != null) AppText( - "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate)).inDays + 1}", + "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}", fontWeight: FontWeight.w700, fontSize: 12, color: Color(0xFF2E303A), ) else AppText( - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}", fontWeight: FontWeight.w700, fontSize: 12, color: Color(0xFF2E303A), @@ -386,7 +386,7 @@ class PatientProfileAppBar extends StatelessWidget ), ), ]), - if (patientProfileAppBarModel.isAppointmentHeader) + if (patientProfileAppBarModel.isAppointmentHeader!) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -401,8 +401,8 @@ class PatientProfileAppBar extends StatelessWidget shape: BoxShape.rectangle, border: Border( bottom: - BorderSide(color: Colors.grey[400], width: 2.5), - left: BorderSide(color: Colors.grey[400], width: 2.5), + BorderSide(color: Colors.grey[400]!, width: 2.5), + left: BorderSide(color: Colors.grey[400]!, width: 2.5), )), ), Expanded( @@ -436,7 +436,7 @@ class PatientProfileAppBar extends StatelessWidget if (patientProfileAppBarModel.orderNo != null && !patientProfileAppBarModel - .isPrescriptions) + .isPrescriptions!) Row( children: [ AppText( @@ -454,8 +454,8 @@ class PatientProfileAppBar extends StatelessWidget ), if (patientProfileAppBarModel.invoiceNO != null && - !patientProfileAppBarModel - .isPrescriptions) + !patientProfileAppBarModel! + .isPrescriptions!) Row( children: [ AppText( @@ -506,7 +506,7 @@ class PatientProfileAppBar extends StatelessWidget ], ), if (patientProfileAppBarModel - .isMedicalFile && + .isMedicalFile! && patientProfileAppBarModel.episode != null) Row( @@ -525,7 +525,7 @@ class PatientProfileAppBar extends StatelessWidget ], ), if (patientProfileAppBarModel - .isMedicalFile && + .isMedicalFile! && patientProfileAppBarModel.visitDate != null) Row( @@ -544,12 +544,12 @@ class PatientProfileAppBar extends StatelessWidget ], ), if (!patientProfileAppBarModel - .isMedicalFile) + .isMedicalFile!) Row( children: [ AppText( !patientProfileAppBarModel - .isPrescriptions + .isPrescriptions! ? 'Result Date:' : 'Prescriptions Date ', fontSize: 10, @@ -557,7 +557,7 @@ class PatientProfileAppBar extends StatelessWidget color: Color(0xFF575757), ), AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}', fontSize: 12, ) ], @@ -581,14 +581,14 @@ class PatientProfileAppBar extends StatelessWidget Size get preferredSize => Size( double.maxFinite, patientProfileAppBarModel.height == 0 - ? patientProfileAppBarModel.isAppointmentHeader + ? patientProfileAppBarModel.isAppointmentHeader! ? 270 - : ((patientProfileAppBarModel.patient.appointmentDate != null &&patientProfileAppBarModel.patient.appointmentDate.isNotEmpty ) - ? patientProfileAppBarModel.isFromLabResult?170:150 - : patientProfileAppBarModel.patient.admissionDate != null - ? patientProfileAppBarModel.isFromLabResult?170:150 - : patientProfileAppBarModel.isDischargedPatient - ? 240 - : 130) - : patientProfileAppBarModel.height); + : ((patientProfileAppBarModel.patient!.appointmentDate! != null &&patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty ) + ? patientProfileAppBarModel.isFromLabResult!?170:150 + : patientProfileAppBarModel.patient!.admissionDate != null + ? patientProfileAppBarModel.isFromLabResult!?170:150 + : patientProfileAppBarModel.isDischargedPatient! + ? 240! + : 130!) + : patientProfileAppBarModel.height!); } diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 251d2e65..d5ddd66c 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -20,10 +20,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred final bool isDischargedPatient; final bool isFromLiveCare; - final Stream videoCallDurationStream; + final Stream videoCallDurationStream; PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType, - {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, this.videoCallDurationStream}); + {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, required this.videoCallDurationStream}); @override Widget build(BuildContext context) { @@ -101,7 +101,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred child: Container( decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)), padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), - child: Text(snapshot.data, style: TextStyle(color: Colors.white),), + child: Text(snapshot.data!, style: TextStyle(color: Colors.white),), ), ); else diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index fa09aa72..a8c59032 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -21,12 +21,12 @@ class AppScaffold extends StatelessWidget { final Widget? bottomSheet; final Color? backgroundColor; final PreferredSizeWidget? appBar; - final Widget drawer; - final Widget bottomNavigationBar; + final Widget? drawer; + final Widget? bottomNavigationBar; final String? subtitle; final bool isHomeIcon; final bool extendBody; - final PatientProfileAppBarModel patientProfileAppBarModel; + final PatientProfileAppBarModel? patientProfileAppBarModel; AppScaffold( {this.appBarTitle = '', @@ -57,7 +57,7 @@ class AppScaffold extends StatelessWidget { bottomNavigationBar: bottomNavigationBar, appBar: isShowAppBar ? patientProfileAppBarModel != null ? PatientProfileAppBar( - patientProfileAppBarModel: patientProfileAppBarModel,) : appBar ?? + patientProfileAppBarModel: patientProfileAppBarModel!,) : appBar ?? AppBar( elevation: 0, backgroundColor: Colors.white, diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 6c46ea36..108b987c 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -18,7 +18,7 @@ class AppText extends StatefulWidget { final double? marginRight; final double? marginBottom; final double? marginLeft; - final double letterSpacing; + final double? letterSpacing; final TextAlign? textAlign; final bool? bold; final bool? regular; diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index 4b80ae0a..a4dafc9e 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -22,7 +22,7 @@ class AppButton extends StatefulWidget { final double? radius; final double? vPadding; final double? hPadding; - final double height; + final double? height; AppButton({ @required this.onPressed, diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 4a38bfac..5da3f232 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -11,7 +11,7 @@ class DrawerItem extends StatefulWidget { final IconData? icon; final Color? color; final String? assetLink; - final double drawerWidth; + final double? drawerWidth; DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink, this.drawerWidth}); From a1ef72295472532e63372f37cb370fb538c774d3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 20 Jun 2021 17:07:04 +0300 Subject: [PATCH 17/18] fix yaml --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index e1040a32..80b6502a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -91,7 +91,7 @@ dependencies: speech_to_text: path: speech_to_text - quiver: ^2.1.5 + quiver: ^3.0.0 # Html Editor Enhanced html_editor_enhanced: ^2.1.1 From 95c7161987efc26f46cafa91c693923bbf6b002a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 21 Jun 2021 10:30:24 +0300 Subject: [PATCH 18/18] fix flutter 2 issue --- .../live_care/live_care_patient_screen.dart | 4 +- pubspec.lock | 376 +++++++++++------- pubspec.yaml | 1 + 3 files changed, 240 insertions(+), 141 deletions(-) diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index f92ced53..aee028cf 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -39,8 +39,8 @@ class _LiveCarePatientScreenState extends State { @override void dispose() { _liveCareViewModel.isLogin(0); - _liveCareViewModel = null!; - timer?.cancel(); + // _liveCareViewModel = null!; + timer.cancel(); super.dispose(); } diff --git a/pubspec.lock b/pubspec.lock index e4fdc2dc..f6841219 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.6.1" autocomplete_textfield: dependency: "direct main" description: @@ -56,14 +56,14 @@ packages: name: bazel_worker url: "https://pub.dartlang.org" source: hosted - version: "0.1.25" + version: "1.0.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" build: dependency: transitive description: @@ -119,49 +119,49 @@ packages: name: build_web_compilers url: "https://pub.dartlang.org" source: hosted - version: "2.12.2" + version: "2.16.3" built_collection: dependency: transitive description: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "4.3.2" + version: "5.1.0" built_value: dependency: transitive description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "7.1.0" + version: "8.1.0" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" charts_common: dependency: transitive description: name: charts_common url: "https://pub.dartlang.org" source: hosted - version: "0.9.0" + version: "0.10.0" charts_flutter: dependency: "direct main" description: name: charts_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.9.0" + version: "0.10.0" checked_yaml: dependency: transitive description: @@ -175,14 +175,14 @@ packages: name: chewie url: "https://pub.dartlang.org" source: hosted - version: "0.9.10" + version: "1.2.2" chewie_audio: dependency: transitive description: name: chewie_audio url: "https://pub.dartlang.org" source: hosted - version: "1.0.0+1" + version: "1.2.0" cli_util: dependency: transitive description: @@ -196,7 +196,7 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" code_builder: dependency: transitive description: @@ -210,35 +210,35 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" connectivity: dependency: "direct main" description: name: connectivity url: "https://pub.dartlang.org" source: hosted - version: "0.4.9+5" + version: "3.0.6" connectivity_for_web: dependency: transitive description: name: connectivity_for_web url: "https://pub.dartlang.org" source: hosted - version: "0.3.1+4" + version: "0.4.0" connectivity_macos: dependency: transitive description: name: connectivity_macos url: "https://pub.dartlang.org" source: hosted - version: "0.1.0+7" + version: "0.2.0" connectivity_platform_interface: dependency: transitive description: name: connectivity_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.6" + version: "2.0.1" convert: dependency: transitive description: @@ -253,27 +253,20 @@ packages: 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" + version: "0.17.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "1.0.3" dart_style: dependency: transitive description: @@ -287,124 +280,152 @@ packages: name: date_time_picker url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "2.0.0" device_info: dependency: "direct main" description: name: device_info url: "https://pub.dartlang.org" source: hosted - version: "0.4.2+10" + version: "2.0.2" device_info_platform_interface: dependency: transitive description: name: device_info_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.1" dropdown_search: dependency: "direct main" description: name: dropdown_search url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.6.3" equatable: dependency: transitive description: name: equatable url: "https://pub.dartlang.org" source: hosted - version: "1.2.6" + version: "2.0.3" eva_icons_flutter: dependency: "direct main" description: name: eva_icons_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "3.0.0" expandable: dependency: "direct main" description: name: expandable url: "https://pub.dartlang.org" source: hosted - version: "4.1.4" + version: "5.0.1" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" ffi: dependency: transitive description: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "1.1.2" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "5.2.1" + version: "6.1.2" + file_picker: + dependency: "direct main" + description: + name: file_picker + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2+2" firebase_core: dependency: transitive description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "0.5.3" + version: "1.3.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "4.0.1" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "0.2.1+1" + version: "1.1.0" firebase_messaging: dependency: "direct main" description: name: firebase_messaging url: "https://pub.dartlang.org" source: hosted - version: "7.0.3" + version: "10.0.2" + firebase_messaging_platform_interface: + dependency: transitive + description: + name: firebase_messaging_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" + firebase_messaging_web: + dependency: transitive + description: + name: firebase_messaging_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" fixnum: dependency: transitive description: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "0.10.11" + version: "1.0.0" fl_chart: dependency: "direct main" description: name: fl_chart url: "https://pub.dartlang.org" source: hosted - version: "0.12.3" + version: "0.36.2" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_colorpicker: + dependency: "direct main" + description: + name: flutter_colorpicker + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" flutter_device_type: dependency: "direct main" description: name: flutter_device_type url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.4.0" flutter_flexible_toast: dependency: "direct main" description: @@ -425,19 +446,54 @@ packages: name: flutter_html url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "2.1.0" flutter_inappwebview: dependency: transitive description: name: flutter_inappwebview url: "https://pub.dartlang.org" source: hosted - version: "4.0.0+4" + version: "5.3.2" + flutter_keyboard_visibility: + dependency: transitive + description: + name: flutter_keyboard_visibility + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.2" + flutter_keyboard_visibility_platform_interface: + dependency: transitive + description: + name: flutter_keyboard_visibility_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_web: + dependency: transitive + description: + name: flutter_keyboard_visibility_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_layout_grid: + dependency: transitive + description: + name: flutter_layout_grid + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" flutter_localizations: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_math_fork: + dependency: transitive + description: + name: flutter_math_fork + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.3+1" flutter_page_indicator: dependency: transitive description: @@ -451,21 +507,21 @@ packages: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "1.0.11" + version: "2.0.2" flutter_staggered_grid_view: dependency: "direct main" description: name: flutter_staggered_grid_view url: "https://pub.dartlang.org" source: hosted - version: "0.3.4" + version: "0.4.0" flutter_svg: dependency: transitive description: name: flutter_svg url: "https://pub.dartlang.org" source: hosted - version: "0.18.1" + version: "0.22.0" flutter_swiper: dependency: "direct main" description: @@ -489,14 +545,14 @@ packages: name: font_awesome_flutter url: "https://pub.dartlang.org" source: hosted - version: "8.12.0" + version: "9.1.0" get_it: dependency: "direct main" description: name: get_it url: "https://pub.dartlang.org" source: hosted - version: "4.0.4" + version: "7.1.3" glob: dependency: transitive description: @@ -517,35 +573,35 @@ packages: name: hexcolor url: "https://pub.dartlang.org" source: hosted - version: "1.0.6" + version: "2.0.4" html: dependency: "direct main" description: name: html url: "https://pub.dartlang.org" source: hosted - version: "0.14.0+4" + version: "0.15.0" html_editor_enhanced: dependency: "direct main" description: name: html_editor_enhanced url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "2.2.0+1-dev.1" http: dependency: "direct main" description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.12.2" + version: "0.13.3" http_interceptor: dependency: "direct main" description: name: http_interceptor url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.4.1" http_multi_server: dependency: transitive description: @@ -559,7 +615,7 @@ packages: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "3.1.4" + version: "4.0.0" imei_plugin: dependency: "direct main" description: @@ -567,13 +623,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + infinite_listview: + dependency: transitive + description: + name: infinite_listview + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" intl: dependency: "direct main" description: name: intl url: "https://pub.dartlang.org" source: hosted - version: "0.16.1" + version: "0.17.0" io: dependency: transitive description: @@ -587,21 +650,21 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "3.1.1" + version: "4.0.1" local_auth: dependency: "direct main" description: name: local_auth url: "https://pub.dartlang.org" source: hosted - version: "0.6.3+4" + version: "1.1.6" logging: dependency: transitive description: @@ -615,21 +678,21 @@ packages: name: maps_launcher url: "https://pub.dartlang.org" source: hosted - version: "1.2.2+2" + version: "2.0.0" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" mime: dependency: transitive description: @@ -643,7 +706,7 @@ packages: name: nested url: "https://pub.dartlang.org" source: hosted - version: "0.0.4" + version: "1.0.0" node_interop: dependency: transitive description: @@ -657,14 +720,21 @@ packages: name: node_io url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" - open_iconic_flutter: + version: "1.1.1" + numberpicker: dependency: transitive description: - name: open_iconic_flutter + name: numberpicker url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "2.1.1" + numerus: + dependency: transitive + description: + name: numerus + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" package_config: dependency: transitive description: @@ -678,91 +748,98 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" path_drawing: dependency: transitive description: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.4.1+1" + version: "0.5.1" path_parsing: dependency: transitive description: name: path_parsing url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.2.1" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+2" + version: "2.0.0" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.4+3" + version: "2.0.1" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.11.1" percent_indicator: dependency: "direct main" description: name: percent_indicator url: "https://pub.dartlang.org" source: hosted - version: "2.1.9+1" + version: "3.0.1" permission_handler: dependency: "direct main" description: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "5.1.0+2" + version: "8.1.1" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.6.0" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "4.1.0" platform: dependency: transitive description: name: platform url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "3.0.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "2.0.0" + pointer_interceptor: + dependency: transitive + description: + name: pointer_interceptor + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0+1" pool: dependency: transitive description: @@ -776,28 +853,21 @@ packages: 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" + version: "4.2.1" protobuf: dependency: transitive description: name: protobuf url: "https://pub.dartlang.org" source: hosted - version: "1.1.3" + version: "2.0.0" provider: dependency: "direct main" description: name: provider url: "https://pub.dartlang.org" source: hosted - version: "4.3.3" + version: "5.0.0" pub_semver: dependency: transitive description: @@ -818,7 +888,7 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "3.0.1" scratch_space: dependency: transitive description: @@ -826,62 +896,55 @@ packages: 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" + version: "2.0.6" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.2+4" + version: "2.0.0" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+11" + version: "2.0.0" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.2+7" + version: "2.0.0" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.2+3" + version: "2.0.0" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "0.7.9" + version: "1.1.4" shelf_web_socket: dependency: transitive description: @@ -907,7 +970,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.1" speech_to_text: dependency: "direct main" description: @@ -921,21 +984,21 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" sticky_headers: dependency: "direct main" description: name: sticky_headers url: "https://pub.dartlang.org" source: hosted - version: "0.1.8+1" + version: "0.2.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" stream_transform: dependency: transitive description: @@ -949,21 +1012,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.3.0" timing: dependency: transitive description: @@ -978,97 +1041,132 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.6" + tuple: + dependency: transitive + description: + name: tuple + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" url_launcher: dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "5.7.10" + version: "6.0.6" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+4" + version: "2.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+9" + version: "2.0.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.9" + version: "2.0.3" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.5+3" + version: "2.0.1" 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" + version: "2.0.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" video_player: dependency: transitive description: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "0.10.12+5" + version: "2.1.6" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "4.1.0" video_player_web: dependency: transitive description: name: video_player_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.4+1" + version: "2.0.1" + visibility_detector: + dependency: transitive + description: + name: visibility_detector + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" wakelock: dependency: transitive description: name: wakelock url: "https://pub.dartlang.org" source: hosted - version: "0.1.4+2" + version: "0.5.2" + wakelock_macos: + dependency: transitive + description: + name: wakelock_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0+1" + wakelock_platform_interface: + dependency: transitive + description: + name: wakelock_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1+1" + wakelock_web: + dependency: transitive + description: + name: wakelock_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0+1" + wakelock_windows: + dependency: transitive + description: + name: wakelock_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" watcher: dependency: transitive description: @@ -1089,28 +1187,28 @@ packages: name: webview_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.3.24" + version: "2.0.8" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "1.7.4+1" + version: "2.2.2" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.1.2" + version: "0.2.0" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted - version: "4.5.1" + version: "5.1.2" yaml: dependency: transitive description: @@ -1119,5 +1217,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" - flutter: ">=1.22.0 <2.0.0" + dart: ">=2.13.0 <3.0.0" + flutter: ">=2.2.0" diff --git a/pubspec.yaml b/pubspec.yaml index 80b6502a..e582ef08 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -92,6 +92,7 @@ dependencies: path: speech_to_text quiver: ^3.0.0 + flutter_colorpicker: ^0.5.0 # Html Editor Enhanced html_editor_enhanced: ^2.1.1