From 1b7014498fe801c1e4e113d32f05d6f0620accd6 Mon Sep 17 00:00:00 2001 From: Rahul Dev Garg <34365102+rahuldevgarg@users.noreply.github.com> Date: Sun, 26 Nov 2023 17:54:45 +0530 Subject: [PATCH] Flutter version upgrade (#657) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Flutter version upgrade Flutter 3.16.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision db7ef5bf9f (10 days ago) • 2023-11-15 11:25:44 -0800 Engine • revision 74d16627b9 Tools • Dart 3.2.0 • DevTools 2.28.2 * fixes for supporting latest version * privacy policy placeholder * privacy policy placeholder * dartfix latest * build gradle upgrade * ios fixes * config changes * updated Deperacated cirrusci to cirruslabs * PFM-5044 * PFM-4878 --- frontend/mgramseva/.metadata | 39 +- frontend/mgramseva/README.md | 1 + .../android/app/src/main/AndroidManifest.xml | 10 +- frontend/mgramseva/android/build.gradle | 8 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- frontend/mgramseva/docker/Dockerfile | 2 +- .../integration_test/add_expense.dart | 2 - .../integration_test/dashboard_test.dart | 6 +- .../forgot_password_test.dart | 4 - .../integration_test/log_out_test.dart | 1 - .../integration_test/login_test.dart | 5 - .../integration_test/update_expense.dart | 1 - frontend/mgramseva/ios/Podfile | 2 +- frontend/mgramseva/ios/Podfile.lock | 297 +++++ .../ios/Runner.xcodeproj/project.pbxproj | 7 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- frontend/mgramseva/ios/Runner/Info.plist | 2 + .../lib/components/dashboard/bills_table.dart | 2 - .../components/dashboard/dashboard_card.dart | 2 +- .../consumer_bill_payment.dart | 44 +- .../generate_new_bill.dart | 4 +- .../new_consumer_bill.dart | 25 +- frontend/mgramseva/lib/env/app_config.dart | 20 + frontend/mgramseva/lib/main.dart | 32 +- .../mgramseva/lib/model/common/demand.dart | 1 - .../lib/model/dashboard/revenue_chart.dart | 2 +- .../expenses_details/expenses_details.dart | 3 - .../lib/model/expenses_details/vendor.dart | 2 - .../mgramseva/lib/model/file/file_store.dart | 1 - .../lib/model/localization/language.dart | 2 +- .../localization/localization_label.dart | 1 - .../lib/model/mdms/payment_type.dart | 2 +- .../mgramseva/lib/model/mdms/tax_period.dart | 5 + .../mgramseva/lib/model/success_handler.dart | 1 - .../providers/authentication_provider.dart | 38 +- .../bill_generation_details_provider.dart | 210 ++- .../change_password_details_provider.dart | 14 +- .../providers/collect_payment_provider.dart | 11 +- .../lib/providers/common_provider.dart | 8 +- .../providers/consumer_details_provider.dart | 111 +- .../lib/providers/dashboard_provider.dart | 60 +- .../providers/expenses_details_provider.dart | 21 +- .../lib/providers/fetch_bill_provider.dart | 18 +- .../providers/forgot_password_provider.dart | 8 +- .../providers/household_details_provider.dart | 3 +- .../household_register_provider.dart | 89 +- .../notification_screen_provider.dart | 2 +- .../lib/providers/notifications_provider.dart | 2 +- .../lib/providers/reports_provider.dart | 105 +- .../providers/revenue_dashboard_provider.dart | 2 +- .../providers/search_connection_provider.dart | 48 +- .../lib/providers/tenants_provider.dart | 8 +- .../providers/user_edit_profile_provider.dart | 26 +- .../lib/providers/user_profile_provider.dart | 8 +- .../mgramseva/lib/repository/core_repo.dart | 21 +- frontend/mgramseva/lib/routing.dart | 2 +- .../expense_walk_through.dart | 1 + .../screeens/add_expense/expense_details.dart | 89 +- .../change_password/change_password.dart | 2 +- .../lib/screeens/common/payment_failure.dart | 2 +- .../connection_details_card.dart | 2 - .../connection_results.dart | 3 +- .../connection_results/search_connection.dart | 4 +- .../consumer_details/consumer_details.dart | 15 +- .../walk_through.dart | 3 + .../walkthrough_1.dart | 3 + .../lib/screeens/dashboard/IndividualTab.dart | 4 +- .../screeens/dashboard/individual_tab.dart | 4 +- .../custom_tooltip_label_render.dart | 11 +- .../revenue_expense_dashboard/revenue.dart | 4 +- .../revenue_charts.dart | 2 +- .../lib/screeens/expense/expense_results.dart | 2 +- .../lib/screeens/expense/search_expense.dart | 6 +- .../lib/screeens/feedback/feed_back.dart | 2 +- .../screeens/generate_bill/generate_bill.dart | 15 +- .../gpwsc_boundary_detail_card.dart | 1 - .../gpwsc_details/gpwsc_rate_card.dart | 5 +- .../mgramseva/lib/screeens/home/home.dart | 2 +- .../home_walk_through_container.dart | 15 +- .../household_detail/household_detail.dart | 2 +- .../household_register/household_list.dart | 2 +- .../mgramseva/lib/screeens/login/login.dart | 1 + .../notifications/notification_screen.dart | 2 +- .../password_success/password_success.dart | 2 - .../privacy_and_terms/PrivacyAndTerms.dart | 5 +- .../lib/screeens/profile/edit_profile.dart | 2 +- .../lib/screeens/reports/bill_report.dart | 2 - .../screeens/reports/collection_report.dart | 2 - .../reports/generic_report_table.dart | 3 - .../reports/inactive_consumer_report.dart | 2 - .../lib/screeens/reports/reports.dart | 9 +- .../lib/screeens/reports/view_table.dart | 2 - .../reset_password/reset_password.dart | 14 +- .../language_selection_desktop_view.dart | 2 - frontend/mgramseva/lib/theme.dart | 26 +- .../mgramseva/lib/utils/common_printer.dart | 103 -- .../mgramseva/lib/utils/common_widgets.dart | 2 +- .../mgramseva/lib/utils/date_formats.dart | 16 +- .../excel_download/save_file_mobile.dart | 8 +- .../utils/excel_download/save_file_web.dart | 4 +- frontend/mgramseva/lib/utils/loaders.dart | 2 +- .../application_localizations.dart | 2 - frontend/mgramseva/lib/utils/notifiers.dart | 3 + .../mgramseva/lib/utils/print_bluetooth.dart | 109 -- .../lib/utils/printer/image_utils.dart | 47 + .../lib/utils/validators/validators.dart | 1 - .../lib/widgets/bluetooth_printer.dart | 432 +++++++ .../lib/widgets/bottom_button_bar.dart | 3 +- frontend/mgramseva/lib/widgets/button.dart | 5 +- .../mgramseva/lib/widgets/button_group.dart | 20 +- .../mgramseva/lib/widgets/custom_app_bar.dart | 15 +- .../mgramseva/lib/widgets/file_picker.dart | 4 +- .../mgramseva/lib/widgets/label_text.dart | 2 +- .../mgramseva/lib/widgets/pagination.dart | 2 +- .../widgets/radio_button_field_builder.dart | 3 +- .../widgets/search_select_field_builder.dart | 37 +- .../lib/widgets/select_field_builder.dart | 71 +- .../mgramseva/lib/widgets/short_button.dart | 5 +- .../mgramseva/lib/widgets/success_page.dart | 12 +- .../mgramseva/lib/widgets/toast/toster.dart | 2 +- frontend/mgramseva/pubspec.lock | 1130 +++++++++++------ frontend/mgramseva/pubspec.yaml | 47 +- frontend/mgramseva/web/index.html | 138 +- 123 files changed, 2434 insertions(+), 1423 deletions(-) create mode 100644 frontend/mgramseva/ios/Podfile.lock delete mode 100644 frontend/mgramseva/lib/utils/common_printer.dart delete mode 100644 frontend/mgramseva/lib/utils/print_bluetooth.dart create mode 100644 frontend/mgramseva/lib/utils/printer/image_utils.dart create mode 100644 frontend/mgramseva/lib/widgets/bluetooth_printer.dart diff --git a/frontend/mgramseva/.metadata b/frontend/mgramseva/.metadata index 56bfc2c4d..d22992edb 100644 --- a/frontend/mgramseva/.metadata +++ b/frontend/mgramseva/.metadata @@ -4,7 +4,42 @@ # This file should be version controlled and should not be manually edited. version: - revision: f4abaa0735eba4dfd8f33f73363911d63931fe03 - channel: stable + revision: "db7ef5bf9f59442b0e200a90587e8fa5e0c6336a" + channel: "stable" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: android + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: ios + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: linux + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: macos + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: web + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: windows + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/frontend/mgramseva/README.md b/frontend/mgramseva/README.md index 02c1210a3..968155668 100644 --- a/frontend/mgramseva/README.md +++ b/frontend/mgramseva/README.md @@ -8,6 +8,7 @@ mGramSeva is a Hybrid Application (web + App(Android + IOS)) built using Open So ## Commands for flutter - **flutter run** : Command to run the app +- **flutter run --no-enable-impeller** : Command to run the app on mac virtual machine without GPU Passthrough - **flutter build web** : Command to build web - **flutter build apk --release** : Command to build the apk of the application diff --git a/frontend/mgramseva/android/app/src/main/AndroidManifest.xml b/frontend/mgramseva/android/app/src/main/AndroidManifest.xml index 5e9b650e1..b97fd4e28 100644 --- a/frontend/mgramseva/android/app/src/main/AndroidManifest.xml +++ b/frontend/mgramseva/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,11 @@ - - + + + + + @@ -14,7 +17,8 @@ 10.18.0) + - Firebase/CoreOnly (10.18.0): + - FirebaseCore (= 10.18.0) + - firebase_analytics (10.7.1): + - Firebase/Analytics (= 10.18.0) + - firebase_core + - Flutter + - firebase_core (2.23.0): + - Firebase/CoreOnly (= 10.18.0) + - Flutter + - FirebaseAnalytics (10.18.0): + - FirebaseAnalytics/AdIdSupport (= 10.18.0) + - FirebaseCore (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - FirebaseAnalytics/AdIdSupport (10.18.0): + - FirebaseCore (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleAppMeasurement (= 10.18.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - FirebaseCore (10.18.0): + - FirebaseCoreInternal (~> 10.0) + - GoogleUtilities/Environment (~> 7.12) + - GoogleUtilities/Logger (~> 7.12) + - FirebaseCoreInternal (10.18.0): + - "GoogleUtilities/NSData+zlib (~> 7.8)" + - FirebaseInstallations (10.18.0): + - FirebaseCore (~> 10.0) + - GoogleUtilities/Environment (~> 7.8) + - GoogleUtilities/UserDefaults (~> 7.8) + - PromisesObjC (~> 2.1) + - Flutter (1.0.0) + - flutter_downloader (0.0.1): + - Flutter + - flutter_keyboard_visibility (0.0.1): + - Flutter + - flutter_secure_storage (3.3.1): + - Flutter + - flutter_share_me (0.0.1): + - FBSDKCoreKit (~> 14.0.0) + - FBSDKLoginKit (~> 14.0.0) + - FBSDKShareKit (~> 14.0.0) + - Flutter + - GoogleAppMeasurement (10.18.0): + - GoogleAppMeasurement/AdIdSupport (= 10.18.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - GoogleAppMeasurement/AdIdSupport (10.18.0): + - GoogleAppMeasurement/WithoutAdIdSupport (= 10.18.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - GoogleAppMeasurement/WithoutAdIdSupport (10.18.0): + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - GoogleUtilities/AppDelegateSwizzler (7.12.0): + - GoogleUtilities/Environment + - GoogleUtilities/Logger + - GoogleUtilities/Network + - GoogleUtilities/Environment (7.12.0): + - PromisesObjC (< 3.0, >= 1.2) + - GoogleUtilities/Logger (7.12.0): + - GoogleUtilities/Environment + - GoogleUtilities/MethodSwizzler (7.12.0): + - GoogleUtilities/Logger + - GoogleUtilities/Network (7.12.0): + - GoogleUtilities/Logger + - "GoogleUtilities/NSData+zlib" + - GoogleUtilities/Reachability + - "GoogleUtilities/NSData+zlib (7.12.0)" + - GoogleUtilities/Reachability (7.12.0): + - GoogleUtilities/Logger + - GoogleUtilities/UserDefaults (7.12.0): + - GoogleUtilities/Logger + - image_picker_ios (0.0.1): + - Flutter + - integration_test (0.0.1): + - Flutter + - nanopb (2.30909.1): + - nanopb/decode (= 2.30909.1) + - nanopb/encode (= 2.30909.1) + - nanopb/decode (2.30909.1) + - nanopb/encode (2.30909.1) + - open_filex (0.0.2): + - Flutter + - package_info_plus (0.4.5): + - Flutter + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - "permission_handler (5.1.0+2)": + - Flutter + - print_bluetooth_thermal (0.0.1): + - Flutter + - printing (1.0.0): + - Flutter + - PromisesObjC (2.3.1) + - SDWebImage (5.18.5): + - SDWebImage/Core (= 5.18.5) + - SDWebImage/Core (5.18.5) + - SwiftyGif (5.4.4) + - url_launcher_ios (0.0.1): + - Flutter + +DEPENDENCIES: + - bluetooth_thermal_printer (from `.symlinks/plugins/bluetooth_thermal_printer/ios`) + - charset_converter (from `.symlinks/plugins/charset_converter/ios`) + - file_picker (from `.symlinks/plugins/file_picker/ios`) + - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) + - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - Flutter (from `Flutter`) + - flutter_downloader (from `.symlinks/plugins/flutter_downloader/ios`) + - flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`) + - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) + - flutter_share_me (from `.symlinks/plugins/flutter_share_me/ios`) + - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) + - integration_test (from `.symlinks/plugins/integration_test/ios`) + - open_filex (from `.symlinks/plugins/open_filex/ios`) + - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) + - permission_handler (from `.symlinks/plugins/permission_handler/ios`) + - print_bluetooth_thermal (from `.symlinks/plugins/print_bluetooth_thermal/ios`) + - printing (from `.symlinks/plugins/printing/ios`) + - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) + +SPEC REPOS: + trunk: + - DKImagePickerController + - DKPhotoGallery + - FBAEMKit + - FBSDKCoreKit + - FBSDKCoreKit_Basics + - FBSDKLoginKit + - FBSDKShareKit + - Firebase + - FirebaseAnalytics + - FirebaseCore + - FirebaseCoreInternal + - FirebaseInstallations + - GoogleAppMeasurement + - GoogleUtilities + - nanopb + - PromisesObjC + - SDWebImage + - SwiftyGif + +EXTERNAL SOURCES: + bluetooth_thermal_printer: + :path: ".symlinks/plugins/bluetooth_thermal_printer/ios" + charset_converter: + :path: ".symlinks/plugins/charset_converter/ios" + file_picker: + :path: ".symlinks/plugins/file_picker/ios" + firebase_analytics: + :path: ".symlinks/plugins/firebase_analytics/ios" + firebase_core: + :path: ".symlinks/plugins/firebase_core/ios" + Flutter: + :path: Flutter + flutter_downloader: + :path: ".symlinks/plugins/flutter_downloader/ios" + flutter_keyboard_visibility: + :path: ".symlinks/plugins/flutter_keyboard_visibility/ios" + flutter_secure_storage: + :path: ".symlinks/plugins/flutter_secure_storage/ios" + flutter_share_me: + :path: ".symlinks/plugins/flutter_share_me/ios" + image_picker_ios: + :path: ".symlinks/plugins/image_picker_ios/ios" + integration_test: + :path: ".symlinks/plugins/integration_test/ios" + open_filex: + :path: ".symlinks/plugins/open_filex/ios" + package_info_plus: + :path: ".symlinks/plugins/package_info_plus/ios" + path_provider_foundation: + :path: ".symlinks/plugins/path_provider_foundation/darwin" + permission_handler: + :path: ".symlinks/plugins/permission_handler/ios" + print_bluetooth_thermal: + :path: ".symlinks/plugins/print_bluetooth_thermal/ios" + printing: + :path: ".symlinks/plugins/printing/ios" + url_launcher_ios: + :path: ".symlinks/plugins/url_launcher_ios/ios" + +SPEC CHECKSUMS: + bluetooth_thermal_printer: 65b8304b3a1d8c67d466642a28cc2b4984409346 + charset_converter: 215c7b04932ec2b9ba43be96a9bc34afed3e5322 + DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac + DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 + FBAEMKit: d00064597439e75885c70d9adbcb5f3e9ad84f5d + FBSDKCoreKit: e5d3acfffe5063a9d0b967ba2ad1f5afc460cf43 + FBSDKCoreKit_Basics: 1ff46a12e80f0b66e6c00e1ef32d6a5b5b9008a5 + FBSDKLoginKit: dbe86ef42ab142f3bd0f1c904a21bb33f31c5569 + FBSDKShareKit: 2f6a6a1445cc1b8ea0f733e60d02d2f7c4ebf8be + file_picker: ce3938a0df3cc1ef404671531facef740d03f920 + Firebase: 414ad272f8d02dfbf12662a9d43f4bba9bec2a06 + firebase_analytics: 3e5dba777bb51d1e0358b5a37adefa69746a94bd + firebase_core: 29d66baf806970cda37c93621b27cd369b27db1b + FirebaseAnalytics: 4d310b35c48eaa4a058ddc04bdca6bdb5dc0fe80 + FirebaseCore: 2322423314d92f946219c8791674d2f3345b598f + FirebaseCoreInternal: 8eb002e564b533bdcf1ba011f33f2b5c10e2ed4a + FirebaseInstallations: e842042ec6ac1fd2e37d7706363ebe7f662afea4 + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + flutter_downloader: b7301ae057deadd4b1650dc7c05375f10ff12c39 + flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069 + flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec + flutter_share_me: 1fb559741e0dff56a9d2bdeaf4d966b0b47449ae + GoogleAppMeasurement: 70ce9aa438cff1cfb31ea3e660bcc67734cb716e + GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34 + image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5 + integration_test: 13825b8a9334a850581300559b8839134b124670 + nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5 + open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4 + package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85 + path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 + permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 + print_bluetooth_thermal: 54a9ba9436479dd633d18f393669ee793ee498fa + printing: 233e1b73bd1f4a05615548e9b5a324c98588640b + PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 + SDWebImage: 7ac2b7ddc5e8484c79aa90fc4e30b149d6a2c88f + SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f + url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b + +PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 + +COCOAPODS: 1.14.3 diff --git a/frontend/mgramseva/ios/Runner.xcodeproj/project.pbxproj b/frontend/mgramseva/ios/Runner.xcodeproj/project.pbxproj index a85457607..00c7b1d2f 100644 --- a/frontend/mgramseva/ios/Runner.xcodeproj/project.pbxproj +++ b/frontend/mgramseva/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -162,7 +162,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -207,10 +207,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -260,6 +262,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); diff --git a/frontend/mgramseva/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/frontend/mgramseva/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a33..a6b826db2 100644 --- a/frontend/mgramseva/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/frontend/mgramseva/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ CADisableMinimumFrameDurationOnPhone + UIApplicationSupportsIndirectInputEvents + diff --git a/frontend/mgramseva/lib/components/dashboard/bills_table.dart b/frontend/mgramseva/lib/components/dashboard/bills_table.dart index 8a75c9cf5..7eb43c4c2 100644 --- a/frontend/mgramseva/lib/components/dashboard/bills_table.dart +++ b/frontend/mgramseva/lib/components/dashboard/bills_table.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; import 'package:horizontal_data_table/horizontal_data_table.dart'; import 'package:mgramseva/utils/localization/application_localizations.dart'; import 'package:mgramseva/utils/models.dart'; @@ -83,7 +82,6 @@ class _BillsTable extends State { var index = 0; return widget.headerList.map((e) { index++; - ; if (e.isSortingRequired ?? false) { return TextButton( style: TextButton.styleFrom( diff --git a/frontend/mgramseva/lib/components/dashboard/dashboard_card.dart b/frontend/mgramseva/lib/components/dashboard/dashboard_card.dart index cd6ed3c8d..c73746779 100644 --- a/frontend/mgramseva/lib/components/dashboard/dashboard_card.dart +++ b/frontend/mgramseva/lib/components/dashboard/dashboard_card.dart @@ -38,7 +38,7 @@ class DashboardCard extends StatelessWidget { dashBoardProvider.selectedMonth, context), style: Theme.of(context) .textTheme - .subtitle1 + .titleMedium ?.apply( color: Theme.of(context).primaryColor), ), diff --git a/frontend/mgramseva/lib/components/house_connection_and_bill/consumer_bill_payment.dart b/frontend/mgramseva/lib/components/house_connection_and_bill/consumer_bill_payment.dart index dfd56f969..a6b235d27 100644 --- a/frontend/mgramseva/lib/components/house_connection_and_bill/consumer_bill_payment.dart +++ b/frontend/mgramseva/lib/components/house_connection_and_bill/consumer_bill_payment.dart @@ -1,6 +1,5 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:image/image.dart' as img; import 'package:mgramseva/model/bill/bill_payments.dart'; import 'package:mgramseva/model/connection/water_connection.dart'; import 'package:mgramseva/providers/bill_payments_provider.dart'; @@ -12,7 +11,7 @@ import 'package:mgramseva/utils/common_styles.dart'; import 'package:mgramseva/utils/date_formats.dart'; import 'package:mgramseva/utils/global_variables.dart'; import 'package:mgramseva/utils/loaders.dart'; -import 'package:mgramseva/utils/print_bluetooth.dart'; +import 'package:mgramseva/widgets/bluetooth_printer.dart'; import 'package:mgramseva/widgets/list_label_text.dart'; import 'package:number_to_words/number_to_words.dart'; import 'package:provider/provider.dart'; @@ -117,10 +116,10 @@ class ConsumerBillPaymentsState extends State { navigatorKey.currentContext!) .translate(i18.consumerReciepts .GRAM_PANCHAYAT_WATER_SUPPLY_AND_SANITATION), - textScaleFactor: kIsWeb ? 3 : 1, + textScaler: TextScaler.linear(kIsWeb ? 3 : 1), maxLines: 3, style: TextStyle( - color: Colors.blue, + color: Colors.black, fontSize: 10, height: 1, fontWeight: FontWeight.bold, @@ -140,9 +139,9 @@ class ConsumerBillPaymentsState extends State { ApplicationLocalizations.of( navigatorKey.currentContext!) .translate(i18.consumerReciepts.WATER_RECEIPT), - textScaleFactor: kIsWeb ? 3 : 1, + textScaler: TextScaler.linear(kIsWeb ? 3 : 1), style: TextStyle( - color: Colors.blue, + color: Colors.black, fontSize: 10, height: 1, fontWeight: FontWeight.bold, @@ -232,7 +231,7 @@ class ConsumerBillPaymentsState extends State { height: 8, ), Text('- - *** - -', - textScaleFactor: kIsWeb ? 3 : 1, + textScaler: TextScaler.linear(kIsWeb ? 3 : 1), textAlign: TextAlign.start, style: TextStyle( color: Colors.red, @@ -240,7 +239,7 @@ class ConsumerBillPaymentsState extends State { fontWeight: FontWeight.bold)), Text( "${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.common.RECEIPT_FOOTER)}", - textScaleFactor: kIsWeb ? 3 : 1, + textScaler: TextScaler.linear(kIsWeb ? 3 : 1), textAlign: TextAlign.start, style: TextStyle( color: Colors.red, @@ -253,9 +252,12 @@ class ConsumerBillPaymentsState extends State { kIsWeb ? js.onButtonClick( value, stateProvider.stateInfo!.stateLogoURL.toString()) - : PrintBluetooth.printTicket( - img.decodeImage(value), navigatorKey.currentContext!) + :showDialog( + context: context, + builder: (_) => BluetoothPrinterScreen(imageData: value) + ) }); + return null; } afterViewBuild() { @@ -364,18 +366,9 @@ class ConsumerBillPaymentsState extends State { "tenantId": commonProvider .userDetails!.selectedtenant!.code, }, item.mobileNumber, item, "Share"), - style: ButtonStyle( - alignment: Alignment.center, - padding: MaterialStateProperty.all( - EdgeInsets.symmetric(vertical: 8)), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - side: BorderSide( - width: 2, - color: Theme.of(context).primaryColor), - borderRadius: BorderRadius.circular(0.0), - )), - ), + style: ElevatedButton.styleFrom(padding:EdgeInsets.symmetric(vertical: 8),alignment: Alignment.center,side:BorderSide( + width: 1, + color: Theme.of(context).disabledColor)), icon: (Image.asset('assets/png/whats_app.png')), label: Padding( padding: const EdgeInsets.symmetric(vertical: 5), @@ -383,7 +376,7 @@ class ConsumerBillPaymentsState extends State { ApplicationLocalizations.of(context).translate(i18 .consumerReciepts .CONSUMER_RECIEPT_SHARE_RECEIPT), - style: Theme.of(context).textTheme.subtitle2, + style: Theme.of(context).textTheme.titleSmall, ), ), ), @@ -395,14 +388,15 @@ class ConsumerBillPaymentsState extends State { : MediaQuery.of(context).size.width / 2.2, child: ElevatedButton.icon( onPressed: () => _capturePng(item), - icon: Icon(Icons.print), + icon: Icon(Icons.print,color: Colors.white,), + style: ElevatedButton.styleFrom(backgroundColor: Color.fromRGBO(244, 119, 56, 1)), label: Text( ApplicationLocalizations.of(context).translate( i18.consumerReciepts .CONSUMER_RECEIPT_PRINT), style: Theme.of(context) .textTheme - .subtitle1! + .titleMedium! .apply(color: Colors.white))), ), ]), diff --git a/frontend/mgramseva/lib/components/house_connection_and_bill/generate_new_bill.dart b/frontend/mgramseva/lib/components/house_connection_and_bill/generate_new_bill.dart index fcae9b2a7..c34d417b1 100644 --- a/frontend/mgramseva/lib/components/house_connection_and_bill/generate_new_bill.dart +++ b/frontend/mgramseva/lib/components/house_connection_and_bill/generate_new_bill.dart @@ -53,7 +53,7 @@ class _GenerateNewBillState extends State { if (demandList.demands!.isNotEmpty) { int? num = demandList.demands?.first.auditDetails?.createdTime; var houseHoldProvider = - Provider.of(context, listen: false);; + Provider.of(context, listen: false); return LayoutBuilder(builder: (context, constraints) { return Column( children: [ @@ -222,7 +222,7 @@ class _GenerateNewBillState extends State { .GENERATE_BILL_LABEL), style: Theme.of(context) .textTheme - .subtitle2)), + .titleSmall)), )), Expanded( child: ShortButton( diff --git a/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart b/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart index 45c43ef42..e78dcd00d 100644 --- a/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart +++ b/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart @@ -347,28 +347,9 @@ class NewConsumerBillState extends State { billList.bill!.first, "Share", ), - style: ButtonStyle( - alignment: - Alignment.center, - padding: - MaterialStateProperty - .all(EdgeInsets - .symmetric( - vertical: - 0)), - shape: MaterialStateProperty - .all( - RoundedRectangleBorder( - side: BorderSide( - width: 2, - color: Theme.of( - context) - .primaryColor), - borderRadius: - BorderRadius - .circular(0.0), - )), - ), + style: ElevatedButton.styleFrom(padding:EdgeInsets.symmetric(vertical: 8),alignment: Alignment.center,side:BorderSide( + width: 1, + color: Theme.of(context).disabledColor)), icon: (Image.asset( 'assets/png/whats_app.png')), label: Padding( diff --git a/frontend/mgramseva/lib/env/app_config.dart b/frontend/mgramseva/lib/env/app_config.dart index f10823029..a5dc5ba55 100644 --- a/frontend/mgramseva/lib/env/app_config.dart +++ b/frontend/mgramseva/lib/env/app_config.dart @@ -1,3 +1,4 @@ +import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/foundation.dart'; import 'package:universal_html/html.dart'; @@ -38,3 +39,22 @@ Map stageConstants = { Map prodConstants = { _baseUrl: "https://api.production.com/", }; + +class FirebaseConfigurations { + static const _apiKey = "AIzaSyBWQkRGvXiKu_fLAA5O8SvQzZTWeQTqMZ8"; + static const _authDomain = "mgramseva-qa.egov.org.in"; + static const _projectId = "sample-mgramseva"; + static const _storageBucket = "sample-mgramseva.appspot.com"; + static const _messagingSenderId ="1026518772539"; + static const _appId = "1:1026518772539:android:bfa7ff7ef250f28789251e"; + +//Make some getter functions + String get apiKey => _apiKey; + String get authDomain => _authDomain; + String get projectId => _projectId; + String get storageBucket => _storageBucket; + String get messagingSenderId => _messagingSenderId; + String get appId => _appId; + + static FirebaseOptions get firebaseOptions => FirebaseOptions(apiKey: _apiKey, appId: _appId, messagingSenderId: _messagingSenderId, projectId: _projectId, storageBucket: _storageBucket, authDomain: _authDomain); +} diff --git a/frontend/mgramseva/lib/main.dart b/frontend/mgramseva/lib/main.dart index 0effec991..169653719 100644 --- a/frontend/mgramseva/lib/main.dart +++ b/frontend/mgramseva/lib/main.dart @@ -3,8 +3,8 @@ import 'dart:io'; import 'dart:isolate'; import 'dart:ui'; +import 'package:dart_ping_ios/dart_ping_ios.dart'; import 'package:firebase_analytics/firebase_analytics.dart'; -import 'package:firebase_analytics/observer.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -46,7 +46,7 @@ import 'package:mgramseva/utils/error_logging.dart'; import 'package:mgramseva/utils/global_variables.dart'; import 'package:mgramseva/utils/loaders.dart'; import 'package:mgramseva/utils/notifiers.dart'; -import 'package:open_file/open_file.dart'; +import 'package:open_filex/open_filex.dart'; import 'package:provider/provider.dart'; import 'package:url_strategy/url_strategy.dart'; @@ -59,6 +59,10 @@ void main() { setPathUrlStrategy(); //configureApp(); setEnvironment(Environment.dev); + // Register DartPingIOS + if (Platform.isIOS) { + DartPingIOS.register(); + } runZonedGuarded(() async { FlutterError.onError = (FlutterErrorDetails details) { @@ -68,10 +72,14 @@ void main() { }; WidgetsFlutterBinding.ensureInitialized(); - - if (Firebase.apps.length == 0) { + if(kIsWeb){ + await Firebase.initializeApp(options: FirebaseConfigurations.firebaseOptions); + }else{ await Firebase.initializeApp(); } + if (Firebase.apps.length == 0) { + + } if (!kIsWeb) { await FlutterDownloader.initialize( @@ -104,7 +112,7 @@ class MyApp extends StatefulWidget { class _MyAppState extends State { late Locale _locale = Locale('en', 'IN'); - static FirebaseAnalytics analytics = FirebaseAnalytics(); + static FirebaseAnalytics analytics = FirebaseAnalytics.instance; static FirebaseAnalyticsObserver observer = FirebaseAnalyticsObserver(analytics: analytics); ReceivePort _port = ReceivePort(); @@ -126,13 +134,13 @@ class _MyAppState extends State { IsolateNameServer.removePortNameMapping('downloader_send_port'); super.dispose(); } - + @pragma('vm:entry-point') static void downloadCallback( - String id, DownloadTaskStatus status, int progress) { + String id, int status, int progress) { final SendPort send = IsolateNameServer.lookupPortByName('downloader_send_port')!; - send.send([id, status, progress]); + send.send([id, DownloadTaskStatus.values.elementAt(status), progress]); } afterViewBuild() async { @@ -143,10 +151,10 @@ class _MyAppState extends State { String id = data[0]; DownloadTaskStatus status = data[1]; int progress = data[2]; + print("Download progress: "+progress.toString()); if (status == DownloadTaskStatus.complete) { if (CommonProvider.downloadUrl.containsKey(id)) { - if (Platform.isIOS && CommonProvider.downloadUrl[id] != null) - OpenFile.open(CommonProvider.downloadUrl[id] ?? ''); + if (CommonProvider.downloadUrl[id] != null) OpenFilex.open(CommonProvider.downloadUrl[id] ?? ''); CommonProvider.downloadUrl.remove(id); } else if (status == DownloadTaskStatus.failed || status == DownloadTaskStatus.canceled || @@ -155,7 +163,9 @@ class _MyAppState extends State { CommonProvider.downloadUrl.remove(id); } } - setState(() {}); + setState(() { + print("Download progress: "+progress.toString()); + }); }); FlutterDownloader.registerCallback(downloadCallback); } diff --git a/frontend/mgramseva/lib/model/common/demand.dart b/frontend/mgramseva/lib/model/common/demand.dart index 37212510a..23dec86b7 100644 --- a/frontend/mgramseva/lib/model/common/demand.dart +++ b/frontend/mgramseva/lib/model/common/demand.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; part 'demand.g.dart'; diff --git a/frontend/mgramseva/lib/model/dashboard/revenue_chart.dart b/frontend/mgramseva/lib/model/dashboard/revenue_chart.dart index 4fc0454bb..d00297d77 100644 --- a/frontend/mgramseva/lib/model/dashboard/revenue_chart.dart +++ b/frontend/mgramseva/lib/model/dashboard/revenue_chart.dart @@ -1,5 +1,5 @@ import 'package:json_annotation/json_annotation.dart'; -import 'package:charts_flutter/flutter.dart' as charts; +import 'package:community_charts_flutter/community_charts_flutter.dart' as charts; import '../../screeens/dashboard/revenue_expense_dashboard/revenue.dart'; diff --git a/frontend/mgramseva/lib/model/expenses_details/expenses_details.dart b/frontend/mgramseva/lib/model/expenses_details/expenses_details.dart index 68c6ae4d1..018f62fa8 100644 --- a/frontend/mgramseva/lib/model/expenses_details/expenses_details.dart +++ b/frontend/mgramseva/lib/model/expenses_details/expenses_details.dart @@ -2,11 +2,8 @@ import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; import 'package:mgramseva/model/expenses_details/vendor.dart'; import 'package:mgramseva/model/file/file_store.dart'; -import 'package:mgramseva/providers/expenses_details_provider.dart'; import 'package:mgramseva/utils/date_formats.dart'; -import 'package:provider/provider.dart'; -import '../../utils/global_variables.dart'; part 'expenses_details.g.dart'; diff --git a/frontend/mgramseva/lib/model/expenses_details/vendor.dart b/frontend/mgramseva/lib/model/expenses_details/vendor.dart index 62eef28bb..0fd90569c 100644 --- a/frontend/mgramseva/lib/model/expenses_details/vendor.dart +++ b/frontend/mgramseva/lib/model/expenses_details/vendor.dart @@ -1,6 +1,4 @@ import 'package:json_annotation/json_annotation.dart'; -import 'package:flutter/material.dart'; -import 'package:mgramseva/utils/date_formats.dart'; part 'vendor.g.dart'; diff --git a/frontend/mgramseva/lib/model/file/file_store.dart b/frontend/mgramseva/lib/model/file/file_store.dart index 96cfecf44..3bc2eb663 100644 --- a/frontend/mgramseva/lib/model/file/file_store.dart +++ b/frontend/mgramseva/lib/model/file/file_store.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; part 'file_store.g.dart'; diff --git a/frontend/mgramseva/lib/model/localization/language.dart b/frontend/mgramseva/lib/model/localization/language.dart index a91299a3a..6884e5804 100644 --- a/frontend/mgramseva/lib/model/localization/language.dart +++ b/frontend/mgramseva/lib/model/localization/language.dart @@ -9,7 +9,7 @@ import 'package:mgramseva/model/mdms/tax_period.dart'; import '../../repository/water_services_calculation.dart'; class LanguageList { - dynamic? responseInfo; + dynamic responseInfo; MdmsRes? mdmsRes; LanguageList({this.responseInfo, this.mdmsRes}); diff --git a/frontend/mgramseva/lib/model/localization/localization_label.dart b/frontend/mgramseva/lib/model/localization/localization_label.dart index 7627eed0b..248aba7d0 100644 --- a/frontend/mgramseva/lib/model/localization/localization_label.dart +++ b/frontend/mgramseva/lib/model/localization/localization_label.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; part 'localization_label.g.dart'; diff --git a/frontend/mgramseva/lib/model/mdms/payment_type.dart b/frontend/mgramseva/lib/model/mdms/payment_type.dart index d45117918..79a4243e7 100644 --- a/frontend/mgramseva/lib/model/mdms/payment_type.dart +++ b/frontend/mgramseva/lib/model/mdms/payment_type.dart @@ -3,7 +3,7 @@ import '../localization/language.dart'; class PaymentType { - dynamic? responseInfo; + dynamic responseInfo; MdmsRes? mdmsRes; PaymentType({this.responseInfo, this.mdmsRes}); diff --git a/frontend/mgramseva/lib/model/mdms/tax_period.dart b/frontend/mgramseva/lib/model/mdms/tax_period.dart index 8e308d8cc..26b3bdfc2 100644 --- a/frontend/mgramseva/lib/model/mdms/tax_period.dart +++ b/frontend/mgramseva/lib/model/mdms/tax_period.dart @@ -29,6 +29,11 @@ class TaxPeriod { factory TaxPeriod.fromJson(Map json) => _$TaxPeriodFromJson(json); Map toJson() => _$TaxPeriodToJson(this); + + @override + String toString() { + return '$financialYear'; + } } diff --git a/frontend/mgramseva/lib/model/success_handler.dart b/frontend/mgramseva/lib/model/success_handler.dart index 065566105..ac808a5a1 100644 --- a/frontend/mgramseva/lib/model/success_handler.dart +++ b/frontend/mgramseva/lib/model/success_handler.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; part 'success_handler.g.dart'; diff --git a/frontend/mgramseva/lib/providers/authentication_provider.dart b/frontend/mgramseva/lib/providers/authentication_provider.dart index b6f080985..7e7943d55 100644 --- a/frontend/mgramseva/lib/providers/authentication_provider.dart +++ b/frontend/mgramseva/lib/providers/authentication_provider.dart @@ -43,27 +43,25 @@ class AuthenticationProvider with ChangeNotifier { Navigator.pop(context); - if (loginResponse != null) { - var userInfo = await AuthenticationRepository().getProfile({ - "tenantId": loginResponse.userRequest!.tenantId, - "id": [loginResponse.userRequest!.id], - "mobileNumber": loginResponse.userRequest!.mobileNumber - }, loginResponse.accessToken!); - var commonProvider = - Provider.of(context, listen: false); - loginResponse.isFirstTimeLogin = userInfo.user!.first.defaultPwdChgd; - commonProvider.loginCredentials = loginResponse; - if (userInfo.user!.first.defaultPwdChgd == false) { - commonProvider.userProfile = userInfo; - Navigator.pushNamed(context, Routes.UPDATE_PASSWORD, - arguments: loginResponse); - return; - } else { - Navigator.of(context).pushNamedAndRemoveUntil( - Routes.HOME, (Route route) => false); - } + var userInfo = await AuthenticationRepository().getProfile({ + "tenantId": loginResponse.userRequest!.tenantId, + "id": [loginResponse.userRequest!.id], + "mobileNumber": loginResponse.userRequest!.mobileNumber + }, loginResponse.accessToken!); + var commonProvider = + Provider.of(context, listen: false); + loginResponse.isFirstTimeLogin = userInfo.user!.first.defaultPwdChgd; + commonProvider.loginCredentials = loginResponse; + if (userInfo.user!.first.defaultPwdChgd == false) { + commonProvider.userProfile = userInfo; + Navigator.pushNamed(context, Routes.UPDATE_PASSWORD, + arguments: loginResponse); + return; + } else { + Navigator.of(context).pushNamedAndRemoveUntil( + Routes.HOME, (Route route) => false); } - } on CustomException catch (e, s) { + } on CustomException catch (e, s) { Navigator.pop(context); if (ErrorHandler.handleApiException(context, e, s)) { Notifiers.getToastMessage(context, e.message, 'ERROR'); diff --git a/frontend/mgramseva/lib/providers/bill_generation_details_provider.dart b/frontend/mgramseva/lib/providers/bill_generation_details_provider.dart index ce93b1da3..dc322ad4d 100644 --- a/frontend/mgramseva/lib/providers/bill_generation_details_provider.dart +++ b/frontend/mgramseva/lib/providers/bill_generation_details_provider.dart @@ -177,9 +177,10 @@ class BillGenerationProvider with ChangeNotifier { notifyListeners(); } - void onChangeOfBillCycle(val) { - var result = DateTime.parse(val); - selectedBillCycle = (DateFormats.getMonth(result)); + void onChangeOfBillCycle(cycle) { + var val = cycle['code']; + DateTime result = DateTime.parse(val.toString()); + selectedBillCycle = cycle; selectedBillPeriod = (DateFormats.getFilteredDate( result.toLocal().toString(), dateFormat: "dd/MM/yyyy")) + @@ -189,7 +190,7 @@ class BillGenerationProvider with ChangeNotifier { .toLocal() .toString(), dateFormat: "dd/MM/yyyy"); - billGenerateDetails.billCycle = val; + billGenerateDetails.billCycle = result.toLocal().toString(); notifyListeners(); } @@ -284,59 +285,57 @@ class BillGenerationProvider with ChangeNotifier { "businessService": "WS" }).then((value) => billList = value); Navigator.pop(context); - if (billResponse1 != null) { - late String localizationText; - localizationText = - '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.GENERATE_BILL_SUCCESS_SUBTEXT)}'; - localizationText = localizationText.replaceFirst( - '{number}', '(+91 - ${billList.bill!.first.mobileNumber})'); - Navigator.of(context).pushReplacement( - new MaterialPageRoute(builder: (BuildContext context) { - return CommonSuccess( - SuccessHandler( - ApplicationLocalizations.of(context) - .translate(i18.demandGenerate.GENERATE_BILL_SUCCESS), - localizationText, - ApplicationLocalizations.of(context) - .translate(i18.common.COLLECT_PAYMENT), - Routes.BILL_GENERATE, - downloadLink: '', - downloadLinkLabel: ApplicationLocalizations.of(context) - .translate(i18.common.DOWNLOAD), - whatsAppShare: '', - subHeader: - '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.BILL_ID_NO)}', - subHeaderText: - '${billList.bill!.first.billNumber.toString()}'), - callBack: () => - onClickOfCollectPayment(billList.bill!.first, context), - callBackDownload: () => commonProvider - .getFileFromPDFBillService({ - "Bill": [billList.bill!.first] - }, { - "key": waterconnection.connectionType == 'Metered' - ? "ws-bill" - : "ws-bill-nm", - "tenantId": - commonProvider.userDetails!.selectedtenant!.code, - }, billList.bill!.first.mobileNumber, billList.bill!.first, - "Download"), - callBackWhatsApp: () => commonProvider - .getFileFromPDFBillService({ - "Bill": [billList.bill!.first], - }, { - "key": waterconnection.connectionType == 'Metered' - ? "ws-bill" - : "ws-bill-nm", - "tenantId": - commonProvider.userDetails!.selectedtenant!.code, - }, billList.bill!.first.mobileNumber, billList.bill!.first, - "Share"), - backButton: true, - ); - })); - } - } catch (e) { + late String localizationText; + localizationText = + '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.GENERATE_BILL_SUCCESS_SUBTEXT)}'; + localizationText = localizationText.replaceFirst( + '{number}', '(+91 - ${billList.bill!.first.mobileNumber})'); + Navigator.of(context).pushReplacement( + new MaterialPageRoute(builder: (BuildContext context) { + return CommonSuccess( + SuccessHandler( + ApplicationLocalizations.of(context) + .translate(i18.demandGenerate.GENERATE_BILL_SUCCESS), + localizationText, + ApplicationLocalizations.of(context) + .translate(i18.common.COLLECT_PAYMENT), + Routes.BILL_GENERATE, + downloadLink: '', + downloadLinkLabel: ApplicationLocalizations.of(context) + .translate(i18.common.DOWNLOAD), + whatsAppShare: '', + subHeader: + '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.BILL_ID_NO)}', + subHeaderText: + '${billList.bill!.first.billNumber.toString()}'), + callBack: () => + onClickOfCollectPayment(billList.bill!.first, context), + callBackDownload: () => commonProvider + .getFileFromPDFBillService({ + "Bill": [billList.bill!.first] + }, { + "key": waterconnection.connectionType == 'Metered' + ? "ws-bill" + : "ws-bill-nm", + "tenantId": + commonProvider.userDetails!.selectedtenant!.code, + }, billList.bill!.first.mobileNumber, billList.bill!.first, + "Download"), + callBackWhatsApp: () => commonProvider + .getFileFromPDFBillService({ + "Bill": [billList.bill!.first], + }, { + "key": waterconnection.connectionType == 'Metered' + ? "ws-bill" + : "ws-bill-nm", + "tenantId": + commonProvider.userDetails!.selectedtenant!.code, + }, billList.bill!.first.mobileNumber, billList.bill!.first, + "Share"), + backButton: true, + ); + })); + } catch (e) { Navigator.pop(context); Navigator.of(context).pushReplacement( new MaterialPageRoute(builder: (BuildContext context) { @@ -361,23 +360,21 @@ class BillGenerationProvider with ChangeNotifier { }; var billResponse2 = await BillGenerateRepository().bulkDemand(res2); Navigator.pop(context); - if (billResponse2 != null) { - String localizationText = getSubtitleText(context); - Navigator.of(context).pushReplacement( - new MaterialPageRoute(builder: (BuildContext context) { - return CommonSuccess(SuccessHandler( - ApplicationLocalizations.of(context) - .translate(i18.demandGenerate.GENERATE_DEMAND_SUCCESS), - localizationText, - i18.common.BACK_HOME, - Routes.BILL_GENERATE, - subHeader: - '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.BILLING_CYCLE_LABEL)}', - subTextFun: () => getLocalizedText(context), - subtitleFun: () => getSubtitleText(context))); - })); - } - } catch (e) { + String localizationText = getSubtitleText(context); + Navigator.of(context).pushReplacement( + new MaterialPageRoute(builder: (BuildContext context) { + return CommonSuccess(SuccessHandler( + ApplicationLocalizations.of(context) + .translate(i18.demandGenerate.GENERATE_DEMAND_SUCCESS), + localizationText, + i18.common.BACK_HOME, + Routes.BILL_GENERATE, + subHeader: + '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.BILLING_CYCLE_LABEL)}', + subTextFun: () => getLocalizedText(context), + subtitleFun: () => getSubtitleText(context))); + })); + } catch (e) { Navigator.of(context).pushReplacement( new MaterialPageRoute(builder: (BuildContext context) { return ErrorPage(e.toString()); @@ -396,78 +393,64 @@ class BillGenerationProvider with ChangeNotifier { '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.GENERATE_DEMAND_SUCCESS_SUBTEXT)}'; localizationText = localizationText.replaceFirst( '{billing cycle}', - '${ApplicationLocalizations.of(context).translate(selectedBillCycle.toString())}' + + '${ApplicationLocalizations.of(context).translate(selectedBillCycle['name'].toString())} | ' + ' ${selectedBillYear.financialYear!.toString().substring(2)}'); return localizationText; } String getLocalizedText(BuildContext context) { - return '${ApplicationLocalizations.of(context).translate(selectedBillCycle)}' + + return '${ApplicationLocalizations.of(context).translate(selectedBillCycle['name'])} | ' + ' ${selectedBillYear.financialYear!.toString().substring(2)}'; } - List> getPropertyTypeList() { + List getPropertyTypeList() { if (languageList?.mdmsRes?.propertyTax?.PropertyTypeList != null) { return (languageList?.mdmsRes?.propertyTax?.PropertyTypeList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text(value.code!), - ); + return value.code!; }).toList(); } - return >[]; + return []; } - List> getConnectionTypeList() { + List getConnectionTypeList() { if (languageList?.mdmsRes?.connection?.connectionTypeList != null) { return (languageList?.mdmsRes?.connection?.connectionTypeList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text( - ApplicationLocalizations.of(navigatorKey.currentContext!) - .translate(value.code!)), - ); + return value.code!; }).toList(); } - return >[]; + return []; } - List> getFinancialYearList() { + List getFinancialYearList() { if (languageList?.mdmsRes?.billingService?.taxPeriodList != null) { CommonMethods.getFilteredFinancialYearList(languageList?.mdmsRes?.billingService?.taxPeriodList ?? []); languageList?.mdmsRes?.billingService?.taxPeriodList!.sort((a,b)=>a.fromDate!.compareTo(b.fromDate!)); return (languageList?.mdmsRes?.billingService?.taxPeriodList ?? []) .map((value) { - return DropdownMenuItem( - value: value, - child: new Text((value.financialYear!)), - ); + return value; }).toList().reversed.toList(); } - return >[]; + return []; } - List> getServiceCategoryList() { + List getServiceCategoryList() { if (languageList?.mdmsRes?.billingService?.taxHeadMasterList != null) { return (languageList?.mdmsRes?.billingService?.taxHeadMasterList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text((value.code!)), - ); + return value.code!; }).toList(); } - return >[]; + return []; } - List> getBillingCycle() { - dates = []; + List> getBillingCycle() { + var dates = >[]; if (billGenerateDetails.billYear != null && selectedBillYear != null) { DatePeriod ytd; var fromDate = DateFormats.getFormattedDateToDateTime( @@ -486,23 +469,16 @@ class BillGenerationProvider with ChangeNotifier { for (var i = 0; i < months.length; i++) { var prevMonth = months[i].startDate; - var r = {"code": prevMonth, "name": prevMonth}; + Map r = {"code": prevMonth, "name": "${ApplicationLocalizations.of(navigatorKey.currentContext!) + .translate((Constants.MONTHS[prevMonth.month - 1])) + + " - " + + prevMonth.year.toString()}"}; dates.add(r); } } if (dates.length > 0) { - return (dates).map((value) { - var d = value['name']; - return DropdownMenuItem( - value: value['code'].toLocal().toString(), - child: new Text( - ApplicationLocalizations.of(navigatorKey.currentContext!) - .translate((Constants.MONTHS[d.month - 1])) + - " - " + - d.year.toString()), - ); - }).toList(); + return dates; } - return >[]; + return >[]; } } diff --git a/frontend/mgramseva/lib/providers/change_password_details_provider.dart b/frontend/mgramseva/lib/providers/change_password_details_provider.dart index 83bd560d9..beac78ded 100644 --- a/frontend/mgramseva/lib/providers/change_password_details_provider.dart +++ b/frontend/mgramseva/lib/providers/change_password_details_provider.dart @@ -19,15 +19,13 @@ class ChangePasswordProvider with ChangeNotifier { var changePasswordResponse = await ChangePasswordRepository().updatePassword(body); Navigator.pop(context); - if (changePasswordResponse != null) { - Notifiers.getToastMessage( - context, i18.password.CHANGE_PASSWORD_SUCCESS, 'SUCCESS'); - new Future.delayed(const Duration(seconds: 5), - () => Navigator.pop(context), - ); + Notifiers.getToastMessage( + context, i18.password.CHANGE_PASSWORD_SUCCESS, 'SUCCESS'); + new Future.delayed(const Duration(seconds: 5), + () => Navigator.pop(context), + ); - } - } catch (e, s) { + } catch (e, s) { Navigator.pop(context); ErrorHandler().allExceptionsHandler(context, e, s); } diff --git a/frontend/mgramseva/lib/providers/collect_payment_provider.dart b/frontend/mgramseva/lib/providers/collect_payment_provider.dart index 160318192..c9fb773e5 100644 --- a/frontend/mgramseva/lib/providers/collect_payment_provider.dart +++ b/frontend/mgramseva/lib/providers/collect_payment_provider.dart @@ -2,7 +2,6 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:image/image.dart' as img; import 'package:mgramseva/model/bill/bill_payments.dart'; import 'package:mgramseva/model/bill/billing.dart'; import 'package:mgramseva/model/common/fetch_bill.dart'; @@ -26,7 +25,6 @@ import 'package:mgramseva/utils/global_variables.dart'; import 'package:mgramseva/utils/loaders.dart'; import 'package:mgramseva/utils/models.dart'; import 'package:mgramseva/utils/notifiers.dart'; -import 'package:mgramseva/utils/print_bluetooth.dart'; import 'package:mgramseva/widgets/common_success_page.dart'; import 'package:number_to_words/number_to_words.dart'; import 'package:provider/provider.dart'; @@ -36,6 +34,7 @@ import '../components/house_connection_and_bill/js_connnector.dart' as js; import '../env/app_config.dart'; import '../model/localization/language.dart'; import '../repository/core_repo.dart'; +import '../widgets/bluetooth_printer.dart'; import 'common_provider.dart'; class CollectPaymentProvider with ChangeNotifier { @@ -400,7 +399,7 @@ class CollectPaymentProvider with ChangeNotifier { height: 8, ), Text('- - *** - -', - textScaleFactor: kIsWeb ? 3 : 1, + textScaler: TextScaler.linear(kIsWeb ? 3 : 1), textAlign: TextAlign.start, style: TextStyle( color: Colors.red, @@ -408,7 +407,7 @@ class CollectPaymentProvider with ChangeNotifier { fontWeight: FontWeight.bold)), Text( "${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.common.RECEIPT_FOOTER)}", - textScaleFactor: kIsWeb ? 3 : 1, + textScaler: TextScaler.linear(kIsWeb ? 3 : 1), textAlign: TextAlign.start, style: TextStyle( color: Colors.red, @@ -421,9 +420,9 @@ class CollectPaymentProvider with ChangeNotifier { kIsWeb ? js.onButtonClick( value, stateProvider.stateInfo!.stateLogoURL.toString()) - : PrintBluetooth.printTicket( - img.decodeImage(value), navigatorKey.currentContext!) + :Navigator.push(navigatorKey.currentContext!, new MaterialPageRoute(builder: (context)=>BluetoothPrinterScreen(imageData: value))) }); + return null; } Future getPaymentModes(FetchBill fetchBill, String tenantId, diff --git a/frontend/mgramseva/lib/providers/common_provider.dart b/frontend/mgramseva/lib/providers/common_provider.dart index 0b2378a41..15a23f3c5 100644 --- a/frontend/mgramseva/lib/providers/common_provider.dart +++ b/frontend/mgramseva/lib/providers/common_provider.dart @@ -76,11 +76,9 @@ class CommonProvider with ChangeNotifier { }; var response = await CoreRepository().getLocilisation(query); - if (response != null) { - labels = localizedStrings = response; - setLocalizationLabels(response); - } - } catch (e) { + labels = localizedStrings = response; + setLocalizationLabels(response); + } catch (e) { print(e); } return labels; diff --git a/frontend/mgramseva/lib/providers/consumer_details_provider.dart b/frontend/mgramseva/lib/providers/consumer_details_provider.dart index 897198ddf..2048a5d92 100644 --- a/frontend/mgramseva/lib/providers/consumer_details_provider.dart +++ b/frontend/mgramseva/lib/providers/consumer_details_provider.dart @@ -152,11 +152,15 @@ class ConsumerProvider with ChangeNotifier { isEdit = true; waterconnection = data; waterconnection.getText(); - selectedcycle = DateFormats.timeStampToDate( - waterconnection.previousReadingDate, - format: 'yyyy-MM-dd') - .toString() + - " 00:00:00.000"; + selectedcycle = {'code':DateTime.fromMillisecondsSinceEpoch(waterconnection.previousReadingDate!), + 'name':"${ApplicationLocalizations.of(navigatorKey.currentContext!) + .translate(DateFormats.timeStampToDate( + waterconnection.previousReadingDate, + format: 'MMMM')) + + " - " + + DateFormats.timeStampToDate( + waterconnection.previousReadingDate, + format: 'yyyy')}"}; if (waterconnection.previousReadingDate != null && (languageList?.mdmsRes?.billingService?.taxPeriodList?.isNotEmpty ?? false)) { @@ -346,7 +350,7 @@ class ConsumerProvider with ChangeNotifier { streamController.add(property); Notifiers.getToastMessage( context, i18.consumer.REGISTER_SUCCESS, 'SUCCESS'); - selectedcycle = ''; + selectedcycle = null; waterconnection.connectionType = ''; Navigator.pop(context); } @@ -460,6 +464,7 @@ class ConsumerProvider with ChangeNotifier { } catch (e) { print(e); } + return null; } Future fetchBoundary() async { @@ -514,57 +519,43 @@ class ConsumerProvider with ChangeNotifier { notifyListeners(); } - List> getBoundaryList() { + List getBoundaryList() { if (boundaryList.length > 0) { - return (boundaryList).map((value) { - return DropdownMenuItem( - value: value, - child: new Text(value.code!), - ); - }).toList(); + return boundaryList; } - return >[]; + return []; } - List> getCategoryList() { + List getCategoryList() { if (languageList?.mdmsRes?.category != null) { return (languageList?.mdmsRes?.category?.categoryList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text((value.code!)), - ); - }).toList(); - } - return >[]; + return value.code!; + }).toList(); + } + return []; } - List> getSubCategoryList() { + List getSubCategoryList() { if (languageList?.mdmsRes?.subCategory != null) { return (languageList?.mdmsRes?.subCategory?.subcategoryList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text((value.code!)), - ); + return value.code!; }).toList(); } - return >[]; + return []; } - List> getPropertyTypeList() { + List getPropertyTypeList() { if (languageList?.mdmsRes?.propertyTax?.PropertyTypeList != null) { return (languageList?.mdmsRes?.propertyTax?.PropertyTypeList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text(value.code!), - ); + return value.code!; }).toList(); } - return >[]; + return []; } onChangeOfConnectionType(val) { @@ -582,30 +573,28 @@ class ConsumerProvider with ChangeNotifier { onChangeBillingCycle(val) { selectedcycle = val; + DateTime result = DateTime.parse(val['code'].toString()); waterconnection.previousReadingDateCtrl.clear(); - waterconnection.BillingCycleCtrl.text = selectedcycle ?? ''; - waterconnection.meterInstallationDateCtrl.text = selectedcycle ?? ''; + waterconnection.BillingCycleCtrl.text = result.toLocal().toString(); + waterconnection.meterInstallationDateCtrl.text = result.toLocal().toString(); notifyListeners(); } //Displaying ConnectionType data Fetched From MDMD (Ex Metered, Non Metered..) - List> getConnectionTypeList() { + List getConnectionTypeList() { if (languageList?.mdmsRes?.connection?.connectionTypeList != null) { return (languageList?.mdmsRes?.connection?.connectionTypeList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text((value.code!)), - ); + return value.code!; }).toList(); } - return >[]; + return []; } //Displaying Billing Cycle Vaule (EX- JAN-2021,,) - List> getBillingCycle() { - dates = []; + List> getBillingCycle() { + var dates = >[]; if (billYear != null) { DatePeriod ytd; var fromDate = DateFormats.getFormattedDateToDateTime( @@ -624,24 +613,17 @@ class ConsumerProvider with ChangeNotifier { for (var i = 0; i < months.length; i++) { var prevMonth = months[i].startDate; - var r = {"code": prevMonth, "name": prevMonth}; + var r = {"code": prevMonth, "name": '${ApplicationLocalizations.of(navigatorKey.currentContext!) + .translate((Constants.MONTHS[prevMonth.month - 1])) + + " - " + + prevMonth.year.toString()}'}; dates.add(r); } } if (dates.length > 0 && waterconnection.connectionType == 'Non_Metered') { - return (dates).map((value) { - var d = value['name']; - return DropdownMenuItem( - value: value['code'].toLocal().toString(), - child: new Text( - ApplicationLocalizations.of(navigatorKey.currentContext!) - .translate((Constants.MONTHS[d.month - 1])) + - " - " + - d.year.toString()), - ); - }).toList(); + return dates; } - return >[]; + return >[]; } incrementIndex(index, consumerGenderKey) async { @@ -673,22 +655,17 @@ class ConsumerProvider with ChangeNotifier { notifyListeners(); } - List> getFinancialYearList() { + List getFinancialYearList() { if (languageList?.mdmsRes?.billingService?.taxPeriodList != null) { - CommonMethods.getFilteredFinancialYearList( - languageList?.mdmsRes?.billingService?.taxPeriodList ?? - []); + CommonMethods.getFilteredFinancialYearList(languageList?.mdmsRes?.billingService?.taxPeriodList ?? []); languageList?.mdmsRes?.billingService?.taxPeriodList!.sort((a,b)=>a.fromDate!.compareTo(b.fromDate!)); return (languageList?.mdmsRes?.billingService?.taxPeriodList ?? - []) + []) .map((value) { - return DropdownMenuItem( - value: value, - child: new Text((value.financialYear!)), - ); + return value; }).toList().reversed.toList(); } - return >[]; + return []; } void onChangeOfAmountType(value) { diff --git a/frontend/mgramseva/lib/providers/dashboard_provider.dart b/frontend/mgramseva/lib/providers/dashboard_provider.dart index 95f92d8cc..6798a477c 100644 --- a/frontend/mgramseva/lib/providers/dashboard_provider.dart +++ b/frontend/mgramseva/lib/providers/dashboard_provider.dart @@ -307,41 +307,39 @@ class DashBoardProvider with ChangeNotifier { isLoaderEnabled = false; if (selectedDashboardType != DashBoardType.collections) return; - if (response != null) { - if (waterConnectionsDetails == null) { - waterConnectionsDetails = response; - - if (selectedTab == 'all') { - collectionCountHolder['all'] = response.totalCount ?? 0; - propertyTaxList.forEach((key) { - collectionCountHolder[key.code!] = - int.parse(response.tabData?[key.code!] ?? '0'); - }); - } else if (searchResponse != null) { - collectionCountHolder['all'] = searchResponse.totalCount ?? 0; - propertyTaxList.forEach((key) { - collectionCountHolder[key.code!] = - int.parse(searchResponse.tabData?[key.code!] ?? '0'); - }); - } + if (waterConnectionsDetails == null) { + waterConnectionsDetails = response; - notifyListeners(); - } else { - waterConnectionsDetails?.totalCount = response.totalCount; - waterConnectionsDetails?.waterConnection - ?.addAll(response.waterConnection ?? []); + if (selectedTab == 'all') { + collectionCountHolder['all'] = response.totalCount ?? 0; + propertyTaxList.forEach((key) { + collectionCountHolder[key.code!] = + int.parse(response.tabData?[key.code!] ?? '0'); + }); + } else if (searchResponse != null) { + collectionCountHolder['all'] = searchResponse.totalCount ?? 0; + propertyTaxList.forEach((key) { + collectionCountHolder[key.code!] = + int.parse(searchResponse.tabData?[key.code!] ?? '0'); + }); } + notifyListeners(); - streamController.add(waterConnectionsDetails!.waterConnection!.isEmpty - ? [] - : waterConnectionsDetails?.waterConnection?.sublist( - offSet - 1, - ((offset + limit - 1) > - (waterConnectionsDetails?.totalCount ?? 0)) - ? (waterConnectionsDetails!.totalCount!) - : (offset + limit) - 1)); + } else { + waterConnectionsDetails?.totalCount = response.totalCount; + waterConnectionsDetails?.waterConnection + ?.addAll(response.waterConnection ?? []); } - } catch (e, s) { + notifyListeners(); + streamController.add(waterConnectionsDetails!.waterConnection!.isEmpty + ? [] + : waterConnectionsDetails?.waterConnection?.sublist( + offSet - 1, + ((offset + limit - 1) > + (waterConnectionsDetails?.totalCount ?? 0)) + ? (waterConnectionsDetails!.totalCount!) + : (offset + limit) - 1)); + } catch (e, s) { isLoaderEnabled = false; notifyListeners(); streamController.addError('error'); diff --git a/frontend/mgramseva/lib/providers/expenses_details_provider.dart b/frontend/mgramseva/lib/providers/expenses_details_provider.dart index b6495b768..c7aa47077 100644 --- a/frontend/mgramseva/lib/providers/expenses_details_provider.dart +++ b/frontend/mgramseva/lib/providers/expenses_details_provider.dart @@ -61,7 +61,7 @@ class ExpensesDetailsProvider with ChangeNotifier { Provider.of(context, listen: false); if (languageList?.mdmsRes?.expense?.expenseList != null) { var res = languageList?.mdmsRes?.pspclIntegration?.accountNumberGpMapping?.where((element) => element.departmentEntityCode==commonProvider.userDetails?.selectedtenant?.city?.code).toList(); - if(res!.isNotEmpty){ + if(res!=null && res.isNotEmpty){ isPSPCLEnabled = true; notifyListeners(); }else{ @@ -98,6 +98,7 @@ class ExpensesDetailsProvider with ChangeNotifier { if(this.expenditureDetails.expenseType=='ELECTRICITY_BILL' && isPSPCLEnabled){ this.expenditureDetails.allowEdit = false; } + notifyListeners(); streamController.add(this.expenditureDetails); } on CustomException catch (e, s) { ErrorHandler.handleApiException(context, e, s); @@ -545,25 +546,22 @@ class ExpensesDetailsProvider with ChangeNotifier { notifyListeners(); } - List> getExpenseTypeList({bool isSearch=false}) { + List getExpenseTypeList({bool isSearch=false}) { var commonProvider = Provider.of( navigatorKey.currentContext!, listen: false); if (languageList?.mdmsRes?.expense?.expenseList != null) { var res = languageList?.mdmsRes?.pspclIntegration?.accountNumberGpMapping?.where((element) => element.departmentEntityCode==commonProvider.userDetails?.selectedtenant?.city?.code).toList(); - var temp_list = languageList?.mdmsRes?.expense?.expenseList?.toList(); - if(res!.isNotEmpty){ - isSearch?{}:temp_list!.removeWhere((element) => element.code=="ELECTRICITY_BILL"); + var tempList = languageList?.mdmsRes?.expense?.expenseList?.toList(); + if(res!=null && res.isNotEmpty){ + isSearch?{}:tempList!.removeWhere((element) => element.code=="ELECTRICITY_BILL"); } - return (temp_list ?? []) + return (tempList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text((value.code!)), - ); + return value.code; }).toList(); } - return >[]; + return []; } incrementindex(index, expenseKey) async { @@ -584,6 +582,7 @@ class ExpensesDetailsProvider with ChangeNotifier { Vendor(vendorList[index].name.trim(), vendorList[index].id); expenditureDetails.selectedVendor?.owner ??= Owner(mobileNumber); } + notifyListeners(); } callNotifyer() { diff --git a/frontend/mgramseva/lib/providers/fetch_bill_provider.dart b/frontend/mgramseva/lib/providers/fetch_bill_provider.dart index 274c63d5a..c3b71941f 100644 --- a/frontend/mgramseva/lib/providers/fetch_bill_provider.dart +++ b/frontend/mgramseva/lib/providers/fetch_bill_provider.dart @@ -19,23 +19,17 @@ class FetchBillProvider with ChangeNotifier { "consumerCode": data.connectionNo.toString(), "businessService": "WS" }); - if (res != null) { - if (res.bill!.isNotEmpty) { - res.bill?.first.billDetails - ?.sort((a, b) => b.fromPeriod!.compareTo(a.fromPeriod!)); - billList = res; - streamController.add(res); - } else { - billList = new BillList(); - billList.bill = []; - streamController.add(billList); - } + if (res.bill!.isNotEmpty) { + res.bill?.first.billDetails + ?.sort((a, b) => b.fromPeriod!.compareTo(a.fromPeriod!)); + billList = res; + streamController.add(res); } else { billList = new BillList(); billList.bill = []; streamController.add(billList); } - } catch (e, s) { + } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); streamController.addError('error'); } diff --git a/frontend/mgramseva/lib/providers/forgot_password_provider.dart b/frontend/mgramseva/lib/providers/forgot_password_provider.dart index a699d3cec..f64ec3835 100644 --- a/frontend/mgramseva/lib/providers/forgot_password_provider.dart +++ b/frontend/mgramseva/lib/providers/forgot_password_provider.dart @@ -30,11 +30,9 @@ class ForgotPasswordProvider with ChangeNotifier { await ForgotPasswordRepository().forgotPassword(body, context); Navigator.pop(context); - if (otpResponse != null) { - Navigator.of(context) - .pushNamed(Routes.RESET_PASSWORD, arguments: {"id": mobileNumber}); - } - } catch (e, s) { + Navigator.of(context) + .pushNamed(Routes.RESET_PASSWORD, arguments: {"id": mobileNumber}); + } catch (e, s) { Navigator.pop(context); ErrorHandler().allExceptionsHandler(context, e, s); } diff --git a/frontend/mgramseva/lib/providers/household_details_provider.dart b/frontend/mgramseva/lib/providers/household_details_provider.dart index fe59b7e33..98a40253e 100644 --- a/frontend/mgramseva/lib/providers/household_details_provider.dart +++ b/frontend/mgramseva/lib/providers/household_details_provider.dart @@ -61,8 +61,7 @@ class HouseHoldProvider with ChangeNotifier { "tenantId": commonProvider.userDetails!.selectedtenant!.code, ...{'connectionNumber': id}, }); - if (res != null && - res.waterConnection != null && + if (res.waterConnection != null && res.waterConnection!.isNotEmpty) { data = res.waterConnection!.first; } diff --git a/frontend/mgramseva/lib/providers/household_register_provider.dart b/frontend/mgramseva/lib/providers/household_register_provider.dart index 5b3c3c285..0208c0e63 100644 --- a/frontend/mgramseva/lib/providers/household_register_provider.dart +++ b/frontend/mgramseva/lib/providers/household_register_provider.dart @@ -128,40 +128,38 @@ class HouseholdRegisterProvider with ChangeNotifier { isLoaderEnabled = false; - if (response != null) { - if (selectedTab == Constants.ALL) { - collectionCountHolder[Constants.ALL] = response.totalCount ?? 0; - collectionCountHolder[Constants.PAID] = - response.collectionDataCount?.collectionPaid ?? 0; - collectionCountHolder[Constants.PENDING] = - response.collectionDataCount?.collectionPending ?? 0; - } else if (searchResponse != null) { - collectionCountHolder[Constants.ALL] = searchResponse.totalCount ?? 0; - collectionCountHolder[Constants.PAID] = - searchResponse.collectionDataCount?.collectionPaid ?? 0; - collectionCountHolder[Constants.PENDING] = - searchResponse.collectionDataCount?.collectionPending ?? 0; - } - - if (waterConnectionsDetails == null) { - waterConnectionsDetails = response; - notifyListeners(); - } else { - waterConnectionsDetails?.totalCount = response.totalCount; - waterConnectionsDetails?.waterConnection - ?.addAll(response.waterConnection ?? []); - } + if (selectedTab == Constants.ALL) { + collectionCountHolder[Constants.ALL] = response.totalCount ?? 0; + collectionCountHolder[Constants.PAID] = + response.collectionDataCount?.collectionPaid ?? 0; + collectionCountHolder[Constants.PENDING] = + response.collectionDataCount?.collectionPending ?? 0; + } else if (searchResponse != null) { + collectionCountHolder[Constants.ALL] = searchResponse.totalCount ?? 0; + collectionCountHolder[Constants.PAID] = + searchResponse.collectionDataCount?.collectionPaid ?? 0; + collectionCountHolder[Constants.PENDING] = + searchResponse.collectionDataCount?.collectionPending ?? 0; + } + + if (waterConnectionsDetails == null) { + waterConnectionsDetails = response; notifyListeners(); - streamController.add(waterConnectionsDetails!.waterConnection!.isEmpty - ? [] - : waterConnectionsDetails?.waterConnection?.sublist( - offSet - 1, - ((offset + limit - 1) > - (waterConnectionsDetails?.totalCount ?? 0)) - ? (waterConnectionsDetails!.totalCount!) - : (offset + limit) - 1)); + } else { + waterConnectionsDetails?.totalCount = response.totalCount; + waterConnectionsDetails?.waterConnection + ?.addAll(response.waterConnection ?? []); } - } catch (e, s) { + notifyListeners(); + streamController.add(waterConnectionsDetails!.waterConnection!.isEmpty + ? [] + : waterConnectionsDetails?.waterConnection?.sublist( + offSet - 1, + ((offset + limit - 1) > + (waterConnectionsDetails?.totalCount ?? 0)) + ? (waterConnectionsDetails!.totalCount!) + : (offset + limit) - 1)); + } catch (e, s) { isLoaderEnabled = false; notifyListeners(); streamController.addError('error'); @@ -399,6 +397,33 @@ class HouseholdRegisterProvider with ChangeNotifier { i18.householdRegister.ACTIVE_INACTIVE, i18.householdRegister.LAST_BILL_GEN_DATE ]; + var downloadheaderList = [ + i18.common.VILLAGE_CODE, + i18.common.VILLAGE_NAME, + i18.common.TENANT_ID, + i18.common.NAME, + i18.common.GENDER, + i18.consumer.FATHER_SPOUSE_NAME, + i18.common.MOBILE_NUMBER, + i18.consumer.OLD_CONNECTION_ID, + i18.common.CONNECTION_ID, + i18.consumer.CONSUMER_CATEGORY, + i18.consumer.CONSUMER_SUBCATEGORY, + i18.searchWaterConnection.PROPERTY_TYPE, + i18.searchWaterConnection.CONNECTION_TYPE, + i18.demandGenerate.METER_READING_DATE, + i18.searchWaterConnection.METER_NUMBER, + i18.demandGenerate.PREV_METER_READING_LABEL, + i18.householdRegister.LAST_BILL_GEN_DATE, + i18.common.ARREARS, + i18.common.CORE_PENALTY, + i18.common.CORE_ADVANCE, + i18.householdRegister.PENDING_COLLECTIONS, + i18.common.CORE_ADVANCE, + i18.householdRegister.PENDING_COLLECTIONS, + i18.householdRegister.ACTIVE_INACTIVE + + ]; var pdfTableData = waterConnectionsDetails.waterConnection ?.map>((connection) => [ diff --git a/frontend/mgramseva/lib/providers/notification_screen_provider.dart b/frontend/mgramseva/lib/providers/notification_screen_provider.dart index 884c062c6..891d11d38 100644 --- a/frontend/mgramseva/lib/providers/notification_screen_provider.dart +++ b/frontend/mgramseva/lib/providers/notification_screen_provider.dart @@ -28,7 +28,7 @@ class NotificationScreenProvider with ChangeNotifier { var commonProvider = Provider.of( navigatorKey.currentContext!, listen: false); - if (notifications != null && notifications.length > 0) { + if (notifications.length > 0) { final jsonList = notifications.map((item) => jsonEncode(item)).toList(); final uniqueJsonList = jsonList.toSet().toList(); var result = new EventsList.fromJson( diff --git a/frontend/mgramseva/lib/providers/notifications_provider.dart b/frontend/mgramseva/lib/providers/notifications_provider.dart index 14f29ae50..ddf39661d 100644 --- a/frontend/mgramseva/lib/providers/notifications_provider.dart +++ b/frontend/mgramseva/lib/providers/notifications_provider.dart @@ -22,7 +22,7 @@ class NotificationProvider with ChangeNotifier { List res = [] ..addAll(notifications2!.events!) ..addAll(notifications1!.events!); - if (res != null && res.length > 0) { + if (res.length > 0) { final jsonList = res.map((item) => jsonEncode(item)).toList(); final uniqueJsonList = jsonList.toSet().toList(); var result = EventsList.fromJson({ diff --git a/frontend/mgramseva/lib/providers/reports_provider.dart b/frontend/mgramseva/lib/providers/reports_provider.dart index 6b20c213f..12bfb02c2 100644 --- a/frontend/mgramseva/lib/providers/reports_provider.dart +++ b/frontend/mgramseva/lib/providers/reports_provider.dart @@ -2,7 +2,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:mgramseva/model/reports/InactiveConsumerReportData.dart'; -import 'package:mgramseva/utils/common_widgets.dart'; import 'package:provider/provider.dart'; import 'package:syncfusion_flutter_xlsio/xlsio.dart'; @@ -18,8 +17,7 @@ import '../utils/constants.dart'; import 'package:mgramseva/utils/constants/i18_key_constants.dart'; import '../utils/date_formats.dart'; import '../utils/error_logging.dart'; -import 'package:mgramseva/utils/excel_download/save_file_mobile.dart' - if (dart.library.html) 'package:mgramseva/utils/excel_download/save_file_web.dart'; +import 'package:mgramseva/utils/excel_download/save_file_mobile.dart'; import '../utils/global_variables.dart'; import '../utils/localization/application_localizations.dart'; import '../utils/models.dart'; @@ -28,7 +26,7 @@ import 'package:mgramseva/services/mdms.dart' as mdms; class ReportsProvider with ChangeNotifier { var streamController = StreamController.broadcast(); - LanguageList? languageList; + LanguageList? billingYearList; var selectedBillYear; var selectedBillPeriod; var selectedBillCycle; @@ -179,15 +177,18 @@ class ReportsProvider with ChangeNotifier { void onChangeOfBillYear(val) { selectedBillYear = val; + print(val.toString()); + billingyearCtrl.text = val.toString(); billingcycleCtrl.clear(); selectedBillCycle = null; selectedBillPeriod = null; notifyListeners(); } - void onChangeOfBillCycle(val) { - var result = DateTime.parse(val); - selectedBillCycle = (DateFormats.getMonth(result)); + void onChangeOfBillCycle(cycle) { + var val = cycle['code']; + var result = DateTime.parse(val.toString()); + selectedBillCycle = cycle; selectedBillPeriod = (DateFormats.getFilteredDate( result.toLocal().toString(), dateFormat: "dd/MM/yyyy")) + @@ -207,16 +208,70 @@ class ReportsProvider with ChangeNotifier { listen: false); var res = await CoreRepository().getMdms(mdms.getTenantFinancialYearList( commonProvider.userDetails!.userRequest!.tenantId.toString())); - languageList = res; + billingYearList = res; notifyListeners(); - streamController.add(languageList); + streamController.add(billingYearList); } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); streamController.addError('error'); } } + List getFinancialYearListDropdownA( + LanguageList? languageList) { + if (languageList?.mdmsRes?.billingService?.taxPeriodList != null) { + CommonMethods.getFilteredFinancialYearList( + languageList?.mdmsRes?.billingService?.taxPeriodList ?? + []); + languageList?.mdmsRes?.billingService?.taxPeriodList! + .sort((a, b) => a.fromDate!.compareTo(b.fromDate!)); + return (languageList?.mdmsRes?.billingService?.taxPeriodList ?? + []) + .reversed + .toList(); + } + return []; + } + List> getBillingCycleDropdownA( + dynamic selectedBillYear) { + List> dates = []; + if (selectedBillYear != null) { + DatePeriod ytd; + var fromDate = DateFormats.getFormattedDateToDateTime( + DateFormats.timeStampToDate(selectedBillYear.fromDate)) as DateTime; - List> getFinancialYearListDropdown( + var toDate = DateFormats.getFormattedDateToDateTime( + DateFormats.timeStampToDate(selectedBillYear.toDate)) as DateTime; + + ytd = DatePeriod(fromDate, toDate, DateType.YTD); + + /// Get months based on selected billing year + var months = CommonMethods.getPastMonthUntilFinancialYTD(ytd, + showCurrentMonth: true); + + /// if selected year is future year means all the months will be removed + if (fromDate.year > ytd.endDate.year) months.clear(); + + for (var i = 0; i < months.length; i++) { + var prevMonth = months[i].startDate; + var r = {"code": prevMonth, "name": '${ApplicationLocalizations.of(navigatorKey.currentContext!) + .translate((Constants.MONTHS[prevMonth.month - 1])) + + " - " + + prevMonth.year.toString()}'}; + dates.add(r); + } + } + // if (dates.length > 0) { + // return (dates).map((value) { + // var d = value['name']; + // return "${ApplicationLocalizations.of(navigatorKey.currentContext!) + // .translate((Constants.MONTHS[d.month - 1])) + + // " - " + + // d.year.toString()}"; + // }).toList(); + // } + return dates; + } + List getFinancialYearListDropdown( LanguageList? languageList) { if (languageList?.mdmsRes?.billingService?.taxPeriodList != null) { CommonMethods.getFilteredFinancialYearList( @@ -227,21 +282,18 @@ class ReportsProvider with ChangeNotifier { return (languageList?.mdmsRes?.billingService?.taxPeriodList ?? []) .map((value) { - return DropdownMenuItem( - value: value, - child: new Text((value.financialYear!)), - ); + return value; }) .toList() .reversed .toList(); } - return >[]; + return []; } - List> getBillingCycleDropdown( + List> getBillingCycleDropdown( dynamic selectedBillYear) { - var dates = []; + var dates = >[]; if (selectedBillYear != null) { DatePeriod ytd; var fromDate = DateFormats.getFormattedDateToDateTime( @@ -261,24 +313,17 @@ class ReportsProvider with ChangeNotifier { for (var i = 0; i < months.length; i++) { var prevMonth = months[i].startDate; - var r = {"code": prevMonth, "name": prevMonth}; + Map r = {"code": prevMonth, "name": "${ApplicationLocalizations.of(navigatorKey.currentContext!) + .translate((Constants.MONTHS[prevMonth.month - 1])) + + " - " + + prevMonth.year.toString()}"}; dates.add(r); } } if (dates.length > 0) { - return (dates).map((value) { - var d = value['name']; - return DropdownMenuItem( - value: value['code'].toLocal().toString(), - child: new Text( - ApplicationLocalizations.of(navigatorKey.currentContext!) - .translate((Constants.MONTHS[d.month - 1])) + - " - " + - d.year.toString()), - ); - }).toList(); + return dates; } - return >[]; + return >[]; } Future getDemandReport( diff --git a/frontend/mgramseva/lib/providers/revenue_dashboard_provider.dart b/frontend/mgramseva/lib/providers/revenue_dashboard_provider.dart index e2c7f8ceb..ab687738c 100644 --- a/frontend/mgramseva/lib/providers/revenue_dashboard_provider.dart +++ b/frontend/mgramseva/lib/providers/revenue_dashboard_provider.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:community_charts_flutter/community_charts_flutter.dart' as charts; import 'package:flutter/material.dart'; import 'package:mgramseva/model/dashboard/revenue_dashboard.dart'; import 'package:mgramseva/providers/common_provider.dart'; @@ -14,7 +15,6 @@ import 'package:mgramseva/model/dashboard/revenue_dashboard.dart' as expense; import '../screeens/dashboard/revenue_expense_dashboard/revenue.dart'; import 'dashboard_provider.dart'; -import 'package:charts_flutter/flutter.dart' as charts; class RevenueDashboard with ChangeNotifier { int selectedIndex = 0; diff --git a/frontend/mgramseva/lib/providers/search_connection_provider.dart b/frontend/mgramseva/lib/providers/search_connection_provider.dart index 5beab8563..e5ea0342b 100644 --- a/frontend/mgramseva/lib/providers/search_connection_provider.dart +++ b/frontend/mgramseva/lib/providers/search_connection_provider.dart @@ -59,7 +59,7 @@ class SearchConnectionProvider with ChangeNotifier { try { Loaders.showLoadingDialog(context); var inputJson = searchconnection.toJson(); - inputJson.removeWhere((key, value) => key == null || value == ""); + inputJson.removeWhere((key, value) => value == ""); var connectionresults = isNameSearch == true ? SearchConnectionRepository().getConnectionName({ "tenantId": commonProvider.userDetails!.selectedtenant!.code, ...inputJson @@ -70,30 +70,28 @@ class SearchConnectionProvider with ChangeNotifier { /// popping the loader - if (connectionresults != null) { - connectionresults.then( - (value) => { - Navigator.pop(context), - if (value.waterConnectionData!.length > 0 || value.waterConnection!.length > 0) - { - waterConnections = value, - Navigator.pushNamed( - context, Routes.SEARCH_CONSUMER_RESULT, - arguments: {...inputJson, ...arguments, "isNameSearch" : isNameSearch }) - } - else - { - Notifiers.getToastMessage( - context, - i18.searchWaterConnection.NO_CONNECTION_FOUND, - "ERROR") - } - }, onError: (e, s) { - Navigator.pop(context); - ErrorHandler().allExceptionsHandler(context, e, s); - }); - } - } catch (e, s) { + connectionresults.then( + (value) => { + Navigator.pop(context), + if (value.waterConnectionData!.length > 0 || value.waterConnection!.length > 0) + { + waterConnections = value, + Navigator.pushNamed( + context, Routes.SEARCH_CONSUMER_RESULT, + arguments: {...inputJson, ...arguments, "isNameSearch" : isNameSearch }) + } + else + { + Notifiers.getToastMessage( + context, + i18.searchWaterConnection.NO_CONNECTION_FOUND, + "ERROR") + } + }, onError: (e, s) { + Navigator.pop(context); + ErrorHandler().allExceptionsHandler(context, e, s); + }); + } catch (e, s) { Navigator.pop(context); ErrorHandler().allExceptionsHandler(context, e, s); } diff --git a/frontend/mgramseva/lib/providers/tenants_provider.dart b/frontend/mgramseva/lib/providers/tenants_provider.dart index fe45b15f4..90d6c4e41 100644 --- a/frontend/mgramseva/lib/providers/tenants_provider.dart +++ b/frontend/mgramseva/lib/providers/tenants_provider.dart @@ -25,11 +25,9 @@ class TenantsProvider with ChangeNotifier { navigatorKey.currentContext!, listen: false); var userResponse = await TenantRepo().fetchTenants(getTenantsMDMS(commonProvider.userDetails!.userRequest!.tenantId.toString())); - if (userResponse != null) { - tenants = userResponse; - streamController.add(userResponse); - } - } catch (e, s) { + tenants = userResponse; + streamController.add(userResponse); + } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); streamController.addError('error'); } diff --git a/frontend/mgramseva/lib/providers/user_edit_profile_provider.dart b/frontend/mgramseva/lib/providers/user_edit_profile_provider.dart index ac0c6e111..723768a37 100644 --- a/frontend/mgramseva/lib/providers/user_edit_profile_provider.dart +++ b/frontend/mgramseva/lib/providers/user_edit_profile_provider.dart @@ -25,21 +25,19 @@ class UserEditProfileProvider with ChangeNotifier { var edituserResponse = await UserEditProfileRepository().editProfile(body); Navigator.pop(context); - if (edituserResponse != null) { - Notifiers.getToastMessage( - context, i18.profileEdit.PROFILE_EDIT_SUCCESS, 'SUCCESS'); - streamController.add(edituserResponse); - if(edituserResponse.user?.isNotEmpty ?? false) { - Provider.of(context, listen: false) - ..userDetails?.userRequest?.name = edituserResponse.user?.first.name - ..userDetails?.userRequest?.emailId = edituserResponse.user?.first - .emailId - ..loginCredentials = Provider.of(context, listen: false).userDetails; - } - Navigator.pop(context); - Navigator.pop(context); + Notifiers.getToastMessage( + context, i18.profileEdit.PROFILE_EDIT_SUCCESS, 'SUCCESS'); + streamController.add(edituserResponse); + if(edituserResponse.user?.isNotEmpty ?? false) { + Provider.of(context, listen: false) + ..userDetails?.userRequest?.name = edituserResponse.user?.first.name + ..userDetails?.userRequest?.emailId = edituserResponse.user?.first + .emailId + ..loginCredentials = Provider.of(context, listen: false).userDetails; } - } catch (e, s) { + Navigator.pop(context); + Navigator.pop(context); + } catch (e, s) { Navigator.pop(context); ErrorHandler().allExceptionsHandler(context, e, s); } diff --git a/frontend/mgramseva/lib/providers/user_profile_provider.dart b/frontend/mgramseva/lib/providers/user_profile_provider.dart index 2a1bad62d..3c2f2cfc0 100644 --- a/frontend/mgramseva/lib/providers/user_profile_provider.dart +++ b/frontend/mgramseva/lib/providers/user_profile_provider.dart @@ -19,11 +19,9 @@ class UserProfileProvider with ChangeNotifier { Future getUserProfileDetails(body, BuildContext context) async { try { var userResponse = await UserProfileRepository().getProfile(body); - if (userResponse != null) { - streamController.add(userResponse.user?.first); - profileDetails = userResponse.user!.first; - } - } catch (e, s) { + streamController.add(userResponse.user?.first); + profileDetails = userResponse.user!.first; + } catch (e, s) { ErrorHandler().allExceptionsHandler(context, e, s); streamController.addError('error'); } diff --git a/frontend/mgramseva/lib/repository/core_repo.dart b/frontend/mgramseva/lib/repository/core_repo.dart index 1b83ffcdd..b65bd4d97 100644 --- a/frontend/mgramseva/lib/repository/core_repo.dart +++ b/frontend/mgramseva/lib/repository/core_repo.dart @@ -248,12 +248,11 @@ class CoreRepository extends BaseService { headers: header, body: jsonEncode({"url": inputUrl})); - if (response.body != null) { - return response.body; - } - } catch (e, s) { + return response.body; + } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); } + return null; } Future getFileStorefromPdfService(body, params) async { @@ -288,6 +287,7 @@ class CoreRepository extends BaseService { } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); } + return null; } Future fetchNotifications(params) async { @@ -320,6 +320,7 @@ class CoreRepository extends BaseService { } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); } + return null; } Future updateNotifications(events) async { @@ -350,6 +351,7 @@ class CoreRepository extends BaseService { } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); } + return null; } Future fileDownload(BuildContext context, String url, @@ -370,11 +372,19 @@ class CoreRepository extends BaseService { } else if (Platform.isIOS) { downloadPath = (await getApplicationDocumentsDirectory()).path; } else { - downloadPath = (await getExternalStorageDirectory())?.path; + downloadPath = (await getDownloadsDirectory())?.path; } var status = await Permission.storage.status; + var status2 = await Permission.photos.status; + var status1 = await Permission.notification.status; if (!status.isGranted) { await Permission.storage.request(); + }if (!status1.isGranted) { + await Permission.notification.request(); + } + if (!status2.isGranted) { + await Permission.photos.request(); + await Permission.videos.request(); } final response = await FlutterDownloader.enqueue( @@ -392,6 +402,7 @@ class CoreRepository extends BaseService { } catch (e, s) { ErrorHandler().allExceptionsHandler(context, e, s); } + return null; } Future submitFeedBack(Map body) async { diff --git a/frontend/mgramseva/lib/routing.dart b/frontend/mgramseva/lib/routing.dart index 759901f36..08b7fb3c3 100644 --- a/frontend/mgramseva/lib/routing.dart +++ b/frontend/mgramseva/lib/routing.dart @@ -167,7 +167,7 @@ class Routing { } if (kIsWeb) { - FirebaseAnalytics analytics = FirebaseAnalytics(); + FirebaseAnalytics analytics = FirebaseAnalytics.instance; analytics.logEvent(name: "screen_view", parameters: { 'firebase_screen': "$path", 'screen_name': "$path", diff --git a/frontend/mgramseva/lib/screeens/add_expense/add_expense_walk_through/expense_walk_through.dart b/frontend/mgramseva/lib/screeens/add_expense/add_expense_walk_through/expense_walk_through.dart index 4e426135c..4d256d1a6 100644 --- a/frontend/mgramseva/lib/screeens/add_expense/add_expense_walk_through/expense_walk_through.dart +++ b/frontend/mgramseva/lib/screeens/add_expense/add_expense_walk_through/expense_walk_through.dart @@ -20,6 +20,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ), }, { diff --git a/frontend/mgramseva/lib/screeens/add_expense/expense_details.dart b/frontend/mgramseva/lib/screeens/add_expense/expense_details.dart index 292cc5e96..2ad06955a 100644 --- a/frontend/mgramseva/lib/screeens/add_expense/expense_details.dart +++ b/frontend/mgramseva/lib/screeens/add_expense/expense_details.dart @@ -1,5 +1,3 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:mgramseva/widgets/keyboard_focus_watcher.dart'; @@ -108,7 +106,7 @@ class _ExpenseDetailsState extends State { return CommonWidgets.buildEmptyMessage( snapshot.data, context); } - return _buildUserView(snapshot.data); + return _buildUserView(); } else if (snapshot.hasError) { return Notifiers.networkErrorPage( context, @@ -155,7 +153,7 @@ class _ExpenseDetailsState extends State { print(context); } - Widget _buildUserView(ExpensesDetailsModel expenseDetails) { + Widget _buildUserView() { return FormWrapper(Consumer( builder: (_, expenseProvider, child) => Column( mainAxisAlignment: MainAxisAlignment.start, @@ -206,28 +204,31 @@ class _ExpenseDetailsState extends State { if (isUpdate) BuildTextField( '${i18.common.BILL_ID}', - expenseDetails.challanNumberCtrl, + expensesDetailsProvider.expenditureDetails.challanNumberCtrl, isDisabled: true, ), SelectFieldBuilder( i18.expense.EXPENSE_TYPE, - expenseDetails.expenseType, + expensesDetailsProvider.expenditureDetails.expenseType, '', '', expensesDetailsProvider.onChangeOfExpenses, expensesDetailsProvider.getExpenseTypeList(isSearch: isUpdate), true, - isEnabled: expenseDetails.allowEdit, + readOnly: !expensesDetailsProvider.expenditureDetails.allowEdit!, requiredMessage: i18.expense.SELECT_EXPENDITURE_CATEGORY, contextKey: expenseProvider.expenseWalkthrougList[0].key, - controller: expenseDetails.expenseTypeController, + controller: expensesDetailsProvider.expenditureDetails.expenseTypeController, key: Keys.expense.EXPENSE_TYPE, + itemAsString: (i) =>'${ApplicationLocalizations.of(context) + .translate( + i.toString())}', ), AutoCompleteView( labelText: i18.expense.VENDOR_NAME, - controller: expenseDetails.vendorNameCtrl, + controller: expensesDetailsProvider.expenditureDetails.vendorNameCtrl, suggestionsBoxController: expensesDetailsProvider .suggestionsBoxController, onSuggestionSelected: @@ -236,7 +237,7 @@ class _ExpenseDetailsState extends State { expensesDetailsProvider.onSearchVendorList, listTile: buildTile, isRequired: true, - isEnabled: expenseDetails.allowEdit, + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit, requiredMessage: i18.expense.MENTION_NAME_OF_VENDOR, inputFormatter: [ @@ -247,10 +248,10 @@ class _ExpenseDetailsState extends State { expenseProvider.expenseWalkthrougList[1].key, key: Keys.expense.VENDOR_NAME, ), - if (expenseDetails.vendorNameCtrl.text.trim().isNotEmpty) + if (expensesDetailsProvider.expenditureDetails.vendorNameCtrl.text.trim().isNotEmpty) BuildTextField( '${i18.common.MOBILE_NUMBER}', - expenseDetails.mobileNumberController, + expensesDetailsProvider.expenditureDetails.mobileNumberController, isRequired: true, prefixText: '+91 - ', textInputType: TextInputType.number, @@ -270,7 +271,7 @@ class _ExpenseDetailsState extends State { ), BuildTextField( '${i18.expense.AMOUNT}', - expenseDetails.expensesAmount!.first.amountCtrl, + expensesDetailsProvider.expenditureDetails.expensesAmount!.first.amountCtrl, isRequired: true, textInputType: TextInputType.number, inputFormatter: [ @@ -279,7 +280,7 @@ class _ExpenseDetailsState extends State { ], placeHolder: '${i18.expense.AMOUNT} (₹)', labelSuffix: '(₹)', - isDisabled: (expenseDetails.allowEdit ?? true) + isDisabled: (expensesDetailsProvider.expenditureDetails.allowEdit ?? true) ? false : true, requiredMessage: @@ -307,23 +308,23 @@ class _ExpenseDetailsState extends State { BasicDateField( i18.expense.BILL_DATE, true, - expenseDetails.billDateCtrl, - firstDate: expenseDetails.billIssuedDateCtrl.text + expensesDetailsProvider.expenditureDetails.billDateCtrl, + firstDate: expensesDetailsProvider.expenditureDetails.billIssuedDateCtrl.text .trim() .isEmpty ? null : DateFormats.getFormattedDateToDateTime( - expenseDetails.billIssuedDateCtrl.text + expensesDetailsProvider.expenditureDetails.billIssuedDateCtrl.text .trim(), ), initialDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.billDateCtrl.text.trim(), + expensesDetailsProvider.expenditureDetails.billDateCtrl.text.trim(), ), lastDate: DateTime.now(), onChangeOfDate: expensesDetailsProvider.onChangeOfBillDate, - isEnabled: expenseDetails.allowEdit, + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit, requiredMessage: i18.expense.DATE_BILL_ENTERED_IN_RECORDS, contextKey: @@ -334,13 +335,13 @@ class _ExpenseDetailsState extends State { BasicDateField( i18.expense.EXPENSE_START_DATE, true, - expenseDetails.fromDateCtrl, + expensesDetailsProvider.expenditureDetails.fromDateCtrl, onChangeOfDate: expensesDetailsProvider.onChangeOfStartEndDate, lastDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.billDateCtrl.text.trim(), + expensesDetailsProvider.expenditureDetails.billDateCtrl.text.trim(), ) ?? DateTime.now(), - isEnabled: expenseDetails.allowEdit, + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit, validator: (val) => expensesDetailsProvider.fromToDateValidator(val, true), autoValidation: expenseProvider.dateAutoValidation ? AutovalidateMode.always : AutovalidateMode.disabled, @@ -349,16 +350,16 @@ class _ExpenseDetailsState extends State { BasicDateField( i18.expense.EXPENSE_END_DATE, true, - expenseDetails.toDateCtrl, + expensesDetailsProvider.expenditureDetails.toDateCtrl, initialDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.billDateCtrl.text.trim(), + expensesDetailsProvider.expenditureDetails.billDateCtrl.text.trim(), ), lastDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.billDateCtrl.text.trim(), + expensesDetailsProvider.expenditureDetails.billDateCtrl.text.trim(), ) ?? DateTime.now(), onChangeOfDate: expensesDetailsProvider.onChangeOfStartEndDate, - isEnabled: expenseDetails.allowEdit, + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit, validator: expensesDetailsProvider.fromToDateValidator, autoValidation: expenseProvider.dateAutoValidation ? AutovalidateMode.always : AutovalidateMode.disabled, @@ -372,20 +373,20 @@ class _ExpenseDetailsState extends State { BasicDateField( i18.expense.PARTY_BILL_DATE, false, - expenseDetails.billIssuedDateCtrl, + expensesDetailsProvider.expenditureDetails.billIssuedDateCtrl, initialDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.billIssuedDateCtrl.text.trim(), + expensesDetailsProvider.expenditureDetails.billIssuedDateCtrl.text.trim(), ), - lastDate: expenseDetails.billDateCtrl.text + lastDate: expensesDetailsProvider.expenditureDetails.billDateCtrl.text .trim() .isEmpty ? DateTime.now() : DateFormats.getFormattedDateToDateTime( - expenseDetails.billDateCtrl.text.trim()), + expensesDetailsProvider.expenditureDetails.billDateCtrl.text.trim()), onChangeOfDate: expensesDetailsProvider.onChangeOfDate, - isEnabled: expenseDetails.allowEdit, + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit, contextKey: expenseProvider.expenseWalkthrougList[4].key, key: Keys.expense.EXPENSE_PARTY_DATE, @@ -393,31 +394,31 @@ class _ExpenseDetailsState extends State { RadioButtonFieldBuilder( context, i18.expense.HAS_THIS_BILL_PAID, - expenseDetails.isBillPaid, + expensesDetailsProvider.expenditureDetails.isBillPaid, '', '', true, Constants.EXPENSESTYPE, expensesDetailsProvider.onChangeOfBillPaid, - isEnabled: expenseDetails.allowEdit), - if (expenseDetails.isBillPaid ?? false) + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit), + if (expensesDetailsProvider.expenditureDetails.isBillPaid ?? false) BasicDateField(i18.expense.PAYMENT_DATE, true, - expenseDetails.paidDateCtrl, + expensesDetailsProvider.expenditureDetails.paidDateCtrl, firstDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.billDateCtrl.text + expensesDetailsProvider.expenditureDetails.billDateCtrl.text .trim()), lastDate: DateTime.now(), initialDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.paidDateCtrl.text + expensesDetailsProvider.expenditureDetails.paidDateCtrl.text .trim()), onChangeOfDate: expensesDetailsProvider.onChangeOfDate, - isEnabled: expenseDetails.allowEdit), + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit), if (isUpdate && - expenseDetails.fileStoreList != null && - expenseDetails.fileStoreList!.isNotEmpty) + expensesDetailsProvider.expenditureDetails.fileStoreList != null && + expensesDetailsProvider.expenditureDetails.fileStoreList!.isNotEmpty) Container( margin: const EdgeInsets.only( top: 20.0, bottom: 5, right: 20, left: 20), @@ -432,7 +433,7 @@ class _ExpenseDetailsState extends State { fontSize: 19, fontWeight: FontWeight.normal)), Wrap( - children: expenseDetails.fileStoreList! + children: expensesDetailsProvider.expenditureDetails.fileStoreList! .map((e) => InkWell( onTap: () => expensesDetailsProvider @@ -463,7 +464,7 @@ class _ExpenseDetailsState extends State { ], ), ), - if (expenseDetails.allowEdit ?? true) + if (expensesDetailsProvider.expenditureDetails.allowEdit ?? true) FilePickerDemo( key: expensesDetailsProvider.filePickerKey, callBack: @@ -473,7 +474,7 @@ class _ExpenseDetailsState extends State { .expenseWalkthrougList[5].key, ), if (isUpdate) - expensesDetailsProvider.isPSPCLEnabled && expenseDetails.expenseType=='ELECTRICITY_BILL'?Container(): + expensesDetailsProvider.isPSPCLEnabled && expensesDetailsProvider.expenditureDetails.expenseType=='ELECTRICITY_BILL'?Container(): Container( alignment: Alignment.centerLeft, padding: EdgeInsets.symmetric( @@ -487,7 +488,7 @@ class _ExpenseDetailsState extends State { width: 20, height: 20, child: Checkbox( - value: expenseDetails.isBillCancelled, + value: expensesDetailsProvider.expenditureDetails.isBillCancelled, onChanged: expensesDetailsProvider .onChangeOfCheckBox), ), diff --git a/frontend/mgramseva/lib/screeens/change_password/change_password.dart b/frontend/mgramseva/lib/screeens/change_password/change_password.dart index 1300326f6..ea786bedf 100644 --- a/frontend/mgramseva/lib/screeens/change_password/change_password.dart +++ b/frontend/mgramseva/lib/screeens/change_password/change_password.dart @@ -135,7 +135,7 @@ class _ChangePasswordState extends State { Provider.of(context, listen: false); return FocusWatcher( child: Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: BaseAppBar( Text(i18.common.MGRAM_SEVA), AppBar(), diff --git a/frontend/mgramseva/lib/screeens/common/payment_failure.dart b/frontend/mgramseva/lib/screeens/common/payment_failure.dart index 4e99e2439..d0ce426e2 100644 --- a/frontend/mgramseva/lib/screeens/common/payment_failure.dart +++ b/frontend/mgramseva/lib/screeens/common/payment_failure.dart @@ -38,7 +38,7 @@ class _PaymentFailureState extends State { var languageProvider = Provider.of(context, listen: false); return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: AppBar( title: Text('mGramSeva'), automaticallyImplyLeading: false, diff --git a/frontend/mgramseva/lib/screeens/connection_results/connection_details_card.dart b/frontend/mgramseva/lib/screeens/connection_results/connection_details_card.dart index 037ed349f..da6729b67 100644 --- a/frontend/mgramseva/lib/screeens/connection_results/connection_details_card.dart +++ b/frontend/mgramseva/lib/screeens/connection_results/connection_details_card.dart @@ -1,6 +1,4 @@ -import 'dart:ui'; import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; import 'package:mgramseva/model/connection/water_connections.dart'; import 'package:mgramseva/providers/common_provider.dart'; import 'package:mgramseva/routers/routers.dart'; diff --git a/frontend/mgramseva/lib/screeens/connection_results/connection_results.dart b/frontend/mgramseva/lib/screeens/connection_results/connection_results.dart index eea4d2c7b..f37112189 100644 --- a/frontend/mgramseva/lib/screeens/connection_results/connection_results.dart +++ b/frontend/mgramseva/lib/screeens/connection_results/connection_results.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; import 'package:mgramseva/model/connection/water_connections.dart'; import 'package:mgramseva/providers/search_connection_provider.dart'; import 'package:mgramseva/screeens/connection_results/connection_details_card.dart'; @@ -43,7 +42,7 @@ class _SearchConsumerResultState extends State { Provider.of(context, listen: false); return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), diff --git a/frontend/mgramseva/lib/screeens/connection_results/search_connection.dart b/frontend/mgramseva/lib/screeens/connection_results/search_connection.dart index 480b6875e..cf5db6c13 100644 --- a/frontend/mgramseva/lib/screeens/connection_results/search_connection.dart +++ b/frontend/mgramseva/lib/screeens/connection_results/search_connection.dart @@ -1,7 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_focus_watcher/flutter_focus_watcher.dart'; import 'package:mgramseva/model/connection/search_connection.dart'; import 'package:mgramseva/providers/search_connection_provider.dart'; @@ -44,7 +42,7 @@ class _SearchConsumerConnectionState extends State { Provider.of(context, listen: false); return FocusWatcher( child: Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart index d670622b2..226c66d02 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart @@ -298,6 +298,7 @@ class _ConsumerDetailsState extends State { false, // contextkey: consumerProvider // .consmerWalkthrougList[6].key, + itemAsString: (i) =>'${ApplicationLocalizations.of(context).translate(i.toString())}', controller: consumerProvider.waterconnection.categoryCtrl, key: Keys.createConsumer.CONSUMER_CATEORY_KEY, @@ -315,6 +316,7 @@ class _ConsumerDetailsState extends State { consumerProvider.onChangeOfSubCategory, consumerProvider.getSubCategoryList(), false, + itemAsString: (i) =>'${ApplicationLocalizations.of(context).translate(i.toString())}', // contextkey: consumerProvider // .consmerWalkthrougList[6].key, controller: consumerProvider @@ -364,6 +366,7 @@ class _ConsumerDetailsState extends State { consumerProvider.onChangeOfLocality, consumerProvider.getBoundaryList(), true, + itemAsString: (i) =>'${ApplicationLocalizations.of(context).translate(i.code!.toString())}', contextKey: consumerProvider .consmerWalkthrougList[5].key) : Container()), @@ -379,6 +382,7 @@ class _ConsumerDetailsState extends State { consumerProvider.onChangeOfPropertyType, consumerProvider.getPropertyTypeList(), true, + itemAsString: (i) =>'${ApplicationLocalizations.of(context).translate(i.toString())}', contextKey: consumerProvider.consmerWalkthrougList[6].key, controller: property.address.propertyCtrl, @@ -400,14 +404,15 @@ class _ConsumerDetailsState extends State { consumerProvider .getConnectionTypeList(), true, + itemAsString: (i) =>'${ApplicationLocalizations.of(context).translate(i.toString())}', contextKey: consumerProvider .consmerWalkthrougList[7].key, controller: consumerProvider .waterconnection.ServiceTypeCtrl, - isEnabled: consumerProvider.isEdit == - false || + readOnly: consumerProvider.isEdit == + true || consumerProvider.isFirstDemand == - false, + true, key: Keys.createConsumer .CONSUMER_SERVICE_KEY, ), @@ -510,6 +515,7 @@ class _ConsumerDetailsState extends State { consumerProvider .getFinancialYearList(), true, + itemAsString: (i) =>'${ApplicationLocalizations.of(context).translate(i.financialYear)}', controller: consumerProvider .waterconnection .billingCycleYearCtrl, @@ -528,6 +534,7 @@ class _ConsumerDetailsState extends State { consumerProvider .getBillingCycle(), true, + itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i['name'])}", controller: consumerProvider .waterconnection .BillingCycleCtrl, @@ -619,7 +626,7 @@ class _ConsumerDetailsState extends State { var userProvider = Provider.of(context, listen: false); return KeyboardFocusWatcher( child: Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walk_through.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walk_through.dart index 8062bedbe..f5ed41bd0 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walk_through.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walk_through.dart @@ -63,6 +63,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ) }, { @@ -75,6 +76,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ) }, { @@ -87,6 +89,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ) }, { diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walkthrough_1.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walkthrough_1.dart index 8062bedbe..f5ed41bd0 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walkthrough_1.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walkthrough_1.dart @@ -63,6 +63,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ) }, { @@ -75,6 +76,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ) }, { @@ -87,6 +89,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ) }, { diff --git a/frontend/mgramseva/lib/screeens/dashboard/IndividualTab.dart b/frontend/mgramseva/lib/screeens/dashboard/IndividualTab.dart index 7b239998e..4f9794f04 100644 --- a/frontend/mgramseva/lib/screeens/dashboard/IndividualTab.dart +++ b/frontend/mgramseva/lib/screeens/dashboard/IndividualTab.dart @@ -62,7 +62,7 @@ class _IndividualTabState extends State { (expenseList is List ? 5 : 3)); var tableData = expenseList is List ? dashBoardProvider - .getExpenseData(expenseList as List) + .getExpenseData(expenseList) : dashBoardProvider .getCollectionsData(expenseList as List); var extraHeight = 0.0; @@ -70,7 +70,7 @@ class _IndividualTabState extends State { if (e.tableRow.first.label.length > 28) extraHeight += e.tableRow.first.label.substring(28).length.toDouble(); }); - return tableData == null || tableData.isEmpty + return tableData.isEmpty ? SizedBox( height: 100, child: CommonWidgets.buildEmptyMessage( diff --git a/frontend/mgramseva/lib/screeens/dashboard/individual_tab.dart b/frontend/mgramseva/lib/screeens/dashboard/individual_tab.dart index 72ce20505..1fa49938c 100644 --- a/frontend/mgramseva/lib/screeens/dashboard/individual_tab.dart +++ b/frontend/mgramseva/lib/screeens/dashboard/individual_tab.dart @@ -62,7 +62,7 @@ class _IndividualTabState extends State { (expenseList is List ? 5 : 3)); var tableData = expenseList is List ? dashBoardProvider - .getExpenseData(expenseList as List) + .getExpenseData(expenseList) : dashBoardProvider .getCollectionsData(expenseList as List); var extraHeight = 0.0; @@ -70,7 +70,7 @@ class _IndividualTabState extends State { if (e.tableRow.first.label.length > 28) extraHeight += e.tableRow.first.label.substring(28).length.toDouble(); }); - return tableData == null || tableData.isEmpty + return tableData.isEmpty ? SizedBox( height: 100, child: CommonWidgets.buildEmptyMessage( diff --git a/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/custom_label_widget/custom_tooltip_label_render.dart b/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/custom_label_widget/custom_tooltip_label_render.dart index 2089b6164..17e4b7c87 100644 --- a/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/custom_label_widget/custom_tooltip_label_render.dart +++ b/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/custom_label_widget/custom_tooltip_label_render.dart @@ -1,13 +1,12 @@ import 'dart:math'; -import 'package:charts_flutter/src/text_element.dart' as ChartText; -import 'package:charts_flutter/src/text_style.dart' as ChartStyle; -import 'package:charts_flutter/flutter.dart'; +import 'package:community_charts_flutter/community_charts_flutter.dart'; +import 'package:community_charts_flutter/src/text_element.dart' as ChartTextElement; +import 'package:community_charts_flutter/src/text_style.dart' as ChartTextStyle; String? _xAxis; String? _pointColor; num? _maxVal; - class ToolTipMgr { static String? get xAxis => _xAxis; @@ -57,14 +56,14 @@ class CustomTooltipLabelRenderer extends CircleSymbolRenderer { roundTopLeft: true, roundTopRight: true, roundBottomLeft: true, roundBottomRight: true, radius: 4); - ChartStyle.TextStyle textStyle = ChartStyle.TextStyle(); + ChartTextStyle.TextStyle textStyle = ChartTextStyle.TextStyle(); textStyle.color = Color.fromHex(code: ToolTipMgr.pointColor ?? '#505A5F'); textStyle.fontSize = 12; canvas.drawText( - ChartText.TextElement('₹ ${ToolTipMgr.xAxis}', style: textStyle), + ChartTextElement.TextElement('₹ ${ToolTipMgr.xAxis}', style: textStyle), (bounds.left - bounds.width ).round(), -10); } diff --git a/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue.dart b/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue.dart index f8231f54c..01bad0e16 100644 --- a/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue.dart +++ b/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue.dart @@ -1,9 +1,9 @@ -import 'package:charts_flutter/flutter.dart'; +import 'package:community_charts_flutter/community_charts_flutter.dart'; import 'package:mgramseva/model/dashboard/revenue_dashboard.dart'; import 'package:mgramseva/model/dashboard/revenue_chart.dart'; -import 'package:charts_flutter/flutter.dart' as charts; +import 'package:community_charts_flutter/community_charts_flutter.dart' as charts; import 'package:mgramseva/utils/models.dart'; class RevenueDataHolder { diff --git a/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue_charts.dart b/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue_charts.dart index 2ba826eac..10bc4fbd3 100644 --- a/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue_charts.dart +++ b/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue_charts.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:charts_flutter/flutter.dart' as charts; +import 'package:community_charts_flutter/community_charts_flutter.dart' as charts; import 'package:mgramseva/providers/revenue_dashboard_provider.dart'; import 'package:mgramseva/utils/localization/application_localizations.dart'; import 'package:mgramseva/utils/common_widgets.dart'; diff --git a/frontend/mgramseva/lib/screeens/expense/expense_results.dart b/frontend/mgramseva/lib/screeens/expense/expense_results.dart index ecbcabdc6..6a13b8fdb 100644 --- a/frontend/mgramseva/lib/screeens/expense/expense_results.dart +++ b/frontend/mgramseva/lib/screeens/expense/expense_results.dart @@ -22,7 +22,7 @@ class ExpenseResults extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), diff --git a/frontend/mgramseva/lib/screeens/expense/search_expense.dart b/frontend/mgramseva/lib/screeens/expense/search_expense.dart index f7cc46c0f..046fbeff9 100644 --- a/frontend/mgramseva/lib/screeens/expense/search_expense.dart +++ b/frontend/mgramseva/lib/screeens/expense/search_expense.dart @@ -45,7 +45,7 @@ class _SearchExpenseState extends State { @override Widget build(BuildContext context) { return KeyboardFocusWatcher(child:Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), @@ -87,7 +87,9 @@ class _SearchExpenseState extends State { hint: '${ApplicationLocalizations.of(context).translate(i18.common.ELECTRICITY_HINT)}', controller: expenseTypeCtrl, - key: Keys.expense.SEARCH_EXPENSE_TYPE, + key: Keys.expense.SEARCH_EXPENSE_TYPE, itemAsString: (i) =>'${ApplicationLocalizations.of(context) + .translate( + i.toString())}', ); } , diff --git a/frontend/mgramseva/lib/screeens/feedback/feed_back.dart b/frontend/mgramseva/lib/screeens/feedback/feed_back.dart index 37ecdffe6..572e816b5 100644 --- a/frontend/mgramseva/lib/screeens/feedback/feed_back.dart +++ b/frontend/mgramseva/lib/screeens/feedback/feed_back.dart @@ -52,7 +52,7 @@ class _PaymentFeedBackState extends State { Widget build(BuildContext context) { return FocusWatcher( child: Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: AppBar( title: Text('mGramSeva'), automaticallyImplyLeading: false, diff --git a/frontend/mgramseva/lib/screeens/generate_bill/generate_bill.dart b/frontend/mgramseva/lib/screeens/generate_bill/generate_bill.dart index bd4e35fec..89e13efb6 100644 --- a/frontend/mgramseva/lib/screeens/generate_bill/generate_bill.dart +++ b/frontend/mgramseva/lib/screeens/generate_bill/generate_bill.dart @@ -22,6 +22,8 @@ import 'package:mgramseva/widgets/text_field_builder.dart'; import 'package:mgramseva/widgets/footer.dart'; import 'package:provider/provider.dart'; +import '../../utils/localization/application_localizations.dart'; + class GenerateBill extends StatefulWidget { final String? id; final WaterConnection? waterconnection; @@ -96,8 +98,8 @@ class _GenerateBillState extends State { billgenerationprovider .getServiceCategoryList(), true, + itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i.toString())}", readOnly: true, - isEnabled: false, controller: billgenerationprovider .billGenerateDetails .serviceCategoryCtrl, @@ -118,8 +120,8 @@ class _GenerateBillState extends State { billgenerationprovider .getConnectionTypeList(), true, + itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i.toString())}", readOnly: true, - isEnabled: false, controller: billgenerationprovider .billGenerateDetails @@ -150,8 +152,8 @@ class _GenerateBillState extends State { billgenerationprovider .getPropertyTypeList(), true, + itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i.toString())}", readOnly: true, - isEnabled: false, controller: billgenerationprovider .billGenerateDetails .propertyTypeCtrl)), @@ -262,6 +264,7 @@ class _GenerateBillState extends State { billgenerationprovider .getFinancialYearList(), true, + itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i.financialYear)}", controller: billgenerationprovider .billGenerateDetails .billingyearCtrl, @@ -276,8 +279,7 @@ class _GenerateBillState extends State { i18.demandGenerate .BILLING_CYCLE_LABEL, billgenerationprovider - .billGenerateDetails - .billCycle, + .selectedBillCycle, '', '', billgenerationprovider @@ -285,6 +287,7 @@ class _GenerateBillState extends State { billgenerationprovider .getBillingCycle(), true, + itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i['name'])}", controller: billgenerationprovider .billGenerateDetails .billingcycleCtrl, @@ -301,7 +304,7 @@ class _GenerateBillState extends State { Provider.of(context, listen: false); return KeyboardFocusWatcher( child: Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: BaseAppBar( Text(i18.common.MGRAM_SEVA), AppBar(), diff --git a/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_boundary_detail_card.dart b/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_boundary_detail_card.dart index 0da24079b..8682d3aa0 100644 --- a/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_boundary_detail_card.dart +++ b/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_boundary_detail_card.dart @@ -9,7 +9,6 @@ import 'package:provider/provider.dart'; import '../../utils/localization/application_localizations.dart'; import '../../utils/common_widgets.dart'; import '../../utils/loaders.dart'; -import '../../utils/notifiers.dart'; import '../../widgets/label_text.dart'; import 'gpwsc_card.dart'; diff --git a/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_rate_card.dart b/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_rate_card.dart index dc1360066..defa16463 100644 --- a/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_rate_card.dart +++ b/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_rate_card.dart @@ -93,8 +93,7 @@ class GPWSCRateCard extends StatelessWidget { wcBillingSlabs.wCBillingSlabs ?.where( (element) => element.connectionType?.compareTo("Metered") == 0) - .forEach((e) => { - e.slabs?.forEach((slabs) => rows.add(DataRow(cells: [ + .forEach((e) => e.slabs?.forEach((slabs) => rows.add(DataRow(cells: [ DataCell(Text( "${ApplicationLocalizations.of(context).translate(i18.common.WATER_CHARGES)}-10101")), DataCell(Text( @@ -104,7 +103,7 @@ class GPWSCRateCard extends StatelessWidget { "${ApplicationLocalizations.of(context).translate("${e.buildingType}")}")), DataCell(Text("${slabs.charge}")) ]))) - }); + ); return rows; } diff --git a/frontend/mgramseva/lib/screeens/home/home.dart b/frontend/mgramseva/lib/screeens/home/home.dart index 4f86e8b3d..456266158 100644 --- a/frontend/mgramseva/lib/screeens/home/home.dart +++ b/frontend/mgramseva/lib/screeens/home/home.dart @@ -80,7 +80,7 @@ class _HomeState extends State { var languageProvider = Provider.of(context, listen: false); return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), diff --git a/frontend/mgramseva/lib/screeens/home/home_walk_through/home_walk_through_container.dart b/frontend/mgramseva/lib/screeens/home/home_walk_through/home_walk_through_container.dart index de4f39976..d4dc2126a 100644 --- a/frontend/mgramseva/lib/screeens/home/home_walk_through/home_walk_through_container.dart +++ b/frontend/mgramseva/lib/screeens/home/home_walk_through/home_walk_through_container.dart @@ -81,11 +81,11 @@ class _HomeWalkThroughContainerState extends State { ))))), Consumer(builder: (_, notificationProvider, child) => Positioned( - left: position.dx + 5, + left: position.dx + 3.7, top: notificationProvider.enableNotification == true ? box.size.height + position.dy : (homeProvider.activeIndex == 6 || homeProvider.activeIndex == 7 || homeProvider.activeIndex == 8) - ? position.dy - 25 + ? position.dy - 15 : box.size.height + position.dy, child: CustomPaint( painter: TrianglePainter( @@ -94,8 +94,8 @@ class _HomeWalkThroughContainerState extends State { paintingStyle: PaintingStyle.fill, ), child: Container( - height: 30, - width: 30, + height: 20, + width: 20, ), ))), Consumer(builder: (_, notificationProvider, child) => @@ -103,13 +103,13 @@ class _HomeWalkThroughContainerState extends State { left: ((homeProvider.activeIndex + 1) % 3 == 0) ? position.dx - 140 : position.dx, - top: notificationProvider.enableNotification == true ? box.size.height + position.dy + 25 : (homeProvider.activeIndex == 6 || + top: notificationProvider.enableNotification == true ? box.size.height + position.dy + 15 : (homeProvider.activeIndex == 6 || homeProvider.activeIndex == 7 || homeProvider.activeIndex == 8) ? position.dy - box.size.height - (MediaQuery.of(context).size.width > 720 ? 55 : 25) - : box.size.height + position.dy + 25, + : box.size.height + position.dy + 15, child: Container( width: MediaQuery.of(context).size.width > 720 ? MediaQuery.of(context).size.width / 3 @@ -118,6 +118,9 @@ class _HomeWalkThroughContainerState extends State { alignment: Alignment.centerRight, padding: EdgeInsets.only(right: 15), child: Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.only(topLeft:((homeProvider.activeIndex + 1) % 3 == 0)?Radius.circular(10):Radius.circular(0),topRight:Radius.circular(10),bottomLeft: Radius.circular(10),bottomRight: Radius.circular(10)), + ), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/frontend/mgramseva/lib/screeens/household_detail/household_detail.dart b/frontend/mgramseva/lib/screeens/household_detail/household_detail.dart index 6f6d510c0..623505356 100644 --- a/frontend/mgramseva/lib/screeens/household_detail/household_detail.dart +++ b/frontend/mgramseva/lib/screeens/household_detail/household_detail.dart @@ -91,7 +91,7 @@ class _HouseholdDetailState extends State { var houseHoldProvider = Provider.of(context, listen: false); return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), diff --git a/frontend/mgramseva/lib/screeens/household_register/household_list.dart b/frontend/mgramseva/lib/screeens/household_register/household_list.dart index afb96c25a..148583319 100644 --- a/frontend/mgramseva/lib/screeens/household_register/household_list.dart +++ b/frontend/mgramseva/lib/screeens/household_register/household_list.dart @@ -58,7 +58,7 @@ class _HouseholdListState extends State { constraints.maxWidth < 760 ? 115.0 : (constraints.maxWidth / 6); var tableData = householdProvider .getCollectionsData(expenseList as List); - return tableData == null || tableData.isEmpty + return tableData.isEmpty ? CommonWidgets.buildEmptyMessage( ApplicationLocalizations.of(context) .translate(i18.dashboard.NO_RECORDS_MSG), diff --git a/frontend/mgramseva/lib/screeens/login/login.dart b/frontend/mgramseva/lib/screeens/login/login.dart index 85ea80595..6c6be1b92 100644 --- a/frontend/mgramseva/lib/screeens/login/login.dart +++ b/frontend/mgramseva/lib/screeens/login/login.dart @@ -131,6 +131,7 @@ class _LoginState extends State { ))), ), RichText( + maxLines: 3, text: TextSpan( children: [ TextSpan( diff --git a/frontend/mgramseva/lib/screeens/notifications/notification_screen.dart b/frontend/mgramseva/lib/screeens/notifications/notification_screen.dart index 7e6e71979..6117e7f72 100644 --- a/frontend/mgramseva/lib/screeens/notifications/notification_screen.dart +++ b/frontend/mgramseva/lib/screeens/notifications/notification_screen.dart @@ -44,7 +44,7 @@ class _NotificationScreen extends State { ..notifications.clear() ..getNotifications(notificationProvider.offset, notificationProvider.limit); } - catch (e, s) { + catch (e) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e); } } diff --git a/frontend/mgramseva/lib/screeens/password_success/password_success.dart b/frontend/mgramseva/lib/screeens/password_success/password_success.dart index 416cebbb9..4638be568 100644 --- a/frontend/mgramseva/lib/screeens/password_success/password_success.dart +++ b/frontend/mgramseva/lib/screeens/password_success/password_success.dart @@ -1,4 +1,3 @@ -import 'package:mgramseva/providers/common_provider.dart'; import 'package:mgramseva/routers/routers.dart'; import 'package:mgramseva/utils/constants/i18_key_constants.dart'; import 'package:mgramseva/utils/localization/application_localizations.dart'; @@ -8,7 +7,6 @@ import 'package:mgramseva/widgets/logo.dart'; import 'package:mgramseva/widgets/mobile_view.dart'; import 'package:mgramseva/widgets/success_page.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class PasswordSuccess extends StatefulWidget { State createState() { diff --git a/frontend/mgramseva/lib/screeens/privacy_and_terms/PrivacyAndTerms.dart b/frontend/mgramseva/lib/screeens/privacy_and_terms/PrivacyAndTerms.dart index 1517b4fec..c0b6c82ac 100644 --- a/frontend/mgramseva/lib/screeens/privacy_and_terms/PrivacyAndTerms.dart +++ b/frontend/mgramseva/lib/screeens/privacy_and_terms/PrivacyAndTerms.dart @@ -22,8 +22,11 @@ class _PrivacyAndTermsState extends State { var languageProvider = Provider.of(context, listen: false); return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: AppBar( + iconTheme: IconThemeData( + color: Colors.white, //change your color here + ), titleSpacing: 0, centerTitle: true, automaticallyImplyLeading: widget.showLeading, diff --git a/frontend/mgramseva/lib/screeens/profile/edit_profile.dart b/frontend/mgramseva/lib/screeens/profile/edit_profile.dart index 92002024d..55ff220e6 100644 --- a/frontend/mgramseva/lib/screeens/profile/edit_profile.dart +++ b/frontend/mgramseva/lib/screeens/profile/edit_profile.dart @@ -136,7 +136,7 @@ class _EditProfileState extends State { var userProvider = Provider.of(context, listen: false); return FocusWatcher(child: Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: BaseAppBar( Text(i18.common.MGRAM_SEVA), AppBar(), diff --git a/frontend/mgramseva/lib/screeens/reports/bill_report.dart b/frontend/mgramseva/lib/screeens/reports/bill_report.dart index fe83f5a16..f3f202f49 100644 --- a/frontend/mgramseva/lib/screeens/reports/bill_report.dart +++ b/frontend/mgramseva/lib/screeens/reports/bill_report.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../../model/common/BillsTableData.dart'; import '../../providers/reports_provider.dart'; import '../../utils/localization/application_localizations.dart'; @@ -10,7 +9,6 @@ import 'package:mgramseva/utils/constants/i18_key_constants.dart'; import '../../utils/notifiers.dart'; import '../../utils/testing_keys/testing_keys.dart'; import '../../widgets/button.dart'; -import 'generic_report_table.dart'; class BillReport extends StatefulWidget { final Function onViewClick; diff --git a/frontend/mgramseva/lib/screeens/reports/collection_report.dart b/frontend/mgramseva/lib/screeens/reports/collection_report.dart index d6e228832..dbae58d3c 100644 --- a/frontend/mgramseva/lib/screeens/reports/collection_report.dart +++ b/frontend/mgramseva/lib/screeens/reports/collection_report.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:mgramseva/model/common/BillsTableData.dart'; import 'package:provider/provider.dart'; import '../../providers/reports_provider.dart'; @@ -10,7 +9,6 @@ import 'package:mgramseva/utils/constants/i18_key_constants.dart'; import '../../utils/notifiers.dart'; import '../../utils/testing_keys/testing_keys.dart'; import '../../widgets/button.dart'; -import 'generic_report_table.dart'; class CollectionReport extends StatefulWidget { final Function onViewClick; diff --git a/frontend/mgramseva/lib/screeens/reports/generic_report_table.dart b/frontend/mgramseva/lib/screeens/reports/generic_report_table.dart index fb060d743..d1f502591 100644 --- a/frontend/mgramseva/lib/screeens/reports/generic_report_table.dart +++ b/frontend/mgramseva/lib/screeens/reports/generic_report_table.dart @@ -1,10 +1,7 @@ import 'package:flutter/material.dart'; import 'package:mgramseva/components/dashboard/bills_table.dart'; -import 'package:provider/provider.dart'; import '../../model/common/BillsTableData.dart'; -import '../../providers/reports_provider.dart'; -import '../../utils/common_widgets.dart'; import '../../utils/localization/application_localizations.dart'; import 'package:mgramseva/utils/constants/i18_key_constants.dart'; diff --git a/frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart b/frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart index f5ee4fa51..bce975982 100644 --- a/frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart +++ b/frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:mgramseva/model/common/BillsTableData.dart'; import 'package:provider/provider.dart'; import '../../providers/reports_provider.dart'; @@ -10,7 +9,6 @@ import 'package:mgramseva/utils/constants/i18_key_constants.dart'; import '../../utils/notifiers.dart'; import '../../utils/testing_keys/testing_keys.dart'; import '../../widgets/button.dart'; -import 'generic_report_table.dart'; class InactiveConsumerReport extends StatefulWidget { final Function onViewClick; diff --git a/frontend/mgramseva/lib/screeens/reports/reports.dart b/frontend/mgramseva/lib/screeens/reports/reports.dart index 8f00250ed..95fe976a2 100644 --- a/frontend/mgramseva/lib/screeens/reports/reports.dart +++ b/frontend/mgramseva/lib/screeens/reports/reports.dart @@ -17,7 +17,6 @@ import '../../widgets/select_field_builder.dart'; import '../../widgets/side_bar.dart'; import 'bill_report.dart'; import 'collection_report.dart'; -import 'generic_report_table.dart'; class Reports extends StatefulWidget { const Reports({Key? key}) : super(key: key); @@ -166,12 +165,13 @@ class _Reports extends State with SingleTickerProviderStateMixin { reportProvider .getFinancialYearListDropdown( reportProvider - .languageList), + .billingYearList), true, + readOnly: false, controller: reportProvider .billingyearCtrl, key: Keys.billReport - .BILL_REPORT_BILLING_YEAR, + .BILL_REPORT_BILLING_YEAR, itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i.financialYear)}", ), SelectFieldBuilder( i18.demandGenerate @@ -187,10 +187,11 @@ class _Reports extends State with SingleTickerProviderStateMixin { reportProvider .selectedBillYear), true, + readOnly: false, controller: reportProvider .billingcycleCtrl, key: Keys.billReport - .BILL_REPORT_BILLING_CYCLE, + .BILL_REPORT_BILLING_CYCLE, itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i['name'])}", ), ], ), diff --git a/frontend/mgramseva/lib/screeens/reports/view_table.dart b/frontend/mgramseva/lib/screeens/reports/view_table.dart index 457e78eed..ac837027b 100644 --- a/frontend/mgramseva/lib/screeens/reports/view_table.dart +++ b/frontend/mgramseva/lib/screeens/reports/view_table.dart @@ -1,7 +1,5 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:mgramseva/utils/constants/i18_key_constants.dart'; import '../../providers/reports_provider.dart'; import '../../utils/constants.dart'; import '../../utils/date_formats.dart'; diff --git a/frontend/mgramseva/lib/screeens/reset_password/reset_password.dart b/frontend/mgramseva/lib/screeens/reset_password/reset_password.dart index 9a9b8eaa0..cee5a42d5 100644 --- a/frontend/mgramseva/lib/screeens/reset_password/reset_password.dart +++ b/frontend/mgramseva/lib/screeens/reset_password/reset_password.dart @@ -298,14 +298,12 @@ class _ResetPasswordState extends State { var resetResponse = await ResetPasswordRepository().forgotPassword(body, context); Navigator.pop(context); - if (resetResponse != null) { - Navigator.push( - context, - MaterialPageRoute( - builder: (_) => PasswordSuccess(), - settings: RouteSettings(name: '/resetPasswordSuccess'))); - } - } catch (e, s) { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => PasswordSuccess(), + settings: RouteSettings(name: '/resetPasswordSuccess'))); + } catch (e, s) { Navigator.pop(context); ErrorHandler().allExceptionsHandler(context, e, s); } diff --git a/frontend/mgramseva/lib/screeens/select_language/language_selection_desktop_view.dart b/frontend/mgramseva/lib/screeens/select_language/language_selection_desktop_view.dart index 35fede434..99ebab331 100644 --- a/frontend/mgramseva/lib/screeens/select_language/language_selection_desktop_view.dart +++ b/frontend/mgramseva/lib/screeens/select_language/language_selection_desktop_view.dart @@ -8,9 +8,7 @@ import 'package:mgramseva/widgets/background_container.dart'; import 'package:mgramseva/widgets/button.dart'; import 'package:mgramseva/widgets/language_card.dart'; import 'package:mgramseva/widgets/footer_banner.dart'; -import 'package:provider/provider.dart'; -import '../../providers/language.dart'; class LanguageSelectionDesktopView extends StatelessWidget { final StateInfo stateInfo; diff --git a/frontend/mgramseva/lib/theme.dart b/frontend/mgramseva/lib/theme.dart index af06d0cc3..eb312864f 100644 --- a/frontend/mgramseva/lib/theme.dart +++ b/frontend/mgramseva/lib/theme.dart @@ -2,13 +2,19 @@ import 'package:flutter/material.dart'; import 'package:mgramseva/utils/color_codes.dart'; ThemeData get theme => ThemeData( - primarySwatch: createMaterialColor(Color(0XFFf47738)), highlightColor: createMaterialColor(Color(0XFFC7E0F1)), - backgroundColor: createMaterialColor(Color.fromRGBO(238, 238, 238, 1)), hintColor: createMaterialColor(Color(0XFF3498DB)), primaryColorDark: Color.fromRGBO(11, 12, 12, 1), primaryColorLight: Color.fromRGBO(80, 90, 95, 1), + primaryColor: Color.fromRGBO(244, 119, 56, 1), disabledColor: Colors.grey, + cardTheme: CardTheme(surfaceTintColor: Colors.white), + datePickerTheme: DatePickerThemeData( + surfaceTintColor: Colors.white + ), + drawerTheme: DrawerThemeData( + surfaceTintColor: Colors.white + ), // accentColor: Color(0xff0B4B66), appBarTheme: AppBarTheme( @@ -16,15 +22,17 @@ ThemeData get theme => ThemeData( centerTitle: false, ), textTheme: TextTheme( - headline1: TextStyle(fontWeight: FontWeight.w700, fontSize: 32, fontStyle: FontStyle.normal, color: Color.fromRGBO(11, 12, 12, 1)), - headline2: TextStyle(fontWeight: FontWeight.w700, fontSize: 24), - button: TextStyle(fontWeight: FontWeight.w500, fontSize: 19, color: Colors.white), // Elevated Button(Orange) - subtitle1: TextStyle(fontWeight: FontWeight.w400, fontSize: 16), - subtitle2: TextStyle(fontWeight: FontWeight.w400, fontSize: 16, color: Color.fromRGBO(244, 119, 56, 1)) // Only for outlined button text + displayLarge: TextStyle(fontWeight: FontWeight.w700, fontSize: 32, fontStyle: FontStyle.normal, color: Color.fromRGBO(11, 12, 12, 1)), + displayMedium: TextStyle(fontWeight: FontWeight.w700, fontSize: 24), + labelLarge: TextStyle(fontWeight: FontWeight.w500, fontSize: 19, color: Colors.white), // Elevated Button(Orange) + labelMedium: TextStyle(fontWeight: FontWeight.w500, fontSize: 14, color: Colors.white), // Elevated Button(Orange) + labelSmall: TextStyle(fontWeight: FontWeight.w500, fontSize: 10, color: Colors.white), // Elevated Button(Orange) + titleMedium: TextStyle(fontWeight: FontWeight.w400, fontSize: 16), + titleSmall: TextStyle(fontWeight: FontWeight.w400, fontSize: 16, color: Color.fromRGBO(244, 119, 56, 1)) // Only for outlined button text ), /// Background color - // scaffoldBackgroundColor: Color.fromRGBO(238, 238, 238, 1), + scaffoldBackgroundColor: Color.fromRGBO(238, 238, 238, 1), textButtonTheme: TextButtonThemeData( style: TextButton.styleFrom( @@ -67,7 +75,7 @@ ThemeData get theme => ThemeData( iconTheme: IconThemeData( color: ColorCodes.HOME_ICON, // size: 25 - )); + ), colorScheme: ColorScheme.fromSwatch(primarySwatch: createMaterialColor(Color(0XFFf47738))).copyWith(background: createMaterialColor(Color.fromRGBO(238, 238, 238, 1)))); MaterialColor createMaterialColor(Color color) { List strengths = [.05]; diff --git a/frontend/mgramseva/lib/utils/common_printer.dart b/frontend/mgramseva/lib/utils/common_printer.dart deleted file mode 100644 index 683814357..000000000 --- a/frontend/mgramseva/lib/utils/common_printer.dart +++ /dev/null @@ -1,103 +0,0 @@ -import 'package:bluetooth_thermal_printer/bluetooth_thermal_printer.dart'; -import 'package:esc_pos_utils/esc_pos_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:mgramseva/utils/constants/i18_key_constants.dart'; - -import 'localization/application_localizations.dart'; -import 'global_variables.dart'; - -class CommonPrinter { - static bool connected = false; - - static setConnect(String mac, value, context) async { - if (connected) { - CommonPrinter.printTicket(value, context); - Navigator.of(context).pop(); - } else { - final String? result = await BluetoothThermalPrinter.connect(mac); - - print("state conneected $result"); - if (result == "true") { - connected = true; - CommonPrinter.printTicket(value, context); - Navigator.of(context).pop(); - } - } - } - - static Future showMyDialog(context, value) async { - connected = false; - Widget setupAlertDialoadContainer(availableBluetoothDevices, context) { - return Container( - height: 300.0, // Change as per your requirement - width: 300.0, - child: ListView.builder( - shrinkWrap: true, - itemCount: availableBluetoothDevices.length > 0 - ? availableBluetoothDevices.length - : 0, - itemBuilder: (context, index) { - return ListTile( - onTap: () { - String select = availableBluetoothDevices[index]; - List list = select.split("#"); - // String name = list[0]; - String mac = list[1]; - setConnect(mac, value, context); - }, - title: Text('${availableBluetoothDevices[index]}'), - subtitle: Text("Click to connect"), - ); - }, - ), - ); - } - - final List? availableBluetoothDevices = - await BluetoothThermalPrinter.getBluetooths; - return showDialog( - context: context, - barrierDismissible: false, // user must tap button! - builder: (BuildContext context) { - return AlertDialog( - title: const Text('Connect to Device'), - content: - setupAlertDialoadContainer(availableBluetoothDevices, context), - actions: [ - TextButton( - child: const Text('Close'), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], - ); - }, - ); - } - - static Future printTicket(value, context) async { - String? isConnected = await BluetoothThermalPrinter.connectionStatus; - print(isConnected); - if (isConnected == "true") { - List bytes = await getTicket(value); - final result = await BluetoothThermalPrinter.writeBytes(bytes); - print("Print $result"); - } else { - CommonPrinter.showMyDialog(context, value); - print("connction not established"); - } - } - - static Future> getTicket(value) async { - print(value); - List bytes = []; - CapabilityProfile profile = await CapabilityProfile.load(); - final generator = Generator(PaperSize.mm80, profile); - bytes += generator.image(value); - - // ticket.feed(2); - bytes += generator.cut(); - return bytes; - } -} diff --git a/frontend/mgramseva/lib/utils/common_widgets.dart b/frontend/mgramseva/lib/utils/common_widgets.dart index e6bc0b09f..5032db618 100644 --- a/frontend/mgramseva/lib/utils/common_widgets.dart +++ b/frontend/mgramseva/lib/utils/common_widgets.dart @@ -17,7 +17,7 @@ class CommonWidgets { static Widget buildEmptyMessage(String label, BuildContext context) { return Container( alignment: Alignment.center, - child: Text('${ApplicationLocalizations.of(context).translate(label)}', style: Theme.of(context).textTheme.subtitle1), + child: Text('${ApplicationLocalizations.of(context).translate(label)}', style: Theme.of(context).textTheme.titleMedium), ); } } \ No newline at end of file diff --git a/frontend/mgramseva/lib/utils/date_formats.dart b/frontend/mgramseva/lib/utils/date_formats.dart index 41fae3fbf..7007c13b1 100644 --- a/frontend/mgramseva/lib/utils/date_formats.dart +++ b/frontend/mgramseva/lib/utils/date_formats.dart @@ -9,21 +9,21 @@ import 'models.dart'; class DateFormats { static getFilteredDate(String date, {String? dateFormat}) { - if (date == null || date.trim().isEmpty) return ''; + if (date.trim().isEmpty) return ''; try { var dateTime = DateTime.parse(date).toLocal(); return DateFormat(dateFormat ?? "dd-MM-yyyy").format(dateTime); - } on Exception catch (e) { + } on Exception { return ''; } } static DateTime? getDateFromString(String date) { - if (date == null || date.trim().isEmpty) return null; + if (date.trim().isEmpty) return null; try { var dateTime = DateTime.parse(date).toLocal(); return dateTime; - } on Exception catch (e) { + } on Exception { return null; } } @@ -38,17 +38,17 @@ class DateFormats { } var inputDate = inputFormat.parse(date); return inputDate; - } on Exception catch (e) { + } on Exception { return null; } } static String getTime(String date) { - if (date == null || date.trim().isEmpty) return ''; + if (date.trim().isEmpty) return ''; try { var dateTime = getDateFromString(date); return DateFormat.Hms().format(dateTime!); - } on Exception catch (e, stackTrace) { + } on Exception { return ''; } } @@ -57,7 +57,7 @@ class DateFormats { try { var dateTime = getDateFromString(date); return DateFormat.jm().format(dateTime!); - } on Exception catch (e, stackTrace) { + } on Exception { return ''; } } diff --git a/frontend/mgramseva/lib/utils/excel_download/save_file_mobile.dart b/frontend/mgramseva/lib/utils/excel_download/save_file_mobile.dart index c7ddbff8b..72954f956 100644 --- a/frontend/mgramseva/lib/utils/excel_download/save_file_mobile.dart +++ b/frontend/mgramseva/lib/utils/excel_download/save_file_mobile.dart @@ -1,9 +1,11 @@ import 'dart:io'; -import 'package:open_file/open_file.dart' as open_file; +import 'package:flutter/foundation.dart'; +import 'package:open_filex/open_filex.dart' as open_file; import 'package:path_provider/path_provider.dart' as path_provider; // ignore: depend_on_referenced_packages import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; +import 'save_file_web.dart' as sfw; ///To save the Excel file in the device ///To save the Excel file in the device @@ -25,7 +27,7 @@ Future saveAndLaunchFile(List bytes, String fileName) async { await file.writeAsBytes(bytes, flush: true); if (Platform.isAndroid || Platform.isIOS) { //Launch the file (used open_file package) - await open_file.OpenFile.open('$path/$fileName'); + await open_file.OpenFilex.open('$path/$fileName'); } else if (Platform.isWindows) { await Process.run('start', ['$path\\$fileName'], runInShell: true); } else if (Platform.isMacOS) { @@ -33,5 +35,7 @@ Future saveAndLaunchFile(List bytes, String fileName) async { } else if (Platform.isLinux) { await Process.run('xdg-open', ['$path/$fileName'], runInShell: true); + }else if (kIsWeb){ + sfw.saveAndLaunchFile(bytes,fileName); } } diff --git a/frontend/mgramseva/lib/utils/excel_download/save_file_web.dart b/frontend/mgramseva/lib/utils/excel_download/save_file_web.dart index 08f09f2d3..5503dcff0 100644 --- a/frontend/mgramseva/lib/utils/excel_download/save_file_web.dart +++ b/frontend/mgramseva/lib/utils/excel_download/save_file_web.dart @@ -1,12 +1,12 @@ import 'dart:async'; import 'dart:convert'; // ignore: avoid_web_libraries_in_flutter -import 'dart:html'; +import 'package:universal_html/html.dart' as htmlk; ///To save the Excel file in the device ///To save the Excel file in the device Future saveAndLaunchFile(List bytes, String fileName) async { - AnchorElement( + htmlk.AnchorElement( href: 'data:application/octet-stream;charset=utf-16le;base64,${base64.encode(bytes)}') ..setAttribute('download', fileName) diff --git a/frontend/mgramseva/lib/utils/loaders.dart b/frontend/mgramseva/lib/utils/loaders.dart index 242314651..a4dce80bf 100644 --- a/frontend/mgramseva/lib/utils/loaders.dart +++ b/frontend/mgramseva/lib/utils/loaders.dart @@ -34,7 +34,7 @@ class Loaders { // controller: AnimationController(vsync: this, duration: const Duration(milliseconds: 1200)), // ), CircularProgressIndicator( - color: Theme.of(context).accentColor, + color: Theme.of(context).primaryColor, ), const SizedBox( height: 10, diff --git a/frontend/mgramseva/lib/utils/localization/application_localizations.dart b/frontend/mgramseva/lib/utils/localization/application_localizations.dart index a83fe129f..922961f06 100644 --- a/frontend/mgramseva/lib/utils/localization/application_localizations.dart +++ b/frontend/mgramseva/lib/utils/localization/application_localizations.dart @@ -1,6 +1,4 @@ import 'dart:async'; -import 'dart:convert'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:mgramseva/model/localization/localization_label.dart'; import 'package:mgramseva/providers/common_provider.dart'; diff --git a/frontend/mgramseva/lib/utils/notifiers.dart b/frontend/mgramseva/lib/utils/notifiers.dart index f37b7a3b9..a7771eba3 100644 --- a/frontend/mgramseva/lib/utils/notifiers.dart +++ b/frontend/mgramseva/lib/utils/notifiers.dart @@ -20,6 +20,9 @@ class Notifiers { Padding( padding: EdgeInsets.all(12.0), child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Color.fromRGBO(244, 119, 56, 0.7) + ), onPressed: callBack, child: Text( 'Retry', diff --git a/frontend/mgramseva/lib/utils/print_bluetooth.dart b/frontend/mgramseva/lib/utils/print_bluetooth.dart deleted file mode 100644 index 24678fed5..000000000 --- a/frontend/mgramseva/lib/utils/print_bluetooth.dart +++ /dev/null @@ -1,109 +0,0 @@ -import 'package:esc_pos_utils/esc_pos_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:mgramseva/utils/constants/i18_key_constants.dart'; -import 'package:nearby_connections/nearby_connections.dart'; -import 'package:print_bluetooth_thermal/print_bluetooth_thermal.dart'; - -import 'localization/application_localizations.dart'; - -class PrintBluetooth { - static bool connected = false; - - static setConnect(String mac, value, context) async { - if (connected) { - PrintBluetooth.printTicket(value, context); - Navigator.of(context).pop(); - } else { - final result = - await PrintBluetoothThermal.connect(macPrinterAddress: mac); - - if (result) { - connected = true; - PrintBluetooth.printTicket(value, context); - Navigator.of(context).pop(); - } - } - } - - static Future showMyDialog(context, value) async { - connected = false; - Widget setupAlertDialogContainer( - List availableBluetoothDevices, context) { - return Container( - height: 300.0, // Change as per your requirement - width: 300.0, - child: ListView.builder( - shrinkWrap: true, - itemCount: availableBluetoothDevices.length > 0 - ? availableBluetoothDevices.length - : 0, - itemBuilder: (context, index) { - return ListTile( - onTap: () { - String select = availableBluetoothDevices[index].macAdress; - setConnect(select, value, context); - }, - title: Text('${availableBluetoothDevices[index].name}'), - subtitle: Text(ApplicationLocalizations.of(context) - .translate(i18.consumerReciepts.CLICK_TO_CONNECT)), - ); - }, - ), - ); - } - - final List availableBluetoothDevices = - await PrintBluetoothThermal.pairedBluetooths; - return showDialog( - context: context, - barrierDismissible: false, // user must tap button! - builder: (BuildContext context) { - return AlertDialog( - title: Text(ApplicationLocalizations.of(context) - .translate(i18.consumerReciepts.CONNECT_TO_DEVICE)), - content: - setupAlertDialogContainer(availableBluetoothDevices, context), - actions: [ - TextButton( - child: Text(ApplicationLocalizations.of(context) - .translate(i18.consumerReciepts.CLOSE)), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], - ); - }, - ); - } - - static Future printTicket(value, context) async { - bool? isPermissionGranted = - await PrintBluetoothThermal.isPermissionBluetoothGranted; - print(isPermissionGranted); - if (!isPermissionGranted) { - Nearby().askBluetoothPermission(); - } - bool? isConnected = await PrintBluetoothThermal.connectionStatus; - if (isConnected) { - List bytes = await getTicket(value); - final result = await PrintBluetoothThermal.writeBytes(bytes); - } else { - PrintBluetooth.showMyDialog(context, value); - print(ApplicationLocalizations.of(context) - .translate(i18.consumerReciepts.CONNECTION_NOT_ESTABLISHED)); - } - } - - static Future> getTicket(value) async { - print(value); - List bytes = []; - CapabilityProfile profile = await CapabilityProfile.load(); - final generator = Generator(PaperSize.mm80, profile); - bytes += generator.image(value); - - // ticket.feed(2); - bytes += generator.cut(); - return bytes; - } -} diff --git a/frontend/mgramseva/lib/utils/printer/image_utils.dart b/frontend/mgramseva/lib/utils/printer/image_utils.dart new file mode 100644 index 000000000..922981f0c --- /dev/null +++ b/frontend/mgramseva/lib/utils/printer/image_utils.dart @@ -0,0 +1,47 @@ +import 'package:image/image.dart' as img; + +/// Draw the image [src] onto the image [dst]. +/// +/// In other words, drawImage will take an rectangular area from src of +/// width [src_w] and height [src_h] at position ([src_x],[src_y]) and place it +/// in a rectangular area of [dst] of width [dst_w] and height [dst_h] at +/// position ([dst_x],[dst_y]). +/// +/// If the source and destination coordinates and width and heights differ, +/// appropriate stretching or shrinking of the image fragment will be performed. +/// The coordinates refer to the upper left corner. This function can be used to +/// copy regions within the same image (if [dst] is the same as [src]) +/// but if the regions overlap the results will be unpredictable. +img.Image drawImage(img.Image dst, img.Image src, + {int? dstX, int? dstY, int? dstW, int? dstH, int? srcX, int? srcY, int? srcW, int? srcH, bool blend = true}) { + dstX ??= 0; + dstY ??= 0; + srcX ??= 0; + srcY ??= 0; + srcW ??= src.width; + srcH ??= src.height; + dstW ??= (dst.width < src.width) ? dstW = dst.width : src.width; + dstH ??= (dst.height < src.height) ? dst.height : src.height; + + if (blend) { + for (var y = 0; y < dstH; ++y) { + for (var x = 0; x < dstW; ++x) { + final stepX = (x * (srcW / dstW)).toInt(); + final stepY = (y * (srcH / dstH)).toInt(); + final srcPixel = src.getPixel(srcX + stepX, srcY + stepY); + img.drawPixel(dst, dstX + x, dstY + y, srcPixel); + } + } + } else { + for (var y = 0; y < dstH; ++y) { + for (var x = 0; x < dstW; ++x) { + final stepX = (x * (srcW / dstW)).toInt(); + final stepY = (y * (srcH / dstH)).toInt(); + final srcPixel = src.getPixel(srcX + stepX, srcY + stepY); + dst.setPixel(dstX + x, dstY + y, srcPixel); + } + } + } + + return dst; +} diff --git a/frontend/mgramseva/lib/utils/validators/validators.dart b/frontend/mgramseva/lib/utils/validators/validators.dart index 1fb309612..dffa31df9 100644 --- a/frontend/mgramseva/lib/utils/validators/validators.dart +++ b/frontend/mgramseva/lib/utils/validators/validators.dart @@ -1,7 +1,6 @@ import 'package:mgramseva/utils/constants/i18_key_constants.dart'; import 'package:mgramseva/utils/localization/application_localizations.dart'; import 'package:mgramseva/utils/global_variables.dart'; -import 'dart:math' as math; class Validators { static validate(value, type) { diff --git a/frontend/mgramseva/lib/widgets/bluetooth_printer.dart b/frontend/mgramseva/lib/widgets/bluetooth_printer.dart new file mode 100644 index 000000000..37a76932a --- /dev/null +++ b/frontend/mgramseva/lib/widgets/bluetooth_printer.dart @@ -0,0 +1,432 @@ +import 'dart:async'; +import 'dart:developer'; +import 'dart:io'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:thermal_printer/esc_pos_utils_platform/esc_pos_utils_platform.dart'; +import 'package:thermal_printer/thermal_printer.dart'; +import 'package:image/image.dart' as img; +import '../utils/printer/image_utils.dart'; + + +class BluetoothPrinterScreen extends StatefulWidget { + final Uint8List imageData; + const BluetoothPrinterScreen({Key? key, required this.imageData}) : super(key: key); + + @override + State createState() => _BluetoothPrinterScreenState(); +} + +class _BluetoothPrinterScreenState extends State { + // Printer Type [bluetooth, usb, network] + var defaultPrinterType = PrinterType.bluetooth; + var _isBle = false; + var _reconnect = false; + var _isConnected = false; + var printerManager = PrinterManager.instance; + var devices = []; + StreamSubscription? _subscription; + StreamSubscription? _subscriptionBtStatus; + StreamSubscription? _subscriptionUsbStatus; + StreamSubscription? _subscriptionTCPStatus; + BTStatus _currentStatus = BTStatus.none; + // ignore: unused_field + TCPStatus _currentTCPStatus = TCPStatus.none; + // _currentUsbStatus is only supports on Android + // ignore: unused_field + USBStatus _currentUsbStatus = USBStatus.none; + List? pendingTask; + String _ipAddress = ''; + String _port = '9100'; + final _ipController = TextEditingController(); + final _portController = TextEditingController(); + BluetoothPrinter? selectedPrinter; + + @override + void initState() { + if (Platform.isWindows) defaultPrinterType = PrinterType.usb; + super.initState(); + _portController.text = _port; + _scan(); + + // subscription to listen change status of bluetooth connection + _subscriptionBtStatus = PrinterManager.instance.stateBluetooth.listen((status) { + log(' ----------------- status bt $status ------------------ '); + _currentStatus = status; + if (status == BTStatus.connected) { + setState(() { + _isConnected = true; + }); + } + if (status == BTStatus.none) { + setState(() { + _isConnected = false; + }); + } + if (status == BTStatus.connected && pendingTask != null) { + if (Platform.isAndroid) { + Future.delayed(const Duration(milliseconds: 1000), () { + PrinterManager.instance.send(type: PrinterType.bluetooth, bytes: pendingTask!); + pendingTask = null; + }); + } else if (Platform.isIOS) { + PrinterManager.instance.send(type: PrinterType.bluetooth, bytes: pendingTask!); + pendingTask = null; + } + } + }); + // PrinterManager.instance.stateUSB is only supports on Android + _subscriptionUsbStatus = PrinterManager.instance.stateUSB.listen((status) { + log(' ----------------- status usb $status ------------------ '); + _currentUsbStatus = status; + if (Platform.isAndroid) { + if (status == USBStatus.connected && pendingTask != null) { + Future.delayed(const Duration(milliseconds: 1000), () { + PrinterManager.instance.send(type: PrinterType.usb, bytes: pendingTask!); + pendingTask = null; + }); + } + } + }); + + // PrinterManager.instance.stateUSB is only supports on Android + _subscriptionTCPStatus = PrinterManager.instance.stateTCP.listen((status) { + log(' ----------------- status tcp $status ------------------ '); + _currentTCPStatus = status; + }); + } + + @override + void dispose() { + _subscription?.cancel(); + _subscriptionBtStatus?.cancel(); + _subscriptionUsbStatus?.cancel(); + _subscriptionTCPStatus?.cancel(); + _portController.dispose(); + _ipController.dispose(); + super.dispose(); + } + + // method to scan devices according PrinterType + void _scan() { + devices.clear(); + _subscription = printerManager.discovery(type: defaultPrinterType, isBle: _isBle).listen((device) { + devices.add(BluetoothPrinter( + deviceName: device.name, + address: device.address, + isBle: _isBle, + vendorId: device.vendorId, + productId: device.productId, + typePrinter: defaultPrinterType, + )); + setState(() {}); + }); + } + + void setPort(String value) { + if (value.isEmpty) value = '9100'; + _port = value; + var device = BluetoothPrinter( + deviceName: value, + address: _ipAddress, + port: _port, + typePrinter: PrinterType.network, + state: false, + ); + selectDevice(device); + } + + void setIpAddress(String value) { + _ipAddress = value; + var device = BluetoothPrinter( + deviceName: value, + address: _ipAddress, + port: _port, + typePrinter: PrinterType.network, + state: false, + ); + selectDevice(device); + } + + Future selectDevice(BluetoothPrinter device) async { + try{ + if (selectedPrinter != null) { + if ((device.address != selectedPrinter!.address) || (device.typePrinter == PrinterType.usb && selectedPrinter!.vendorId != device.vendorId)) { + await PrinterManager.instance.disconnect(type: selectedPrinter!.typePrinter); + } + } + + selectedPrinter = device; + setState(() {}); + return true; + }catch(e){ + return false; + } + } + + Future _printReceiveTest() async { + List bytes = []; + + // Xprinter XP-N160I + final profile = await CapabilityProfile.load(name: 'XP-N160I'); + + // PaperSize.mm80 or PaperSize.mm58 + final generator = Generator(PaperSize.mm58, profile); + bytes += generator.setGlobalCodeTable('CP1252'); + + + final Uint8List imageBytes = widget.imageData; + // decode the bytes into an image + final decodedImage = img.decodeImage(imageBytes)!; + // Create a black bottom layer + // Resize the image to a 130x? thumbnail (maintaining the aspect ratio). + img.Image thumbnail = img.copyResize(decodedImage, height: decodedImage.height); + // creates a copy of the original image with set dimensions + img.Image originalImg = img.copyResize(decodedImage, width: PaperSize.mm58.width, height: decodedImage.height); + // fills the original image with a white background + img.fill(originalImg, color: img.ColorRgb8(255, 255, 255)); + // var padding = (originalImg.width - thumbnail.width) / 2; + // + // //insert the image inside the frame and center it + drawImage(originalImg, thumbnail, dstX: 0); + // + // // convert image to grayscale + // var grayscaleImage = img.grayscale(originalImg); + + bytes += generator.feed(1); + // bytes += generator.imageRaster(img.decodeImage(imageBytes)!, align: PosAlign.center); + bytes += generator.imageRaster(originalImg, align: PosAlign.center); + bytes += generator.feed(1); + + _printEscPos(bytes, generator); + } + + /// print ticket + void _printEscPos(List bytes, Generator generator) async { + var connectedTCP = false; + if (selectedPrinter == null) return; + var bluetoothPrinter = selectedPrinter!; + + switch (bluetoothPrinter.typePrinter) { + case PrinterType.usb: + bytes += generator.feed(2); + bytes += generator.cut(); + await printerManager.connect( + type: bluetoothPrinter.typePrinter, + model: UsbPrinterInput(name: bluetoothPrinter.deviceName, productId: bluetoothPrinter.productId, vendorId: bluetoothPrinter.vendorId)); + pendingTask = null; + break; + case PrinterType.bluetooth: + bytes += generator.cut(); + await printerManager.connect( + type: bluetoothPrinter.typePrinter, + model: BluetoothPrinterInput( + name: bluetoothPrinter.deviceName, + address: bluetoothPrinter.address!, + isBle: bluetoothPrinter.isBle ?? false, + autoConnect: _reconnect)); + pendingTask = null; + if (Platform.isAndroid) pendingTask = bytes; + break; + case PrinterType.network: + bytes += generator.feed(2); + bytes += generator.cut(); + connectedTCP = await printerManager.connect(type: bluetoothPrinter.typePrinter, model: TcpPrinterInput(ipAddress: bluetoothPrinter.address!)); + if (!connectedTCP) print(' --- please review your connection ---'); + break; + default: + } + if (bluetoothPrinter.typePrinter == PrinterType.bluetooth && Platform.isAndroid) { + if (_currentStatus == BTStatus.connected) { + printerManager.send(type: bluetoothPrinter.typePrinter, bytes: bytes); + pendingTask = null; + } + } else { + printerManager.send(type: bluetoothPrinter.typePrinter, bytes: bytes); + } + } + + // conectar dispositivo + _connectDevice() async { + _isConnected = false; + if (selectedPrinter == null) return; + switch (selectedPrinter!.typePrinter) { + case PrinterType.usb: + await printerManager.connect( + type: selectedPrinter!.typePrinter, + model: UsbPrinterInput(name: selectedPrinter!.deviceName, productId: selectedPrinter!.productId, vendorId: selectedPrinter!.vendorId)); + _isConnected = true; + break; + case PrinterType.bluetooth: + await printerManager.connect( + type: selectedPrinter!.typePrinter, + model: BluetoothPrinterInput( + name: selectedPrinter!.deviceName, + address: selectedPrinter!.address!, + isBle: selectedPrinter!.isBle ?? false, + autoConnect: _reconnect)); + break; + case PrinterType.network: + await printerManager.connect(type: selectedPrinter!.typePrinter, model: TcpPrinterInput(ipAddress: selectedPrinter!.address!)); + _isConnected = true; + break; + default: + } + + setState(() {}); + } + + @override + Widget build(BuildContext context) { + return AlertDialog( + surfaceTintColor: Colors.white, + content: Container( + height: MediaQuery.of(context).size.height*0.5, + constraints: const BoxConstraints(maxWidth: 400), + child: SingleChildScrollView( + padding: EdgeInsets.zero, + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Expanded( + child: ElevatedButton( + onPressed: selectedPrinter == null || _isConnected + ? null + : () { + _connectDevice(); + }, + child: const Text("Connect", textAlign: TextAlign.center), + ), + ), + const SizedBox(width: 8), + Expanded( + child: ElevatedButton( + onPressed: selectedPrinter == null || !_isConnected + ? null + : () { + if (selectedPrinter != null) printerManager.disconnect(type: selectedPrinter!.typePrinter); + setState(() { + _isConnected = false; + }); + }, + child: const Text("Disconnect", textAlign: TextAlign.center), + ), + ), + ], + ), + ), + Column( + children: devices + .map( + (device) => ListTile( + selected: selectedPrinter != null && + ((device.typePrinter == PrinterType.usb && Platform.isWindows + ? device.deviceName == selectedPrinter!.deviceName + : device.vendorId != null && selectedPrinter!.vendorId == device.vendorId) || + (device.address != null && selectedPrinter!.address == device.address)), + selectedColor: Theme.of(context).primaryColor, + title: Text('${device.deviceName}'), + subtitle: Platform.isAndroid && defaultPrinterType == PrinterType.usb + ? null + : Visibility(visible: !Platform.isWindows, child: Text("${device.address}")), + onTap: () { + // do something + selectDevice(device).then((value) async => { + if(value==true){ + await _printReceiveTest() + } + }); + }, + leading: selectedPrinter != null && + ((device.typePrinter == PrinterType.usb && Platform.isWindows + ? device.deviceName == selectedPrinter!.deviceName + : device.vendorId != null && selectedPrinter!.vendorId == device.vendorId) || + (device.address != null && selectedPrinter!.address == device.address)) + ? const Icon( + Icons.check, + color: Colors.green, + ) + : null, + + ), + ) + .toList()), + Visibility( + visible: defaultPrinterType == PrinterType.network && Platform.isWindows, + child: Padding( + padding: const EdgeInsets.only(top: 10.0), + child: TextFormField( + controller: _ipController, + keyboardType: const TextInputType.numberWithOptions(signed: true), + decoration: const InputDecoration( + label: Text("Ip Address"), + prefixIcon: Icon(Icons.wifi, size: 24), + ), + onChanged: setIpAddress, + ), + ), + ), + Visibility( + visible: defaultPrinterType == PrinterType.network && Platform.isWindows, + child: Padding( + padding: const EdgeInsets.only(top: 10.0), + child: TextFormField( + controller: _portController, + keyboardType: const TextInputType.numberWithOptions(signed: true), + decoration: const InputDecoration( + label: Text("Port"), + prefixIcon: Icon(Icons.numbers_outlined, size: 24), + ), + onChanged: setPort, + ), + ), + ), + Visibility( + visible: defaultPrinterType == PrinterType.network && Platform.isWindows, + child: Padding( + padding: const EdgeInsets.only(top: 10.0), + child: OutlinedButton( + onPressed: () async { + if (_ipController.text.isNotEmpty) setIpAddress(_ipController.text); + _printReceiveTest(); + }, + child: const Padding( + padding: EdgeInsets.symmetric(vertical: 4, horizontal: 50), + child: Text("Print", textAlign: TextAlign.center), + ), + ), + ), + ) + ], + ), + ), + ), + ); + } +} + +class BluetoothPrinter { + int? id; + String? deviceName; + String? address; + String? port; + String? vendorId; + String? productId; + bool? isBle; + + PrinterType typePrinter; + bool? state; + + BluetoothPrinter( + {this.deviceName, + this.address, + this.port, + this.state, + this.vendorId, + this.productId, + this.typePrinter = PrinterType.bluetooth, + this.isBle = false}); +} diff --git a/frontend/mgramseva/lib/widgets/bottom_button_bar.dart b/frontend/mgramseva/lib/widgets/bottom_button_bar.dart index 65489bfa2..674756c32 100644 --- a/frontend/mgramseva/lib/widgets/bottom_button_bar.dart +++ b/frontend/mgramseva/lib/widgets/bottom_button_bar.dart @@ -45,10 +45,11 @@ class BottomButtonBar extends StatelessWidget { print(ApplicationLocalizations.of(context).translate(this.label)); return ElevatedButton( style: ElevatedButton.styleFrom( - primary: callBack != null ? Color.fromRGBO(244, 119, 56, 0.7) : Color.fromRGBO(235,235,228, 0.7) + backgroundColor: callBack != null ? Color.fromRGBO(244, 119, 56, 1) : Color.fromRGBO(235,235,228, 0.7) ), child: Text( ApplicationLocalizations.of(context).translate(this.label), + style: Theme.of(context).textTheme.labelLarge, ), onPressed: () => callBack != null ? callBack!() : null, ); diff --git a/frontend/mgramseva/lib/widgets/button.dart b/frontend/mgramseva/lib/widgets/button.dart index b399b0101..8c91a1d58 100644 --- a/frontend/mgramseva/lib/widgets/button.dart +++ b/frontend/mgramseva/lib/widgets/button.dart @@ -15,12 +15,11 @@ class Button extends StatelessWidget { decoration: CommonStyles.buttonBottomDecoration, child: new ElevatedButton( style: ElevatedButton.styleFrom( - minimumSize: Size(double.infinity, 50), - primary: widgetFunction == null ? Color.fromRGBO(244, 119, 56, 0.7) : null + minimumSize: Size(double.infinity, 50), backgroundColor: widgetFunction != null ? Color.fromRGBO(244, 119, 56, 1) : Color.fromRGBO(244, 119, 56, 0.7) // padding: EdgeInsets.all(15), ), child: new Text(ApplicationLocalizations.of(context).translate(label), - style: Theme.of(context).textTheme.button), + style: Theme.of(context).textTheme.labelLarge), onPressed: () => widgetFunction != null ? widgetFunction!() : null ), )); diff --git a/frontend/mgramseva/lib/widgets/button_group.dart b/frontend/mgramseva/lib/widgets/button_group.dart index dfd579bc8..09cfc952f 100644 --- a/frontend/mgramseva/lib/widgets/button_group.dart +++ b/frontend/mgramseva/lib/widgets/button_group.dart @@ -34,25 +34,17 @@ class ButtonGroup extends StatelessWidget { Expanded( child: OutlinedButton.icon( onPressed: callBackIcon, - style: ButtonStyle( - alignment: Alignment.center, - padding: MaterialStateProperty.all( - EdgeInsets.symmetric(vertical: 0.0)), - shape: - MaterialStateProperty.all(RoundedRectangleBorder( - borderRadius: BorderRadius.circular(0.0), - side: BorderSide( - width: 2, - color: Theme.of(context).primaryColor), - )), - ), + style: ElevatedButton.styleFrom(padding:EdgeInsets.symmetric(vertical: 8),alignment: Alignment.center,side:BorderSide( + width: 1, + color: Theme.of(context).disabledColor), + ), icon: (Image.asset('assets/png/whats_app.png', fit: BoxFit.fitHeight,)), label: Padding( - padding: const EdgeInsets.symmetric(vertical: 15), + padding: const EdgeInsets.symmetric(vertical: 12), child: Text( ApplicationLocalizations.of(context) .translate(i18.common.SHARE_BILL_PDF), - style: Theme.of(context).textTheme.subtitle2)), + style: Theme.of(context).textTheme.titleSmall)), )), Expanded(child: ShortButton(label, callBack)) ], diff --git a/frontend/mgramseva/lib/widgets/custom_app_bar.dart b/frontend/mgramseva/lib/widgets/custom_app_bar.dart index cdbd0bf51..b6bb07c1b 100644 --- a/frontend/mgramseva/lib/widgets/custom_app_bar.dart +++ b/frontend/mgramseva/lib/widgets/custom_app_bar.dart @@ -130,15 +130,13 @@ class _CustomAppBarState extends State { ), onChanged: (text) { if(text.isEmpty){ - stateSetter(()=>{ - visibleTenants = tenants.asMap().values.toList() - }); + stateSetter(()=>visibleTenants = tenants.asMap().values.toList() + ); }else{ var tresult = tenants.where((e) => "${ApplicationLocalizations.of(context) .translate(e.code!)}-${e.city!.code!}".toLowerCase().trim().contains(text.toLowerCase().trim())).toList(); - stateSetter(()=>{ - visibleTenants = tresult - }); + stateSetter(()=>visibleTenants = tresult + ); } }, ), @@ -236,10 +234,10 @@ class _CustomAppBarState extends State { children: [ Text(ApplicationLocalizations.of(context) .translate(commonProvider - .userDetails!.selectedtenant!.code!)), + .userDetails!.selectedtenant!.code!),style: Theme.of(context).textTheme.labelMedium,), Text(ApplicationLocalizations.of(context) .translate(commonProvider.userDetails! - .selectedtenant!.city!.code!)) + .selectedtenant!.city!.code!),style: Theme.of(context).textTheme.labelSmall,) ])), Icon(Icons.arrow_drop_down) ], @@ -255,6 +253,7 @@ class _CustomAppBarState extends State { Provider.of(context, listen: false); return AppBar( titleSpacing: 0, + iconTheme: IconThemeData(color: Colors.white), title: Image( width: 130, image: NetworkImage( diff --git a/frontend/mgramseva/lib/widgets/file_picker.dart b/frontend/mgramseva/lib/widgets/file_picker.dart index 1835bda00..dfce5ab44 100644 --- a/frontend/mgramseva/lib/widgets/file_picker.dart +++ b/frontend/mgramseva/lib/widgets/file_picker.dart @@ -60,7 +60,7 @@ class FilePickerDemoState extends State { if(paths != null){ var isNotValidSize = false; for(var path in paths){ - if (!(await CommonMethods.isValidFileSize(path.size))) isNotValidSize = true;; + if (!(await CommonMethods.isValidFileSize(path.size))) isNotValidSize = true; } if(isNotValidSize){ @@ -333,7 +333,7 @@ class FilePickerDemoState extends State { if (!(await CommonMethods.isValidFileSize(await file.length()))){ Notifiers.getToastMessage(context, i18.common.FILE_SIZE, 'ERROR'); return; - }; + } if(_multiPick){ _selectedFiles.addAll([file]); }else{ diff --git a/frontend/mgramseva/lib/widgets/label_text.dart b/frontend/mgramseva/lib/widgets/label_text.dart index 53c7a29fa..d9034d392 100644 --- a/frontend/mgramseva/lib/widgets/label_text.dart +++ b/frontend/mgramseva/lib/widgets/label_text.dart @@ -15,7 +15,7 @@ class LabelText extends StatelessWidget { padding: padding ?? (constraints.maxWidth > 760 ? const EdgeInsets.all(20.0) : const EdgeInsets.all(8.0)), child: Text( ApplicationLocalizations.of(context).translate(input), - style: Theme.of(context).textTheme.headline1, + style: Theme.of(context).textTheme.displayLarge, textAlign: TextAlign.left, ), ))); diff --git a/frontend/mgramseva/lib/widgets/pagination.dart b/frontend/mgramseva/lib/widgets/pagination.dart index 144e4544e..1042f88af 100644 --- a/frontend/mgramseva/lib/widgets/pagination.dart +++ b/frontend/mgramseva/lib/widgets/pagination.dart @@ -52,7 +52,7 @@ class _PaginationState extends State { } get dropDownItems { - return [1,2,3,10, 20, 30, 40, 50].map((value) { + return [10, 20, 30, 40, 50].map((value) { return DropdownMenuItem( key: Key('$value'), value: value, diff --git a/frontend/mgramseva/lib/widgets/radio_button_field_builder.dart b/frontend/mgramseva/lib/widgets/radio_button_field_builder.dart index 82a2a6d5b..f21641bf7 100644 --- a/frontend/mgramseva/lib/widgets/radio_button_field_builder.dart +++ b/frontend/mgramseva/lib/widgets/radio_button_field_builder.dart @@ -1,4 +1,3 @@ -import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:mgramseva/utils/localization/application_localizations.dart'; @@ -7,7 +6,7 @@ import 'package:mgramseva/utils/models.dart'; class RadioButtonFieldBuilder extends StatelessWidget { final BuildContext context; final String labelText; - final dynamic? controller; + final dynamic controller; final bool isRequired; final String input; diff --git a/frontend/mgramseva/lib/widgets/search_select_field_builder.dart b/frontend/mgramseva/lib/widgets/search_select_field_builder.dart index 41088136f..11c34414d 100644 --- a/frontend/mgramseva/lib/widgets/search_select_field_builder.dart +++ b/frontend/mgramseva/lib/widgets/search_select_field_builder.dart @@ -7,7 +7,7 @@ import 'package:provider/provider.dart'; class SearchSelectField extends StatefulWidget { final String labelText; - final List> options; + final List options; final dynamic value; final Function(dynamic) widget; final bool? isEnabled; @@ -35,7 +35,7 @@ class SearchSelectFieldState extends State { _focusNode.addListener(() { if (_focusNode.hasFocus) { this._overlayEntry = this._createOverlayEntry(); - Overlay.of(context)!.insert(this._overlayEntry); + Overlay.of(context).insert(this._overlayEntry); } else { this._overlayEntry.remove(); } @@ -47,10 +47,10 @@ class SearchSelectFieldState extends State { afterViewBuild() { var res = widget.options - .where((e) => (e.value == (widget.value))); + .where((e) => (e.toString() == (widget.value))); if (res.isNotEmpty && _focusNode.hasFocus == false) { widget.controller?.text = ApplicationLocalizations.of(context) - .translate((res.first.child as Text).data.toString()); + .translate((res.first).toString()); } } @@ -59,16 +59,24 @@ class SearchSelectFieldState extends State { setState(() { isInit = true; Options = widget.options - .where((element) => (element.child as Text) - .data + .where((element) => element .toString() .toLowerCase() - .contains(val.toString().toLowerCase())) - .toList(); + .contains(val.toString().toLowerCase())).map((e) => + DropdownMenuItem( + value: e, + child: new Text(('${e.toString()}')), + ), + ).toList(); }); } else { setState(() { - Options = widget.options; + Options = widget.options.map((e) => + DropdownMenuItem( + value: e, + child: new Text(('${e.toString()}')), + ), + ).toList(); }); } } @@ -105,16 +113,15 @@ class SearchSelectFieldState extends State { child: ListTile( title: Text(ApplicationLocalizations.of(context) .translate( - (item.child as Text).data.toString())), + item.toString())), onTap: () { - Text txt = item.child as Text; - widget.widget(item.value); + widget.widget(item.toString()); setState(() { - selectedCode = item.value; + selectedCode = item; }); widget.controller?.text = ApplicationLocalizations.of(context) - .translate((txt.data.toString())); + .translate((item.toString())); _focusNode.unfocus(); }, )), @@ -156,7 +163,7 @@ class SearchSelectFieldState extends State { } else if (widget.options .where((element) => ApplicationLocalizations.of(context) - .translate((element.child as Text).data.toString()) + .translate((element).toString()) .toLowerCase() == (value.toString().toLowerCase())) .toList() diff --git a/frontend/mgramseva/lib/widgets/select_field_builder.dart b/frontend/mgramseva/lib/widgets/select_field_builder.dart index fa30ec834..2945df97c 100644 --- a/frontend/mgramseva/lib/widgets/select_field_builder.dart +++ b/frontend/mgramseva/lib/widgets/select_field_builder.dart @@ -1,3 +1,4 @@ +import 'package:dropdown_search/dropdown_search.dart'; import 'package:flutter/material.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:mgramseva/providers/language.dart'; @@ -12,11 +13,12 @@ class SelectFieldBuilder extends StatefulWidget { final String input; final String prefixText; final Function(dynamic) widget; - final List> options; + final String Function(dynamic) itemAsString; + final List options; final bool isRequired; final String? hint; final bool? readOnly; - final bool? isEnabled; + final bool showSearchBox; final String? requiredMessage; final GlobalKey? contextKey; final TextEditingController? controller; @@ -26,11 +28,10 @@ class SelectFieldBuilder extends StatefulWidget { const SelectFieldBuilder(this.labelText, this.value, this.input, this.prefixText, this.widget, this.options, this.isRequired, {this.hint, - this.isEnabled, - this.readOnly, + this.readOnly = false, this.requiredMessage, this.contextKey, - this.controller,this.key, this.suggestionKey}); + this.controller,this.key, this.suggestionKey, required this.itemAsString, this.showSearchBox = false}); @override State createState() => SelectFieldBuilderState(); @@ -49,7 +50,7 @@ class SelectFieldBuilderState extends State { style: TextStyle( fontWeight: FontWeight.w400, fontSize: 16, - color: (widget.isEnabled ?? true) + color: (!widget.readOnly!) ? Theme.of(context).primaryColorDark : Colors.grey)), Visibility( @@ -59,7 +60,7 @@ class SelectFieldBuilderState extends State { style: TextStyle( fontWeight: FontWeight.w400, fontSize: 16, - color: (widget.isEnabled ?? true) + color: (!widget.readOnly! ?? true) ? Theme.of(context).primaryColorDark : Colors.grey)), ), @@ -107,15 +108,31 @@ class SelectFieldBuilderState extends State { children: [ Consumer( builder: (_, consumerProvider, child) => - SearchSelectField( - widget.labelText, - widget.options, - widget.controller, - widget.widget, - widget.value, - widget.isEnabled, - widget.isRequired, - widget.requiredMessage, key : widget.suggestionKey)), + // SearchSelectField( + // widget.labelText, + // widget.options, + // widget.controller, + // widget.widget, + // widget.value, + // widget.isEnabled, + // widget.isRequired, + // widget.requiredMessage, key : widget.suggestionKey), + DropdownSearch( + key: widget.suggestionKey, + selectedItem: widget.value, + itemAsString: widget.itemAsString, + items: widget.options, + onChanged: widget.widget, + enabled: !widget.readOnly!, + popupProps: PopupProps.menu( + showSearchBox: widget.showSearchBox, + fit: FlexFit.loose, + searchDelay: Duration(seconds: 0), + //comment this if you want that the items do not takes all available height + constraints: BoxConstraints(maxHeight: 400), + ), + ) + ), CommonWidgets().buildHint( widget.hint, context, @@ -134,8 +151,26 @@ class SelectFieldBuilderState extends State { child: new Align( alignment: Alignment.centerLeft, child: textLabelWidget)), Consumer(builder: (_, consumerProvider, child) { - return SearchSelectField(widget.labelText, widget.options, widget.controller, widget.widget, - widget.value, widget.isEnabled, widget.isRequired, widget.requiredMessage, key: widget.suggestionKey,); + return DropdownSearch( + key: widget.suggestionKey, + selectedItem: widget.value, + itemAsString: widget.itemAsString, + items: widget.options, + onChanged: widget.widget, + enabled: !widget.readOnly!, + dropdownDecoratorProps: DropDownDecoratorProps( + baseStyle: TextStyle( + color: !widget.readOnly!?Theme.of(context).primaryColorDark:Colors.grey + ) + ), + popupProps: PopupProps.menu( + showSearchBox: widget.showSearchBox, + fit: FlexFit.loose, + searchDelay: Duration(seconds: 0), + //comment this if you want that the items do not takes all available height + constraints: BoxConstraints(maxHeight: 200), + ), + ); }), CommonWidgets().buildHint(widget.hint, context) ]), diff --git a/frontend/mgramseva/lib/widgets/short_button.dart b/frontend/mgramseva/lib/widgets/short_button.dart index 168143037..2d1e1964e 100644 --- a/frontend/mgramseva/lib/widgets/short_button.dart +++ b/frontend/mgramseva/lib/widgets/short_button.dart @@ -17,13 +17,14 @@ class ShortButton extends StatelessWidget { decoration: CommonStyles.buttonBottomDecoration, child: new ElevatedButton( style: ElevatedButton.styleFrom( - padding: EdgeInsets.symmetric(vertical: 13) + padding: EdgeInsets.symmetric(vertical: 13), + backgroundColor: callBack!=null?Theme.of(context).primaryColor:Theme.of(context).disabledColor ), key: key, child: new Text( ApplicationLocalizations.of(context).translate(label), style: - Theme.of(context).textTheme.subtitle1!.apply(color: Colors.white) + Theme.of(context).textTheme.titleMedium!.apply(color: Colors.white) ), onPressed: callBack ), diff --git a/frontend/mgramseva/lib/widgets/success_page.dart b/frontend/mgramseva/lib/widgets/success_page.dart index 3834102f1..a0a9b4641 100644 --- a/frontend/mgramseva/lib/widgets/success_page.dart +++ b/frontend/mgramseva/lib/widgets/success_page.dart @@ -23,7 +23,7 @@ class SuccessPage extends StatelessWidget { child: Text(ApplicationLocalizations.of(context).translate(label), textAlign: TextAlign.center, style: TextStyle( - color: Theme.of(context).backgroundColor, + color: Theme.of(context).colorScheme.background, fontSize: 32, fontFamily: 'Roboto Condensed', fontWeight: FontWeight.w700 @@ -35,10 +35,10 @@ class SuccessPage extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - amount==null?SizedBox():Text('₹${amount}', + amount==null?SizedBox():Text('₹$amount', textAlign: TextAlign.center, style: TextStyle( - color: Theme.of(context).backgroundColor, + color: Theme.of(context).colorScheme.background, fontSize: 32, fontFamily: 'Roboto Condensed', fontWeight: FontWeight.w700 @@ -46,7 +46,7 @@ class SuccessPage extends StatelessWidget { SizedBox(width: 8,), Icon( Icons.check_circle, - color: Theme.of(context).backgroundColor, + color: Theme.of(context).colorScheme.background, size: 32, ), ], @@ -60,7 +60,7 @@ class SuccessPage extends StatelessWidget { child: Text(ApplicationLocalizations.of(context).translate(subTextHeader ?? ''), textAlign: TextAlign.center, style: TextStyle( - color: Theme.of(context).backgroundColor, + color: Theme.of(context).colorScheme.background, fontSize: 18, fontWeight: FontWeight.w700 )), @@ -71,7 +71,7 @@ class SuccessPage extends StatelessWidget { child: Text(ApplicationLocalizations.of(context).translate(subText ?? ''), textAlign: TextAlign.center, style: TextStyle( - color: Theme.of(context).backgroundColor, + color: Theme.of(context).colorScheme.background, fontSize: 24, fontWeight: FontWeight.w700 )), diff --git a/frontend/mgramseva/lib/widgets/toast/toster.dart b/frontend/mgramseva/lib/widgets/toast/toster.dart index 3a1dc2539..00579b32a 100644 --- a/frontend/mgramseva/lib/widgets/toast/toster.dart +++ b/frontend/mgramseva/lib/widgets/toast/toster.dart @@ -20,7 +20,7 @@ class ToastUtils { } _overlayEntry = createOverlayEntry(context, message, type); - Overlay.of(context)!.insert(_overlayEntry!); + Overlay.of(context).insert(_overlayEntry!); toastTimer = Timer(Duration(seconds: 10), () { if (_overlayEntry != null) { _overlayEntry!.remove(); diff --git a/frontend/mgramseva/pubspec.lock b/frontend/mgramseva/pubspec.lock index 87e1ebf01..958c1b311 100644 --- a/frontend/mgramseva/pubspec.lock +++ b/frontend/mgramseva/pubspec.lock @@ -5,331 +5,450 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 + url: "https://pub.dev" source: hosted - version: "22.0.0" + version: "64.0.0" + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: dd68ecea9f1e3556d385521bd21c7bafd6311a8c1e11abe2595ca27974f468ee + url: "https://pub.dev" + source: hosted + version: "1.3.13" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" + url: "https://pub.dev" source: hosted - version: "1.7.2" + version: "6.2.0" archive: dependency: transitive description: name: archive - url: "https://pub.dartlang.org" + sha256: "7b875fd4a20b165a3084bd2d210439b22ebc653f21cea4842729c0c30c82596b" + url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "3.4.9" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" barcode: dependency: transitive description: name: barcode - url: "https://pub.dartlang.org" + sha256: "789f898eef0bd88312470bdb2cc996f895ad7dd5f89e9adde84b204546a90b45" + url: "https://pub.dev" source: hosted - version: "2.2.0" - bluetooth_thermal_printer: - dependency: "direct main" + version: "2.2.4" + bidi: + dependency: transitive description: - name: bluetooth_thermal_printer - url: "https://pub.dartlang.org" + name: bidi + sha256: "1a7d0c696324b2089f72e7671fd1f1f64fef44c980f3cebc84e803967c597b63" + url: "https://pub.dev" source: hosted - version: "0.0.6" + version: "2.0.10" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.4.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.dartlang.org" + sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "4.0.1" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + sha256: "64e12b0521812d1684b1917bc80945625391cb9bdd4312536b1d69dcb6133ed8" + url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.4.1" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.dartlang.org" + sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.4.6" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.dartlang.org" + sha256: c9e32d21dd6626b5c163d48b037ce906bbe428bc23ab77bcd77bb21e593b6185 + url: "https://pub.dev" source: hosted - version: "7.1.0" + version: "7.2.11" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + sha256: "723b4021e903217dfc445ec4cf5b42e27975aece1fc4ebbc1ca6329c2d9fb54e" + url: "https://pub.dev" source: hosted - version: "8.1.2" + version: "8.7.0" buttons_tabbar: dependency: "direct main" description: name: buttons_tabbar - url: "https://pub.dartlang.org" + sha256: "3f0969c26574ef15c0c9ff1dee42c3c4b0d3563d2c8607804372490fb8b76896" + url: "https://pub.dev" source: hosted - version: "1.3.6" + version: "1.3.8" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" source: hosted version: "1.3.1" charset_converter: dependency: "direct main" description: name: charset_converter - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - charts_common: - dependency: transitive - description: - name: charts_common - url: "https://pub.dartlang.org" + sha256: e4827b2d623ab75c2b6767d69e03485ea5bc894db6f6bdcb2ffeda58446bbe26 + url: "https://pub.dev" source: hosted - version: "0.12.0" - charts_flutter: - dependency: "direct main" - description: - name: charts_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.0" + version: "2.1.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.3" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.dartlang.org" + sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7 + url: "https://pub.dev" source: hosted - version: "0.3.3" + version: "0.4.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + sha256: b2151ce26a06171005b379ecff6e08d34c470180ffe16b8e14b6d52be292b55f + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.8.0" collection: dependency: "direct main" description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + community_charts_common: + dependency: transitive + description: + name: community_charts_common + sha256: "20697244c826df0545237ebe01d61caa96a2a2e4d23c6f88890441636a4d5220" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + community_charts_flutter: + dependency: "direct main" + description: + name: community_charts_flutter + sha256: ca5bd07337e162daee13c19679f602cd8b3f704520d242beeebbc2e312f84f89 + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.0.2" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.1" cross_file: dependency: transitive description: name: cross_file - url: "https://pub.dartlang.org" + sha256: "445db18de832dba8d851e287aff8ccf169bed30d2e94243cb54c7d2f1ed2142c" + url: "https://pub.dev" source: hosted - version: "0.3.1+5" + version: "0.3.3+6" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" csslib: dependency: transitive description: name: csslib - url: "https://pub.dartlang.org" + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "1.0.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.6" + dart_ping: + dependency: transitive + description: + name: dart_ping + sha256: "91ee37e5bf5316caca5bd6f7b6016e73cd861b6a4b99565a2fd89b1d65003e1a" + url: "https://pub.dev" + source: hosted + version: "8.0.1" + dart_ping_ios: + dependency: "direct main" + description: + name: dart_ping_ios + sha256: ade22dedb8bbe37b6ba69bbfb0cbb36b6a20f55f6a63abcb4583373f9ea8eebd + url: "https://pub.dev" + source: hosted + version: "3.0.0" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368" + url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.3.4" datetime_picker_formfield: dependency: "direct main" description: name: datetime_picker_formfield - url: "https://pub.dartlang.org" + sha256: "6d0412c98cc5da18a5dca1f81f82a834fbacdb5d249fd6d9bed42d912339720e" + url: "https://pub.dev" source: hosted - version: "2.0.0" - esc_pos_utils: + version: "2.0.1" + dbus: + dependency: transitive + description: + name: dbus + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" + url: "https://pub.dev" + source: hosted + version: "0.7.10" + dropdown_search: dependency: "direct main" description: - name: esc_pos_utils - url: "https://pub.dartlang.org" + name: dropdown_search + sha256: "55106e8290acaa97ed15bea1fdad82c3cf0c248dd410e651f5a8ac6870f783ab" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "5.0.6" + enum_to_string: + dependency: transitive + description: + name: enum_to_string + sha256: bd9e83a33b754cb43a75b36a9af2a0b92a757bfd9847d2621ca0b1bed45f8e7a + url: "https://pub.dev" + source: hosted + version: "2.0.1" + esc_pos_utils_plus: + dependency: "direct main" + description: + name: esc_pos_utils_plus + sha256: dca660e2bf5622c3b9bc54ce098128606a8942ff07f1e2d2f4c88e483df3fe74 + url: "https://pub.dev" + source: hosted + version: "2.0.2" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.1.0" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "6.1.4" file_picker: dependency: "direct main" description: name: file_picker - url: "https://pub.dartlang.org" + sha256: be325344c1f3070354a1d84a231a1ba75ea85d413774ec4bdf444c023342e030 + url: "https://pub.dev" source: hosted - version: "4.0.0" - firebase: + version: "5.5.0" + file_selector_linux: dependency: transitive description: - name: firebase - url: "https://pub.dartlang.org" + name: file_selector_linux + sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492" + url: "https://pub.dev" source: hosted - version: "9.0.3" + version: "0.9.2+1" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: b15c3da8bd4908b9918111fa486903f5808e388b8d1c559949f584725a6594d6 + url: "https://pub.dev" + source: hosted + version: "0.9.3+3" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: "0aa47a725c346825a2bd396343ce63ac00bda6eff2fbc43eabe99737dede8262" + url: "https://pub.dev" + source: hosted + version: "2.6.1" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: d3547240c20cabf205c7c7f01a50ecdbc413755814d6677f3cb366f04abcead0 + url: "https://pub.dev" + source: hosted + version: "0.9.3+1" firebase_analytics: dependency: "direct main" description: name: firebase_analytics - url: "https://pub.dartlang.org" + sha256: de3d73b5c5618bf31004308b017b4067b7d9156b96e97b62d59ae5eab71081ec + url: "https://pub.dev" source: hosted - version: "8.3.4" + version: "10.7.1" firebase_analytics_platform_interface: dependency: transitive description: name: firebase_analytics_platform_interface - url: "https://pub.dartlang.org" + sha256: ffc59c0b00a572cd1fbf915a1d50cb4ccdc61e429614aa6ae9a598ee5723b96a + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.8.1" firebase_analytics_web: dependency: transitive description: name: firebase_analytics_web - url: "https://pub.dartlang.org" + sha256: "0e725a7dcdeb0a59e44d93d1d45dfec94efe54329ac9d6aa145e24d31429100c" + url: "https://pub.dev" source: hosted - version: "0.3.0+1" + version: "0.5.5+8" firebase_core: - dependency: transitive + dependency: "direct main" description: name: firebase_core - url: "https://pub.dartlang.org" + sha256: "471b46ea6a9af503184d4de691566887daedd312aec5baac5baa42d819f56446" + url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "2.23.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - url: "https://pub.dartlang.org" + sha256: c437ae5d17e6b5cc7981cf6fd458a5db4d12979905f9aafd1fea930428a9fe63 + url: "https://pub.dev" source: hosted - version: "4.4.1" + version: "5.0.0" firebase_core_web: dependency: transitive description: name: firebase_core_web - url: "https://pub.dartlang.org" + sha256: "0631a2ec971dbc540275e2fa00c3a8a2676f0a7adbc3c197d6fba569db689d97" + url: "https://pub.dev" source: hosted - version: "1.6.5" + version: "2.8.1" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -339,16 +458,18 @@ packages: dependency: "direct main" description: name: flutter_countdown_timer - url: "https://pub.dartlang.org" + sha256: dfcbd7d6f76a5589f78f3f3ba2f9ea2e199368eccc1adce4153ce985b9587bc5 + url: "https://pub.dev" source: hosted version: "4.1.0" flutter_downloader: dependency: "direct main" description: name: flutter_downloader - url: "https://pub.dartlang.org" + sha256: "36c16cc6657274f3cf7ccb681aeca89df62531ff5956f85e175f6be4b8d6b140" + url: "https://pub.dev" source: hosted - version: "1.8.0+1" + version: "1.11.5" flutter_driver: dependency: transitive description: flutter @@ -358,37 +479,74 @@ packages: dependency: "direct main" description: name: flutter_focus_watcher - url: "https://pub.dartlang.org" + sha256: a72ee539ae0237961308a25839887ca93a0b1cb6f87b0d492b139c8fccff8e79 + url: "https://pub.dev" source: hosted version: "2.0.0" + flutter_icmp_ping: + dependency: transitive + description: + name: flutter_icmp_ping + sha256: de9633cf65a8c733fae29d08a35d3d4b343620cd1d13e1bfa88eccf56696d896 + url: "https://pub.dev" + source: hosted + version: "3.1.3" flutter_keyboard_visibility: dependency: transitive description: name: flutter_keyboard_visibility - url: "https://pub.dartlang.org" + sha256: "4983655c26ab5b959252ee204c2fffa4afeb4413cd030455194ec0caa3b8e7cb" + url: "https://pub.dev" + source: hosted + version: "5.4.1" + flutter_keyboard_visibility_linux: + dependency: transitive + description: + name: flutter_keyboard_visibility_linux + sha256: "6fba7cd9bb033b6ddd8c2beb4c99ad02d728f1e6e6d9b9446667398b2ac39f08" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + flutter_keyboard_visibility_macos: + dependency: transitive + description: + name: flutter_keyboard_visibility_macos + sha256: c5c49b16fff453dfdafdc16f26bdd8fb8d55812a1d50b0ce25fc8d9f2e53d086 + url: "https://pub.dev" source: hosted - version: "5.0.3" + version: "1.0.0" flutter_keyboard_visibility_platform_interface: dependency: transitive description: name: flutter_keyboard_visibility_platform_interface - url: "https://pub.dartlang.org" + sha256: e43a89845873f7be10cb3884345ceb9aebf00a659f479d1c8f4293fcb37022a4 + url: "https://pub.dev" source: hosted version: "2.0.0" flutter_keyboard_visibility_web: dependency: transitive description: name: flutter_keyboard_visibility_web - url: "https://pub.dartlang.org" + sha256: d3771a2e752880c79203f8d80658401d0c998e4183edca05a149f5098ce6e3d1 + url: "https://pub.dev" source: hosted version: "2.0.0" + flutter_keyboard_visibility_windows: + dependency: transitive + description: + name: flutter_keyboard_visibility_windows + sha256: fc4b0f0b6be9b93ae527f3d527fb56ee2d918cd88bbca438c478af7bcfd0ef73 + url: "https://pub.dev" + source: hosted + version: "1.0.0" flutter_launcher_icons: dependency: "direct dev" description: name: flutter_launcher_icons - url: "https://pub.dartlang.org" + sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" + url: "https://pub.dev" source: hosted - version: "0.9.2" + version: "0.13.1" flutter_localizations: dependency: "direct main" description: flutter @@ -398,44 +556,50 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.17" flutter_rating_bar: dependency: "direct main" description: name: flutter_rating_bar - url: "https://pub.dartlang.org" + sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93 + url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.1" flutter_secure_storage: dependency: "direct main" description: name: flutter_secure_storage - url: "https://pub.dartlang.org" + sha256: "9f3dd2ac3b6875b0fde5b04734789c3ef35ba3965c18e99dd564a7a2f8056df6" + url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "4.2.1" flutter_share_me: dependency: "direct main" description: name: flutter_share_me - url: "https://pub.dartlang.org" + sha256: "2cd97783bcd7c61eaee20b11c2952bb57a94608f25c3504ff3c08803134609c2" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" flutter_spinkit: dependency: "direct main" description: name: flutter_spinkit - url: "https://pub.dartlang.org" + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e + url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.2.0" flutter_svg: dependency: "direct main" description: name: flutter_svg - url: "https://pub.dartlang.org" + sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c + url: "https://pub.dev" source: hosted - version: "0.22.0" + version: "2.0.9" flutter_test: dependency: "direct dev" description: flutter @@ -445,9 +609,10 @@ packages: dependency: "direct main" description: name: flutter_typeahead - url: "https://pub.dartlang.org" + sha256: b9942bd5b7611a6ec3f0730c477146cffa4cd4b051077983ba67ddfc9e7ee818 + url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.8.0" flutter_web_plugins: dependency: "direct main" description: flutter @@ -457,9 +622,10 @@ packages: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "3.2.0" fuchsia_remote_debug_protocol: dependency: transitive description: flutter @@ -469,93 +635,146 @@ packages: dependency: transitive description: name: gbk_codec - url: "https://pub.dartlang.org" + sha256: "3af5311fc9393115e3650ae6023862adf998051a804a08fb804f042724999f61" + url: "https://pub.dev" source: hosted version: "0.4.0" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.2" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.3.1" hex: dependency: transitive description: name: hex - url: "https://pub.dartlang.org" + sha256: "4e7cd54e4b59ba026432a6be2dd9d96e4c5205725194997193bf871703b82c4a" + url: "https://pub.dev" source: hosted version: "0.2.0" horizontal_data_table: dependency: "direct main" description: name: horizontal_data_table - url: "https://pub.dartlang.org" + sha256: c8ab5256bbced698a729f3e0ff2cb0e8e97416cdbb082860370eaf883badf722 + url: "https://pub.dev" source: hosted - version: "4.1.4" + version: "4.3.1" html: dependency: transitive description: name: html - url: "https://pub.dartlang.org" + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + url: "https://pub.dev" source: hosted - version: "0.15.0" + version: "0.15.4" http: dependency: "direct main" description: name: http - url: "https://pub.dartlang.org" + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + url: "https://pub.dev" source: hosted - version: "0.13.3" + version: "1.1.0" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.2" image: dependency: transitive description: name: image - url: "https://pub.dartlang.org" + sha256: "028f61960d56f26414eb616b48b04eb37d700cbe477b7fb09bf1d7ce57fd9271" + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "4.1.3" image_picker: dependency: "direct main" description: name: image_picker - url: "https://pub.dartlang.org" + sha256: b6951e25b795d053a6ba03af5f710069c99349de9341af95155d52665cb4607c + url: "https://pub.dev" source: hosted - version: "0.8.4" + version: "0.8.9" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: d6a6e78821086b0b737009b09363018309bbc6de3fd88cc5c26bc2bb44a4957f + url: "https://pub.dev" + source: hosted + version: "0.8.8+2" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - url: "https://pub.dartlang.org" + sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: "76ec722aeea419d03aa915c2c96bf5b47214b053899088c9abb4086ceecf97a7" + url: "https://pub.dev" + source: hosted + version: "0.8.8+4" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "4ed1d9bb36f7cd60aa6e6cd479779cc56a4cb4e4de8f49d487b1aaad831300fa" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "3f5ad1e8112a9a6111c46d0b57a7be2286a9a07fc6e1976fdf5be2bd31d4ff62" + url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "0.2.1+1" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - url: "https://pub.dartlang.org" + sha256: ed9b00e63977c93b0d2d2b343685bed9c324534ba5abafbb3dfbd6a780b1b514 + url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.9.1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" integration_test: dependency: "direct dev" description: flutter @@ -565,359 +784,458 @@ packages: dependency: transitive description: name: intl - url: "https://pub.dartlang.org" + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.1" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" jiffy: dependency: transitive description: name: jiffy - url: "https://pub.dartlang.org" + sha256: c3c1da3fe0c08bba3c2c455e8a3e724dfe7ea34dbe8069b992cab90ea1fe40b6 + url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.0.1" js: dependency: "direct main" description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.7" json_annotation: dependency: "direct main" description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.8.1" json_serializable: dependency: "direct dev" description: name: json_serializable - url: "https://pub.dartlang.org" + sha256: aa1f5a8912615733e0fdc7a02af03308933c93235bdc8d50d0b0c8a8ccb0b969 + url: "https://pub.dev" source: hosted - version: "4.1.4" + version: "6.7.1" lint: dependency: transitive description: name: lint - url: "https://pub.dartlang.org" + sha256: "4a539aa34ec5721a2c7574ae2ca0336738ea4adc2a34887d54b7596310b33c85" + url: "https://pub.dev" source: hosted - version: "1.7.2" + version: "1.10.0" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.2.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.5.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.10.0" mime: dependency: "direct main" description: name: mime - url: "https://pub.dartlang.org" + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.4" nearby_connections: dependency: "direct main" description: name: nearby_connections - url: "https://pub.dartlang.org" + sha256: "95fbc4fb01a199a02e6498b32800a89ea10e4e40b1e6ccae2033fe3e31453309" + url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "3.3.1" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" source: hosted version: "1.0.0" - new_version: + network_info_plus: + dependency: transitive + description: + name: network_info_plus + sha256: "2d9e88b9a459e5d4e224f828d26cc38ea140511e89b943116939994324be5c96" + url: "https://pub.dev" + source: hosted + version: "4.1.0" + network_info_plus_platform_interface: + dependency: transitive + description: + name: network_info_plus_platform_interface + sha256: "881f5029c5edaf19c616c201d3d8b366c5b1384afd5c1da5a49e4345de82fb8b" + url: "https://pub.dev" + source: hosted + version: "1.1.3" + new_version_plus: dependency: "direct main" description: - name: new_version - url: "https://pub.dartlang.org" + name: new_version_plus + sha256: e0d8027223488cc7f7c78f6ff286f1b5d9808f88814aecfa0bb12254d25f48ca + url: "https://pub.dev" source: hosted - version: "0.2.3" + version: "0.0.11" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" + source: hosted + version: "0.5.0" number_to_words: dependency: "direct main" description: name: number_to_words - url: "https://pub.dartlang.org" + sha256: "279af97baabe7460e3e724be5e797ab1902bcf0ce52d065dd2409a4be423f05c" + url: "https://pub.dev" source: hosted version: "1.0.0" - open_file: + open_filex: dependency: "direct main" description: - name: open_file - url: "https://pub.dartlang.org" + name: open_filex + sha256: a6c95237767c5647e68b71a476602fcf4f1bfc530c126265e53addae22ef5fc2 + url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "4.3.4" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" package_info_plus: dependency: "direct main" description: name: package_info_plus - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - package_info_plus_linux: - dependency: transitive - description: - name: package_info_plus_linux - url: "https://pub.dartlang.org" + sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" + url: "https://pub.dev" source: hosted - version: "1.0.3" - package_info_plus_macos: - dependency: transitive - description: - name: package_info_plus_macos - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "4.2.0" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - package_info_plus_web: - dependency: transitive - description: - name: package_info_plus_web - url: "https://pub.dartlang.org" + sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" + url: "https://pub.dev" source: hosted - version: "1.0.4" - package_info_plus_windows: - dependency: transitive - description: - name: package_info_plus_windows - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" + version: "2.0.1" path: dependency: "direct main" description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.1" + version: "1.8.3" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.dartlang.org" + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" source: hosted - version: "0.2.1" + version: "1.0.1" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa + url: "https://pub.dev" source: hosted - version: "2.0.2" - path_provider_linux: + version: "2.1.1" + path_provider_android: dependency: transitive description: - name: path_provider_linux - url: "https://pub.dartlang.org" + name: path_provider_android + sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72 + url: "https://pub.dev" source: hosted - version: "2.0.2" - path_provider_macos: + version: "2.2.1" + path_provider_foundation: dependency: transitive description: - name: path_provider_macos - url: "https://pub.dartlang.org" + name: path_provider_foundation + sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.3.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.1" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.2.1" pdf: dependency: "direct main" description: name: pdf - url: "https://pub.dartlang.org" - source: hosted - version: "3.8.1" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" + sha256: aa8835fcb9cfaf57ab2f1970e8548ceed3d0cb53eda7da906648f8153eaf37c9 + url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "3.10.6" permission_handler: dependency: "direct main" description: name: permission_handler - url: "https://pub.dartlang.org" + sha256: "860c6b871c94c78e202dc69546d4d8fd84bd59faeb36f8fb9888668a53ff4f78" + url: "https://pub.dev" + source: hosted + version: "11.1.0" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + sha256: "2f1bec180ee2f5665c22faada971a8f024761f632e93ddc23310487df52dcfa6" + url: "https://pub.dev" + source: hosted + version: "12.0.1" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + sha256: "1a816084338ada8d574b1cb48390e6e8b19305d5120fe3a37c98825bacc78306" + url: "https://pub.dev" source: hosted - version: "8.1.4+2" + version: "9.2.0" + permission_handler_html: + dependency: transitive + description: + name: permission_handler_html + sha256: d96ff56a757b7f04fa825c469d296c5aebc55f743e87bd639fef91a466a24da8 + url: "https://pub.dev" + source: hosted + version: "0.1.0+1" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - url: "https://pub.dartlang.org" + sha256: d87349312f7eaf6ce0adaf668daf700ac5b06af84338bd8b8574dfbd93ffe1a1 + url: "https://pub.dev" source: hosted - version: "3.6.1" + version: "4.0.2" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + sha256: "1e8640c1e39121128da6b816d236e714d2cf17fac5a105dd6acdd3403a628004" + url: "https://pub.dev" + source: hosted + version: "0.2.0" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + sha256: eeb2d1428ee7f4170e2bd498827296a18d4e7fc462b71727d111c0ac7707cfa6 + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "6.0.1" pin_input_text_field: dependency: "direct main" description: name: pin_input_text_field - url: "https://pub.dartlang.org" + sha256: "8d6fc670aa673a4df5976086f0e8039972a5b2bcb783c8db8dd3b9b4b072ca90" + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.5.1" + ping_discover_network_forked: + dependency: transitive + description: + name: ping_discover_network_forked + sha256: d3975c4f3fbaa388f78fb4037ad9c33059d8e2ec0e804ed45e05277d2451fe77 + url: "https://pub.dev" + source: hosted + version: "0.0.1" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.7" + pointer_interceptor: + dependency: transitive + description: + name: pointer_interceptor + sha256: adf7a637f97c077041d36801b43be08559fd4322d2127b3f20bb7be1b9eebc22 + url: "https://pub.dev" + source: hosted + version: "0.9.3+7" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" + url: "https://pub.dev" + source: hosted + version: "3.7.3" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "1.5.1" print_bluetooth_thermal: dependency: "direct main" description: name: print_bluetooth_thermal - url: "https://pub.dartlang.org" + sha256: aecc2c8e799e524e4622e3ab298bfc8cc44bc3d61de425591e17f1cacf6a3f5a + url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.0.9" printing: dependency: "direct main" description: name: printing - url: "https://pub.dartlang.org" + sha256: ad39a42a5f83125952457dfd94f395c8cf0eb1f7759583dadb769be5c7f99d24 + url: "https://pub.dev" source: hosted - version: "5.9.1" + version: "5.11.1" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + url: "https://pub.dev" source: hosted version: "4.2.4" provider: dependency: "direct main" description: name: provider - url: "https://pub.dartlang.org" + sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096" + url: "https://pub.dev" source: hosted - version: "6.0.5" + version: "6.1.1" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.4" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.2.3" qr: dependency: transitive description: name: qr - url: "https://pub.dartlang.org" + sha256: "64957a3930367bf97cc211a5af99551d630f2f4625e38af10edd6b19131b64b3" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.1" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" + url: "https://pub.dev" + source: hosted + version: "0.27.7" screenshot: dependency: "direct main" description: name: screenshot - url: "https://pub.dartlang.org" + sha256: "455284ff1f5b911d94a43c25e1385485cf6b4f288293eba68f15dad711c7b81c" + url: "https://pub.dev" source: hosted - version: "1.2.3" + version: "2.1.0" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.4" sky_engine: dependency: transitive description: flutter @@ -927,226 +1245,322 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.4.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" + url: "https://pub.dev" + source: hosted + version: "1.3.4" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" sync_http: dependency: transitive description: name: sync_http - url: "https://pub.dartlang.org" + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.dev" source: hosted version: "0.3.1" syncfusion_flutter_core: dependency: transitive description: name: syncfusion_flutter_core - url: "https://pub.dartlang.org" + sha256: "3979f0b1c5a97422cadae52d476c21fa3e0fb671ef51de6cae1d646d8b99fe1f" + url: "https://pub.dev" source: hosted - version: "20.3.60" + version: "20.4.54" syncfusion_flutter_xlsio: dependency: "direct main" description: name: syncfusion_flutter_xlsio - url: "https://pub.dartlang.org" + sha256: a73bb379ab01f37a764038667d1e3636a46cc55a4bfa573e98475a35659b7bff + url: "https://pub.dev" source: hosted - version: "20.3.60-beta" + version: "20.4.54-beta" syncfusion_officecore: dependency: transitive description: name: syncfusion_officecore - url: "https://pub.dartlang.org" + sha256: "2ca66b01fb903bb8444d02c122078917d34edf2e5ad640cb41e3f07076c3b677" + url: "https://pub.dev" source: hosted - version: "20.3.60-beta" + version: "20.4.54-beta" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" + source: hosted + version: "0.6.1" + thermal_printer: + dependency: "direct main" + description: + name: thermal_printer + sha256: "0434f1c18a58b03d46139917e58e7236ad9776fccc36fd9ffd2f17a75fbbc333" + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "1.0.1" timing: dependency: transitive description: name: timing - url: "https://pub.dartlang.org" + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" universal_html: dependency: "direct main" description: name: universal_html - url: "https://pub.dartlang.org" + sha256: "56536254004e24d9d8cfdb7dbbf09b74cf8df96729f38a2f5c238163e3d58971" + url: "https://pub.dev" source: hosted - version: "2.0.8" + version: "2.2.4" universal_io: dependency: transitive description: name: universal_io - url: "https://pub.dartlang.org" + sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" + url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.2.2" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.dartlang.org" + sha256: b1c9e98774adf8820c96fbc7ae3601231d324a7d5ebd8babe27b6dfac91357ba + url: "https://pub.dev" source: hosted - version: "6.0.9" + version: "6.2.1" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def" + url: "https://pub.dev" + source: hosted + version: "6.2.0" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: bba3373219b7abb6b5e0d071b0fe66dfbe005d07517a68e38d4fc3638f35c6d3 + url: "https://pub.dev" + source: hosted + version: "6.2.1" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.dartlang.org" + sha256: "9f2d390e096fdbe1e6e6256f97851e51afc2d9c423d3432f1d6a02a8a9a8b9fd" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.1.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.dartlang.org" + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.1.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.dartlang.org" + sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50" + url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.2.0" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.dartlang.org" + sha256: "138bd45b3a456dcfafc46d1a146787424f8d2edfbf2809c9324361e58f851cf7" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.2.1" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.dartlang.org" + sha256: "7754a1ad30ee896b265f8d14078b0513a4dba28d358eabb9d5f339886f4a1adc" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "3.1.0" url_strategy: dependency: "direct main" description: name: url_strategy - url: "https://pub.dartlang.org" + sha256: "42b68b42a9864c4d710401add17ad06e28f1c1d5500c93b98c431f6b0ea4ab87" + url: "https://pub.dev" source: hosted version: "0.2.0" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "0f0c746dd2d6254a0057218ff980fc7f5670fd0fcf5e4db38a490d31eed4ad43" + url: "https://pub.dev" + source: hosted + version: "1.1.9+1" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "0edf6d630d1bfd5589114138ed8fada3234deacc37966bec033d3047c29248b7" + url: "https://pub.dev" + source: hosted + version: "1.1.9+1" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: d24333727332d9bd20990f1483af4e09abdb9b1fc7c3db940b56ab5c42790c26 + url: "https://pub.dev" + source: hosted + version: "1.1.9+1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 + url: "https://pub.dev" source: hosted - version: "9.0.0" + version: "11.10.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.4.0" webdriver: dependency: transitive description: name: webdriver - url: "https://pub.dartlang.org" + sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.2" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + sha256: "7c99c0e1e2fa190b48d25c81ca5e42036d5cac81430ef249027d97b0935c553f" + url: "https://pub.dev" source: hosted - version: "2.2.6" + version: "5.1.0" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" + url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "1.0.3" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + sha256: af5e77e9b83f2f4adc5d3f0a4ece1c7f45a2467b695c2540381bac793e34e556 + url: "https://pub.dev" source: hosted - version: "5.1.2" + version: "6.4.2" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" sdks: - dart: ">=2.17.0 <3.0.0" - flutter: ">=3.0.0" \ No newline at end of file + dart: ">=3.2.0 <4.0.0" + flutter: ">=3.16.0" diff --git a/frontend/mgramseva/pubspec.yaml b/frontend/mgramseva/pubspec.yaml index 2f597eb81..8fe269f84 100644 --- a/frontend/mgramseva/pubspec.yaml +++ b/frontend/mgramseva/pubspec.yaml @@ -15,66 +15,69 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.2.14+31 + +version: 1.2.15+32 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.2 - bluetooth_thermal_printer: ^0.0.6 + thermal_printer: ^1.0.1 + dart_ping_ios: ^3.0.0 universal_html: ^2.0.8 flutter_secure_storage: ^4.2.0 - flutter_svg: ^0.22.0 + flutter_svg: ^2.0.7 datetime_picker_formfield: ^2.0.0 horizontal_data_table: ^4.1.3 - file_picker: ^4.0.3 - http: ^0.13.3 + file_picker: ^5.5.0 + http: ^1.1.0 provider: ^6.0.0 flutter_spinkit: ^5.0.0 json_annotation: ^4.8.0 url_strategy: ^0.2.0 - charset_converter: ^2.0.0 - screenshot: ^1.2.3 + charset_converter: ^2.1.1 + screenshot: ^2.1.0 number_to_words: ^1.0.0 flutter_localizations: sdk: flutter flutter_typeahead: ^4.0.0 - flutter_downloader: ^1.8.0+1 + flutter_downloader: ^1.11.5 js: ^0.6.3 - path_provider: ^2.0.2 - permission_handler: ^8.1.4+2 + path_provider: ^2.1.1 + permission_handler: ^11.1.0 buttons_tabbar: ^1.3.6 url_launcher: ^6.0.9 pin_input_text_field: ^4.1.0 flutter_countdown_timer: ^4.1.0 - flutter_rating_bar: ^4.0.0 + flutter_rating_bar: ^4.0.1 collection: ^1.15.0 image_picker: ^0.8.4 flutter_focus_watcher: ^2.0.0 path: ^1.8.0 - esc_pos_utils: ^1.1.0 - new_version: ^0.2.3 + esc_pos_utils_plus: ^2.0.2 + new_version_plus: ^0.0.11 pdf: ^3.8.1 flutter_share_me: ^1.3.0 - printing: ^5.9.1 + printing: ^5.10.4 mime: ^1.0.1 - charts_flutter: ^0.12.0 + community_charts_flutter: ^1.0.1 flutter_web_plugins: sdk: flutter - firebase_analytics: ^8.3.4 - package_info_plus: ^1.3.0 - open_file: ^3.2.1 #use for web - #open_file_safe: ^3.2.3 #use for mobiles + firebase_analytics: ^10.7.0 + firebase_core: ^2.22.0 + package_info_plus: ^4.2.0 + open_filex: ^4.3.4 syncfusion_flutter_xlsio: ^20.3.59-beta print_bluetooth_thermal: ^1.0.5 - nearby_connections: ^3.2.0 + nearby_connections: ^3.3.0 + dropdown_search: ^5.0.6 dev_dependencies: - flutter_launcher_icons: "^0.9.2" + flutter_launcher_icons: ^0.13.1 build_runner: ^2.1.2 flutter_test: sdk: flutter diff --git a/frontend/mgramseva/web/index.html b/frontend/mgramseva/web/index.html index 68f2b2563..c9f112ddb 100644 --- a/frontend/mgramseva/web/index.html +++ b/frontend/mgramseva/web/index.html @@ -21,12 +21,18 @@ - + - mgramseva + mGramSeva + + + - - - - - loading.. - loading.. +loading.. +loading.. - - - - - - - - + + + - -
-
-
+
+
+