diff --git a/lib/commons/components/atoms/index.dart b/.tool-versions:Zone.Identifier similarity index 100% rename from lib/commons/components/atoms/index.dart rename to .tool-versions:Zone.Identifier diff --git a/lib/commons/components/atoms/local_header/index.dart b/README.md:Zone.Identifier similarity index 100% rename from lib/commons/components/atoms/local_header/index.dart rename to README.md:Zone.Identifier diff --git a/lib/commons/components/atoms/menu_button_item/index.dart b/analysis_options.yaml:Zone.Identifier similarity index 100% rename from lib/commons/components/atoms/menu_button_item/index.dart rename to analysis_options.yaml:Zone.Identifier diff --git a/lib/commons/components/atoms/menu_card_item/index.dart b/android/.gitignore:Zone.Identifier similarity index 100% rename from lib/commons/components/atoms/menu_card_item/index.dart rename to android/.gitignore:Zone.Identifier diff --git a/lib/commons/components/index.dart b/android/app/build.gradle:Zone.Identifier similarity index 100% rename from lib/commons/components/index.dart rename to android/app/build.gradle:Zone.Identifier diff --git a/lib/commons/components/molecules/card/index.dart b/android/app/google-services.json:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/card/index.dart rename to android/app/google-services.json:Zone.Identifier diff --git a/lib/commons/components/molecules/header/index.dart b/android/app/src/debug/AndroidManifest.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/header/index.dart rename to android/app/src/debug/AndroidManifest.xml:Zone.Identifier diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 1994e1c8..87d8dd6f 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -10,7 +10,7 @@ diff --git a/lib/commons/components/molecules/index.dart b/android/app/src/main/AndroidManifest.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/index.dart rename to android/app/src/main/AndroidManifest.xml:Zone.Identifier diff --git a/lib/commons/components/molecules/menu_item/index.dart b/android/app/src/main/kotlin/com/example/my_project/MainActivity.kt:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/menu_item/index.dart rename to android/app/src/main/kotlin/com/example/my_project/MainActivity.kt:Zone.Identifier diff --git a/lib/commons/components/molecules/menu_list_view/index.dart b/android/app/src/main/res/drawable/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/menu_list_view/index.dart rename to android/app/src/main/res/drawable/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/molecules/menu_staggered_view/index.dart b/android/app/src/main/res/drawable/launch_background.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/menu_staggered_view/index.dart rename to android/app/src/main/res/drawable/launch_background.xml:Zone.Identifier diff --git a/lib/commons/components/molecules/message_well/index.dart b/android/app/src/main/res/drawable/mipmap/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/message_well/index.dart rename to android/app/src/main/res/drawable/mipmap/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/molecules/well/index.dart b/android/app/src/main/res/mipmap-hdpi/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/molecules/well/index.dart rename to android/app/src/main/res/mipmap-hdpi/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/organisms/index.dart b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:Zone.Identifier similarity index 100% rename from lib/commons/components/organisms/index.dart rename to android/app/src/main/res/mipmap-hdpi/ic_launcher.png:Zone.Identifier diff --git a/lib/commons/components/organisms/menu/index.dart b/android/app/src/main/res/mipmap-mdpi/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/organisms/menu/index.dart rename to android/app/src/main/res/mipmap-mdpi/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/templates/browser/index.dart b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/browser/index.dart rename to android/app/src/main/res/mipmap-mdpi/ic_launcher.png:Zone.Identifier diff --git a/lib/commons/components/templates/consult/index.dart b/android/app/src/main/res/mipmap-xhdpi/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/consult/index.dart rename to android/app/src/main/res/mipmap-xhdpi/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/templates/consult/model.dart b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/consult/model.dart rename to android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:Zone.Identifier diff --git a/lib/commons/components/templates/consult/widget.dart b/android/app/src/main/res/mipmap-xxhdpi/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/consult/widget.dart rename to android/app/src/main/res/mipmap-xxhdpi/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/templates/detail/index.dart b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/detail/index.dart rename to android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:Zone.Identifier diff --git a/lib/commons/components/templates/exception/index.dart b/android/app/src/main/res/mipmap-xxxhdpi/ic_fre_black.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/exception/index.dart rename to android/app/src/main/res/mipmap-xxxhdpi/ic_fre_black.png:Zone.Identifier diff --git a/lib/commons/components/templates/filter/index.dart b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/filter/index.dart rename to android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:Zone.Identifier diff --git a/lib/commons/components/templates/forms/index.dart b/android/app/src/main/res/values-night-v31/styles.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/forms/index.dart rename to android/app/src/main/res/values-night-v31/styles.xml:Zone.Identifier diff --git a/lib/commons/components/templates/index.dart b/android/app/src/main/res/values-night/styles.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/index.dart rename to android/app/src/main/res/values-night/styles.xml:Zone.Identifier diff --git a/lib/commons/components/templates/notification/index.dart b/android/app/src/main/res/values-v31/styles.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/notification/index.dart rename to android/app/src/main/res/values-v31/styles.xml:Zone.Identifier diff --git a/lib/commons/components/templates/register/index.dart b/android/app/src/main/res/values/strings.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/register/index.dart rename to android/app/src/main/res/values/strings.xml:Zone.Identifier diff --git a/lib/commons/components/templates/register/mode.dart b/android/app/src/main/res/values/styles.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/register/mode.dart rename to android/app/src/main/res/values/styles.xml:Zone.Identifier diff --git a/lib/commons/components/templates/register/widget.dart b/android/app/src/profile/AndroidManifest.xml:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/register/widget.dart rename to android/app/src/profile/AndroidManifest.xml:Zone.Identifier diff --git a/lib/commons/components/templates/schedule/index.dart b/android/build.gradle:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/schedule/index.dart rename to android/build.gradle:Zone.Identifier diff --git a/lib/commons/components/templates/schedule/model.dart b/android/gradle.properties:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/schedule/model.dart rename to android/gradle.properties:Zone.Identifier diff --git a/lib/commons/components/templates/schedule/widget.dart b/android/gradle/wrapper/gradle-wrapper.properties:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/schedule/widget.dart rename to android/gradle/wrapper/gradle-wrapper.properties:Zone.Identifier diff --git a/lib/commons/components/templates/setting/index.dart b/android/settings.gradle:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/setting/index.dart rename to android/settings.gradle:Zone.Identifier diff --git a/lib/commons/components/templates/setting/model.dart b/assets/audios/favicon.png:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/setting/model.dart rename to assets/audios/favicon.png:Zone.Identifier diff --git a/lib/commons/components/templates/setting/widget.dart b/assets/fonts/Nunito-Medium.ttf:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/setting/widget.dart rename to assets/fonts/Nunito-Medium.ttf:Zone.Identifier diff --git a/lib/commons/components/templates/welcome/index.dart b/assets/fonts/Nunito-Regular.ttf:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/welcome/index.dart rename to assets/fonts/Nunito-Regular.ttf:Zone.Identifier diff --git a/lib/commons/components/templates/welcome/model.dart b/assets/fonts/SFPRODISPLAYBOLD.OTF:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/welcome/model.dart rename to assets/fonts/SFPRODISPLAYBOLD.OTF:Zone.Identifier diff --git a/lib/commons/components/templates/welcome/widget.dart b/assets/fonts/SFPRODISPLAYMEDIUM.OTF:Zone.Identifier similarity index 100% rename from lib/commons/components/templates/welcome/widget.dart rename to assets/fonts/SFPRODISPLAYMEDIUM.OTF:Zone.Identifier diff --git a/lib/commons/schema/enums/index.dart b/assets/fonts/SFPRODISPLAYREGULAR.OTF:Zone.Identifier similarity index 100% rename from lib/commons/schema/enums/index.dart rename to assets/fonts/SFPRODISPLAYREGULAR.OTF:Zone.Identifier diff --git a/lib/commons/schema/index.dart b/assets/fonts/favicon.png:Zone.Identifier similarity index 100% rename from lib/commons/schema/index.dart rename to assets/fonts/favicon.png:Zone.Identifier diff --git a/lib/commons/schema/util/index.dart b/assets/fonts/icons.ttf:Zone.Identifier similarity index 100% rename from lib/commons/schema/util/index.dart rename to assets/fonts/icons.ttf:Zone.Identifier diff --git a/lib/commons/widgets/a11y/index.dart b/assets/fonts/menu.ttf:Zone.Identifier similarity index 100% rename from lib/commons/widgets/a11y/index.dart rename to assets/fonts/menu.ttf:Zone.Identifier diff --git a/lib/commons/widgets/control/index.dart b/assets/images/adaptive_background_icon.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/control/index.dart rename to assets/images/adaptive_background_icon.svg:Zone.Identifier diff --git a/lib/commons/widgets/info/index.dart b/assets/images/adaptive_foreground_icon.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/info/index.dart rename to assets/images/adaptive_foreground_icon.svg:Zone.Identifier diff --git a/lib/commons/widgets/io/index.dart b/assets/images/app_launcher_icon.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/io/index.dart rename to assets/images/app_launcher_icon.svg:Zone.Identifier diff --git a/lib/commons/widgets/io/textfield/index.dart b/assets/images/dark/login.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/io/textfield/index.dart rename to assets/images/dark/login.svg:Zone.Identifier diff --git a/assets/images/dark/register.svg b/assets/images/dark/register.svg new file mode 100644 index 00000000..5e7071f7 --- /dev/null +++ b/assets/images/dark/register.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/commons/widgets/layout/index.dart b/assets/images/dark/register.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/layout/index.dart rename to assets/images/dark/register.svg:Zone.Identifier diff --git a/lib/commons/widgets/nav/index.dart b/assets/images/dark/welcome.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/nav/index.dart rename to assets/images/dark/welcome.svg:Zone.Identifier diff --git a/lib/commons/widgets/scroll/index.dart b/assets/images/error_image.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/scroll/index.dart rename to assets/images/error_image.svg:Zone.Identifier diff --git a/lib/commons/widgets/style/index.dart b/assets/images/favicon.png:Zone.Identifier similarity index 100% rename from lib/commons/widgets/style/index.dart rename to assets/images/favicon.png:Zone.Identifier diff --git a/lib/commons/widgets/view/index.dart b/assets/images/light/login.svg:Zone.Identifier similarity index 100% rename from lib/commons/widgets/view/index.dart rename to assets/images/light/login.svg:Zone.Identifier diff --git a/assets/images/light/register.svg b/assets/images/light/register.svg new file mode 100644 index 00000000..2fecef14 --- /dev/null +++ b/assets/images/light/register.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/modals/browsers/index.dart b/assets/images/light/register.svg:Zone.Identifier similarity index 100% rename from lib/modals/browsers/index.dart rename to assets/images/light/register.svg:Zone.Identifier diff --git a/lib/modals/browsers/visitor_browser/index.dart b/assets/images/light/welcome.svg:Zone.Identifier similarity index 100% rename from lib/modals/browsers/visitor_browser/index.dart rename to assets/images/light/welcome.svg:Zone.Identifier diff --git a/lib/modals/details/index.dart b/assets/images/logo.svg:Zone.Identifier similarity index 100% rename from lib/modals/details/index.dart rename to assets/images/logo.svg:Zone.Identifier diff --git a/assets/images/welcome.svg b/assets/images/welcome.svg deleted file mode 100644 index 8983fac0..00000000 --- a/assets/images/welcome.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/modals/details/liberation_history_item_details/index.dart b/assets/lottie_animations/favicon.png:Zone.Identifier similarity index 100% rename from lib/modals/details/liberation_history_item_details/index.dart rename to assets/lottie_animations/favicon.png:Zone.Identifier diff --git a/lib/modals/details/schedule_visit_detail/index.dart b/assets/pdfs/favicon.png:Zone.Identifier similarity index 100% rename from lib/modals/details/schedule_visit_detail/index.dart rename to assets/pdfs/favicon.png:Zone.Identifier diff --git a/lib/modals/details/view_visit_detail/index.dart b/assets/rive_animations/favicon.png:Zone.Identifier similarity index 100% rename from lib/modals/details/view_visit_detail/index.dart rename to assets/rive_animations/favicon.png:Zone.Identifier diff --git a/lib/modals/details/visit_details_modal/index.dart b/assets/videos/favicon.png:Zone.Identifier similarity index 100% rename from lib/modals/details/visit_details_modal/index.dart rename to assets/videos/favicon.png:Zone.Identifier diff --git a/lib/modals/details/visitor_details_modal/index.dart b/devtools_options.yaml:Zone.Identifier similarity index 100% rename from lib/modals/details/visitor_details_modal/index.dart rename to devtools_options.yaml:Zone.Identifier diff --git a/lib/modals/exceptions/error/index.dart b/firebase.json:Zone.Identifier similarity index 100% rename from lib/modals/exceptions/error/index.dart rename to firebase.json:Zone.Identifier diff --git a/lib/modals/exceptions/index.dart b/ios/.gitignore:Zone.Identifier similarity index 100% rename from lib/modals/exceptions/index.dart rename to ios/.gitignore:Zone.Identifier diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index ff0dcf11..748aee74 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 14.0 + 14.0.0 diff --git a/lib/modals/exceptions/info/index.dart b/ios/Flutter/AppFrameworkInfo.plist:Zone.Identifier similarity index 100% rename from lib/modals/exceptions/info/index.dart rename to ios/Flutter/AppFrameworkInfo.plist:Zone.Identifier diff --git a/lib/modals/exceptions/not_found/index.dart b/ios/Flutter/Debug.xcconfig:Zone.Identifier similarity index 100% rename from lib/modals/exceptions/not_found/index.dart rename to ios/Flutter/Debug.xcconfig:Zone.Identifier diff --git a/lib/modals/exceptions/warning/index.dart b/ios/Flutter/Release.xcconfig:Zone.Identifier similarity index 100% rename from lib/modals/exceptions/warning/index.dart rename to ios/Flutter/Release.xcconfig:Zone.Identifier diff --git a/lib/modals/filters/access_filter/index.dart b/ios/ImageNotification/Info.plist:Zone.Identifier similarity index 100% rename from lib/modals/filters/access_filter/index.dart rename to ios/ImageNotification/Info.plist:Zone.Identifier diff --git a/lib/modals/filters/options/index.dart b/ios/ImageNotification/NotificationService.swift:Zone.Identifier similarity index 100% rename from lib/modals/filters/options/index.dart rename to ios/ImageNotification/NotificationService.swift:Zone.Identifier diff --git a/ios/Podfile b/ios/Podfile index a43aebd4..8f4bfd94 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '14.0' +platform :ios, '14.0.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 20609413..0aa4fbd2 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -42,6 +42,9 @@ PODS: - FirebaseAnalytics (~> 10.27.0) - Firebase/CoreOnly (10.27.0): - FirebaseCore (= 10.27.0) + - Firebase/Crashlytics (10.27.0): + - Firebase/CoreOnly + - FirebaseCrashlytics (~> 10.27.0) - Firebase/Messaging (10.27.0): - Firebase/CoreOnly - FirebaseMessaging (~> 10.27.0) @@ -52,6 +55,10 @@ PODS: - firebase_core (3.1.0): - Firebase/CoreOnly (= 10.27.0) - Flutter + - firebase_crashlytics (4.0.1): + - Firebase/Crashlytics (= 10.27.0) + - firebase_core + - Flutter - firebase_messaging (15.0.1): - Firebase/Messaging (= 10.27.0) - firebase_core @@ -78,8 +85,19 @@ PODS: - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.12) - GoogleUtilities/Logger (~> 7.12) + - FirebaseCoreExtension (10.29.0): + - FirebaseCore (~> 10.0) - FirebaseCoreInternal (10.28.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" + - FirebaseCrashlytics (10.27.0): + - FirebaseCore (~> 10.5) + - FirebaseInstallations (~> 10.0) + - FirebaseRemoteConfigInterop (~> 10.23) + - FirebaseSessions (~> 10.5) + - GoogleDataTransport (~> 9.2) + - GoogleUtilities/Environment (~> 7.8) + - nanopb (< 2.30911.0, >= 2.30908.0) + - PromisesObjC (~> 2.1) - FirebaseInstallations (10.28.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) @@ -94,6 +112,16 @@ PODS: - GoogleUtilities/Reachability (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) - nanopb (< 2.30911.0, >= 2.30908.0) + - FirebaseRemoteConfigInterop (10.29.0) + - FirebaseSessions (10.29.0): + - FirebaseCore (~> 10.5) + - FirebaseCoreExtension (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleDataTransport (~> 9.2) + - GoogleUtilities/Environment (~> 7.13) + - GoogleUtilities/UserDefaults (~> 7.13) + - nanopb (< 2.30911.0, >= 2.30908.0) + - PromisesSwift (~> 2.1) - Flutter (1.0.0) - flutter_inappwebview_ios (0.0.1): - Flutter @@ -174,6 +202,8 @@ PODS: - permission_handler_apple (9.3.0): - Flutter - PromisesObjC (2.4.0) + - PromisesSwift (2.4.0): + - PromisesObjC (= 2.4.0) - SDWebImage (5.19.2): - SDWebImage/Core (= 5.19.2) - SDWebImage/Core (5.19.2) @@ -199,6 +229,7 @@ DEPENDENCIES: - file_picker (from `.symlinks/plugins/file_picker/ios`) - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`) - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - Flutter (from `Flutter`) - flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`) @@ -222,15 +253,20 @@ SPEC REPOS: - Firebase - FirebaseAnalytics - FirebaseCore + - FirebaseCoreExtension - FirebaseCoreInternal + - FirebaseCrashlytics - FirebaseInstallations - FirebaseMessaging + - FirebaseRemoteConfigInterop + - FirebaseSessions - GoogleAppMeasurement - GoogleDataTransport - GoogleUtilities - nanopb - OrderedSet - PromisesObjC + - PromisesSwift - SDWebImage - SwiftyGif @@ -243,6 +279,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/firebase_analytics/ios" firebase_core: :path: ".symlinks/plugins/firebase_core/ios" + firebase_crashlytics: + :path: ".symlinks/plugins/firebase_crashlytics/ios" firebase_messaging: :path: ".symlinks/plugins/firebase_messaging/ios" Flutter: @@ -282,12 +320,17 @@ SPEC CHECKSUMS: Firebase: 26b040b20866a55f55eb3611b9fcf3ae64816b86 firebase_analytics: 0627e95b73eb9e04f59167687ed5bc3f6fb50f23 firebase_core: 483cfad66d24d8f3c233f31db4263830c625c909 + firebase_crashlytics: 8f04c663c8734f97c4ccbe81b8511ce7060e3b28 firebase_messaging: e60c0694699d8a2e56a319e043709583f6544123 FirebaseAnalytics: f9211b719db260cc91aebee8bb539cb367d0dfd1 FirebaseCore: a2b95ae4ce7c83ceecfbbbe3b6f1cddc7415a808 + FirebaseCoreExtension: 705ca5b14bf71d2564a0ddc677df1fc86ffa600f FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698 + FirebaseCrashlytics: 81ea6ec96519388687f6061beb838a8eec482293 FirebaseInstallations: 60c1d3bc1beef809fd1ad1189a8057a040c59f2e FirebaseMessaging: 585984d0a1df120617eb10b44cad8968b859815e + FirebaseRemoteConfigInterop: 6efda51fb5e2f15b16585197e26eaa09574e8a4d + FirebaseSessions: dbd14adac65ce996228652c1fc3a3f576bdf3ecc Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0 flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086 @@ -302,6 +345,7 @@ SPEC CHECKSUMS: path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 + PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851 SDWebImage: dfe95b2466a9823cf9f0c6d01217c06550d7b29a share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 @@ -311,6 +355,6 @@ SPEC CHECKSUMS: video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3 webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36 -PODFILE CHECKSUM: f2b7abe080b8e8f49e642b85431f5117d22149fe +PODFILE CHECKSUM: d7f4d1b71f8c708247c1078c4aec33a28c763405 COCOAPODS: 1.15.2 diff --git a/lib/modals/filters/selections/index.dart b/ios/Podfile.lock:Zone.Identifier similarity index 100% rename from lib/modals/filters/selections/index.dart rename to ios/Podfile.lock:Zone.Identifier diff --git a/lib/modals/forms/change_password/index.dart b/ios/Podfile:Zone.Identifier similarity index 100% rename from lib/modals/forms/change_password/index.dart rename to ios/Podfile:Zone.Identifier diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 9ace6cd2..53994b42 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -51,6 +51,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6436409727A31CDC00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409027A31CD400820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C1B4A503715BC7B0F8826983 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -299,6 +301,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( + 6436409727A31CDC00820AF7 /* pt */, + 6436409027A31CD400820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; @@ -363,7 +367,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -458,7 +462,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -507,7 +511,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/lib/modals/forms/forgot_password/index.dart b/ios/Runner.xcodeproj/project.pbxproj:Zone.Identifier similarity index 100% rename from lib/modals/forms/forgot_password/index.dart rename to ios/Runner.xcodeproj/project.pbxproj:Zone.Identifier diff --git a/lib/modals/forms/index.dart b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:Zone.Identifier similarity index 100% rename from lib/modals/forms/index.dart rename to ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:Zone.Identifier diff --git a/lib/modals/forms/qr_code/index.dart b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier similarity index 100% rename from lib/modals/forms/qr_code/index.dart rename to ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier diff --git a/lib/modals/index.dart b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier similarity index 100% rename from lib/modals/index.dart rename to ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier diff --git a/lib/modals/notifications/access_notification/index.dart b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:Zone.Identifier similarity index 100% rename from lib/modals/notifications/access_notification/index.dart rename to ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:Zone.Identifier diff --git a/lib/modals/notifications/index.dart b/ios/Runner.xcworkspace/contents.xcworkspacedata:Zone.Identifier similarity index 100% rename from lib/modals/notifications/index.dart rename to ios/Runner.xcworkspace/contents.xcworkspacedata:Zone.Identifier diff --git a/lib/modals/notifications/message_notificaion/index.dart b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier similarity index 100% rename from lib/modals/notifications/message_notificaion/index.dart rename to ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:Zone.Identifier diff --git a/lib/modals/notifications/visit_request/index.dart b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier similarity index 100% rename from lib/modals/notifications/visit_request/index.dart rename to ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:Zone.Identifier diff --git a/lib/modals/selection/bottom_arrow_linked_locals/index.dart b/ios/Runner/AppDelegate.swift:Zone.Identifier similarity index 100% rename from lib/modals/selection/bottom_arrow_linked_locals/index.dart rename to ios/Runner/AppDelegate.swift:Zone.Identifier diff --git a/lib/modals/selection/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png:Zone.Identifier similarity index 100% rename from lib/modals/selection/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png:Zone.Identifier diff --git a/lib/modals/selection/top_arrow_linked_locals/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png:Zone.Identifier similarity index 100% rename from lib/modals/selection/top_arrow_linked_locals/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png:Zone.Identifier diff --git a/lib/modals/selection/up_arrow_linked_locals/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png:Zone.Identifier similarity index 100% rename from lib/modals/selection/up_arrow_linked_locals/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png:Zone.Identifier diff --git a/lib/pages/consults/access/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/access/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png:Zone.Identifier diff --git a/lib/pages/consults/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png:Zone.Identifier diff --git a/lib/pages/consults/liberation/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/liberation/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png:Zone.Identifier diff --git a/lib/pages/consults/message/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/message/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png:Zone.Identifier diff --git a/lib/pages/consults/poeple/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/poeple/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png:Zone.Identifier diff --git a/lib/pages/consults/qrcode/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/qrcode/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png:Zone.Identifier diff --git a/lib/pages/consults/visit/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png:Zone.Identifier similarity index 100% rename from lib/pages/consults/visit/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png:Zone.Identifier diff --git a/lib/pages/home/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png:Zone.Identifier similarity index 100% rename from lib/pages/home/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png:Zone.Identifier diff --git a/lib/pages/onboarding/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png:Zone.Identifier similarity index 100% rename from lib/pages/onboarding/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png:Zone.Identifier diff --git a/lib/pages/registers/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png:Zone.Identifier similarity index 100% rename from lib/pages/registers/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png:Zone.Identifier diff --git a/lib/pages/registers/visitor/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png:Zone.Identifier similarity index 100% rename from lib/pages/registers/visitor/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png:Zone.Identifier diff --git a/lib/pages/schedules/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png:Zone.Identifier similarity index 100% rename from lib/pages/schedules/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png:Zone.Identifier diff --git a/lib/pages/schedules/visit/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png:Zone.Identifier similarity index 100% rename from lib/pages/schedules/visit/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png:Zone.Identifier diff --git a/lib/pages/settings/index.dart b/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png:Zone.Identifier similarity index 100% rename from lib/pages/settings/index.dart rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png:Zone.Identifier diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:Zone.Identifier b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/69 1.png:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/69 1.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/69 2.png:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/69 2.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/69.png:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/69.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:Zone.Identifier b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/appstore.png:Zone.Identifier b/ios/Runner/Assets.xcassets/appstore.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Assets.xcassets/playstore.png:Zone.Identifier b/ios/Runner/Assets.xcassets/playstore.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard:Zone.Identifier b/ios/Runner/Base.lproj/LaunchScreen.storyboard:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Base.lproj/Main.storyboard:Zone.Identifier b/ios/Runner/Base.lproj/Main.storyboard:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/GoogleService-Info.plist:Zone.Identifier b/ios/Runner/GoogleService-Info.plist:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Info.plist:Zone.Identifier b/ios/Runner/Info.plist:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/PrivacyInfo.xcprivacy:Zone.Identifier b/ios/Runner/PrivacyInfo.xcprivacy:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Runner-Bridging-Header.h:Zone.Identifier b/ios/Runner/Runner-Bridging-Header.h:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/Runner.entitlements:Zone.Identifier b/ios/Runner/Runner.entitlements:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/en.lproj/InfoPlist.strings:Zone.Identifier b/ios/Runner/en.lproj/InfoPlist.strings:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/ios/Runner/pt.lproj/InfoPlist.strings:Zone.Identifier b/ios/Runner/pt.lproj/InfoPlist.strings:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart new file mode 100644 index 00000000..d7a4ae22 --- /dev/null +++ b/lib/actions/actions.dart @@ -0,0 +1,781 @@ +import 'dart:developer'; + +// import 'package:hub/components/organisms/bottom_arrow_linked_locals/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/custom_code/actions/get_dev_u_u_i_d.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/random_data_util.dart'; +import 'package:hub/pages/home_page/home_page_model.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:qr_flutter/qr_flutter.dart'; + +import 'package:url_launcher/url_launcher.dart'; + +import '../shared/utils/log_util.dart'; + +Future openTermsOfUse(BuildContext context) async { + log('openTermsOfUse'); + final Uri url = Uri.parse('https://freaccess.com.br/pp/'); + if (!await launchUrl(url)) { + throw Exception('Could not launch $url'); + } +} + +Future repeatVisitScheduleAction( + BuildContext context, { + List? visitorJsonList, + String? visitorStrList, + String? visitStartDateStr, + String? visitEndDateStr, + String? visitReasonStr, + String? visitLevelStr, + bool? visitTempBol, + String? visitObsStr, +}) async { + context.pushNamed( + 'scheduleCompleteVisitPage', + queryParameters: { + 'visitStartDateStr': serializeParam( + visitStartDateStr, + ParamType.String, + ), + 'visitEndDateStr': serializeParam( + visitEndDateStr, + ParamType.String, + ), + 'visitReasonStr': serializeParam( + visitReasonStr, + ParamType.String, + ), + 'visitLevelStr': serializeParam( + visitLevelStr, + ParamType.String, + ), + 'visitTempBol': serializeParam( + visitTempBol, + ParamType.bool, + ), + 'visitObsStr': serializeParam( + visitObsStr, + ParamType.String, + ), + 'visitorStrList': serializeParam( + visitorStrList, + ParamType.String, + ), + 'visitorJsonList': serializeParam( + visitorJsonList, + ParamType.JSON, + isList: true, + ), + }.withoutNulls, + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); +} + +Future manageStatusColorAction( + BuildContext context, { + required String? visitStatusStr, +}) async { + log('visitStatusStr: $visitStatusStr'); + if (visitStatusStr == 'A') { + return FlutterFlowTheme.of(context).success; + } else if ((visitStatusStr == 'C') || + (visitStatusStr == 'F') || + (visitStatusStr == 'B') || + (visitStatusStr == 'I')) { + return FlutterFlowTheme.of(context).error; + } + + return FlutterFlowTheme.of(context).warning; +} + +Future singInLoginAction( + BuildContext context, { + String? emailAdress, + String? password, +}) async { + try { + String? devUUID; + ApiCallResponse? loginCall; + + await Future.wait([ + Future(() async { + FFAppState().email = emailAdress!; + }), + Future(() async { + FFAppState().passwd = password!; + }), + ]); + + if ((FFAppState().email != '') && (FFAppState().passwd != '')) { + devUUID = await getDevUUID(); + + FFAppState().devUUID = devUUID!; + + loginCall = await PhpGroup.loginCall.call( + email: FFAppState().email, + password: FFAppState().passwd, + uuid: FFAppState().devUUID, + type: FFAppState().device, + description: randomString( + 10, + 10, + true, + false, + false, + ), + ); + + if (PhpGroup.loginCall.error((loginCall.jsonBody ?? '')) == false) { + FFAppState().userUUID = PhpGroup.loginCall.userUUID( + (loginCall.jsonBody ?? ''), + )!; + + FFAppState().createdAt = dateTimeFormat( + 'd/M/y H:mm:ss', + getCurrentTimestamp, + locale: FFLocalizations.of(context).languageCode, + ); + + FFAppState().updatedAt = '00/00/0000 00:00:00'; + + FFAppState().status = + PhpGroup.loginCall.userStatus((loginCall.jsonBody ?? ''))!; + + FFAppState().userDevUUID = + PhpGroup.loginCall.userDeviceId((loginCall.jsonBody ?? ''))!; + + FFAppState().name = + PhpGroup.loginCall.userName((loginCall.jsonBody ?? ''))!; + + FFAppState().serialNumber = await getSerialNumber() ?? ''; + + FFAppState().isLogged = true; + + await toggleHomePage(context); + } else { + if (PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')) == null) { + DialogUtil.errorDefault(context); + } else { + DialogUtil.error(context, + PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')).toString()); + } + + FFAppState().deleteEmail(); + FFAppState().email = ''; + + FFAppState().deletePasswd(); + FFAppState().passwd = ''; + + FFAppState().update(() {}); + } + } + + return; + } catch (e, s) { + DialogUtil.errorDefault(context); + LogUtil.requestAPIFailed( + 'login.php', emailAdress.toString(), "Login", e, s); + } +} + +Future signUpRegisterAction( + BuildContext context, { + required String? name, + String? passwd, + required String? email, + String? device, +}) async { + try { + ApiCallResponse? registerCall; + if ((email != null && email != '') && + (passwd != null && passwd != '' && passwd.length > 7) && + (name != null && name != '')) { + registerCall = await PhpGroup.registerCall.call( + name: name, + password: passwd, + email: email, + token: randomString( + 36, + 36, + false, + false, + true, + ), + uuid: randomString( + 36, + 36, + false, + false, + true, + ), + tipo: device, + descricao: randomString( + 36, + 36, + true, + false, + false, + ), + ); + + if (PhpGroup.registerCall.error( + (registerCall.jsonBody ?? ''), + ) == + false) { + return true; + } + final errorMessage = registerCall?.jsonBody['error_msg']; + DialogUtil.error(context, errorMessage); + return false; + } else { + DialogUtil.errorDefault(context); + return false; + } + } catch (e, s) { + DialogUtil.errorDefault(context); + LogUtil.requestAPIFailed( + 'registro.php', email.toString(), "Register", e, s); + return false; + } +} + +Future forgotPasswdAction( + BuildContext context, { + required String? email, +}) async { + ApiCallResponse? forgotPasswd; + + forgotPasswd = await PhpGroup.forgotPasswordCall.call( + email: email, + ); + + if (PhpGroup.forgotPasswordCall.error( + (forgotPasswd.jsonBody ?? ''), + ) != + false) { + return; + } +} + +Future cachingLoginActionApp(BuildContext context) async { + if (FFAppState().isLogged == true) { + context.pushNamed('homePage'); + } else { + if (isAndroid == true) { + FFAppState().device = 'Android'; + } else if (isiOS == true) { + FFAppState().device = 'iOS'; + } else { + FFAppState().device = 'Web'; + } + } +} + +Future toggleSignInPage(BuildContext context) async { + context.pushNamed( + 'signInPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); +} + +Future toggleSignUpPage(BuildContext context) async { + context.pushNamed( + 'signUpPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); +} + +Future toggleHomePage(BuildContext context) async { + context.goNamed( + 'homePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); +} + +Future visitRequestComponentAction( + BuildContext context, { + required String? actionValue, + required String? refUUID, + required String? responseValue, + required String? vteUUID, +}) async { + ApiCallResponse? respondeSolicitacaoCall; + + respondeSolicitacaoCall = await PhpGroup.respondeSolicitacaoCall.call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'respondeSolicitacao', + referencia: refUUID, + tarefa: actionValue, + resposta: responseValue, + idVisitante: vteUUID, + ); + + if (respondeSolicitacaoCall.statusCode == 200) { + return true; + } else { + log('headers: ${respondeSolicitacaoCall.headers}'); + log('bodyText: ${respondeSolicitacaoCall.bodyText}'); + log('jsonBody: ${respondeSolicitacaoCall.jsonBody}'); + log('userUUID: ${FFAppState().userUUID}'); + log('devUUID: ${FFAppState().devUUID}'); + log('cliUUID: ${FFAppState().cliUUID}'); + log('atividade: respondeSolicitacao'); + log('referencia: $refUUID'); + log('tarefa: $actionValue'); + log('resposta: $responseValue'); + log('idVisitante: $vteUUID'); + return false; + } +} + +Future snackbar(BuildContext context, {required bool opt}) async { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + elevation: 10, + margin: const EdgeInsets.all(50), + content: Center( + child: Text( + opt + ? FFLocalizations.of(context).getText('asjd2q3k2j4l21') + : FFLocalizations.of(context).getText('asda2e42fafa'), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.normal, + color: FlutterFlowTheme.of(context).info, + ), + ), + ), + backgroundColor: opt + ? FlutterFlowTheme.of(context).success.withOpacity(0.5) + : FlutterFlowTheme.of(context).error.withOpacity(0.5), + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), + ), + ); +} + +Future checkLocals({ + String? cliUUID, + required BuildContext context, + required HomePageModel model, + required void Function(void Function()) safeSetState, +}) async { + // A chamada para a API permanece a mesma, assumindo que é necessária sempre. + final response = await PhpGroup.getLocalsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + ); + + // Verificação rápida de erro para evitar processamento desnecessário. + if (response.jsonBody['error']) { + log("checkLocals => Erro encontrado na resposta"); + return false; + } + + // Uso eficiente de coleções para verificar a condição desejada. + final String uuid = cliUUID ?? FFAppState().cliUUID; + final bool itemFound = response.jsonBody['locais'].any( + (local) => local['CLI_ID'] == uuid && local['CLU_STATUS'] == "A", + ); + + // Log e retorno condicional baseado no resultado da busca. + if (itemFound) { + log("checkLocals => Item encontrado com CLI_ID $uuid e CLU_STATUS A"); + return true; + } else { + log("checkLocals => Item não encontrado com CLI_ID $uuid e CLU_STATUS A"); + // A chamada para showModalBottomSheet permanece, mas a atualização da UI é otimizada. + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) => GestureDetector( + onTap: () => model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const BottomArrowLinkedLocalsComponentWidget(), + ), + ), + ); + safeSetState( + () {}); // Chamada otimizada fora do then para evitar encadeamentos desnecessários. + return false; + } +} + +Future changeStatusAction( + BuildContext context, + String status, + String vawREF, + String msg, + String vteUUID, +) async { + log('status: $status'); + + switch (status) { + case 'L': + Navigator.pop(context, true); + + bool? approveVisitRequest; + approveVisitRequest = await visitRequestComponentAction( + context, + actionValue: status, + refUUID: vawREF, + responseValue: msg, + vteUUID: vteUUID, + ); + if (!context.mounted) return; + if (approveVisitRequest == true) { + log('Aprovado'); + } else { + log('Erro ao aprovar'); + } + break; + case 'B': + Navigator.pop(context, true); + + bool? blockVisitRequest; + blockVisitRequest = await visitRequestComponentAction( + context, + actionValue: status, + refUUID: vawREF, + responseValue: msg, + vteUUID: vteUUID, + ); + if (!context.mounted) return; + if (blockVisitRequest == true) { + log('Bloqueado'); + } else { + log('Erro ao bloquear'); + } + break; + default: + break; + } +} + +/// QR Code + +Uint8List assembleQRPacket(int direction, String identifier, String password) { + List packet = [direction]; + + String paddedBadge = identifier.padLeft(30, '0'); + + log("Badge: $paddedBadge"); + + for (var i = 0; i < paddedBadge.length; i += 2) { + packet.add(int.parse(paddedBadge.substring(i, i + 2), radix: 16)); + } + + DateTime now = DateTime.now(); + int year = now.year % 100; + int month = now.month; + int day = now.day; + int hour = now.hour; + int minute = now.minute; + + int sum = year + month + day + hour + minute; + + if (sum == int.parse('0D', radix: 16) || sum == int.parse('0A', radix: 16)) { + packet.add(int.parse('FF', radix: 16)); + } else { + packet.add(sum); + } + + String paddedPassword = password.length != 4 ? 'FFFF' : password; + + for (var i = 0; i < paddedPassword.length; i += 2) { + packet.add(int.parse(paddedPassword.substring(i, i + 2), radix: 16)); + } + + int check = 0x00; + + for (var b in packet) { + check ^= b; + } + + if (check == int.parse('0D', radix: 16) || + check == int.parse('0A', radix: 16)) { + packet.add(int.parse('FF', radix: 16)); + } else { + packet.add(check); + } + + var bytes = + packet.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join((' ')); + + log("Pacote: $packet"); + log("Bytes: $bytes"); + return Uint8List.fromList(packet); +} + +Uint8List hexStringToByteArray(String s) { + int len = s.length; + Uint8List data = Uint8List(len ~/ 2); + for (int i = 0; i < len; i += 2) { + data[i ~/ 2] = + ((int.parse(s[i], radix: 16) << 4) + int.parse(s[i + 1], radix: 16)); + } + return data; +} + +String byteToHexa(Uint8List pDados) { + return pDados + .map((byte) => byte.toRadixString(16).padLeft(2, '0').toUpperCase()) + .join(); +} + +Future byteToString(Uint8List bytes) async { + return String.fromCharCodes(bytes); +} + +Widget buildQrCode( + { + // required String data, + // required String type, + // required int version, + // required int maskPattern, + required int errorCorrectLevel, + required double dimension, + required String identifier, + required String pass, + required int direction}) { + try { + log("pass: $pass"); + const Color backgroundColor = Colors.white; + const Color foregroundColor = Colors.black; + return QrImageView.withQr( + qr: QrCode.fromUint8List( + data: assembleQRPacket(direction, identifier, pass), + errorCorrectLevel: errorCorrectLevel), + size: dimension, + padding: const EdgeInsets.all(10), + backgroundColor: backgroundColor, + foregroundColor: foregroundColor); + } catch (e) { + return Text("Erro ao gerar QR Code: ${e.toString()}"); + } +} + +// // Retorna o conteúdo a ser codificado no QR Code. +// String getContents() { +// return data; +// } + +// // Retorna uma versão do conteúdo otimizada para exibição. +// String getDisplayContents() { +// return data.trim(); +// } + +// // Retorna o título baseado no tipo de conteúdo. +// String getTitle() { +// return type; +// } + +// // Codifica o conteúdo em uma string adequada para o QR Code. +// Future encodeContents() async { +// // Implementação específica para codificar o conteúdo. +// return data; // Exemplo simplificado. +// } + +// // Codifica o conteúdo específico do QR Code. +// Future encodeQRCodeContents() async { +// return getQrCode(); +// } + +// // Gera o QR Code como um widget. + +// // Codifica o conteúdo como um bitmap (pode ser útil para operações de baixo nível). +// // Future encodeAsBitmap() async { +// // // Implementação para codificar como bitmap. +// // return Image(image); // Exemplo simplificado. +// // } + +// // Adivinha a codificação apropriada para o conteúdo. +// String guessAppropriateEncoding(String content) { +// // Implementação para adivinhar a codificação. +// return "UTF-8"; // Exemplo simplificado. +// } + +// // Remove espaços em branco do início e do fim do conteúdo. +// String trim(String content) { +// return content.trim(); +// } + +// // Escapa caracteres especiais para o formato MECARD. +// String escapeMECARD(String content) { +// // Implementação para escapar caracteres. +// return content.replaceAll(':', '\\:'); // Exemplo simplificado. +// } + +/// menu + +Future scheduleVisitOptAction(BuildContext context) async { + await showAdaptiveDialog( + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: OptionSelectionModalWidget( + routesListStr: [ + 'scheduleCompleteVisitPage', + 'scheduleProvisionalVisitPage', + 'fastPassPage', + ], + iconsListIcon: [ + Icons.date_range_rounded, + Icons.date_range_rounded, + Icons.date_range_rounded, + ], + nameListStr: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nCompleta', + enText: 'Complete\nSchedule', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nProvisória', + enText: 'Provisional\nSchedule', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nRápida', + enText: 'Fast\nSchedule', + ), + ], + ), + ); + }, + ); +} + +Future registerVisitorOptAction(BuildContext context) async { + context.pushNamed( + 'registerVisitorPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); +} + +Future peopleOnThePropertyAction(BuildContext context) async { + context.pushNamed( + 'peopleOnThePropertyPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); +} + +Future preferencesSettings(BuildContext context) async { + context.pushNamed( + 'preferencesSettings', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); +} + +Future liberationHistoryOptAction(BuildContext context) async { + await showAdaptiveDialog( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: OptionSelectionModalWidget( + routesListStr: [ + 'liberationHistory', + 'acessHistoryPage', + 'scheduleCompleteVisitPage', + // 'messageHistoryPage', + ], + iconsListIcon: [ + Icons.history_rounded, + Icons.history_rounded, + Icons.history_rounded, + // Icons.history_rounded, + ], + nameListStr: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Liberação', + enText: 'Liberation\nHistory', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Acesso', + enText: 'Access\nHistory', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Visita', + enText: 'Visit\nHistory', + ), + // FFLocalizations.of(context).getVariableText( + // ptText: 'Histórico\nde Mensagens', + // enText: 'Message\nHistory', + // ), + ], + ), + ); + }, + ); +} + +Future accessQRCodeOptAction(BuildContext context) async { + context.pushNamed( + 'qrCodePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); +} diff --git a/lib/actions/actions.dart:Zone.Identifier b/lib/actions/actions.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/app_state.dart b/lib/app_state.dart index c16883dc..115951d0 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -1,11 +1,9 @@ // import 'dart:ffi'; -import 'commons/widgets/permissions_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:csv/csv.dart'; import 'package:local_auth/local_auth.dart'; -import 'package:permission_handler/permission_handler.dart'; import 'package:synchronized/synchronized.dart'; class FFAppState extends ChangeNotifier { @@ -19,7 +17,7 @@ class FFAppState extends ChangeNotifier { // Verifica suporte biométrico Future checkBiometrics() async { try { - return await auth.canCheckBiometrics; + return await auth.canCheckBiometrics; } catch (e) { clearBiometricAuthentication(); debugPrint('Error checking biometrics: $e'); @@ -32,14 +30,13 @@ class FFAppState extends ChangeNotifier { bool authenticated = false; try { authenticated = await auth.authenticate( - localizedReason: 'Scan your fingerprint to authenticate', - options: const AuthenticationOptions( - biometricOnly: true, - stickyAuth: true, - useErrorDialogs: true, - sensitiveTransaction: true, - ) - ); + localizedReason: 'Scan your fingerprint to authenticate', + options: const AuthenticationOptions( + biometricOnly: true, + stickyAuth: true, + useErrorDialogs: true, + sensitiveTransaction: true, + )); if (authenticated) { _isBiometricAuthenticated = true; notifyListeners(); @@ -52,7 +49,8 @@ class FFAppState extends ChangeNotifier { clearBiometricAuthentication(); return Future.error(e); } - return Future.error(''); // Add this line to ensure a value is always returned + return Future.error( + ''); // Add this line to ensure a value is always returned } // Função para limpar o estado de autenticação biométrica @@ -62,9 +60,6 @@ class FFAppState extends ChangeNotifier { // Limpar a informação salva, se necessário } - - - static FFAppState _instance = FFAppState._internal(); factory FFAppState() { @@ -125,13 +120,16 @@ class FFAppState extends ChangeNotifier { _tokenAPNS = await secureStorage.getString('ff_tokenAPNS') ?? _tokenAPNS; }); await _safeInitAsync(() async { - _userDevUUID = await secureStorage.getString('ff_user_dev_id') ?? _userDevUUID; + _userDevUUID = + await secureStorage.getString('ff_user_dev_id') ?? _userDevUUID; }); await _safeInitAsync(() async { - _serialNumber = await secureStorage.getString('ff_serialNumber') ?? _serialNumber; + _serialNumber = + await secureStorage.getString('ff_serialNumber') ?? _serialNumber; }); await _safeInitAsync(() async { - _fingerprintOPT = await secureStorage.getBool('fingerprint') ?? _fingerprintOPT; + _fingerprintOPT = + await secureStorage.getBool('fingerprint') ?? _fingerprintOPT; }); await _safeInitAsync(() async { _personOPT = await secureStorage.getBool('person') ?? _personOPT; @@ -139,6 +137,9 @@ class FFAppState extends ChangeNotifier { await _safeInitAsync(() async { _passOPT = await secureStorage.getBool('pass') ?? _passOPT; }); + await _safeInitAsync(() async { + _panicOPT = await secureStorage.getBool('panic') ?? _panicOPT; + }); await _safeInitAsync(() async { _notifyOPT = await secureStorage.getBool('notify') ?? _notifyOPT; }); @@ -149,9 +150,9 @@ class FFAppState extends ChangeNotifier { _panicPass = await secureStorage.getString('panicPass') ?? _panicPass; }); await _safeInitAsync(() async { - _fingerprintPass = await secureStorage.getString('fingerprintPass') ?? _fingerprintPass; + _fingerprintPass = + await secureStorage.getString('fingerprintPass') ?? _fingerprintPass; }); - } void update(VoidCallback callback) { @@ -161,6 +162,17 @@ class FFAppState extends ChangeNotifier { late FlutterSecureStorage secureStorage; + bool _panicOPT = false; + bool get panic => _panicOPT; + set panic(bool value) { + _panicOPT = value; + secureStorage.setBool('panic', value); + } + + void deletePanic() { + secureStorage.delete(key: 'panic'); + } + String _fingerprintPass = ''; String get fingerprintPass => _fingerprintPass; set fingerprintPass(String value) { @@ -187,8 +199,7 @@ class FFAppState extends ChangeNotifier { String get panicPass => _panicPass; set panicPass(String value) { _panicPass = value; - secureStorage.setString - ('panicPass', value); + secureStorage.setString('panicPass', value); } void deletePanicPass() { @@ -205,8 +216,7 @@ class FFAppState extends ChangeNotifier { bool _passOPT = false; bool get pass => _passOPT; set pass(bool value) { - _passOPT = - value; + _passOPT = value; secureStorage.setBool('pass', value); } diff --git a/lib/app_state.dart:Zone.Identifier b/lib/app_state.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/api_calls.dart b/lib/backend/api_requests/api_calls.dart similarity index 99% rename from lib/commons/actions/api_calls.dart rename to lib/backend/api_requests/api_calls.dart index 67ec207f..2a8838ec 100644 --- a/lib/commons/actions/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -4,13 +4,14 @@ import 'dart:developer'; import 'package:flutter/foundation.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'api_manager.dart'; export 'api_manager.dart' show ApiCallResponse; const _kPrivateApiFunctionName = 'ffPrivateApiCall'; + /// Start PHP Group Code class PhpGroup { @@ -2432,4 +2433,4 @@ String _serializeJson(dynamic jsonVar, [bool isList = false]) { } return isList ? '[]' : '{}'; } -} +} \ No newline at end of file diff --git a/lib/backend/api_requests/api_calls.dart:Zone.Identifier b/lib/backend/api_requests/api_calls.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/api_manager.dart b/lib/backend/api_requests/api_manager.dart similarity index 99% rename from lib/commons/actions/api_manager.dart rename to lib/backend/api_requests/api_manager.dart index dcb91c8a..53340d4f 100644 --- a/lib/commons/actions/api_manager.dart +++ b/lib/backend/api_requests/api_manager.dart @@ -11,10 +11,13 @@ import 'package:equatable/equatable.dart'; import 'package:http_parser/http_parser.dart'; import 'package:mime_type/mime_type.dart'; -import '/commons/widgets/uploaded_file.dart'; +import '/flutter_flow/uploaded_file.dart'; import 'get_streamed_response.dart'; + + + enum ApiCallType { GET, POST, @@ -512,4 +515,4 @@ class ApiManager { return result; } -} +} \ No newline at end of file diff --git a/lib/backend/api_requests/api_manager.dart:Zone.Identifier b/lib/backend/api_requests/api_manager.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/get_streamed_response.dart b/lib/backend/api_requests/get_streamed_response.dart similarity index 77% rename from lib/commons/actions/get_streamed_response.dart rename to lib/backend/api_requests/get_streamed_response.dart index 1a53aab0..303a19e5 100644 --- a/lib/commons/actions/get_streamed_response.dart +++ b/lib/backend/api_requests/get_streamed_response.dart @@ -1,4 +1,4 @@ import 'package:http/http.dart'; Future getStreamedResponse(Request request) => - Client().send(request); + Client().send(request); \ No newline at end of file diff --git a/lib/backend/api_requests/get_streamed_response.dart:Zone.Identifier b/lib/backend/api_requests/get_streamed_response.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart similarity index 94% rename from lib/commons/actions/pushNotificationService.dart rename to lib/backend/push_notification/pushNotificationService.dart index c8dfa7f5..883a9338 100644 --- a/lib/commons/actions/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -4,18 +4,24 @@ import 'dart:developer'; import 'dart:io'; import 'dart:math' as math; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/actions.dart'; -import 'package:hub/app_state.dart'; -import 'package:hub/commons/actions/api_manager.dart'; + + import 'package:firebase_messaging/firebase_messaging.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; -import 'package:hub/modals/notifications/access_notification/widget.dart'; -import 'package:hub/modals/notifications/message_notificaion/widget.dart'; -import 'package:hub/modals/notifications/visit_request/widget.dart'; +import 'package:hub/actions/actions.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; import 'package:rxdart/rxdart.dart'; +// + + class PushNotificationService { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin = @@ -128,7 +134,7 @@ class PushNotificationService { log('Notification payload: $message'); var data = _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage log('Extra: ${data.value}'); - _handleNotificationClick(message, extra: data.value ?? {'extra': 'extra'}); + _handleNotificationClick(message, extra: data.value); } catch (e) { log('Error decoding notification payload: $e'); } @@ -359,7 +365,7 @@ class NotificationHandler { showDialog( context: context, builder: (BuildContext context) { - String id = _getIdBasedOnUserType(message); + _getIdBasedOnUserType(message); return Dialog( backgroundColor: Colors.transparent, child: AccessNotificationModalTemplateComponentWidget( @@ -407,7 +413,7 @@ class NotificationHandler { showDialog( context: context, builder: (BuildContext context) { - String id = _getIdBasedOnUserType(message); + _getIdBasedOnUserType(message); return Dialog( backgroundColor: Colors.transparent, child: VisitRequestTemplateComponentWidget( @@ -415,8 +421,8 @@ class NotificationHandler { vteReason: message['motivo'] ?? 'Unknown', vteMsg: message['mensagem'] ?? 'Unknown', vteDocument: message['documento'] ?? '', - vteUUID: message['idVisitante'].toString() ?? '0', - vawRef: message['referencia'].toString() ?? '0', + vteUUID: message['idVisitante'].toString(), + vawRef: message['referencia'].toString(), vawStatus: 'S', changeStatusAction: changeStatusAction, ), @@ -444,4 +450,4 @@ class PushNotificationManager { } -} +} \ No newline at end of file diff --git a/lib/backend/push_notification/pushNotificationService.dart:Zone.Identifier b/lib/backend/push_notification/pushNotificationService.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/tapNotifcationActivity.dart b/lib/backend/push_notification/tapNotifcationActivity.dart similarity index 95% rename from lib/commons/actions/tapNotifcationActivity.dart rename to lib/backend/push_notification/tapNotifcationActivity.dart index 064ee82b..1ee22050 100644 --- a/lib/commons/actions/tapNotifcationActivity.dart +++ b/lib/backend/push_notification/tapNotifcationActivity.dart @@ -1,4 +1,4 @@ -// import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +// import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; // import 'package:firebase_messaging/firebase_messaging.dart'; // import 'package:flutter/material.dart'; // import 'package:rxdart/rxdart.dart'; diff --git a/lib/backend/push_notification/tapNotifcationActivity.dart:Zone.Identifier b/lib/backend/push_notification/tapNotifcationActivity.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/schema/enums/enums.dart b/lib/backend/schema/enums/enums.dart similarity index 99% rename from lib/commons/schema/enums/enums.dart rename to lib/backend/schema/enums/enums.dart index bb6ac511..64351084 100644 --- a/lib/commons/schema/enums/enums.dart +++ b/lib/backend/schema/enums/enums.dart @@ -32,4 +32,4 @@ T? deserializeEnum(String? value) { default: return null; } -} +} \ No newline at end of file diff --git a/lib/backend/schema/enums/enums.dart:Zone.Identifier b/lib/backend/schema/enums/enums.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/schema/structs/device_struct.dart b/lib/backend/schema/structs/device_struct.dart similarity index 96% rename from lib/commons/schema/structs/device_struct.dart rename to lib/backend/schema/structs/device_struct.dart index 6ffaeaae..174afa98 100644 --- a/lib/commons/schema/structs/device_struct.dart +++ b/lib/backend/schema/structs/device_struct.dart @@ -1,9 +1,10 @@ // ignore_for_file: unnecessary_getters_setters -import '/commons/schema/util/schema_util.dart'; + +import 'package:hub/flutter_flow/nav/nav.dart'; import 'index.dart'; -import '/commons/widgets/flutter_flow_util.dart'; + class DeviceStruct extends BaseStruct { DeviceStruct({ @@ -110,4 +111,4 @@ DeviceStruct createDeviceStruct({ devUUID: devUUID, version: version, description: description, - ); + ); \ No newline at end of file diff --git a/lib/backend/schema/structs/device_struct.dart:Zone.Identifier b/lib/backend/schema/structs/device_struct.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/backend/schema/structs/index.dart b/lib/backend/schema/structs/index.dart new file mode 100644 index 00000000..4affa264 --- /dev/null +++ b/lib/backend/schema/structs/index.dart @@ -0,0 +1,3 @@ +export '/backend/schema/util/schema_util.dart'; + +export 'device_struct.dart'; diff --git a/lib/backend/schema/structs/index.dart:Zone.Identifier b/lib/backend/schema/structs/index.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/schema/util/schema_util.dart b/lib/backend/schema/util/schema_util.dart similarity index 91% rename from lib/commons/schema/util/schema_util.dart rename to lib/backend/schema/util/schema_util.dart index b788a544..80a9f7a4 100644 --- a/lib/commons/schema/util/schema_util.dart +++ b/lib/backend/schema/util/schema_util.dart @@ -2,9 +2,11 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:from_css_color/from_css_color.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/serialization_util.dart'; + -import '/commons/schema/enums/enums.dart'; -import '/commons/widgets/flutter_flow_util.dart'; export 'package:collection/collection.dart' show ListEquality; export 'package:flutter/material.dart' show Color, Colors; @@ -77,4 +79,4 @@ List? getColorsList(dynamic value) => value is! List ? null : value.map(getSchemaColor).withoutNulls; List? getDataList(dynamic value) => - value is! List ? null : value.map((e) => castToType(e)!).toList(); + value is! List ? null : value.map((e) => castToType(e)!).toList(); \ No newline at end of file diff --git a/lib/backend/schema/util/schema_util.dart:Zone.Identifier b/lib/backend/schema/util/schema_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/actions.dart b/lib/commons/actions/actions.dart deleted file mode 100644 index b16ce6e8..00000000 --- a/lib/commons/actions/actions.dart +++ /dev/null @@ -1,814 +0,0 @@ -import 'dart:convert'; -import 'dart:developer'; - -// import 'package:hub/components/organisms/bottom_arrow_linked_locals/bottom_arrow_linked_locals_component_widget.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; -import 'package:hub/modals/filters/selections/widget.dart'; -import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart'; -import 'package:hub/pages/home/model.dart'; -import 'package:hub/pages/home/widget.dart'; -import 'package:hub/commons/actions/get_dev_u_u_i_d.dart'; -import 'package:flutter/material.dart'; -import 'package:qr_flutter/qr_flutter.dart'; -import 'package:sqflite/utils/utils.dart'; - -import '/commons/actions/actions.dart' as action_blocks; -import '/commons/actions/api_calls.dart'; -import '/commons/actions/index.dart' as actions; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/random_data_util.dart' as random_data; - - -import 'package:url_launcher/url_launcher.dart'; - -Future openTermsOfUse(BuildContext context) async { - log('openTermsOfUse'); - final Uri url = Uri.parse('https://freaccess.com.br/pp/'); - if (!await launchUrl(url)) { - throw Exception('Could not launch $url'); - } -} - -Future repeatVisitScheduleAction( - BuildContext context, { - List? visitorJsonList, - String? visitorStrList, - String? visitStartDateStr, - String? visitEndDateStr, - String? visitReasonStr, - String? visitLevelStr, - bool? visitTempBol, - String? visitObsStr, -}) async { - context.pushNamed( - 'scheduleCompleteVisitPage', - queryParameters: { - 'visitStartDateStr': serializeParam( - visitStartDateStr, - ParamType.String, - ), - 'visitEndDateStr': serializeParam( - visitEndDateStr, - ParamType.String, - ), - 'visitReasonStr': serializeParam( - visitReasonStr, - ParamType.String, - ), - 'visitLevelStr': serializeParam( - visitLevelStr, - ParamType.String, - ), - 'visitTempBol': serializeParam( - visitTempBol, - ParamType.bool, - ), - 'visitObsStr': serializeParam( - visitObsStr, - ParamType.String, - ), - 'visitorStrList': serializeParam( - visitorStrList, - ParamType.String, - ), - 'visitorJsonList': serializeParam( - visitorJsonList, - ParamType.JSON, - isList: true, - ), - }.withoutNulls, - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); -} - -Future manageStatusColorAction( - BuildContext context, { - required String? visitStatusStr, -}) async { - log('visitStatusStr: $visitStatusStr'); - if (visitStatusStr == 'A') { - return FlutterFlowTheme.of(context).success; - } else if ((visitStatusStr == 'C') || - (visitStatusStr == 'F') || - (visitStatusStr == 'B') || - (visitStatusStr == 'I')) { - return FlutterFlowTheme.of(context).error; - } - - return FlutterFlowTheme.of(context).warning; -} - -Future singInLoginAction( - BuildContext context, { - String? emailAdress, - String? password, -}) async { - String? devUUID; - ApiCallResponse? loginCall; - - await Future.wait([ - Future(() async { - FFAppState().email = emailAdress!; - }), - Future(() async { - FFAppState().passwd = password!; - }), - ]); - if ((FFAppState().email != '') && (FFAppState().passwd != '')) { - devUUID = await actions.getDevUUID(); - FFAppState().devUUID = devUUID!; - loginCall = await PhpGroup.loginCall.call( - email: FFAppState().email, - password: FFAppState().passwd, - uuid: FFAppState().devUUID, - type: FFAppState().device, - description: random_data.randomString( - 10, - 10, - true, - false, - false, - ), - ); - - if (PhpGroup.loginCall.error( - (loginCall.jsonBody ?? ''), - ) == - false) { - FFAppState().userUUID = PhpGroup.loginCall.userUUID( - (loginCall.jsonBody ?? ''), - )!; - // FFAppState().token = await FirebaseMessaging.instance.getToken(); - FFAppState().createdAt = dateTimeFormat( - 'd/M/y H:mm:ss', - getCurrentTimestamp, - locale: FFLocalizations.of(context).languageCode, - ); - FFAppState().updatedAt = '00/00/0000 00:00:00'; - FFAppState().status = PhpGroup.loginCall.userStatus( - (loginCall.jsonBody ?? ''), - )!; - FFAppState().userDevUUID = PhpGroup.loginCall.userDeviceId( - (loginCall.jsonBody ?? ''), - )!; - FFAppState().name = PhpGroup.loginCall.userName( - (loginCall.jsonBody ?? ''), - )!; - FFAppState().serialNumber = await getSerialNumber() ?? ''; - FFAppState().isLogged = true; - await action_blocks.toggleHomePage(context); - return; - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.loginCall.msg( - (loginCall?.jsonBody ?? ''), - )!, - ), - ); - }, - ); - - FFAppState().deleteEmail(); - FFAppState().email = ''; - - FFAppState().deletePasswd(); - FFAppState().passwd = ''; - - FFAppState().update(() {}); - } - - return; - } else { - return; - } -} - -Future signUpRegisterAction( - BuildContext context, { - required String? name, - String? passwd, - required String? email, - String? device, -}) async { - ApiCallResponse? registerCall; - - if ((email != null && email != '') && - (passwd != null && passwd != '') && - (name != null && name != '')) { - registerCall = await PhpGroup.registerCall.call( - name: name, - password: passwd, - email: email, - token: random_data.randomString( - 36, - 36, - false, - false, - true, - ), - uuid: random_data.randomString( - 36, - 36, - false, - false, - true, - ), - tipo: device, - descricao: random_data.randomString( - 36, - 36, - true, - false, - false, - ), - ); - - if (PhpGroup.registerCall.error( - (registerCall.jsonBody ?? ''), - ) == - false) { - return true; - } - - await showDialog( - context: context, - builder: (alertDialogContext) { - return AlertDialog( - title: const Text('Error'), - content: Text('${registerCall?.jsonBody}'), - actions: [ - TextButton( - onPressed: () => Navigator.pop(alertDialogContext), - child: const Text('ERROR2 '), - ), - ], - ); - }, - ); - return false; - } else { - await showDialog( - context: context, - builder: (alertDialogContext) { - return AlertDialog( - title: Text(FFLocalizations.of(context).getVariableText( - enText: 'Error', - ptText: 'Erro', - )), - content: Text(FFLocalizations.of(context).getVariableText( - enText: 'Please fill in all fields', - ptText: 'Por favor, preencha todos os campos', - )), - actions: [ - TextButton( - onPressed: () => Navigator.pop(alertDialogContext), - child: Text(FFLocalizations.of(context).getVariableText( - ptText: 'Fechar', - enText: 'Close', - )), - ), - ], - ); - }, - ); - return false; - } -} - -Future forgotPasswdAction( - BuildContext context, { - required String? email, -}) async { - ApiCallResponse? forgotPasswd; - - forgotPasswd = await PhpGroup.forgotPasswordCall.call( - email: email, - ); - - if (PhpGroup.forgotPasswordCall.error( - (forgotPasswd.jsonBody ?? ''), - ) != - false) { - return; - } -} - -Future cachingLoginActionApp(BuildContext context) async { - if (FFAppState().isLogged == true) { - context.pushNamed('homePage'); - } else { - if (isAndroid == true) { - FFAppState().device = 'Android'; - } else if (isiOS == true) { - FFAppState().device = 'iOS'; - } else { - FFAppState().device = 'Web'; - } - } -} - -Future toggleSignInPage(BuildContext context) async { - context.pushNamed( - 'signInPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); -} - -Future toggleSignUpPage(BuildContext context) async { - - context.pushNamed( - 'signUpPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); -} - -Future toggleHomePage(BuildContext context) async { - context.goNamed( - 'homePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); -} - -Future visitRequestComponentAction( - BuildContext context, { - required String? actionValue, - required String? refUUID, - required String? responseValue, - required String? vteUUID, -}) async { - ApiCallResponse? respondeSolicitacaoCall; - - respondeSolicitacaoCall = await PhpGroup.respondeSolicitacaoCall.call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliUUID: FFAppState().cliUUID, - atividade: 'respondeSolicitacao', - referencia: refUUID, - tarefa: actionValue, - resposta: responseValue, - idVisitante: vteUUID, - ); - - if (respondeSolicitacaoCall.statusCode == 200) { - return true; - } else { - log('headers: ${respondeSolicitacaoCall.headers}'); - log('bodyText: ${respondeSolicitacaoCall.bodyText}'); - log('jsonBody: ${respondeSolicitacaoCall.jsonBody}'); - log('userUUID: ${FFAppState().userUUID}'); - log('devUUID: ${FFAppState().devUUID}'); - log('cliUUID: ${FFAppState().cliUUID}'); - log('atividade: respondeSolicitacao'); - log('referencia: $refUUID'); - log('tarefa: $actionValue'); - log('resposta: $responseValue'); - log('idVisitante: $vteUUID'); - return false; - } -} - -Future snackbar(BuildContext context, {required bool opt}) async { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - elevation: 10, - margin: const EdgeInsets.all(50), - content: Center( - child: Text( - opt - ? FFLocalizations.of(context).getText('asjd2q3k2j4l21') - : FFLocalizations.of(context).getText('asda2e42fafa'), - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.normal, - color: FlutterFlowTheme.of(context).info, - ), - ), - ), - backgroundColor: opt - ? FlutterFlowTheme.of(context).success.withOpacity(0.5) - : FlutterFlowTheme.of(context).error.withOpacity(0.5), - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - ), - ); -} - -Future checkLocals({ - String? cliUUID, - required BuildContext context, - required HomePageModel model, - required void Function(void Function()) safeSetState, -}) async { - // A chamada para a API permanece a mesma, assumindo que é necessária sempre. - final response = await PhpGroup.getLocalsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - ); - - // Verificação rápida de erro para evitar processamento desnecessário. - if (response.jsonBody['error']) { - log("checkLocals => Erro encontrado na resposta"); - return false; - } - - // Uso eficiente de coleções para verificar a condição desejada. - final String uuid = cliUUID ?? FFAppState().cliUUID; - final bool itemFound = response.jsonBody['locais'].any( - (local) => local['CLI_ID'] == uuid && local['CLU_STATUS'] == "A", - ); - - // Log e retorno condicional baseado no resultado da busca. - if (itemFound) { - log("checkLocals => Item encontrado com CLI_ID $uuid e CLU_STATUS A"); - return true; - } else { - log("checkLocals => Item não encontrado com CLI_ID $uuid e CLU_STATUS A"); - // A chamada para showModalBottomSheet permanece, mas a atualização da UI é otimizada. - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) => GestureDetector( - onTap: () => model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const BottomArrowLinkedLocalsComponentWidget(), - ), - ), - ); - safeSetState(() {}); // Chamada otimizada fora do then para evitar encadeamentos desnecessários. - return false; - } -} - - -Future changeStatusAction( - BuildContext context, - String status, - String vawREF, - String msg, - String vteUUID, -) async { - log('status: $status'); - - switch (status) { - case 'L': - Navigator.pop(context, true); - - bool? approveVisitRequest; - approveVisitRequest = await visitRequestComponentAction( - context, - actionValue: status, - refUUID: vawREF, - responseValue: msg, - vteUUID: vteUUID, - ); - if (!context.mounted) return; - if (approveVisitRequest == true) { - log('Aprovado'); - } else { - log('Erro ao aprovar'); - } - break; - case 'B': - Navigator.pop(context, true); - - bool? blockVisitRequest; - blockVisitRequest = await visitRequestComponentAction( - context, - actionValue: status, - refUUID: vawREF, - responseValue: msg, - vteUUID: vteUUID, - ); - if (!context.mounted) return; - if (blockVisitRequest == true) { - log('Bloqueado'); - } else { - log('Erro ao bloquear'); - } - break; - default: - break; - } - - -} - - -/// QR Code - - -Uint8List assembleQRPacket(int direction, String identifier, String password) { - List packet = [direction]; - - String paddedBadge = identifier.padLeft(30, '0'); - - log("Badge: $paddedBadge"); - - for (var i = 0; i < paddedBadge.length; i += 2) { - packet.add(int.parse(paddedBadge.substring(i, i + 2), radix: 16)); - } - - DateTime now = DateTime.now(); - int year = now.year % 100; - int month = now.month; - int day = now.day; - int hour = now.hour; - int minute = now.minute; - - int sum = year + month + day + hour + minute; - - if (sum == int.parse('0D', radix: 16) || sum == int.parse('0A', radix: 16)) { - packet.add(int.parse('FF', radix: 16)); - } else { - packet.add(sum); - } - - String paddedPassword = password.length != 4 ? 'FFFF' : password; - - for (var i = 0; i < paddedPassword.length; i += 2) { - packet.add(int.parse(paddedPassword.substring(i, i + 2), radix: 16)); - } - - int check = 0x00; - - for (var b in packet) { - check ^= b; - } - - if (check == int.parse('0D', radix: 16) || check == int.parse('0A', radix: 16)) { - packet.add(int.parse('FF', radix: 16)); - } else { - packet.add(check); - } - - var bytes = packet.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join((' ')); - - log("Pacote: $packet"); - log("Bytes: $bytes"); - return Uint8List.fromList(packet); -} - -Uint8List hexStringToByteArray(String s) { - int len = s.length; - Uint8List data = Uint8List(len ~/ 2); - for (int i = 0; i < len; i += 2) { - data[i ~/ 2] = ((int.parse(s[i], radix: 16) << 4) + int.parse(s[i + 1], radix: 16)); - } - return data; -} - -String byteToHexa(Uint8List pDados) { - return pDados.map((byte) => byte.toRadixString(16).padLeft(2, '0').toUpperCase()).join(); -} - -Future byteToString(Uint8List bytes) async { - return String.fromCharCodes(bytes); -} - - -Widget buildQrCode( -{ - // required String data, - // required String type, - // required int version, - // required int maskPattern, - required int errorCorrectLevel, - required double dimension, - required String identifier, - required String pass, - required int direction - } - ) { - try { - log("pass: $pass"); - const Color backgroundColor = Colors.white; - const Color foregroundColor = Colors.black; - return QrImageView.withQr(qr: QrCode.fromUint8List(data: assembleQRPacket(direction, identifier, pass), errorCorrectLevel: errorCorrectLevel), size: dimension, padding: const EdgeInsets.all(10), backgroundColor: backgroundColor, foregroundColor: foregroundColor); - } catch (e) { - return Text("Erro ao gerar QR Code: ${e.toString()}"); - } -} - - - // // Retorna o conteúdo a ser codificado no QR Code. - // String getContents() { - // return data; - // } - - // // Retorna uma versão do conteúdo otimizada para exibição. - // String getDisplayContents() { - // return data.trim(); - // } - - // // Retorna o título baseado no tipo de conteúdo. - // String getTitle() { - // return type; - // } - - // // Codifica o conteúdo em uma string adequada para o QR Code. - // Future encodeContents() async { - // // Implementação específica para codificar o conteúdo. - // return data; // Exemplo simplificado. - // } - - // // Codifica o conteúdo específico do QR Code. - // Future encodeQRCodeContents() async { - // return getQrCode(); - // } - - // // Gera o QR Code como um widget. - - - // // Codifica o conteúdo como um bitmap (pode ser útil para operações de baixo nível). - // // Future encodeAsBitmap() async { - // // // Implementação para codificar como bitmap. - // // return Image(image); // Exemplo simplificado. - // // } - - // // Adivinha a codificação apropriada para o conteúdo. - // String guessAppropriateEncoding(String content) { - // // Implementação para adivinhar a codificação. - // return "UTF-8"; // Exemplo simplificado. - // } - - // // Remove espaços em branco do início e do fim do conteúdo. - // String trim(String content) { - // return content.trim(); - // } - - // // Escapa caracteres especiais para o formato MECARD. - // String escapeMECARD(String content) { - // // Implementação para escapar caracteres. - // return content.replaceAll(':', '\\:'); // Exemplo simplificado. - // } - - /// menu - - Future scheduleVisitOptAction(BuildContext context) async { - await showAdaptiveDialog( - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: OptionSelectionModalWidget( - routesListStr: [ - 'scheduleCompleteVisitPage', - 'scheduleProvisionalVisitPage', - 'fastPassPage', - ], - iconsListIcon: [ - Icons.date_range_rounded, - Icons.date_range_rounded, - Icons.date_range_rounded, - ], - nameListStr: [ - FFLocalizations.of(context).getVariableText( - ptText: 'Visita\nCompleta', - enText: 'Complete\nSchedule', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Visita\nProvisória', - enText: 'Provisional\nSchedule', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Visita\nRápida', - enText: 'Fast\nSchedule', - ), - ], - ), - ); - }, - ); - } - - Future registerVisitorOptAction(BuildContext context) async { - context.pushNamed( - 'registerVisitorPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - Future peopleOnThePropertyAction(BuildContext context) async { - context.pushNamed( - 'peopleOnThePropertyPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); - } - - Future preferencesSettings(BuildContext context) async { - context.pushNamed( - 'preferencesSettings', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - Future liberationHistoryOptAction(BuildContext context) async { - await showAdaptiveDialog( - // isScrollControlled: true, - // backgroundColor: Colors.transparent, - // enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: OptionSelectionModalWidget( - routesListStr: [ - 'liberationHistory', - 'acessHistoryPage', - 'scheduleCompleteVisitPage', - // 'messageHistoryPage', - ], - iconsListIcon: [ - Icons.history_rounded, - Icons.history_rounded, - Icons.history_rounded, - // Icons.history_rounded, - ], - nameListStr: [ - FFLocalizations.of(context).getVariableText( - ptText: 'Histórico\nde Liberação', - enText: 'Liberation\nHistory', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Histórico\nde Acesso', - enText: 'Access\nHistory', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Histórico\nde Visita', - enText: 'Visit\nHistory', - ), - // FFLocalizations.of(context).getVariableText( - // ptText: 'Histórico\nde Mensagens', - // enText: 'Message\nHistory', - // ), - ], - ), - ); - }, - ); - } - - Future accessQRCodeOptAction(BuildContext context) async { - context.pushNamed( - 'qrCodePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } diff --git a/lib/commons/components/atoms/menu_card_item/widget.dart b/lib/commons/components/atoms/menu_card_item/widget.dart deleted file mode 100644 index 5204dea7..00000000 --- a/lib/commons/components/atoms/menu_card_item/widget.dart +++ /dev/null @@ -1,109 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/commons/components/molecules/menu_item/widget.dart'; -import 'package:hub/commons/widgets/custom_icons.dart'; -import 'package:hub/commons/widgets/flutter_flow_theme.dart'; -import 'package:hub/commons/widgets/flutter_flow_util.dart'; - - - - -class MenuButtonWidget extends MenuEntry { - const MenuButtonWidget({ - Key? key, - this.action, - this.title, - this.icon, - }) : super(key: key); - - final Function()? action; - final String? title; - final IconData? icon; - - @override - _MenuButtonWidgetState createState() => _MenuButtonWidgetState(); -} - -class _MenuButtonWidgetState extends State { - @override - Widget build(BuildContext context) { - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.action?.call(); - }, - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kfast, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - widget.title ?? 'Menu Item', - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - widget.icon, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - ); - } -} \ No newline at end of file diff --git a/lib/commons/components/molecules/menu_item/widget.dart b/lib/commons/components/molecules/menu_item/widget.dart deleted file mode 100644 index 458ff49a..00000000 --- a/lib/commons/components/molecules/menu_item/widget.dart +++ /dev/null @@ -1,11 +0,0 @@ - -import 'package:flutter/cupertino.dart'; - -abstract class MenuEntry extends StatefulWidget { - const MenuEntry({ - Key? key, - }) : super(key: key); - - - -} \ No newline at end of file diff --git a/lib/commons/components/molecules/menu_staggered_view/widget.dart b/lib/commons/components/molecules/menu_staggered_view/widget.dart deleted file mode 100644 index c635435b..00000000 --- a/lib/commons/components/molecules/menu_staggered_view/widget.dart +++ /dev/null @@ -1,1082 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; -import 'package:google_fonts/google_fonts.dart'; - -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'model.dart'; - -export 'model.dart'; - -class MenuStaggeredViewComponentWidget extends StatefulWidget { - const MenuStaggeredViewComponentWidget({ - super.key, - required this.changeMenuStyleAction, - required this.registerVisitorOptAction, - required this.scheduleVisitOptAction, - required this.peopleOnThePropertyOptAction, - required this.preferencesSettings, - required this.liberationHistoryOptAction, - required this.accessQRCodeOptAction, - }); - - final Future Function()? changeMenuStyleAction; - final Future Function()? registerVisitorOptAction; - final Future Function()? scheduleVisitOptAction; - final Future Function()? peopleOnThePropertyOptAction; - final Future Function()? preferencesSettings; - final Future Function()? liberationHistoryOptAction; - final Future Function()? accessQRCodeOptAction; - - @override - State createState() => - _MenuStaggeredViewComponentWidgetState(); -} - -class _MenuStaggeredViewComponentWidgetState - extends State { - late MenuStaggeredViewComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => MenuStaggeredViewComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - Container( - width: double.infinity, - height: MediaQuery.sizeOf(context).height * 0.498, - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsets.all(14.0), - child: MasonryGridView.builder( - physics: const NeverScrollableScrollPhysics(), - gridDelegate: - const SliverSimpleGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - ), - crossAxisSpacing: 10.0, - mainAxisSpacing: 10.0, - itemCount: 8, - padding: const EdgeInsets.fromLTRB( - 0, - 10.0, - 0, - 10.0, - ), - shrinkWrap: true, - itemBuilder: (context, index) { - return [ - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.scheduleVisitOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector1, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'ee33l0ms' /* Agendar -Visita */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.registerVisitorOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'ya37l3jt' /* Cadastrar - Visitante */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.khome, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'h8s3adu8' /* Vincular -Condomínio */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kpets, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'j6tfixen' /* Cadastrar -Pet */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.accessQRCodeOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector2, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '9tli4i2x' /* QR Code -de Acesso */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.peopleOnThePropertyOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.people, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'i22hecs8' /* Pessoas na -Propriedade */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.liberationHistoryOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.history_sharp, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getVariableText( - enText: 'Consult\nHistories', - ptText: 'Consultar\nHistóricos', - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.preferencesSettings?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.history_sharp, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getVariableText( - enText: 'Preferences\nSettings', - ptText: 'Preferências\ndo Sistema', - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - - ][index](); - }, - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Container( - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Text( - FFLocalizations.of(context).getVariableText( - enText: 'Minimize', - ptText: 'Minimizar', - ), - style: FlutterFlowTheme.of(context).title1.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 12.0, - fontWeight: FontWeight.w600, - fontStyle: FontStyle.normal, - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 50.0, - fillColor: const Color(0x00FFFFFF), - icon: Icon( - Icons.keyboard_arrow_up_sharp, - color: FlutterFlowTheme.of(context).primary, - ), - onPressed: () async { - await widget.changeMenuStyleAction?.call(); - }, - ), - ), - ], - ), - ), - ), - ], - ); - } -} diff --git a/lib/commons/components/organisms/menu/widget.dart b/lib/commons/components/organisms/menu/widget.dart deleted file mode 100644 index ddda55dc..00000000 --- a/lib/commons/components/organisms/menu/widget.dart +++ /dev/null @@ -1,217 +0,0 @@ - - - - -import 'dart:developer'; - -import 'package:hub/commons/components/atoms/menu_button_item/widget.dart'; -import 'package:hub/commons/components/molecules/menu_item/widget.dart'; -import 'package:hub/commons/components/molecules/menu_list_view/widget.dart'; -import 'package:hub/commons/components/molecules/menu_staggered_view/widget.dart'; -import 'package:hub/commons/schema/enums/enums.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'model.dart'; -export 'model.dart'; - -class MenuComponentWidget extends StatefulWidget { - const MenuComponentWidget({ - Key? key, - required this.style, - required this.item, - required this.expandable, - required this.options, - }); - final MenuView style; - final MenuItem item; - final bool expandable; - final List options; - - @override - State createState() => _MenuComponentWidgetState(); -} - -class _MenuComponentWidgetState extends State { - late MenuComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => MenuComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - log('MenuComponentWidget: ${widget.options.toList().toString()}'); - return Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), - child: Builder( - builder: (context) { - if (widget.style == MenuView.list_grid && widget.expandable == true && widget.item == MenuItem.button) { - if (_model.isGrid == true) { - return wrapWithModel( - model: _model.menuListViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuListViewComponentWidget( - options: widget.options, - expandable: widget.expandable, - item: widget.item, - - - changeMenuStyle: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - preferencesSettings: () async { - await _model.preferencesSettings(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, - messageHistoryAction: () async { - await _model.messageHistoryAction(context); - setState(() {}); - }, - - ), - ); - } else { - return wrapWithModel( - model: _model.menuStaggeredViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuStaggeredViewComponentWidget( - changeMenuStyleAction: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - preferencesSettings: () async { - await _model.preferencesSettings(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, - ), - ); - } - } - if (widget.style == MenuView.list && widget.expandable == false && widget.item == MenuItem.card){ - return wrapWithModel( - model: _model.menuListViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuListViewComponentWidget( - expandable: widget.expandable, - item: widget.item, - options: widget.options, - messageHistoryAction: () async { - await _model.messageHistoryAction(context); - setState(() {}); - }, - - - changeMenuStyle: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - preferencesSettings: () async { - await _model.preferencesSettings(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, - - - ), - ); - } - return const SizedBox(); - }, - ), - ); - } - - Future accessQRCodeOptAction(BuildContext context) async { - context.pushNamed( - 'qrCodePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - -} diff --git a/lib/commons/components/templates/exception/widget.dart b/lib/commons/components/templates/exception/widget.dart deleted file mode 100644 index d1476ef0..00000000 --- a/lib/commons/components/templates/exception/widget.dart +++ /dev/null @@ -1,163 +0,0 @@ -import '/commons/widgets/flutter_flow_animations.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_animate/flutter_animate.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; - -class ThrowExceptionWidget extends StatefulWidget { - const ThrowExceptionWidget({ - super.key, - required this.msg, - }); - - final String? msg; - - @override - State createState() => _ThrowExceptionWidgetState(); -} - -class _ThrowExceptionWidgetState extends State - with TickerProviderStateMixin { - late ThrowExceptionModel _model; - - final animationsMap = {}; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => ThrowExceptionModel()); - - animationsMap.addAll({ - 'stackOnPageLoadAnimation': AnimationInfo( - trigger: AnimationTrigger.onPageLoad, - effectsBuilder: () => [ - FadeEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 600.0.ms, - begin: 0.0, - end: 1.0, - ), - ], - ), - }); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - Navigator.pop(context); - }, - child: Container( - height: 400.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(10.0), - bottomRight: Radius.circular(10.0), - topLeft: Radius.circular(10.0), - topRight: Radius.circular(10.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.circle_outlined, - color: FlutterFlowTheme.of(context).error, - size: 200.0, - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.close_outlined, - color: FlutterFlowTheme.of(context).error, - size: 200.0, - ), - ), - ], - ).animateOnPageLoad( - animationsMap['stackOnPageLoadAnimation']!), - Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context).getText( - 'e58xxxiq' /* ERRO */, - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 20.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), - child: Text( - valueOrDefault( - widget.msg, - 'Message Not Found', - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ].addToStart(const SizedBox(height: 50.0)), - ), - ], - ), - ), - ), - ), - ], - ); - } -} diff --git a/lib/commons/schema/structs/index.dart b/lib/commons/schema/structs/index.dart deleted file mode 100644 index 18bd18f3..00000000 --- a/lib/commons/schema/structs/index.dart +++ /dev/null @@ -1,3 +0,0 @@ -export '/commons/schema/util/schema_util.dart'; - -export 'device_struct.dart'; diff --git a/lib/commons/components/atoms/menu_button_item/widget.dart b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart similarity index 95% rename from lib/commons/components/atoms/menu_button_item/widget.dart rename to lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart index 83388793..fd0df4ca 100644 --- a/lib/commons/components/atoms/menu_button_item/widget.dart +++ b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart @@ -1,10 +1,8 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/commons/components/molecules/menu_item/widget.dart'; -import 'package:hub/commons/widgets/custom_icons.dart'; -import 'package:hub/commons/widgets/flutter_flow_theme.dart'; -import 'package:hub/commons/widgets/flutter_flow_util.dart'; -import 'package:hub/commons/widgets/internationalization.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; @@ -23,9 +21,12 @@ class MenuButtonWidget extends MenuEntry { @override _MenuButtonWidgetState createState() => _MenuButtonWidgetState(); + } class _MenuButtonWidgetState extends State { + get action => action; + @override Widget build(BuildContext context) { return InkWell( diff --git a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart:Zone.Identifier b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/atomic_components/menu_card_item/menu_card_item.dart b/lib/components/atomic_components/menu_card_item/menu_card_item.dart new file mode 100644 index 00000000..ac553c46 --- /dev/null +++ b/lib/components/atomic_components/menu_card_item/menu_card_item.dart @@ -0,0 +1,110 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; + + + + +class MenuCardItem extends MenuEntry { + const MenuCardItem({ + Key? key, + this.action, + this.title, + this.icon, + }) : super(key: key); + + final Function()? action; + final String? title; + final IconData? icon; + + @override + _MenuCardItemState createState() => _MenuCardItemState(); + +} + +class _MenuCardItemState extends State { + get action => action; + + @override + Widget build(BuildContext context) { + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.action?.call(); + }, + child: Card( + elevation: 0, + color: FlutterFlowTheme.of(context).primaryBackground, + child: Padding( + padding: const EdgeInsets.all(4.0), + child: + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: const AlignmentDirectional( + -1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB(8.0, 0.0, 10.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Icon( + widget.icon, + fill: null, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Text( + widget.title ?? '', + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/components/atomic_components/menu_card_item/menu_card_item.dart:Zone.Identifier b/lib/components/atomic_components/menu_card_item/menu_card_item.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/shared/components/atoms/atom_image_svg_theme.dart b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart similarity index 62% rename from lib/shared/components/atoms/atom_image_svg_theme.dart rename to lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart index 6da1479c..94484ab5 100644 --- a/lib/shared/components/atoms/atom_image_svg_theme.dart +++ b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart @@ -1,13 +1,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -class AtomImageSVGTheme extends StatelessWidget { - +class AtomImageSvgTheme extends StatelessWidget { final String filename; final double width; final double height; - const AtomImageSVGTheme({ + const AtomImageSvgTheme({ super.key, required this.filename, required this.width, @@ -18,12 +17,9 @@ class AtomImageSVGTheme extends StatelessWidget { Widget build(BuildContext context) { final brightness = MediaQuery.of(context).platformBrightness; final isDarkMode = brightness == Brightness.dark; - final pathImage = "assets/images/${isDarkMode ? "dark" : "light"}/$filename.svg"; + final path = "assets/images/${isDarkMode ? "dark" : "light"}/$filename.svg"; - return SvgPicture.asset( - pathImage, - width: width, - height: height, - ); + return SvgPicture.asset(path, width: width, height: height); } + } diff --git a/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart:Zone.Identifier b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/io/textfield/model.dart b/lib/components/atomic_components/text_field_component/text_field_component_model.dart similarity index 81% rename from lib/commons/widgets/io/textfield/model.dart rename to lib/components/atomic_components/text_field_component/text_field_component_model.dart index a9b24925..a74572ce 100644 --- a/lib/commons/widgets/io/textfield/model.dart +++ b/lib/components/atomic_components/text_field_component/text_field_component_model.dart @@ -1,7 +1,8 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show TextFieldComponentWidget; +import '/flutter_flow/flutter_flow_util.dart'; +import 'text_field_component_widget.dart' show TextFieldComponentWidget; import 'package:flutter/material.dart'; + class TextFieldComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -19,4 +20,4 @@ class TextFieldComponentModel textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/atomic_components/text_field_component/text_field_component_model.dart:Zone.Identifier b/lib/components/atomic_components/text_field_component/text_field_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/io/textfield/widget.dart b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart similarity index 95% rename from lib/commons/widgets/io/textfield/widget.dart rename to lib/components/atomic_components/text_field_component/text_field_component_widget.dart index 0877f481..90a63614 100644 --- a/lib/commons/widgets/io/textfield/widget.dart +++ b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart @@ -1,9 +1,12 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; +import 'text_field_component_model.dart'; +export 'text_field_component_model.dart'; + +//// + class TextFieldComponentWidget extends StatefulWidget { const TextFieldComponentWidget({ @@ -114,4 +117,4 @@ class _TextFieldComponentWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/atomic_components/text_field_component/text_field_component_widget.dart:Zone.Identifier b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/molecular_components/menu_item/menu_item.dart b/lib/components/molecular_components/menu_item/menu_item.dart new file mode 100644 index 00000000..042a9353 --- /dev/null +++ b/lib/components/molecular_components/menu_item/menu_item.dart @@ -0,0 +1,19 @@ + + +import 'package:flutter/material.dart'; + +abstract class MenuEntry extends StatefulWidget { + const MenuEntry({ + Key? key, + this.action, + this.title, + this.icon, + }) : super(key: key); + + final Function()? action; + final String? title; + final IconData? icon; + + + +} \ No newline at end of file diff --git a/lib/components/molecular_components/menu_item/menu_item.dart:Zone.Identifier b/lib/components/molecular_components/menu_item/menu_item.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/filters/access_filter/model.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart similarity index 85% rename from lib/modals/filters/access_filter/model.dart rename to lib/components/molecular_components/message_opt_modal/opt_modal_model.dart index 4a3c32d4..0963fec9 100644 --- a/lib/modals/filters/access_filter/model.dart +++ b/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart @@ -1,8 +1,9 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/form_field_controller.dart'; -import 'widget.dart' show OptModalWidget; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/form_field_controller.dart'; +import 'opt_modal_widget.dart' show OptModalWidget; import 'package:flutter/material.dart'; + class OptModalModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -28,4 +29,4 @@ class OptModalModel extends FlutterFlowModel { textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart:Zone.Identifier b/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/filters/access_filter/widget.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart similarity index 96% rename from lib/modals/filters/access_filter/widget.dart rename to lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart index d0dab29d..6b2df897 100644 --- a/lib/modals/filters/access_filter/widget.dart +++ b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart @@ -1,9 +1,12 @@ -import 'package:hub/commons/widgets/flutter_flow_theme.dart'; -import 'package:hub/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/modals/filters/options/model.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; + class OptModalWidget extends StatefulWidget { final String defaultPersonType; @@ -62,9 +65,9 @@ class _OptModalWidgetState extends State { Map filterResult = { 'personType': '', 'accessType': '', - 'search': _model.textController.text == '' + 'search': _model.textController?.text == '' ? '.*' - : _model.textController.text.toLowerCase(), + : _model.textController!.text.toLowerCase(), }; if (selected['personType']!.isEmpty) { @@ -328,4 +331,4 @@ class _OptModalWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart:Zone.Identifier b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/filters/options/model.dart b/lib/components/molecular_components/opt_modal/opt_modal_model.dart similarity index 85% rename from lib/modals/filters/options/model.dart rename to lib/components/molecular_components/opt_modal/opt_modal_model.dart index 4a3c32d4..66133fb1 100644 --- a/lib/modals/filters/options/model.dart +++ b/lib/components/molecular_components/opt_modal/opt_modal_model.dart @@ -1,8 +1,10 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/form_field_controller.dart'; -import 'widget.dart' show OptModalWidget; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/form_field_controller.dart'; +import 'opt_modal_widget.dart' show OptModalWidget; import 'package:flutter/material.dart'; + + class OptModalModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -28,4 +30,4 @@ class OptModalModel extends FlutterFlowModel { textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/opt_modal/opt_modal_model.dart:Zone.Identifier b/lib/components/molecular_components/opt_modal/opt_modal_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/filters/options/widget.dart b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart similarity index 97% rename from lib/modals/filters/options/widget.dart rename to lib/components/molecular_components/opt_modal/opt_modal_widget.dart index d0dab29d..b2394f52 100644 --- a/lib/modals/filters/options/widget.dart +++ b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart @@ -1,9 +1,10 @@ -import 'package:hub/commons/widgets/flutter_flow_theme.dart'; -import 'package:hub/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/modals/filters/options/model.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; class OptModalWidget extends StatefulWidget { final String defaultPersonType; @@ -62,9 +63,9 @@ class _OptModalWidgetState extends State { Map filterResult = { 'personType': '', 'accessType': '', - 'search': _model.textController.text == '' + 'search': _model.textController?.text == '' ? '.*' - : _model.textController.text.toLowerCase(), + : _model.textController!.text.toLowerCase(), }; if (selected['personType']!.isEmpty) { @@ -328,4 +329,4 @@ class _OptModalWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart:Zone.Identifier b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/filters/selections/model.dart b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart similarity index 55% rename from lib/modals/filters/selections/model.dart rename to lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart index 10acb96b..38613124 100644 --- a/lib/modals/filters/selections/model.dart +++ b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart @@ -1,5 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show OptionSelectionModalWidget; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class OptionSelectionModalModel @@ -9,4 +11,4 @@ class OptionSelectionModalModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart:Zone.Identifier b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/filters/selections/widget.dart b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart similarity index 96% rename from lib/modals/filters/selections/widget.dart rename to lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart index 74a8c39b..83093a34 100644 --- a/lib/modals/filters/selections/widget.dart +++ b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart @@ -1,13 +1,14 @@ // import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; +import 'package:go_router/go_router.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_animations.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; + -import '/commons/widgets/flutter_flow_animations.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'model.dart'; -export 'model.dart'; class OptionSelectionModalWidget extends StatefulWidget { const OptionSelectionModalWidget({ @@ -216,4 +217,4 @@ class _OptionSelectionModalWidgetState extends State ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart:Zone.Identifier b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/templates/exception/model.dart b/lib/components/molecular_components/throw_exception/throw_exception_model.dart similarity index 64% rename from lib/commons/components/templates/exception/model.dart rename to lib/components/molecular_components/throw_exception/throw_exception_model.dart index b157c56b..69ec5ec4 100644 --- a/lib/commons/components/templates/exception/model.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_model.dart @@ -1,11 +1,13 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show ThrowExceptionWidget; +import '/flutter_flow/flutter_flow_util.dart'; +import 'throw_exception_widget.dart' show ThrowExceptionWidget; import 'package:flutter/material.dart'; + + class ThrowExceptionModel extends FlutterFlowModel { @override void initState(BuildContext context) {} @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/throw_exception/throw_exception_model.dart:Zone.Identifier b/lib/components/molecular_components/throw_exception/throw_exception_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart new file mode 100644 index 00000000..9f037c96 --- /dev/null +++ b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart @@ -0,0 +1,175 @@ +import 'package:hub/shared/enums/enum_throw_exception.dart'; + +import '/flutter_flow/flutter_flow_animations.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_animate/flutter_animate.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'throw_exception_model.dart'; +export 'throw_exception_model.dart'; + +class ThrowExceptionWidget extends StatefulWidget { + ThrowExceptionWidget( + {super.key, required this.msg, this.type = EnumThrowException.error}); + + final String? msg; + EnumThrowException type; + + @override + State createState() => _ThrowExceptionWidgetState(); +} + +class _ThrowExceptionWidgetState extends State + with TickerProviderStateMixin { + late ThrowExceptionModel _model; + + final animationsMap = {}; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => ThrowExceptionModel()); + + animationsMap.addAll({ + 'stackOnPageLoadAnimation': AnimationInfo( + trigger: AnimationTrigger.onPageLoad, + effectsBuilder: () => [ + FadeEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 600.0.ms, + begin: 0.0, + end: 1.0, + ), + ], + ), + }); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + Color _getColorByType(BuildContext context) { + switch (widget.type) { + case EnumThrowException.error: + return FlutterFlowTheme.of(context).error; + case EnumThrowException.warning: + return FlutterFlowTheme.of(context).warning; + case EnumThrowException.success: + return FlutterFlowTheme.of(context).success; + } + } + + IconData _getIconByType(BuildContext context) { + switch (widget.type) { + case EnumThrowException.error: + return Icons.cancel_outlined; + case EnumThrowException.warning: + return Icons.warning_amber_outlined; + case EnumThrowException.success: + return Icons.check_circle_outline; + } + } + + String _getTitleByType(BuildContext context) { + switch (widget.type) { + case EnumThrowException.error: + return FFLocalizations.of(context) + .getVariableText(ptText: "Falha :(", enText: "Fail :("); + case EnumThrowException.warning: + return FFLocalizations.of(context) + .getVariableText(ptText: "Aviso :O", enText: "Warning :O"); + case EnumThrowException.success: + return FFLocalizations.of(context) + .getVariableText(ptText: "Sucesso ;)", enText: "Success ;)"); + ; + } + } + + @override + Widget build(BuildContext context) { + return Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + Navigator.pop(context); + }, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Icon( + _getIconByType(context), + color: _getColorByType(context), + size: 150.0, + ), + ), + ], + ).animateOnPageLoad(animationsMap['stackOnPageLoadAnimation']!), + Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + _getTitleByType(context), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + fontSize: 20.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Text( + valueOrDefault( + widget.msg, + 'Message Not Found', + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ].addToStart(const SizedBox(height: 20.0)), + ), + ], + ), + ), + ), + ], + ); + } +} diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart:Zone.Identifier b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/exceptions/not_found/model.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart similarity index 55% rename from lib/modals/exceptions/not_found/model.dart rename to lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart index 3c858af5..6827c26d 100644 --- a/lib/modals/exceptions/not_found/model.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart @@ -1,6 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show VisitorNotFoundComponentWidget; +import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class VisitorNotFoundComponentModel @@ -10,4 +11,4 @@ class VisitorNotFoundComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart:Zone.Identifier b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart new file mode 100644 index 00000000..9ffcdc37 --- /dev/null +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -0,0 +1,179 @@ +import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart'; +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; + +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; + +class VisitorNotFoundComponentWidget extends StatefulWidget { + const VisitorNotFoundComponentWidget({super.key}); + + @override + State createState() => + _VisitorNotFoundComponentWidgetState(); +} + +class _VisitorNotFoundComponentWidgetState + extends State { + late VisitorNotFoundComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => VisitorNotFoundComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Container( + width: MediaQuery.of(context).size.height * 0.5, + height: MediaQuery.of(context).size.height * 0.4, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: const AlignmentDirectional(1.0, -1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.close, + color: FlutterFlowTheme.of(context).accent1, + size: 24.0, + ), + onPressed: () async { + Navigator.pop(context); + }, + ), + ), + ), + Icon( + Icons.notifications_none, + color: FlutterFlowTheme.of(context).accent1, + size: 72.0, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '1p9mykbj' /* Usuário não encontrado */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: + FlutterFlowTheme.of(context).headlineMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(20.0, 4.0, 20.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'kt937sp6' /* O documento inserido não corre... */, + ), + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontStyle: FontStyle.italic, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + ), + ), + Expanded( + child: Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: FFButtonWidget( + onPressed: () async { + Navigator.pop(context); + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: true, + useSafeArea: true, + isDismissible: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: SizedBox( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.9, + child: const RegisiterVistorTemplateComponentWidget( + source: 'VisitorNotFoundComponent', + )), + ); + }, + ).then((value) => safeSetState(() {})); + }, + text: FFLocalizations.of(context) + .getVariableText(enText: 'Add', ptText: 'Adicionar'), + options: FFButtonOptions( + width: double.infinity, + height: 30.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).primary, + textStyle: FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: + FlutterFlowTheme.of(context).titleSmallFamily, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart:Zone.Identifier b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/selection/top_arrow_linked_locals/model.dart b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart similarity index 55% rename from lib/modals/selection/top_arrow_linked_locals/model.dart rename to lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart index 291447c3..ebbcaea4 100644 --- a/lib/modals/selection/top_arrow_linked_locals/model.dart +++ b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart @@ -1,6 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show ArrowLinkedLocalsComponentWidget; +import 'package:hub/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart'; + +import '../../../flutter_flow/flutter_flow_model.dart'; + import 'package:flutter/material.dart'; class ArrowLinkedLocalsComponentModel @@ -10,4 +11,4 @@ class ArrowLinkedLocalsComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart:Zone.Identifier b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/selection/top_arrow_linked_locals/widget.dart b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart similarity index 81% rename from lib/modals/selection/top_arrow_linked_locals/widget.dart rename to lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart index 9bbe184c..d0a00a4f 100644 --- a/lib/modals/selection/top_arrow_linked_locals/widget.dart +++ b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart @@ -1,7 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; -import 'model.dart'; -export 'model.dart'; +import 'package:hub/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + class ArrowLinkedLocalsComponentWidget extends StatefulWidget { const ArrowLinkedLocalsComponentWidget({super.key}); @@ -38,4 +38,4 @@ class _ArrowLinkedLocalsComponentWidgetState Widget build(BuildContext context) { return Container(); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart:Zone.Identifier b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/selection/bottom_arrow_linked_locals/model.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart similarity index 54% rename from lib/modals/selection/bottom_arrow_linked_locals/model.dart rename to lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart index 6e37e7bd..3ff8aba1 100644 --- a/lib/modals/selection/bottom_arrow_linked_locals/model.dart +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart @@ -1,6 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show BottomArrowLinkedLocalsComponentWidget; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class BottomArrowLinkedLocalsComponentModel @@ -10,4 +11,4 @@ class BottomArrowLinkedLocalsComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart:Zone.Identifier b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart new file mode 100644 index 00000000..b1ece369 --- /dev/null +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart @@ -0,0 +1,293 @@ +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart'; + +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_icon_button.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_spinkit/flutter_spinkit.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:provider/provider.dart'; + + +class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget { + const BottomArrowLinkedLocalsComponentWidget({super.key}); + + @override + State createState() => + _BottomArrowLinkedLocalsComponentWidgetState(); +} + +class _BottomArrowLinkedLocalsComponentWidgetState + extends State { + late BottomArrowLinkedLocalsComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = + createModel(context, () => BottomArrowLinkedLocalsComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + + return Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + width: double.infinity, + height: 150.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: 150.0, + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), + ), + ), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .secondaryBackground, + ), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).accent1, + icon: Icon( + Icons.add, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, + ), + onPressed: () { + print('IconButton pressed ...'); + }, + ), + ), + Expanded( + child: FutureBuilder( + future: PhpGroup.getLocalsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: + FlutterFlowTheme.of(context).primary, + size: 50.0, + ), + ), + ); + } + final gridViewGetLocalsResponse = snapshot.data!; + + return Builder( + builder: (context) { + final eachLocals = PhpGroup.getLocalsCall + .locais( + gridViewGetLocalsResponse.jsonBody, + ) + ?.map((e) => e) + .toList() + .toList() ?? + []; + + return GridView.builder( + padding: EdgeInsets.zero, + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 1, + crossAxisSpacing: 10.0, + mainAxisSpacing: 0.0, + childAspectRatio: 1.0, + ), + scrollDirection: Axis.horizontal, + itemCount: eachLocals.length, + itemBuilder: (context, eachLocalsIndex) { + final eachLocalsItem = + eachLocals[eachLocalsIndex]; + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + FFAppState().cliUUID = getJsonField( + eachLocalsItem, + r'''$.CLI_ID''', + ).toString(); + setState(() {}); + FFAppState().local = getJsonField( + eachLocalsItem, + r'''$.CLI_NOME''', + ).toString(); + setState(() {}); + FFAppState().ownerUUID = getJsonField( + eachLocalsItem, + r'''$.CLU_OWNER_ID''', + ).toString(); + setState(() {}); + Navigator.pop(context); + }, + child: Container( + width: 50.0, + height: double.infinity, + decoration: const BoxDecoration(), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryText, + borderRadius: + const BorderRadius.only( + bottomLeft: + Radius.circular(25.0), + bottomRight: + Radius.circular(25.0), + topLeft: + Radius.circular(25.0), + topRight: + Radius.circular(25.0), + ), + border: Border.all( + color: FlutterFlowTheme.of( + context) + .secondaryText, + width: 3.0, + ), + ), + child: ClipRRect( + borderRadius: + const BorderRadius.only( + bottomLeft: + Radius.circular(25.0), + bottomRight: + Radius.circular(25.0), + topLeft: + Radius.circular(25.0), + topRight: + Radius.circular(25.0), + ), + child: Image.network( + 'https://freaccess.com.br/freaccess/Images/Clients/${getJsonField( + eachLocalsItem, + r'''$.CLI_ID''', + ).toString()}.png', + width: double.infinity, + height: double.infinity, + fit: BoxFit.fill, + alignment: + const Alignment(0.0, 0.0), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Text( + getJsonField( + eachLocalsItem, + r'''$.CLI_NOME''', + ).toString(), + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + color: + FlutterFlowTheme.of( + context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ], + ), + ), + ); + }, + ); + }, + ); + }, + ), + ), + ].addToStart(const SizedBox(width: 20.0)), + ), + ), + ], + ), + ), + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart:Zone.Identifier b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/atoms/local_header/model.dart b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart similarity index 62% rename from lib/commons/components/atoms/local_header/model.dart rename to lib/components/organism_components/local_profile_component/local_profile_component_model.dart index befb297d..12c50d2f 100644 --- a/lib/commons/components/atoms/local_header/model.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart @@ -1,8 +1,9 @@ -import 'package:hub/commons/components/atoms/local_header/widget.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'local_profile_component_widget.dart' show LocalProfileComponentWidget; import 'package:flutter/material.dart'; +/// + class LocalProfileComponentModel extends FlutterFlowModel { @override @@ -10,4 +11,4 @@ class LocalProfileComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart:Zone.Identifier b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/atoms/local_header/widget.dart b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart similarity index 92% rename from lib/commons/components/atoms/local_header/widget.dart rename to lib/components/organism_components/local_profile_component/local_profile_component_widget.dart index 047ae944..ab338b78 100644 --- a/lib/commons/components/atoms/local_header/widget.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart @@ -1,16 +1,15 @@ - -import 'package:hub/commons/components/atoms/local_header/model.dart'; -import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart'; - -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import '/commons/widgets/random_data_util.dart' as random_data; +import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/custom_functions.dart' as functions; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -export 'model.dart'; +import 'local_profile_component_model.dart'; +export 'local_profile_component_model.dart'; + +//// class LocalProfileComponentWidget extends StatefulWidget { const LocalProfileComponentWidget({ @@ -149,4 +148,4 @@ class _LocalProfileComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart:Zone.Identifier b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/organisms/menu/model.dart b/lib/components/organism_components/menu_component/menu_component_model.dart similarity index 91% rename from lib/commons/components/organisms/menu/model.dart rename to lib/components/organism_components/menu_component/menu_component_model.dart index ad111216..b2842e56 100644 --- a/lib/commons/components/organisms/menu/model.dart +++ b/lib/components/organism_components/menu_component/menu_component_model.dart @@ -1,13 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; -import 'package:hub/commons/components/molecules/menu_list_view/model.dart'; -import 'package:hub/commons/components/molecules/menu_staggered_view/model.dart'; +import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; -import 'package:hub/modals/filters/selections/widget.dart'; +import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'menu_component_widget.dart' show MenuComponentWidget; -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show MenuComponentWidget; class MenuComponentModel extends FlutterFlowModel { /// Local state fields for this component. @@ -189,4 +189,4 @@ class MenuComponentModel extends FlutterFlowModel { } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_component/menu_component_model.dart:Zone.Identifier b/lib/components/organism_components/menu_component/menu_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart b/lib/components/organism_components/menu_component/menu_component_widget.dart new file mode 100644 index 00000000..5839264c --- /dev/null +++ b/lib/components/organism_components/menu_component/menu_component_widget.dart @@ -0,0 +1,165 @@ +import 'dart:developer'; + +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart'; +import 'package:hub/components/atomic_components/menu_card_item/menu_card_item.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; +import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'menu_component_model.dart'; +export 'menu_component_model.dart'; + + +class MenuComponentWidget extends StatefulWidget { + const MenuComponentWidget({ + Key? key, + required this.style, + required this.item, + required this.expandable, + }); + final MenuView style; + final MenuItem item; + final bool expandable; + @override + State createState() => _MenuComponentWidgetState(); +} + +class _MenuComponentWidgetState extends State { + late MenuComponentModel _model; + + + + @override + void setState(VoidCallback callback) { + + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => MenuComponentModel()); + + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final options = widget.item == MenuItem.button + ? [ + MenuButtonWidget(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule\nVisit' , ptText:'Agendar\nVisita' ,),), + + MenuButtonWidget(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\nVisitor' , ptText:'Cadastro\nde Visitante' ,),), + + // MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),), + // MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),), + + MenuButtonWidget(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode\nAccess' , ptText:'QRCode\nde Acesso' ,),), + + MenuButtonWidget(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on\nthe Property' , ptText:'Pessoas na\nPropriedade' ,),), + + MenuButtonWidget(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult\nHistories' , ptText:'Consultar\nHistóricos' ,),), + + MenuButtonWidget(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences\nSettings' , ptText:'Configurações' ,),), + ] : [ + MenuCardItem(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule Visit' , ptText:'Agendar\nVisita' ,),), + + MenuCardItem(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register Visitor' , ptText:'Cadastro de Visitante' ,),), + + // MenuCardItem(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link Condominum' , ptText:'' ,),), + // MenuCardItem(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),), + + MenuCardItem(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode Access' , ptText:'QRCode de Acesso' ,),), + + MenuCardItem(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on the Property' , ptText:'Pessoas na Propriedade' ,),), + + MenuCardItem(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult Histories' , ptText:'Consultar Historicos' ,),), + + MenuCardItem(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences Settings' , ptText:'Configurações' ,),), + + ]; + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + child: Builder( + builder: (context) { + if (widget.style == MenuView.list_grid && widget.expandable == true && widget.item == MenuItem.button) { + if (_model.isGrid == true) { + return wrapWithModel( + model: _model.menuListViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuListViewComponentWidget( + options: options, + expandable: widget.expandable, + item: widget.item, + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + ), + ); + } else { + return wrapWithModel( + model: _model.menuStaggeredViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuStaggeredViewComponentWidget( + options: options, + expandable: widget.expandable, + item: widget.item, + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + ), + ); + } + } + if (widget.style == MenuView.list && widget.expandable == false && widget.item == MenuItem.card){ + return wrapWithModel( + model: _model.menuListViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuListViewComponentWidget( + options: options, + expandable: widget.expandable, + item: widget.item, + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + ), + ); + } + return const SizedBox(); + }, + ), + ); + } + + Future accessQRCodeOptAction(BuildContext context) async { + context.pushNamed( + 'qrCodePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart:Zone.Identifier b/lib/components/organism_components/menu_component/menu_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/menu_list_view/model.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart similarity index 63% rename from lib/commons/components/molecules/menu_list_view/model.dart rename to lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart index 945dd425..027278ab 100644 --- a/lib/commons/components/molecules/menu_list_view/model.dart +++ b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart @@ -1,8 +1,8 @@ - -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'menu_list_view_component_widget.dart' show MenuListViewComponentWidget; import 'package:flutter/material.dart'; -import 'widget.dart'; + class MenuListViewComponentModel extends FlutterFlowModel { @@ -11,4 +11,4 @@ class MenuListViewComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart:Zone.Identifier b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/menu_list_view/widget.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart similarity index 63% rename from lib/commons/components/molecules/menu_list_view/widget.dart rename to lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart index 481e0fbb..1a2cac35 100644 --- a/lib/commons/components/molecules/menu_list_view/widget.dart +++ b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart @@ -1,30 +1,26 @@ import 'package:flutter/material.dart'; -import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/commons/components/atoms/menu_button_item/widget.dart'; -import 'package:hub/commons/components/molecules/menu_item/widget.dart'; -import 'package:hub/commons/schema/enums/enums.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'model.dart'; +import '/flutter_flow/flutter_flow_icon_button.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'menu_list_view_component_model.dart'; + +export 'menu_list_view_component_model.dart'; + +/// class MenuListViewComponentWidget extends StatefulWidget { const MenuListViewComponentWidget({ super.key, required this.changeMenuStyle, - required this.registerVisitorOptAction, - required this.scheduleVisitOptAction, - required this.peopleOnThePropertyOptAction, - required this.preferencesSettings, - required this.liberationHistoryOptAction, - required this.accessQRCodeOptAction, + required this.expandable, required this.item, required this.options, - required this.messageHistoryAction, }); final bool expandable; @@ -32,13 +28,6 @@ class MenuListViewComponentWidget extends StatefulWidget { final List options; final Future Function()? changeMenuStyle; - final Future Function()? registerVisitorOptAction; - final Future Function()? scheduleVisitOptAction; - final Future Function()? peopleOnThePropertyOptAction; - final Future Function()? preferencesSettings; - final Future Function()? liberationHistoryOptAction; - final Future Function()? accessQRCodeOptAction; - final Future Function()? messageHistoryAction; @override State createState() => @@ -95,37 +84,43 @@ class _MenuListViewComponentWidgetState width: double.infinity, child: ListView.builder( addAutomaticKeepAlives: true, - padding: EdgeInsets.zero, + padding: const EdgeInsets.symmetric(horizontal: 15), shrinkWrap: true, physics: const AlwaysScrollableScrollPhysics(), scrollDirection: Axis.horizontal, - itemCount: widget.options.length, itemBuilder: (context, index) { - return SizedBox( - height: 115, - width: 115, - child: widget.options[index]); + return Padding( + padding: const EdgeInsets.all(8.0), + child: SizedBox( + height: 115, + width: 115, + child: widget.options[index]), + ); }, ), ); case MenuItem.card: - return ListView.builder( - addAutomaticKeepAlives: true, - padding: EdgeInsets.zero, - shrinkWrap: true, - physics: const AlwaysScrollableScrollPhysics(), - itemCount: widget.options.length, - itemBuilder: (context, index) { - return MenuButtonWidget( - action: widget.registerVisitorOptAction, - title: FFLocalizations.of(context).getVariableText( - enText: 'Register Visitor', - ptText: 'Registrar Visitante', + return SizedBox( + width: double.infinity, + height: MediaQuery.sizeOf(context).height * 0.8, + child: ListView.builder( + addAutomaticKeepAlives: true, + padding: const EdgeInsets.symmetric(horizontal: 15), + shrinkWrap: true, + physics: const AlwaysScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + itemCount: widget.options.length, + itemBuilder: (context, index) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: SizedBox( + height: 115, + width: 115, + child: widget.options[index]), + ); + }, ), - icon: Icons.person_add_alt_1_outlined, - ); - }, ); } } @@ -170,3 +165,4 @@ class _MenuListViewComponentWidgetState ); } } + diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart:Zone.Identifier b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/menu_staggered_view/model.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart similarity index 57% rename from lib/commons/components/molecules/menu_staggered_view/model.dart rename to lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart index 4124e85c..4ee29584 100644 --- a/lib/commons/components/molecules/menu_staggered_view/model.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart @@ -1,9 +1,9 @@ +import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'package:flutter/material.dart'; -import 'widget.dart'; class MenuStaggeredViewComponentModel extends FlutterFlowModel { @@ -12,4 +12,4 @@ class MenuStaggeredViewComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart:Zone.Identifier b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart new file mode 100644 index 00000000..0b4f3c6b --- /dev/null +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -0,0 +1,157 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; +import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart'; +import 'package:hub/flutter_flow/custom_icons.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; + + +class MenuStaggeredViewComponentWidget extends StatefulWidget { + const MenuStaggeredViewComponentWidget({ + super.key, + required this.changeMenuStyle, + required this.expandable, + required this.item, + required this.options, + }); + + final bool expandable; + final MenuItem item; + + final List options; + final Future Function()? changeMenuStyle; + + @override + State createState() => + _MenuStaggeredViewComponentWidgetState(); +} + +class _MenuStaggeredViewComponentWidgetState + extends State { + late MenuStaggeredViewComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => MenuStaggeredViewComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + Container( + width: double.infinity, + height: MediaQuery.sizeOf(context).height * 0.498, + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsets.all(14.0), + child: MasonryGridView.builder( + physics: const NeverScrollableScrollPhysics(), + gridDelegate: + const SliverSimpleGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + ), + crossAxisSpacing: 10.0, + mainAxisSpacing: 10.0, + itemCount: widget.options.length, + padding: const EdgeInsets.fromLTRB( + 0, + 10.0, + 0, + 10.0, + ), + shrinkWrap: true, + itemBuilder: (context, index) { + return SizedBox( + height: 100, + width: 100, + child: widget.options[index]); + }, + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), + ), + ), + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Text( + FFLocalizations.of(context).getVariableText( + enText: 'Minimize', + ptText: 'Minimizar', + ), + style: FlutterFlowTheme.of(context).title1.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 12.0, + fontWeight: FontWeight.w600, + fontStyle: FontStyle.normal, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 50.0, + fillColor: const Color(0x00FFFFFF), + icon: Icon( + Icons.keyboard_arrow_up_sharp, + color: FlutterFlowTheme.of(context).primary, + ), + onPressed: () async { + await widget.changeMenuStyle?.call(); + }, + ), + ), + ], + ), + ), + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart:Zone.Identifier b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/message_well/model.dart b/lib/components/organism_components/message_well_component/message_well_component_model.dart similarity index 81% rename from lib/commons/components/molecules/message_well/model.dart rename to lib/components/organism_components/message_well_component/message_well_component_model.dart index 3a1c4b48..e6b577de 100644 --- a/lib/commons/components/molecules/message_well/model.dart +++ b/lib/components/organism_components/message_well_component/message_well_component_model.dart @@ -1,10 +1,15 @@ -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/widgets/request_manager.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; + +import '/flutter_flow/flutter_flow_util.dart'; +import 'message_well_component_widget.dart' show MessageWellComponentWidget; +import 'package:flutter/material.dart'; + +/// + import 'package:flutter/material.dart'; -import 'widget.dart'; class MessageWellComponentModel extends FlutterFlowModel { @@ -44,4 +49,4 @@ class MessageWellComponentModel clearGetLiberationsCache(); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/message_well_component/message_well_component_model.dart:Zone.Identifier b/lib/components/organism_components/message_well_component/message_well_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/message_well/widget.dart b/lib/components/organism_components/message_well_component/message_well_component_widget.dart similarity index 98% rename from lib/commons/components/molecules/message_well/widget.dart rename to lib/components/organism_components/message_well_component/message_well_component_widget.dart index 680f89cf..29432952 100644 --- a/lib/commons/components/molecules/message_well/widget.dart +++ b/lib/components/organism_components/message_well_component/message_well_component_widget.dart @@ -2,16 +2,19 @@ import 'dart:async'; import 'dart:collection'; import 'dart:developer'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/app_state.dart'; -import 'package:hub/commons/widgets/flutter_flow_theme.dart'; -import 'package:hub/commons/widgets/flutter_flow_util.dart'; + import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; import 'package:rxdart/rxdart.dart'; +// + + final dropdown = BehaviorSubject>.seeded( LinkedHashMap.from({ 'All': 'A', @@ -340,4 +343,4 @@ class MessageWellNotifier extends StateNotifier { final messageWellProvider = StateNotifierProvider((ref) { return MessageWellNotifier(); -}); +}); \ No newline at end of file diff --git a/lib/components/organism_components/message_well_component/message_well_component_widget.dart:Zone.Identifier b/lib/components/organism_components/message_well_component/message_well_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/schedule_visit_detail/model.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart similarity index 60% rename from lib/modals/details/schedule_visit_detail/model.dart rename to lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart index 53c511e1..d4df4084 100644 --- a/lib/modals/details/schedule_visit_detail/model.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart @@ -1,8 +1,11 @@ -import 'package:hub/commons/actions/api_manager.dart'; +import 'dart:developer'; + +import 'package:hub/backend/api_requests/api_manager.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show ScheduleVisitDetailWidget; import 'package:flutter/material.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:intl/intl.dart'; class ScheduleVisitDetailModel extends FlutterFlowModel { @@ -35,6 +38,36 @@ class ScheduleVisitDetailModel // Stores action output result for [Backend Call - API (postScheduleVisit)] action in Icon widget. ApiCallResponse? postScheduleVisit; + String convertDateFormat(String dateStr) { + try { + log('Received date string: $dateStr'); + + // Formato original + DateFormat originalFormat = DateFormat('d/M/y H:mm:ss'); + // Novo formato + DateFormat newFormat = DateFormat('y-M-d H:mm:ss'); + + // Validate the input string format + if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$') + .hasMatch(dateStr)) { + log('Invalid date format: $dateStr'); + return 'Invalid date format'; + } + + // Converte a string para DateTime + DateTime dateTime = originalFormat.parse(dateStr); + + // Converte DateTime para a nova string formatada + String formattedDate = newFormat.format(dateTime); + log('Formatted date: $formattedDate'); + return formattedDate; + } catch (e) { + // Handle the exception by returning an error message or a default value + log('Error parsing date: $e'); + return 'Invalid date format'; + } + } + @override void initState(BuildContext context) {} diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart:Zone.Identifier b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart new file mode 100644 index 00000000..150dd715 --- /dev/null +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart @@ -0,0 +1,845 @@ +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; + +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart'; +import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:provider/provider.dart'; + +class ScheduleVisitDetailWidget extends StatefulWidget { + const ScheduleVisitDetailWidget({ + super.key, + required this.visitorJsonList, + required this.visitorStrList, + this.visitorImgPath, + required this.visitStartDate, + required this.visitEndDate, + required this.visitResonStr, + required this.visitLevelStr, + required this.visitTempStr, + required this.visitObsStr, + }); + + final List? visitorJsonList; + final String? visitorStrList; + final String? visitorImgPath; + final String? visitStartDate; + final String? visitEndDate; + final String? visitResonStr; + final String? visitLevelStr; + final String? visitTempStr; + final String? visitObsStr; + + @override + State createState() => + _ScheduleVisitDetailWidgetState(); +} + +class _ScheduleVisitDetailWidgetState extends State { + late ScheduleVisitDetailModel _model; + late FocusNode _focusNode; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _focusNode = FocusNode(); + _model = createModel(context, () => ScheduleVisitDetailModel()); + + _model.textController1 ??= TextEditingController(text: widget.visitTempStr); + _model.textFieldFocusNode1 ??= FocusNode(); + + _model.textController2 ??= + TextEditingController(text: widget.visitStartDate); + _model.textFieldFocusNode2 ??= FocusNode(); + + _model.textController3 ??= TextEditingController(text: widget.visitEndDate); + _model.textFieldFocusNode3 ??= FocusNode(); + + _model.textController4 ??= + TextEditingController(text: extractDescToStr(widget.visitResonStr!)); + _model.textFieldFocusNode4 ??= FocusNode(); + + _model.textController5 ??= + TextEditingController(text: extractDescToStr(widget.visitLevelStr!)); + _model.textFieldFocusNode5 ??= FocusNode(); + + _model.textController6 ??= TextEditingController(text: widget.visitObsStr); + _model.textFieldFocusNode6 ??= FocusNode(); + } + + @override + void dispose() { + _model.maybeDispose(); + _focusNode.dispose(); + + super.dispose(); + } + + void _requestFocus() { + if (mounted) { + _focusNode.requestFocus(); + } + } + + @override + Widget build(BuildContext context) { + context.watch(); + final visitorsData = widget.visitorJsonList!.toList().take(2).toList(); + final visitorsDataItem = visitorsData[0]; + + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + child: GestureDetector( + onTap: () { + _requestFocus(); + }, + child: Container( + // color: FlutterFlowTheme.of(context).primaryBackground, + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height * 0.6, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: double.infinity, + height: 35.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + ), + child: Visibility( + visible: widget.visitorStrList != null && + widget.visitorStrList != '', + child: Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 15.0, 0.0, 0.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.keyboard_return, + color: FlutterFlowTheme.of(context).accent1, + size: 24.0, + ), + onPressed: () async { + Navigator.pop(context); + }, + ), + ), + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 5.0, 0.0, 5.0, 20.0), + child: SizedBox( + width: 100.0, + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 500), + fadeOutDuration: const Duration(milliseconds: 500), + imageUrl: valueOrDefault( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorsDataItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + width: 100.0, + height: 100.0, + fit: BoxFit.cover, + ), + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 10.0), + child: TextFormField( + controller: _model.textController1, + focusNode: _model.textFieldFocusNode1, + autofocus: false, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + '7w4fohoa' /* Encerramento da Visita */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController1Validator + .asValidator(context), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 10.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context) + .getVariableText( + enText: 'Start', + ptText: 'Início', + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '0cp1e31d' /* dd/mm/yyyy */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontSize: 12, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController2Validator + .asValidator(context), + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of(context).getText( + 'abppdgz3' /* Término */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + 'kqralft4' /* dd/mm/yyyy */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontSize: 12, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController3Validator + .asValidator(context), + ), + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 10.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController4, + focusNode: _model.textFieldFocusNode4, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of(context).getText( + 'xjxhzqqm' /* Motivo da Visita */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '47oezdm6' /* Motivo */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController4Validator + .asValidator(context), + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController5, + focusNode: _model.textFieldFocusNode5, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of(context).getText( + '2ujg7u18' /* Nível de Acesso */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '3emmbbfv' /* Nível de Acesso */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController5Validator + .asValidator(context), + ), + ), + ), + ], + ), + ), + Container( + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController6, + focusNode: _model.textFieldFocusNode6, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'ritce5uw' /* Observações da Visita */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController6Validator + .asValidator(context), + ), + ), + ), + ], + ), + ].divide(const SizedBox(height: 0.0)), + ), + IconButton( + onPressed: () async { + _model.postScheduleVisit = + await PhpGroup.postScheduleVisitCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + atividade: 'putVisita', + devDesc: widget.visitObsStr, + idVisitante: widget.visitorStrList, + dtInicio: + _model.convertDateFormat(widget.visitStartDate ?? ''), + dtFim: _model.convertDateFormat(widget.visitEndDate ?? ''), + unica: widget.visitTempStr, + idMotivo: extractIdToStr(widget.visitResonStr!), + idNAC: extractIdToStr(widget.visitLevelStr!), + obs: widget.visitObsStr, + cliID: FFAppState().cliUUID, + ); + + if (PhpGroup.postScheduleVisitCall.error( + (_model.postScheduleVisit?.jsonBody ?? ''), + ) == + false) { + Navigator.pop(context); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: PhpGroup.postScheduleVisitCall.errorMsg( + (_model.postScheduleVisit?.jsonBody ?? ''), + )!, + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, + icon: Icon( + Icons.check, + color: FlutterFlowTheme.of(context).primary, + size: 15.0, + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart:Zone.Identifier b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/selection/up_arrow_linked_locals/model.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart similarity index 54% rename from lib/modals/selection/up_arrow_linked_locals/model.dart rename to lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart index 6139bceb..54f840ca 100644 --- a/lib/modals/selection/up_arrow_linked_locals/model.dart +++ b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart @@ -1,6 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show UpArrowLinkedLocalsComponentWidget; +import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class UpArrowLinkedLocalsComponentModel @@ -10,4 +11,4 @@ class UpArrowLinkedLocalsComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart:Zone.Identifier b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/selection/up_arrow_linked_locals/widget.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart similarity index 96% rename from lib/modals/selection/up_arrow_linked_locals/widget.dart rename to lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart index cdd3fb04..968b22f9 100644 --- a/lib/modals/selection/up_arrow_linked_locals/widget.dart +++ b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart @@ -1,14 +1,16 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; + -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; + class UpArrowLinkedLocalsComponentWidget extends StatefulWidget { const UpArrowLinkedLocalsComponentWidget({super.key}); @@ -242,4 +244,4 @@ class _UpArrowLinkedLocalsComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart:Zone.Identifier b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/access_notification/model.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart similarity index 92% rename from lib/modals/notifications/access_notification/model.dart rename to lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart index 98a0cbf6..f9ee4e21 100644 --- a/lib/modals/notifications/access_notification/model.dart +++ b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart @@ -1,11 +1,10 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'access_notification_modal_template_component_widget.dart' show AccessNotificationModalTemplateComponentWidget; import 'package:flutter/material.dart'; + class AccessNotificationModalTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/access_notification/widget.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart similarity index 98% rename from lib/modals/notifications/access_notification/widget.dart rename to lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart index 8c4018e8..a8d77589 100644 --- a/lib/modals/notifications/access_notification/widget.dart +++ b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart @@ -1,11 +1,14 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; +import 'access_notification_modal_template_component_model.dart'; +export 'access_notification_modal_template_component_model.dart'; + + + class AccessNotificationModalTemplateComponentWidget extends StatefulWidget { const AccessNotificationModalTemplateComponentWidget({ @@ -380,4 +383,4 @@ class _AccessNotificationModalTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/card/model.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart similarity index 62% rename from lib/commons/components/molecules/card/model.dart rename to lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart index 43508738..032a1f68 100644 --- a/lib/commons/components/molecules/card/model.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart @@ -1,7 +1,8 @@ -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'card_item_template_component_widget.dart' + show CardItemTemplateComponentWidget; import 'package:flutter/material.dart'; -import 'widget.dart'; class CardItemTemplateComponentModel extends FlutterFlowModel { @@ -10,4 +11,4 @@ class CardItemTemplateComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/components/molecules/card/widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart similarity index 98% rename from lib/commons/components/molecules/card/widget.dart rename to lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart index 1452e832..a1e4cfc6 100644 --- a/lib/commons/components/molecules/card/widget.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart @@ -1,15 +1,18 @@ import 'dart:collection'; import 'dart:developer'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; +import 'card_item_template_component_model.dart'; +export 'card_item_template_component_model.dart'; + +/// + -import 'model.dart'; -export 'model.dart'; class CardItemTemplateComponentWidget extends StatefulWidget { const CardItemTemplateComponentWidget({ @@ -242,4 +245,4 @@ class _CardItemTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/forms/change_password/model.dart b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart similarity index 95% rename from lib/modals/forms/change_password/model.dart rename to lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart index 924ec401..25cc4529 100644 --- a/lib/modals/forms/change_password/model.dart +++ b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart @@ -1,8 +1,9 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' +import '/flutter_flow/flutter_flow_util.dart'; +import 'change_pass_widget.dart' show PassKeyTemplateWidget; import 'package:flutter/material.dart'; + class PassKeyTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -47,4 +48,4 @@ class PassKeyTemplateComponentModel keyTextFieldTextController1?.dispose(); keyTextFieldTextController2?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart:Zone.Identifier b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/forms/change_password/widget.dart b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart similarity index 98% rename from lib/modals/forms/change_password/widget.dart rename to lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart index ccecaa4c..02ae2c83 100644 --- a/lib/modals/forms/change_password/widget.dart +++ b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart @@ -1,12 +1,15 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; +import 'change_pass_model.dart'; +export 'change_pass_model.dart'; + class PassKeyTemplateWidget extends StatefulWidget { const PassKeyTemplateWidget({ @@ -341,4 +344,4 @@ class _PassKeyTemplateWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart:Zone.Identifier b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart new file mode 100644 index 00000000..13c3c56a --- /dev/null +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart @@ -0,0 +1,47 @@ +import 'package:hub/shared/utils/validator_util.dart'; + +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'forgot_password_template_component_widget.dart' + show ForgotPasswordTemplateComponentWidget; +import 'package:flutter/material.dart'; + +class ForgotPasswordTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this component. + + final formKey = GlobalKey(); + // State field(s) for emailAddress widget. + FocusNode? emailAddressFocusNode; + TextEditingController? emailAddressTextController; + String? Function(BuildContext, String?)? emailAddressTextControllerValidator; + String? _emailAddressTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '3hqg8buh' /* E-mail é Obrigatório */, + ); + } + + if (!ValidatorUtil.isValidEmail(val)) { + return FFLocalizations.of(context).getText( + 'jh5r2b1w' /* E-mail Inválido */, + ); + } + return null; + } + + // Stores action output result for [Backend Call - API (forgotPassword)] action in Button-Login widget. + ApiCallResponse? req; + + @override + void initState(BuildContext context) { + emailAddressTextControllerValidator = _emailAddressTextControllerValidator; + } + + @override + void dispose() { + emailAddressFocusNode?.dispose(); + emailAddressTextController?.dispose(); + } +} \ No newline at end of file diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart new file mode 100644 index 00000000..443b4b65 --- /dev/null +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart @@ -0,0 +1,317 @@ +import 'dart:developer'; + +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/log_util.dart'; +import 'package:hub/shared/utils/validator_util.dart'; + +import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import 'package:easy_debounce/easy_debounce.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'forgot_password_template_component_model.dart'; +export 'forgot_password_template_component_model.dart'; + +class ForgotPasswordTemplateComponentWidget extends StatefulWidget { + const ForgotPasswordTemplateComponentWidget({super.key}); + + @override + State createState() => + _ForgotPasswordTemplateComponentWidgetState(); +} + +class _ForgotPasswordTemplateComponentWidgetState + extends State { + late ForgotPasswordTemplateComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => ForgotPasswordTemplateComponentModel()); + + _model.emailAddressTextController ??= TextEditingController(); + _model.emailAddressFocusNode ??= FocusNode(); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + width: double.infinity, + height: 300.0, + constraints: const BoxConstraints( + maxWidth: 570.0, + ), + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well. + if (responsiveVisibility( + context: context, + phone: false, + tablet: false, + )) + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + context.safePop(); + }, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + const Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.0, 12.0, 0.0, 12.0), + child: Icon( + Icons.arrow_back_rounded, + color: Color(0xFF15161E), + size: 24.0, + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), + child: Text( + '', + style: + FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: const Color(0xFF15161E), + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), + ), + ], + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'xxm3ajsy' /* ESQUECEU SUA SENHA? */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Outfit', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), + child: Text( + FFLocalizations.of(context).getText( + 'wu2f7yzo' /* Não se preucupe nós vamos te a... */, + ), + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + ), + ), + ), + Form( + key: _model.formKey, + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model.emailAddressTextController, + focusNode: _model.emailAddressFocusNode, + onChanged: (_) => EasyDebounce.debounce( + '_model.emailAddressTextController', + const Duration(milliseconds: 500), + () => setState(() {}), + ), + autofocus: true, + autofillHints: const [AutofillHints.email], + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'mtz8l7ft' /* E-mail */, + ), + labelStyle: + FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primary, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + enabledBorder: OutlineInputBorder( + borderSide: const BorderSide( + color: Colors.black, + width: 2.00, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 2.00, + ), + borderRadius: BorderRadius.circular(12.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.00, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.00, + ), + borderRadius: BorderRadius.circular(12.0), + ), + contentPadding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 24.0, 20.0, 24.0), + suffixIcon: Icon( + Icons.email, + color: FlutterFlowTheme.of(context).primary, + size: 22.0, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + maxLines: null, + keyboardType: TextInputType.emailAddress, + cursorColor: FlutterFlowTheme.of(context).primary, + validator: _model.emailAddressTextControllerValidator + .asValidator(context), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), + child: FFButtonWidget( + onPressed: (_model.emailAddressTextController.text == '' || !ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) + ? null + : () async { + + try { + _model.req = await PhpGroup.forgotPasswordCall.call( + email: _model.emailAddressTextController.text, + ); + + if (PhpGroup.forgotPasswordCall.error((_model.req?.jsonBody ?? '')) == false) { + await DialogUtil.success(context, FFLocalizations.of(context).getVariableText( + enText: "Send E-mail Successful!", + ptText: "E-mail Enviado com Sucesso!" + )); + Navigator.pop(context); + } else { + await DialogUtil.error(context, PhpGroup.forgotPasswordCall.msg((_model.req?.jsonBody ?? ''))!); + } + + setState(() {}); + + } catch (error, stack) { + LogUtil.requestAPIFailed("iforgot.php", _model.emailAddressTextController.text, "Recuperar Senha", error, stack); + await DialogUtil.errorDefault(context); + } + }, + text: FFLocalizations.of(context).getText( + '74rnd5bu' /* Enviar */, + ), + options: FFButtonOptions( + width: 270.0, + height: 50.0, + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).primary, + textStyle: FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: 'Plus Jakarta Sans', + color: Colors.white, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + disabledColor: + FlutterFlowTheme.of( + context) + .customColor5, + disabledTextColor: + Colors.white, + ), + showLoadingIndicator: true, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/liberation_history_item_details/model.dart b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart similarity index 85% rename from lib/modals/details/liberation_history_item_details/model.dart rename to lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart index a53352d9..6612b45a 100644 --- a/lib/modals/details/liberation_history_item_details/model.dart +++ b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart @@ -1,9 +1,10 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart'; + +import 'package:hub/flutter_flow/flutter_flow_model.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show LiberationHistoryItemDetailsTemplateComponentWidget; import 'package:flutter/material.dart'; class LiberationHistoryItemDetailsTemplateComponentModel @@ -77,4 +78,4 @@ class LiberationHistoryItemDetailsTemplateComponentModel return false; } } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/liberation_history_item_details/widget.dart b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart similarity index 97% rename from lib/modals/details/liberation_history_item_details/widget.dart rename to lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart index 0c9b872f..025df6e5 100644 --- a/lib/modals/details/liberation_history_item_details/widget.dart +++ b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart @@ -1,11 +1,13 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; class LiberationHistoryItemDetailsTemplateComponentWidget extends StatefulWidget { @@ -363,4 +365,4 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/message_notificaion/model.dart b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart similarity index 86% rename from lib/modals/notifications/message_notificaion/model.dart rename to lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart index b4dc9501..0bcc4038 100644 --- a/lib/modals/notifications/message_notificaion/model.dart +++ b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart @@ -1,10 +1,10 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show MessageNotificationModalTemplateComponentWidget; import 'package:flutter/material.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; class MessageNotificationModalTemplateComponentModel extends FlutterFlowModel { @@ -76,4 +76,4 @@ class MessageNotificationModalTemplateComponentModel return false; } } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart:Zone.Identifier b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/message_notificaion/widget.dart b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart similarity index 96% rename from lib/modals/notifications/message_notificaion/widget.dart rename to lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart index 713eebc5..964a9cd7 100644 --- a/lib/modals/notifications/message_notificaion/widget.dart +++ b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart @@ -1,10 +1,15 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; + + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; class MessageNotificationModalTemplateComponentWidget extends StatefulWidget { const MessageNotificationModalTemplateComponentWidget({ @@ -285,4 +290,4 @@ class _MessageNotificationModalTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart:Zone.Identifier b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/forms/qr_code/model.dart b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart similarity index 92% rename from lib/modals/forms/qr_code/model.dart rename to lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart index 813a6c2a..da0ca0a5 100644 --- a/lib/modals/forms/qr_code/model.dart +++ b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart @@ -1,5 +1,5 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' +import '/flutter_flow/flutter_flow_util.dart'; +import 'qr_code_pass_key_template_component_widget.dart' show QrCodePassKeyTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/forms/qr_code/widget.dart b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart similarity index 97% rename from lib/modals/forms/qr_code/widget.dart rename to lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart index 8f31f358..9fcaa067 100644 --- a/lib/modals/forms/qr_code/widget.dart +++ b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart @@ -1,12 +1,17 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; +import 'qr_code_pass_key_template_component_model.dart'; +export 'qr_code_pass_key_template_component_model.dart'; + + + class QrCodePassKeyTemplateComponentWidget extends StatefulWidget { const QrCodePassKeyTemplateComponentWidget({ @@ -326,4 +331,4 @@ class _QrCodePassKeyTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart new file mode 100644 index 00000000..6e812792 --- /dev/null +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart @@ -0,0 +1,149 @@ +import 'dart:developer'; + +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/custom_code/actions/convert_image_file_to_base64.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; + +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/form_field_controller.dart'; +import 'package:flutter/material.dart'; + +import 'regisiter_vistor_template_component_widget.dart'; + +class RegisiterVistorTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this page. + + final unfocusNode = FocusNode(); + bool isDataUploading = false; + FFUploadedFile uploadedLocalFile = + FFUploadedFile(bytes: Uint8List.fromList([])); + + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode1; + TextEditingController? textController1; + String? Function(BuildContext, String?)? textController1Validator; + String? _textController1Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + + return null; + } + + Future getVisitanteByDocument( + String document, BuildContext context) async { + final response = await PhpGroup.getVisitorByDocCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitante', + documento: document, + ); + log('${response.jsonBody}'); + if (response.jsonBody['visitante']['VTE_ID'] != '0' && + response.jsonBody['error'] != 'false') { + return true; + } + return null; + } + + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode2; + TextEditingController? textController2; + String? Function(BuildContext, String?)? textController2Validator; + String? _textController2Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + + return null; + } + + // State field(s) for DropDown widget. + String? dropDownValue; + FormFieldController? dropDownValueController; + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode3; + TextEditingController? textController3; + String? Function(BuildContext, String?)? textController3Validator; + String? _textController3Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } + + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode4; + TextEditingController? textController4; + String? Function(BuildContext, String?)? textController4Validator; + String? _textController4Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + if (!val.contains('@') || !val.contains('.')) { + return FFLocalizations.of(context).getVariableText( + enText: 'Invalid email', + ptText: 'Email inválido', + ); + } + return null; + } + + // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. + String? imgBase64; + // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. + ApiCallResponse? scheduleVisitor; + + @override + void initState(BuildContext context) { + textFieldFocusNode1 = FocusNode(); + textController1 = TextEditingController(); + textController1Validator = _textController1Validator; + + textFieldFocusNode2 = FocusNode(); + textController2 = TextEditingController(); + textController2Validator = _textController2Validator; + + dropDownValue = ''; + // dropDownValueController = FormFieldController(initialValue: dropDownValue); + + textFieldFocusNode3 = FocusNode(); + textController3 = TextEditingController(); + textController3Validator = _textController3Validator; + + textFieldFocusNode4 = FocusNode(); + textController4 = TextEditingController(); + textController4Validator = _textController4Validator; + } + + @override + void dispose() { + unfocusNode.dispose(); + textFieldFocusNode1?.dispose(); + textController1?.dispose(); + + textFieldFocusNode2?.dispose(); + textController2?.dispose(); + + textFieldFocusNode3?.dispose(); + textController3?.dispose(); + + textFieldFocusNode4?.dispose(); + textController4?.dispose(); + } +} diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/registers/visitor/component.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart similarity index 56% rename from lib/pages/registers/visitor/component.dart rename to lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 894aa28c..9e187e31 100644 --- a/lib/pages/registers/visitor/component.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -1,75 +1,31 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; +import 'dart:developer'; -import '/commons/widgets/flutter_flow_drop_down.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import '/commons/widgets/form_field_controller.dart'; -import '/commons/widgets/upload_data.dart'; -import '/commons/actions/index.dart' as actions; +import 'package:flutter/services.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:json_path/fun_sdk.dart'; +import 'package:rxdart/rxdart.dart'; + +import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/flutter_flow/flutter_flow_drop_down.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import '/flutter_flow/form_field_controller.dart'; +import '/flutter_flow/upload_data.dart'; +import '/custom_code/actions/index.dart' as actions; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -export 'component.dart'; - - - -class RegisiterVistorTemplateComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - bool isDataUploading = false; - FFUploadedFile uploadedLocalFile = - FFUploadedFile(bytes: Uint8List.fromList([])); - - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode1; - TextEditingController? textController1; - String? Function(BuildContext, String?)? textController1Validator; - // State field(s) for DropDown widget. - String? dropDownValue; - FormFieldController? dropDownValueController; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode2; - TextEditingController? textController2; - String? Function(BuildContext, String?)? textController2Validator; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode3; - TextEditingController? textController3; - String? Function(BuildContext, String?)? textController3Validator; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode4; - TextEditingController? textController4; - String? Function(BuildContext, String?)? textController4Validator; - // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. - String? imgBase64; - // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. - ApiCallResponse? registerVisitor; - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - textFieldFocusNode1?.dispose(); - textController1?.dispose(); - - textFieldFocusNode2?.dispose(); - textController2?.dispose(); - - textFieldFocusNode3?.dispose(); - textController3?.dispose(); - - textFieldFocusNode4?.dispose(); - textController4?.dispose(); - } -} +import 'regisiter_vistor_template_component_model.dart'; +export 'regisiter_vistor_template_component_model.dart'; class RegisiterVistorTemplateComponentWidget extends StatefulWidget { - const RegisiterVistorTemplateComponentWidget({super.key}); + final String source; + + const RegisiterVistorTemplateComponentWidget( + {super.key, required this.source}); @override State createState() => @@ -80,11 +36,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State { late RegisiterVistorTemplateComponentModel _model; - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } + final scaffoldKey = GlobalKey(); @override void initState() { @@ -97,6 +49,7 @@ class _RegisiterVistorTemplateComponentWidgetState _model.textController2 ??= TextEditingController(); _model.textFieldFocusNode2 ??= FocusNode(); + _model.textController2?.addListener(_onTextChanged); _model.textController3 ??= TextEditingController(); _model.textFieldFocusNode3 ??= FocusNode(); @@ -107,18 +60,29 @@ class _RegisiterVistorTemplateComponentWidgetState @override void dispose() { - _model.maybeDispose(); + _model.dispose(); super.dispose(); + _model.textController2?.removeListener(_onTextChanged); + } + + void _onTextChanged() { + log('changed'); + setState(() {}); } @override Widget build(BuildContext context) { + BehaviorSubject visitorAlreadyRegistered = BehaviorSubject(); context.watch(); - + log(context + .describeWidget('RegisiterVistorTemplateComponentWidget') + .toString()); return Align( alignment: const AlignmentDirectional(0.0, 1.0), child: Container( + width: double.infinity, + height: double.infinity, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.only( @@ -128,194 +92,22 @@ class _RegisiterVistorTemplateComponentWidgetState topRight: Radius.circular(25.0), ), ), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 30.0, 0.0, 0.0), - child: SingleChildScrollView( + child: SingleChildScrollView( + child: Form( + // key: UniqueKey(), + autovalidateMode: AutovalidateMode.onUserInteraction, child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, children: [ - Align( - alignment: const AlignmentDirectional(-1.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 0.0, 20.0), - child: Text( - FFLocalizations.of(context).getText( - 'wnhkedzt' /* Cadastrar Visitante */, - ), - style: FlutterFlowTheme.of(context).bodyLarge.override( - fontFamily: 'Nunito', - fontSize: 21.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w800, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ), - Builder( - builder: (context) { - if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) { - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - setState(() { - _model.isDataUploading = false; - _model.uploadedLocalFile = - FFUploadedFile(bytes: Uint8List.fromList([])); - }); - }, - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.memory( - _model.uploadedLocalFile.bytes ?? - Uint8List.fromList([]), - width: 300.0, - height: 100.0, - fit: BoxFit.cover, - ), - ), - ); - } else { - return Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: FFButtonWidget( - onPressed: () async { - final selectedMedia = - await selectMediaWithSourceBottomSheet( - context: context, - maxWidth: 300.00, - maxHeight: 300.00, - imageQuality: 0, - allowPhoto: true, - includeDimensions: true, - ); - if (selectedMedia != null && - selectedMedia.every((m) => - validateFileFormat( - m.storagePath, context))) { - setState(() => _model.isDataUploading = true); - var selectedUploadedFiles = - []; - - try { - showUploadMessage( - context, - 'Uploading file...', - showLoading: true, - ); - selectedUploadedFiles = selectedMedia - .map((m) => FFUploadedFile( - name: - m.storagePath.split('/').last, - bytes: m.bytes, - height: m.dimensions?.height, - width: m.dimensions?.width, - blurHash: m.blurHash, - )) - .toList(); - } finally { - ScaffoldMessenger.of(context) - .hideCurrentSnackBar(); - _model.isDataUploading = false; - } - if (selectedUploadedFiles.length == - selectedMedia.length) { - setState(() { - _model.uploadedLocalFile = - selectedUploadedFiles.first; - }); - showUploadMessage(context, 'Success!'); - } else { - setState(() {}); - showUploadMessage( - context, 'Failed to upload data'); - return; - } - } - }, - text: '', - icon: Icon( - Icons.photo_camera, - color: FlutterFlowTheme.of(context).accent1, - size: 30.0, - ), - options: FFButtonOptions( - width: 300.0, - height: 80.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'kpd31z4d' /* Clique para adicionar a foto p... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ); - } - }, - ), Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 30.0, 0.0, 30.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 15.0), child: Text( FFLocalizations.of(context).getText( - 'q986vs4m' /* Preencha o formulário com os d... */, + 'zazj5d8b' /* Preencha o formulário com os d... */, ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( @@ -329,16 +121,150 @@ class _RegisiterVistorTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autovalidateMode: AutovalidateMode.onUserInteraction, + autofocus: false, + textCapitalization: TextCapitalization.none, + autofillHints: const [AutofillHints.password], + keyboardType: TextInputType.number, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'rl8tvwnr' /* Documento */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).customColor6, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.document_scanner, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + validator: + _model.textController2Validator.asValidator(context), + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + ], + ), + ), + FutureBuilder( + future: _model.textController2.text.isNotEmpty + ? _model.getVisitanteByDocument( + _model.textController2.text, context) + : null, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const SizedBox(); + } else if (snapshot.hasError || + snapshot.data == null || + snapshot.data == '') { + visitorAlreadyRegistered.add(true); + return const SizedBox(); + } else { + visitorAlreadyRegistered.add(false); + return _model.textController2.text.isEmpty + ? const SizedBox() + : Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: EdgeInsets.only( + right: MediaQuery.sizeOf(context).width * + 0.1), + child: Text( + FFLocalizations.of(context) + .getVariableText( + enText: 'Visitor already registered', + ptText: 'Visitante já cadastrado', + ), + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context) + .error, + fontSize: 14.0, + letterSpacing: 0.0, + )), + ), + ], + ); + } + }, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController1, + autovalidateMode: AutovalidateMode.onUserInteraction, focusNode: _model.textFieldFocusNode1, autofocus: false, textInputAction: TextInputAction.next, obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - 'llcw2tei' /* Nome */, + 'v7g73yik' /* Nome */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -362,7 +288,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -407,178 +333,284 @@ class _RegisiterVistorTemplateComponentWidgetState _model.textController1Validator.asValidator(context), ), ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), child: Container( + width: MediaQuery.sizeOf(context).width * 0.95, decoration: const BoxDecoration(), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 20.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 20.0, 10.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '67ykbznt' /* Selecione o tipo: */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 20.0, 0.0, 5.0), - child: FlutterFlowDropDown( - controller: _model.dropDownValueController ??= - FormFieldController(null), - options: [ + child: Column( + children: [ + Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 7.0), + child: Text( FFLocalizations.of(context).getText( - 'ugjkeiz7' /* Visitante */, + 'yp23q90m' /* Selecione o tipo: */, ), - FFLocalizations.of(context).getText( - '8nlk5xlk' /* Prestador de Serviço */, - ) - ], - onChanged: (val) => - setState(() => _model.dropDownValue = val), - width: 200.0, - height: 48.0, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'kw07i43y' /* Selecione... */, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context).primaryText, - size: 24.0, - ), - elevation: 2.0, - borderColor: FlutterFlowTheme.of(context).accent1, - borderWidth: 0.5, - borderRadius: 8.0, - margin: const EdgeInsetsDirectional.fromSTEB( - 16.0, 4.0, 16.0, 4.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 5.0), + child: FlutterFlowDropDown( + controller: _model.dropDownValueController ??= + FormFieldController(null), + options: [ + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ), + FFLocalizations.of(context).getText( + '9luaa09e' /* Prestador de Serviço */, + ) + ], + onChanged: (val) => + setState(() => _model.dropDownValue = val), + width: 200.0, + height: 44.0, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'pmezihb4' /* Selecione... */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: + FlutterFlowTheme.of(context).primaryText, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).customColor6, + borderWidth: 0.5, + borderRadius: 8.0, + margin: const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ), + ), + ] + .divide(const SizedBox(width: 19.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + if (_model.dropDownValue == null || + _model.dropDownValue == '') + Align( + alignment: const AlignmentDirectional(0.4, 0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ), + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodySmallFamily, + color: FlutterFlowTheme.of(context) + .customColor6, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodySmallFamily), + )), ), - ], - ), + ], ), ), ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - labelText: FFLocalizations.of(context).getText( - '96ayre48' /* Documento */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), + Builder( + builder: (context) { + if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) { + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + setState(() { + _model.isDataUploading = false; + _model.uploadedLocalFile = + FFUploadedFile(bytes: Uint8List.fromList([])); + }); + }, + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Image.memory( + _model.uploadedLocalFile.bytes ?? + Uint8List.fromList([]), + width: 300.0, + height: 200.0, + fit: BoxFit.cover, ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), + ), + ); + } else { + return Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.01, 0.0), + child: FFButtonWidget( + onPressed: () async { + final selectedMedia = + await selectMediaWithSourceBottomSheet( + context: context, + // maxWidth: 300.00, + // maxHeight: 300.00, + imageQuality: 100, + allowPhoto: true, + includeDimensions: true, + ); + if (selectedMedia != null && + selectedMedia.every((m) => + validateFileFormat( + m.storagePath, context))) { + setState(() => _model.isDataUploading = true); + var selectedUploadedFiles = + []; + + try { + showUploadMessage( + context, + 'Uploading file...', + showLoading: true, + ); + selectedUploadedFiles = selectedMedia + .map((m) => FFUploadedFile( + name: + m.storagePath.split('/').last, + bytes: m.bytes, + height: m.dimensions?.height, + width: m.dimensions?.width, + // blurHash: m.blurHash, + )) + .toList(); + } finally { + ScaffoldMessenger.of(context) + .hideCurrentSnackBar(); + _model.isDataUploading = false; + } + if (selectedUploadedFiles.length == + selectedMedia.length) { + setState(() { + _model.uploadedLocalFile = + selectedUploadedFiles.first; + }); + showUploadMessage(context, 'Success!'); + } else { + setState(() {}); + showUploadMessage( + context, 'Failed to upload data'); + return; + } + } + }, + text: '', + icon: Icon( + Icons.photo_camera, + color: FlutterFlowTheme.of(context).accent1, + size: 30.0, + ), + options: FFButtonOptions( + width: 300.0, + height: 80.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 14.0, 0.0, 0.0, 20.0), + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.2, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.document_scanner, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - validator: - _model.textController2Validator.asValidator(context), - ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 50.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'p4ftwxcy' /* Clique para adicionar a foto p... */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ); + } + }, ), Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 30.0, 0.0, 30.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 10.0, 0.0, 15.0), child: Text( FFLocalizations.of(context).getText( - 'j0g7ggs2' /* Contatos */, + 'bqpucwh0' /* Contatos */, ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( @@ -592,16 +624,24 @@ class _RegisiterVistorTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController3, focusNode: _model.textFieldFocusNode3, + autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: false, textInputAction: TextInputAction.next, + keyboardType: TextInputType.phone, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp('[0-9, +, -, (, )]')), + ], obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - 'ybdjabnd' /* Telefone */, + 'h84ls2r6' /* Telefone */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -625,7 +665,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -664,21 +704,24 @@ class _RegisiterVistorTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), ), - validator: - _model.textController3Validator.asValidator(context), + // validator: + // _model.textController3Validator.asValidator(context), ), ), Padding( - padding: const EdgeInsets.all(24.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController4, focusNode: _model.textFieldFocusNode4, + autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: false, textInputAction: TextInputAction.done, obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - 'tlr6uxo4' /* Email */, + 'fqp7qmka' /* Email */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -702,7 +745,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -742,131 +785,169 @@ class _RegisiterVistorTemplateComponentWidgetState FlutterFlowTheme.of(context).bodyMediumFamily), ), keyboardType: TextInputType.emailAddress, - validator: - _model.textController4Validator.asValidator(context), + // validator: + // _model.textController4Validator.asValidator(context), ), ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 50.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - if (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? - false)) && + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), + child: FFButtonWidget( + onPressed: (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? + false)) && (_model.textController1.text != '') && (_model.dropDownValue != null && _model.dropDownValue != '') && - (_model.textController2.text != '')) { - _model.imgBase64 = - await actions.convertImageFileToBase64( - _model.uploadedLocalFile, - ); - _model.registerVisitor = - await PhpGroup.postScheduleVisitorCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putVisitante', - documento: _model.textController2.text, - nome: _model.textController1.text, - tipo: (_model.dropDownValue == 'Visitante') || - (_model.dropDownValue == 'Visitor') - ? 'V' - : 'P', - foto: 'base64;jpeg,klajsalkjslkajslkajl', - ); - - if (PhpGroup.postScheduleVisitorCall.error( - (_model.registerVisitor?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clear(); - _model.textController2?.clear(); - _model.textController3?.clear(); - _model.textController4?.clear(); - }); - setState(() { - _model.dropDownValueController?.reset(); - }); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - '\\devUUID=${FFAppState().devUUID}\\userUUID=${FFAppState().userUUID}\\cliID=${FFAppState().cliUUID}\\Documento=${_model.textController2.text}\\Nome=${_model.textController1.text}\\dropdown${_model.dropDownValue}\\${PhpGroup.postScheduleVisitorCall.errorMsg( - (_model.registerVisitor?.jsonBody ?? ''), - )}', - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento estão foram preenchidos corretamente.- devUUID=${FFAppState().devUUID}- userUUID=${FFAppState().userUUID}- cliID=${FFAppState().cliUUID}- Documento=${_model.textController2.text}- Nome=${_model.textController1.text}- Tipo=${_model.dropDownValue}', - ), + (_model.textController2.text != '')) + ? () async { + log(visitorAlreadyRegistered.value.toString()); + if (visitorAlreadyRegistered.value == true) { + _model.imgBase64 = + await actions.convertImageFileToBase64( + _model.uploadedLocalFile, ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - '65puvap9' /* Cadastrar */, + _model.scheduleVisitor = + await PhpGroup.postScheduleVisitorCall + .call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'putVisitante', + documento: _model.textController2.text, + nome: _model.textController1.text, + tipo: _model.dropDownValue == + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ) + ? 'V' + : 'P', + foto: 'base64;jpeg,${_model.imgBase64}', + ) + .onError((e, s) async { + return await showAdaptiveDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => Navigator.pop(context), + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: Dialog( + backgroundColor: Colors.transparent, + child: ThrowExceptionWidget( + msg: FFLocalizations.of(context) + .getVariableText( + ptText: + 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', + enText: + 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + ), + ), + ), + ), + ); + }, + ); + }); + if (PhpGroup.postScheduleVisitorCall.error( + (_model.scheduleVisitor?.jsonBody ?? ''), + ) == + false) { + setState(() { + _model.textController1?.clear(); + _model.textController2?.clear(); + _model.textController3?.clear(); + _model.textController4?.clear(); + _model.dropDownValueController?.reset(); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Visitante cadastrado com sucesso.', + enText: + 'Visitor successfully registered.'), + style: TextStyle( + color: + FlutterFlowTheme.of(context) + .info)), + backgroundColor: + FlutterFlowTheme.of(context).primary, + duration: const Duration(seconds: 3), + width: MediaQuery.of(context).size.width, + behavior: SnackBarBehavior.floating, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), + ), + ), + ); + if (widget.source == + 'VisitorNotFoundComponent') { + Navigator.pop(context); + } + }); + } else { + return DialogUtil.error( + context, + PhpGroup.postScheduleVisitorCall + .errorMsg( + _model.scheduleVisitor?.jsonBody) + .toString()); + } + } else { + DialogUtil.error( + context, + FFLocalizations.of(context).getVariableText( + ptText: + 'Visitante já cadastrado. Verifique se o documento foi preenchido corretamente.', + enText: + 'Visitor already registered. Check if the document was filled in correctly.', + )); + } + } + : null, + text: FFLocalizations.of(context).getText( + 'okbw0aiu' /* Cadastrar */, + ), + options: FFButtonOptions( + width: 250.0, + height: 36.0, + disabledColor: FlutterFlowTheme.of(context).customColor5, + padding: const EdgeInsetsDirectional.fromSTEB( + 80.0, 0.0, 80.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).primary, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: + FlutterFlowTheme.of(context).titleSmallFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + borderSide: const BorderSide( + color: Colors.transparent, + width: 30.0, ), - options: FFButtonOptions( - width: double.infinity, - height: 36.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 80.0, 0.0, 80.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context).titleSmallFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: const BorderSide( - color: Colors.transparent, - width: 30.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), ), ), ), ), - ], + ] + .divide(const SizedBox(height: 10.0)) + .addToStart(const SizedBox(height: 30.0)) + .addToEnd(const SizedBox(height: 30.0)), ), ), ), diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart new file mode 100644 index 00000000..e1010ec7 --- /dev/null +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart @@ -0,0 +1,62 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'sign_in_template_component_widget.dart' + show SignInTemplateComponentWidget; +import 'package:flutter/material.dart'; + +class SignInTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this component. + + final formKey = GlobalKey(); + final unfocusNode = FocusNode(); + // State field(s) for emailAddress widget. + FocusNode? emailAddressFocusNode; + TextEditingController? emailAddressTextController; + String? Function(BuildContext, String?)? emailAddressTextControllerValidator; + String? _emailAddressTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'xhnawzcb' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + return FFLocalizations.of(context).getText( + 's3j1hjqx' /* E-mail Inv */, + ); + } + return null; + } + + // State field(s) for password widget. + FocusNode? passwordFocusNode; + TextEditingController? passwordTextController; + late bool passwordVisibility; + String? Function(BuildContext, String?)? passwordTextControllerValidator; + String? _passwordTextControllerValidator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '9cs5wlmc' /* Campo é necessário */, + ); + } + + return null; + } + + @override + void initState(BuildContext context) { + emailAddressTextControllerValidator = _emailAddressTextControllerValidator; + passwordVisibility = false; + passwordTextControllerValidator = _passwordTextControllerValidator; + } + + @override + void dispose() { + emailAddressFocusNode?.dispose(); + emailAddressTextController?.dispose(); + + passwordFocusNode?.dispose(); + passwordTextController?.dispose(); + } +} diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/signin/component.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart similarity index 82% rename from lib/pages/onboarding/signin/component.dart rename to lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart index 4009a680..94ee24dc 100644 --- a/lib/pages/onboarding/signin/component.dart +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart @@ -1,74 +1,22 @@ -import 'package:hub/modals/forms/forgot_password/widget.dart'; -import 'package:hub/shared/components/atoms/atom_image_svg_theme.dart'; +import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; +import 'package:hub/shared/components/atoms/atom_terms_of_use.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/log_util.dart'; +import 'package:hub/shared/utils/validator_util.dart'; -import '/commons/widgets/flutter_flow_animations.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import '/commons/actions/actions.dart' as action_blocks; +import '/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_animations.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import '/actions/actions.dart' as action_blocks; +import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; -export 'component.dart'; - - - -class SignInTemplateComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - final formKey = GlobalKey(); - // State field(s) for emailAddress widget. - FocusNode? emailAddressFocusNode; - TextEditingController? emailAddressTextController; - String? Function(BuildContext, String?)? emailAddressTextControllerValidator; - String? _emailAddressTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'xhnawzcb' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { - return 'Has to be a valid email address.'; - } - return null; - } - - // State field(s) for password widget. - FocusNode? passwordFocusNode; - TextEditingController? passwordTextController; - late bool passwordVisibility; - String? Function(BuildContext, String?)? passwordTextControllerValidator; - String? _passwordTextControllerValidator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - '9cs5wlmc' /* Campo é necessário */, - ); - } - - return null; - } - - @override - void initState(BuildContext context) { - emailAddressTextControllerValidator = _emailAddressTextControllerValidator; - passwordVisibility = false; - passwordTextControllerValidator = _passwordTextControllerValidator; - } - - @override - void dispose() { - emailAddressFocusNode?.dispose(); - emailAddressTextController?.dispose(); - - passwordFocusNode?.dispose(); - passwordTextController?.dispose(); - } -} - +import 'sign_in_template_component_model.dart'; +export 'sign_in_template_component_model.dart'; class SignInTemplateComponentWidget extends StatefulWidget { const SignInTemplateComponentWidget({ @@ -151,6 +99,18 @@ class _SignInTemplateComponentWidgetState super.dispose(); } + bool _isFormInvalid() { + if (_model.emailAddressTextController.text == '' || _model.passwordTextController.text == '') { + return true; + } + + if (!ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) { + return true; + } + + return false; + } + @override Widget build(BuildContext context) { return Row( @@ -171,8 +131,8 @@ class _SignInTemplateComponentWidgetState mainAxisAlignment: MainAxisAlignment.center, children: [ Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 35.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 35.0, 0.0, 35.0), child: Container( width: 548.0, height: 112.0, @@ -188,7 +148,8 @@ class _SignInTemplateComponentWidgetState children: [ Expanded( child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), + alignment: + const AlignmentDirectional(0.0, 1.0), child: Padding( padding: const EdgeInsets.all(3.0), child: Text( @@ -224,7 +185,7 @@ class _SignInTemplateComponentWidgetState decoration: const BoxDecoration(), child: ClipRRect( borderRadius: BorderRadius.circular(8.0), - child: const AtomImageSVGTheme(filename: 'login', width: 600, height: 155), + child: const AtomImageSvgTheme(filename: 'login', width: 600, height: 155), ), ), Column( @@ -263,8 +224,9 @@ class _SignInTemplateComponentWidgetState mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -273,7 +235,17 @@ class _SignInTemplateComponentWidgetState .emailAddressTextController, focusNode: _model .emailAddressFocusNode, - autofocus: false, + onChanged: (_) => + EasyDebounce.debounce( + '_model.emailAddressTextController', + const Duration( + milliseconds: 500), + () => setState(() {}), + ), + autofocus: true, + autofillHints: const [ + AutofillHints.email + ], textCapitalization: TextCapitalization.none, textInputAction: @@ -395,8 +367,9 @@ class _SignInTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -405,7 +378,17 @@ class _SignInTemplateComponentWidgetState .passwordTextController, focusNode: _model.passwordFocusNode, - autofocus: false, + onChanged: (_) => + EasyDebounce.debounce( + '_model.passwordTextController', + const Duration( + milliseconds: 500), + () => setState(() {}), + ), + autofocus: true, + autofillHints: const [ + AutofillHints.password + ], textInputAction: TextInputAction.send, obscureText: !_model @@ -452,7 +435,8 @@ class _SignInTemplateComponentWidgetState ), focusedBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFF1AAB5F), width: 0.25, @@ -463,7 +447,8 @@ class _SignInTemplateComponentWidgetState ), errorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -474,7 +459,8 @@ class _SignInTemplateComponentWidgetState ), focusedErrorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -549,23 +535,26 @@ class _SignInTemplateComponentWidgetState mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: () async { - await action_blocks - .singInLoginAction( - context, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); - setState(() {}); - }, + onPressed: _isFormInvalid() + ? null + : () async { + await action_blocks + .singInLoginAction( + context, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, + ); + setState(() {}); + }, text: FFLocalizations.of( context) .getText( @@ -576,18 +565,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -614,7 +597,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors.transparent, width: 1.0, @@ -622,13 +606,20 @@ class _SignInTemplateComponentWidgetState borderRadius: BorderRadius.circular( 12.0), + disabledColor: + FlutterFlowTheme.of( + context) + .customColor5, + disabledTextColor: + Colors.white, ), showLoadingIndicator: false, ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( onPressed: () async { @@ -646,18 +637,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -684,7 +669,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors.transparent, width: 1.0, @@ -709,36 +695,27 @@ class _SignInTemplateComponentWidgetState padding: const EdgeInsetsDirectional .fromSTEB(0.0, 0.0, - 0.0, 16.0), + 0.0, 16.0), child: FFButtonWidget( - onPressed: (((_model.emailAddressTextController - .text == - '') || - ((_model.emailAddressFocusNode - ?.hasFocus ?? - false) != - null)) && - ((_model.emailAddressTextController - .text == - '') || - ((_model.passwordTextController.text == - '') || - ((_model.passwordFocusNode?.hasFocus ?? - false) != - null)))) + onPressed: _isFormInvalid() ? null : () async { - await action_blocks - .singInLoginAction( - context, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); - setState(() {}); + try { + await action_blocks + .singInLoginAction( + context, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, + ); + setState(() {}); + } catch (e, s) { + await DialogUtil.errorDefault(context); + LogUtil.requestAPIFailed('login.php', _model.emailAddressTextController.text, "Login", e, s); + } }, text: FFLocalizations.of( context) @@ -750,18 +727,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -789,7 +760,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors .transparent, width: 1.0, @@ -798,10 +770,10 @@ class _SignInTemplateComponentWidgetState BorderRadius .circular(12.0), disabledColor: - const Color(0xE81AAB5F), + const Color( + 0xE81AAB5F), ), - showLoadingIndicator: - false, + showLoadingIndicator: true, ), ), ), @@ -810,7 +782,7 @@ class _SignInTemplateComponentWidgetState padding: const EdgeInsetsDirectional .fromSTEB(0.0, 0.0, - 0.0, 16.0), + 0.0, 16.0), child: FFButtonWidget( onPressed: () async { await widget @@ -827,18 +799,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -866,7 +832,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors .transparent, width: 1.0, @@ -880,7 +847,8 @@ class _SignInTemplateComponentWidgetState ), ), ), - ].divide(const SizedBox(width: 7.0)), + ].divide( + const SizedBox(width: 7.0)), ); } }, @@ -888,8 +856,8 @@ class _SignInTemplateComponentWidgetState // You will have to add an action on this rich text to go to your login page. Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 12.0, 0.0, 12.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -898,21 +866,15 @@ class _SignInTemplateComponentWidgetState onTap: () async { await showModalBottomSheet( isScrollControlled: true, - backgroundColor: - Colors.transparent, - enableDrag: false, + backgroundColor: Colors.transparent, context: context, builder: (context) { return Padding( - padding: - MediaQuery.viewInsetsOf( - context), - child: - const ForgotPasswordTemplateComponentWidget(), + padding: MediaQuery.viewInsetsOf(context), + child: const ForgotPasswordTemplateComponentWidget(), ); }, - ).then( - (value) => safeSetState(() {})); + ).then((value) => safeSetState(() {})); }, child: RichText( textScaler: MediaQuery.of(context) @@ -958,29 +920,23 @@ class _SignInTemplateComponentWidgetState ), mouseCursor: SystemMouseCursors.click, - recognizer: - TapGestureRecognizer() - ..onTap = () async { - await showModalBottomSheet( - isScrollControlled: - true, - backgroundColor: - Colors - .transparent, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery - .viewInsetsOf( - context), - child: - const ForgotPasswordTemplateComponentWidget(), - ); - }, - ).then((value) => - safeSetState( - () {})); - }, + // recognizer: TapGestureRecognizer() + // ..onTap = () async { + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // context: context, + // useRootNavigator: true, + // builder: (context) { + // return Padding( + // padding: MediaQuery.viewInsetsOf(context), + // child: const ForgotPasswordTemplateComponentWidget(), + // ); + // }, + // ).then((value) => + // safeSetState( + // () {})); + // }, ) ], style: @@ -1003,35 +959,7 @@ class _SignInTemplateComponentWidgetState ), ), ), - GestureDetector( - onTap: () async { - await action_blocks.openTermsOfUse(context); - }, - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Termos de uso', - enText: 'Terms of use', - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), + const AtomTermsOfUse(), ], ), ), diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart new file mode 100644 index 00000000..370ff262 --- /dev/null +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart @@ -0,0 +1,96 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'sign_up_template_component_widget.dart' + show SignUpTemplateComponentWidget; +import 'package:flutter/material.dart'; + +class SignUpTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this component. + + final formKey = GlobalKey(); + // State field(s) for nameRegisterForm widget. + FocusNode? nameRegisterFormFocusNode; + TextEditingController? nameRegisterFormTextController; + String? Function(BuildContext, String?)? + nameRegisterFormTextControllerValidator; + String? _nameRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '3bs10dfq' /* Campo é necessário */, + ); + } + + return null; + } + + // State field(s) for emailRegisterForm widget. + FocusNode? emailRegisterFormFocusNode; + TextEditingController? emailRegisterFormTextController; + String? Function(BuildContext, String?)? + emailRegisterFormTextControllerValidator; + String? _emailRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'mlvw63yj' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + return FFLocalizations.of(context).getText( + 'vobnktrz' /* Insira um email valido. */, + ); + } + return null; + } + + // State field(s) for passwordRegisterForm widget. + FocusNode? passwordRegisterFormFocusNode; + TextEditingController? passwordRegisterFormTextController; + late bool passwordRegisterFormVisibility; + String? Function(BuildContext, String?)? + passwordRegisterFormTextControllerValidator; + String? _passwordRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '6nn79lmh' /* Campo é necessário */, + ); + } + + if (val.length < 8) { + return FFLocalizations.of(context).getText( + 'duq5gpp6' /* A senha deve ter pelo menos 8 ... */, + ); + } + + return null; + } + + // Stores action output result for [Action Block - signUpRegisterAction] action in SignUpButtonRegisterForm widget. + bool? signUp; + + @override + void initState(BuildContext context) { + nameRegisterFormTextControllerValidator = + _nameRegisterFormTextControllerValidator; + emailRegisterFormTextControllerValidator = + _emailRegisterFormTextControllerValidator; + passwordRegisterFormVisibility = false; + passwordRegisterFormTextControllerValidator = + _passwordRegisterFormTextControllerValidator; + } + + @override + void dispose() { + nameRegisterFormFocusNode?.dispose(); + nameRegisterFormTextController?.dispose(); + + emailRegisterFormFocusNode?.dispose(); + emailRegisterFormTextController?.dispose(); + + passwordRegisterFormFocusNode?.dispose(); + passwordRegisterFormTextController?.dispose(); + } +} diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/signup/component.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart similarity index 89% rename from lib/pages/onboarding/signup/component.dart rename to lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart index 50e21802..8b0eac27 100644 --- a/lib/pages/onboarding/signup/component.dart +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart @@ -1,113 +1,26 @@ -import '/commons/widgets/flutter_flow_animations.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import '/commons/actions/actions.dart' as action_blocks; +import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; +import 'package:hub/shared/components/atoms/atom_terms_of_use.dart'; +import 'package:hub/shared/utils/validator_util.dart'; + +import '/flutter_flow/flutter_flow_animations.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import '/actions/actions.dart' as action_blocks; import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -export 'component.dart'; - - - -class SignUpTemplateComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - final formKey = GlobalKey(); - // State field(s) for nameRegisterForm widget. - FocusNode? nameRegisterFormFocusNode; - TextEditingController? nameRegisterFormTextController; - String? Function(BuildContext, String?)? - nameRegisterFormTextControllerValidator; - String? _nameRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - '3bs10dfq' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorUsernameRegex).hasMatch(val)) { - return 'Must start with a letter and can only contain letters, digits and - or _.'; - } - return null; - } - - // State field(s) for emailRegisterForm widget. - FocusNode? emailRegisterFormFocusNode; - TextEditingController? emailRegisterFormTextController; - String? Function(BuildContext, String?)? - emailRegisterFormTextControllerValidator; - String? _emailRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'mlvw63yj' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { - return 'Has to be a valid email address.'; - } - return null; - } - - // State field(s) for passwordRegisterForm widget. - FocusNode? passwordRegisterFormFocusNode; - TextEditingController? passwordRegisterFormTextController; - late bool passwordRegisterFormVisibility; - String? Function(BuildContext, String?)? - passwordRegisterFormTextControllerValidator; - String? _passwordRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - '6nn79lmh' /* Campo é necessário */, - ); - } - - return null; - } - - // Stores action output result for [Action Block - signUpRegisterAction] action in SignUpButtonRegisterForm widget. - bool? signUp; - - @override - void initState(BuildContext context) { - nameRegisterFormTextControllerValidator = - _nameRegisterFormTextControllerValidator; - emailRegisterFormTextControllerValidator = - _emailRegisterFormTextControllerValidator; - passwordRegisterFormVisibility = false; - passwordRegisterFormTextControllerValidator = - _passwordRegisterFormTextControllerValidator; - } - - @override - void dispose() { - nameRegisterFormFocusNode?.dispose(); - nameRegisterFormTextController?.dispose(); - - emailRegisterFormFocusNode?.dispose(); - emailRegisterFormTextController?.dispose(); - - passwordRegisterFormFocusNode?.dispose(); - passwordRegisterFormTextController?.dispose(); - } -} - - +import 'sign_up_template_component_model.dart'; +export 'sign_up_template_component_model.dart'; class SignUpTemplateComponentWidget extends StatefulWidget { const SignUpTemplateComponentWidget({ super.key, required this.toggleSignInPage, }); - final Future Function()? toggleSignInPage; @override @@ -188,6 +101,28 @@ class _SignUpTemplateComponentWidgetState @override Widget build(BuildContext context) { + double screenWidth = MediaQuery.of(context).size.width; + double screenHeight = MediaQuery.of(context).size.height; + bool _isFormInvalid() { + if (_model.nameRegisterFormTextController.text == '' || + _model.emailRegisterFormTextController.text == '' || + _model.passwordRegisterFormTextController.text == '') { + return true; + } + + if (!ValidatorUtil.isValidEmail( + _model.emailRegisterFormTextController.text)) { + return true; + } + + if (!ValidatorUtil.isValidPassword( + _model.passwordRegisterFormTextController.text)) { + return true; + } + + return false; + } + context.watch(); return Row( @@ -225,7 +160,8 @@ class _SignUpTemplateComponentWidgetState children: [ Expanded( child: Align( - alignment: const AlignmentDirectional(0.0, -1.0), + alignment: + const AlignmentDirectional(0.0, -1.0), child: Padding( padding: const EdgeInsets.all(4.0), child: Text( @@ -239,7 +175,7 @@ class _SignUpTemplateComponentWidgetState fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context) .primaryText, - fontSize: 24.0, + fontSize: screenWidth * 0.06, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -261,11 +197,10 @@ class _SignUpTemplateComponentWidgetState decoration: const BoxDecoration(), child: ClipRRect( borderRadius: BorderRadius.circular(8.0), - child: SvgPicture.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/ug2zlyhca2sh/Frame_5.svg', - width: 603.0, - height: 155.0, - fit: BoxFit.contain, + child: const AtomImageSvgTheme( + filename: 'register', + width: 600, + height: 155, ), ), ), @@ -303,8 +238,9 @@ class _SignUpTemplateComponentWidgetState mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -437,8 +373,6 @@ class _SignUpTemplateComponentWidgetState .containsKey( 'Plus Jakarta Sans'), ), - keyboardType: - TextInputType.name, validator: _model .nameRegisterFormTextControllerValidator .asValidator(context), @@ -446,8 +380,9 @@ class _SignUpTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -589,8 +524,9 @@ class _SignUpTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -654,7 +590,8 @@ class _SignUpTemplateComponentWidgetState ), focusedBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFF1AAB5F), width: 0.25, @@ -665,7 +602,8 @@ class _SignUpTemplateComponentWidgetState ), errorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -676,7 +614,8 @@ class _SignUpTemplateComponentWidgetState ), focusedErrorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -742,10 +681,12 @@ class _SignUpTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: () async { + onPressed: _isFormInvalid() + ? null + : () async { var shouldSetState = false; _model.signUp = await action_blocks @@ -785,11 +726,11 @@ class _SignUpTemplateComponentWidgetState options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 0.0), iconPadding: - const EdgeInsetsDirectional.fromSTEB( + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 0.0), color: FlutterFlowTheme.of(context) .accent1, @@ -817,15 +758,19 @@ class _SignUpTemplateComponentWidgetState ), borderRadius: BorderRadius.circular(12.0), + disabledColor: + FlutterFlowTheme.of(context) + .customColor5, + disabledTextColor: Colors.white, ), - showLoadingIndicator: false, + showLoadingIndicator: true, ), ), // You will have to add an action on this rich text to go to your login page. Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 12.0, 0.0, 12.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -843,9 +788,8 @@ class _SignUpTemplateComponentWidgetState TextSpan( text: FFLocalizations.of( context) - .getVariableText( - ptText: 'Você já tem uma conta? ', - enText: 'Already have an account? ', + .getText( + 'a9smhn5b' /* Você já tem uma conta? */, ), style: TextStyle( color: FlutterFlowTheme.of( @@ -900,6 +844,7 @@ class _SignUpTemplateComponentWidgetState ), ), ), + const AtomTermsOfUse(), ], ), ), @@ -910,26 +855,6 @@ class _SignUpTemplateComponentWidgetState ), ], ), - GestureDetector( - onTap: () async { - await action_blocks.openTermsOfUse(context); - }, - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Termos de uso', - enText: 'Terms of use', - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), ], ), ), diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/view_visit_detail/model.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart similarity index 92% rename from lib/modals/details/view_visit_detail/model.dart rename to lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart index fcb9ff02..a5726bc8 100644 --- a/lib/modals/details/view_visit_detail/model.dart +++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart @@ -1,7 +1,6 @@ -import 'package:hub/commons/actions/api_manager.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show ViewVisitDetailWidget; +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'view_visit_detail_widget.dart' show ViewVisitDetailWidget; import 'package:flutter/material.dart'; class ViewVisitDetailModel extends FlutterFlowModel { diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart:Zone.Identifier b/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/view_visit_detail/widget.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart similarity index 95% rename from lib/modals/details/view_visit_detail/widget.dart rename to lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart index dd308931..0b82c87a 100644 --- a/lib/modals/details/view_visit_detail/widget.dart +++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart @@ -1,23 +1,24 @@ import 'dart:convert'; import 'dart:developer'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/flutter_flow/nav/serialization_util.dart'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; -import 'package:hub/modals/details/visitor_details_modal/widget.dart'; - -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/actions/actions.dart' as action_blocks; +import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_icon_button.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/actions/actions.dart' as action_blocks; import 'package:cached_network_image/cached_network_image.dart'; import 'package:share_plus/share_plus.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; +import 'view_visit_detail_model.dart'; +export 'view_visit_detail_model.dart'; class ViewVisitDetailWidget extends StatefulWidget { const ViewVisitDetailWidget({ @@ -100,8 +101,7 @@ class _ViewVisitDetailWidgetState extends State { TextEditingController(text: widget.visitStartDate); _model.textFieldFocusNode2 ??= FocusNode(); - _model.textController3 ??= - TextEditingController(text: widget.visitEndDate); + _model.textController3 ??= TextEditingController(text: widget.visitEndDate); _model.textFieldFocusNode3 ??= FocusNode(); _model.textController4 ??= @@ -211,20 +211,26 @@ class _ViewVisitDetailWidgetState extends State { hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - Navigator.pop(context); - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: - const VisitorDetailsModalTemplateComponentWidget(), - ); - }, - ).then((value) => safeSetState(() {})); + // Navigator.pop(context); + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // useSafeArea: true, + // context: context, + // builder: (context) { + // return Padding( + // padding: MediaQuery.viewInsetsOf(context), + // child: + // const VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: '', + // visitorEmail: '', + // visitorName: '', + // visitorPhone: '', + // visitorType: '', + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); }, child: ClipRRect( borderRadius: BorderRadius.circular(100.0), @@ -869,7 +875,6 @@ class _ViewVisitDetailWidgetState extends State { Share.share( 'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.', ); - }, ), ], diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart:Zone.Identifier b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/visit_details_modal/model.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart similarity index 67% rename from lib/modals/details/visit_details_modal/model.dart rename to lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart index 9fdddf3d..9ec1e19d 100644 --- a/lib/modals/details/visit_details_modal/model.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart @@ -1,11 +1,10 @@ -import 'package:hub/modals/details/schedule_visit_detail/model.dart'; -import 'package:hub/modals/details/view_visit_detail/model.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart'; +import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_model.dart'; +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show VisitDetailsModalTemplateComponentWidget; import 'package:flutter/material.dart'; class VisitDetailsModalTemplateComponentModel @@ -33,4 +32,4 @@ class VisitDetailsModalTemplateComponentModel viewVisitDetailModel.dispose(); scheduleVisitDetailModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart new file mode 100644 index 00000000..a5e922e8 --- /dev/null +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -0,0 +1,117 @@ +import 'package:flutter/material.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; +import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart'; +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + +class VisitDetailsModalTemplateComponentWidget extends StatefulWidget { + const VisitDetailsModalTemplateComponentWidget({ + super.key, + this.visitStatusStr, + this.visitStartDateStr, + this.visitEndDateStr, + this.visitReasonStr, + this.visitLevelStr, + this.visitTempStr, + this.visitObsStr, + this.visitorStrList, + this.visitorJsonList, + this.visitorImgPath, + this.visitorImgList, + this.visitIdStr, + this.updateToggleIdx, + this.repeatVisitSchedule, + this.visitStatusColor, + }); + + final String? visitStatusStr; + final String? visitStartDateStr; + final String? visitEndDateStr; + final String? visitReasonStr; + final String? visitLevelStr; + final String? visitTempStr; + final String? visitObsStr; + final String? visitorStrList; + final List? visitorJsonList; + final String? visitorImgPath; + final List? visitorImgList; + final String? visitIdStr; + final Future Function()? updateToggleIdx; + final Future Function()? repeatVisitSchedule; + final Color? visitStatusColor; + + @override + State createState() => + _VisitDetailsModalTemplateComponentWidgetState(); +} + +class _VisitDetailsModalTemplateComponentWidgetState + extends State { + late VisitDetailsModalTemplateComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = + createModel(context, () => VisitDetailsModalTemplateComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Builder( + builder: (context) { + if (widget.visitStatusStr != null && widget.visitStatusStr != '') { + return wrapWithModel( + model: _model.viewVisitDetailModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: ViewVisitDetailWidget( + visitorImgPath: widget.visitorImgPath, + visitStartDate: widget.visitStartDateStr!, + visitEndDate: widget.visitEndDateStr!, + visitReasonStr: widget.visitReasonStr!, + visitLevelStr: widget.visitLevelStr!, + visitTempStr: widget.visitTempStr!, + visitObsStr: widget.visitObsStr!, + visitStatusStr: widget.visitStatusStr!, + visitorStrList: widget.visitorStrList!, + visitorJsonList: widget.visitorJsonList, + visitIdStr: widget.visitIdStr!, + visitStatusColor: widget.visitStatusColor!, + ), + ); + } else { + return wrapWithModel( + model: _model.scheduleVisitDetailModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: ScheduleVisitDetailWidget( + visitorStrList: widget.visitorStrList!, + visitorImgPath: widget.visitorImgPath, + visitStartDate: widget.visitStartDateStr!, + visitEndDate: widget.visitEndDateStr!, + visitResonStr: widget.visitReasonStr!, + visitLevelStr: widget.visitLevelStr!, + visitTempStr: widget.visitTempStr!, + visitObsStr: widget.visitObsStr!, + visitorJsonList: widget.visitorJsonList!, + ), + ); + } + }, + ); + } +} diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/visit_request/model.dart b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart similarity index 90% rename from lib/modals/notifications/visit_request/model.dart rename to lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart index e2f51aa9..a5a7eb07 100644 --- a/lib/modals/notifications/visit_request/model.dart +++ b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart @@ -1,7 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show VisitRequestTemplateComponentWidget; + import 'package:flutter/material.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; class VisitRequestTemplateComponentModel extends FlutterFlowModel { @@ -55,4 +55,4 @@ class VisitRequestTemplateComponentModel textFieldFocusNodeStatus?.dispose(); textControllerStatus?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/notifications/visit_request/widget.dart b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart similarity index 99% rename from lib/modals/notifications/visit_request/widget.dart rename to lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart index 0cd9507d..faae71ee 100644 --- a/lib/modals/notifications/visit_request/widget.dart +++ b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart @@ -1,13 +1,14 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; import 'package:provider/provider.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'model.dart'; -export 'model.dart'; + class VisitRequestTemplateComponentWidget extends StatefulWidget { const VisitRequestTemplateComponentWidget({ @@ -835,4 +836,4 @@ class _VisitRequestTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/details/visitor_details_modal/model.dart b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart similarity index 73% rename from lib/modals/details/visitor_details_modal/model.dart rename to lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart index a28e1ad4..d0f79706 100644 --- a/lib/modals/details/visitor_details_modal/model.dart +++ b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart @@ -1,5 +1,5 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' +import '/flutter_flow/flutter_flow_util.dart'; +import 'visitor_details_modal_template_component_widget.dart' show VisitorDetailsModalTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart new file mode 100644 index 00000000..307ba81b --- /dev/null +++ b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart @@ -0,0 +1,284 @@ +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'visitor_details_modal_template_component_model.dart'; +export 'visitor_details_modal_template_component_model.dart'; + +class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget { + const VisitorDetailsModalTemplateComponentWidget( + {super.key, + required this.visitorImageURL, + required this.visitorName, + required this.visitorType, + required this.visitorPhone, + required this.visitorEmail}); + + final String? visitorImageURL; + final String? visitorName; + final String? visitorType; + final String? visitorPhone; + final String? visitorEmail; + + @override + State createState() => + _VisitorDetailsModalTemplateComponentWidgetState(); +} + +class _VisitorDetailsModalTemplateComponentWidgetState + extends State { + late VisitorDetailsModalTemplateComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = + createModel(context, () => VisitorDetailsModalTemplateComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0), + child: Container( + width: double.infinity, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: BorderRadius.circular(25.0), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Container( + width: double.infinity, + height: 34.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryText, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + shape: BoxShape.rectangle, + ), + child: Align( + alignment: const AlignmentDirectional(1.0, -1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 5.0, 15.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + Navigator.pop(context); + }, + child: Icon( + Icons.close, + color: FlutterFlowTheme.of(context).primaryBackground, + size: 24.0, + ), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, -1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 40.0, 20.0, 0.0), + child: Container( + decoration: const BoxDecoration( + shape: BoxShape.rectangle, + ), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + if (widget.visitorImageURL != '' && + widget.visitorImageURL != null) + Container( + width: 100.0, + height: 100.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.network( + widget.visitorImageURL!, + fit: BoxFit.cover, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 0.0), + child: Text( + widget.visitorName ?? '', + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'hz7ivuqn' /* Tipo de Visitante */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Icon( + Icons.phone, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, + ), + Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'rwqn0det' /* (00) 0 0000-0000 */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Icon( + Icons.email, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, + ), + Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '0wqbiekp' /* email@provider.etc */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ), + ], + ), + ), + ), + ), + ), + // Align( + // alignment: const AlignmentDirectional(0.0, 1.0), + // child: Container( + // width: double.infinity, + // height: 34.0, + // decoration: BoxDecoration( + // color: FlutterFlowTheme.of(context).primaryText, + // borderRadius: const BorderRadius.only( + // bottomLeft: Radius.circular(0.0), + // bottomRight: Radius.circular(0.0), + // topLeft: Radius.circular(0.0), + // topRight: Radius.circular(0.0), + // ), + // ), + // ), + // ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/browsers/visitor_browser/model.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart similarity index 85% rename from lib/modals/browsers/visitor_browser/model.dart rename to lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart index dff255f2..1b473920 100644 --- a/lib/modals/browsers/visitor_browser/model.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart @@ -1,8 +1,8 @@ -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show VisitorSearchModalTemplateComponentWidget; import 'package:flutter/material.dart'; class VisitorSearchModalTemplateComponentModel @@ -43,4 +43,4 @@ class VisitorSearchModalTemplateComponentModel textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart new file mode 100644 index 00000000..963676a9 --- /dev/null +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -0,0 +1,482 @@ +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; + +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:provider/provider.dart'; + +class VisitorSearchModalTemplateComponentWidget extends StatefulWidget { + const VisitorSearchModalTemplateComponentWidget({ + super.key, + this.getVisitors, + this.getDocs, + }); + + final Future Function(List? visitorsParam)? getVisitors; + final Future Function(List? docsParam)? getDocs; + + @override + State createState() => + _VisitorSearchModalTemplateComponentWidgetState(); +} + +class _VisitorSearchModalTemplateComponentWidgetState + extends State + with TickerProviderStateMixin { + late VisitorSearchModalTemplateComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = + createModel(context, () => VisitorSearchModalTemplateComponentModel()); + + _model.textController ??= TextEditingController(); + _model.textFieldFocusNode ??= FocusNode(); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 50.0, 0.0, 0.0), + child: Container( + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 10.0, 16.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + onFieldSubmitted: (_) async { + setState(() { + _model.textController?.text = _model.textController.text; + _model.textController?.selection = TextSelection.collapsed( + offset: _model.textController!.text.length); + }); + _model.getVisitorByDoc = + await PhpGroup.getVisitorByDocCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitante', + documento: _model.textController.text, + ); + + if (PhpGroup.getVisitorByDocCall.vistanteId( + (_model.getVisitorByDoc?.jsonBody ?? ''), + ) != + '0') { + _model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante( + (_model.getVisitorByDoc?.jsonBody ?? ''), + )); + setState(() {}); + _model.addToDocs(_model.textController.text); + setState(() {}); + } else { + await showAdaptiveDialog( + useSafeArea: true, + context: context, + builder: (context) { + return Dialog( + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Container( + color: Colors.transparent, + // width: MediaQuery.of(context).size.height * 0.1, + // height: + // MediaQuery.of(context).size.height * 0.4, + child: const VisitorNotFoundComponentWidget()), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, + autofocus: false, + textInputAction: TextInputAction.done, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: FFLocalizations.of(context).getText( + 'cjlpru1m' /* Procure pelo documento do visi... */, + ), + labelStyle: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + '8i1qszba' /* test */, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + filled: true, + fillColor: FlutterFlowTheme.of(context).primaryBackground, + prefixIcon: Icon( + Icons.search_outlined, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + keyboardType: TextInputType.number, + validator: _model.textControllerValidator.asValidator(context), + ), + ), + if (_model.visitors.isNotEmpty && _model.visitors.length > 0) + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 16.0, 12.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '9coywebh' /* Visitantes encontrados */, + ), + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 4.0, 12.0, 16.0, 0.0), + child: Text( + _model.visitors.length.toString(), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ), + ], + ), + Expanded( + child: Builder( + builder: (context) { + if (_model.visitors.isNotEmpty) { + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 8.0, 8.0, 0.0), + child: Builder( + builder: (context) { + final visitor = + _model.visitors.map((e) => e).toList(); + return ListView.builder( + padding: EdgeInsets.zero, + scrollDirection: Axis.vertical, + itemCount: visitor.length, + itemBuilder: (context, visitorIndex) { + final visitorItem = visitor[visitorIndex]; + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 1.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + // await showModalBottomSheet( + // isScrollControlled: true, + // enableDrag: true, + // isDismissible: true, + // context: context, + // builder: (context) { + // return Padding( + // padding: + // MediaQuery.viewInsetsOf(context), + // child: SizedBox( + // height: 610.0, + // child: + // VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: + // "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + // visitorItem, + // r'''$.VTE_DOCUMENTO''', + // ).toString()}&tipo=E", + // visitorEmail: '', + // visitorName: getJsonField( + // visitorItem, + // r'''$.VTE_NOME''', + // )?.toString(), + // visitorPhone: '', + // visitorType: '', + // ), + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); + }, + child: Container( + width: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + ClipRRect( + borderRadius: + BorderRadius.circular(40.0), + child: CachedNetworkImage( + fadeInDuration: const Duration( + milliseconds: 500), + fadeOutDuration: const Duration( + milliseconds: 500), + imageUrl: + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + width: 60.0, + height: 60.0, + fit: BoxFit.cover, + ), + ), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 12.0, 0.0, 0.0, 0.0), + child: Text( + valueOrDefault( + getJsonField( + visitorItem, + r'''$.VTE_NOME''', + )?.toString(), + 'NOT FOUND', + ), + style: FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyLargeFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyLargeFamily), + ), + ), + ), + ], + ), + ), + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.close, + color: + FlutterFlowTheme.of(context) + .customColor6, + size: 20.0, + ), + onPressed: () async { + _model.removeFromVisitors( + visitorItem); + setState(() {}); + }, + ), + ], + ), + ), + ), + ), + ); + }, + ); + }, + ), + ); + } else { + return Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + ); + } + }, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + FFButtonWidget( + onPressed: () async { + await widget.getVisitors?.call( + _model.visitors, + ); + await widget.getDocs?.call( + _model.docs, + ); + Navigator.pop(context); + }, + text: FFLocalizations.of(context).getVariableText( + enText: 'Add', + ptText: 'Adicionar', + ), + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.width * 0.1, + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).primary, + textStyle: FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: + FlutterFlowTheme.of(context).titleSmallFamily, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15), + bottomRight: Radius.circular(15), + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), + ), + ), + ], + ), + const SizedBox( + height: 10.0, + ) + ], + ), + ), + ); + } +} diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart new file mode 100644 index 00000000..17ea3047 --- /dev/null +++ b/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart @@ -0,0 +1,13 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'welcome_template_component_widget.dart' + show WelcomeTemplateComponentWidget; +import 'package:flutter/material.dart'; + +class WelcomeTemplateComponentModel + extends FlutterFlowModel { + @override + void initState(BuildContext context) {} + + @override + void dispose() {} +} diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart:Zone.Identifier b/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/welcome/component.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart similarity index 97% rename from lib/pages/onboarding/welcome/component.dart rename to lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart index e9cece8f..e0b97fe2 100644 --- a/lib/pages/onboarding/welcome/component.dart +++ b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart @@ -1,26 +1,15 @@ -import 'package:hub/shared/components/atoms/atom_image_svg_theme.dart'; +import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; -import '/commons/widgets/flutter_flow_animations.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; +import '/flutter_flow/flutter_flow_animations.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:google_fonts/google_fonts.dart'; -export 'component.dart'; - - -class WelcomeTemplateComponentModel - extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} - - +import 'welcome_template_component_model.dart'; +export 'welcome_template_component_model.dart'; class WelcomeTemplateComponentWidget extends StatefulWidget { const WelcomeTemplateComponentWidget({ @@ -177,7 +166,7 @@ class _WelcomeTemplateComponentWidgetState decoration: const BoxDecoration(), child: ClipRRect( borderRadius: BorderRadius.circular(0.0), - child: const AtomImageSVGTheme(filename: 'welcome', width: 600, height: double.infinity), + child: const AtomImageSvgTheme(filename: 'welcome', width: 600, height: double.infinity), ), ), Align( diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart:Zone.Identifier b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/convert_image_file_to_base64.dart b/lib/custom_code/actions/convert_image_file_to_base64.dart similarity index 55% rename from lib/commons/actions/convert_image_file_to_base64.dart rename to lib/custom_code/actions/convert_image_file_to_base64.dart index 19ff6095..33f4fd83 100644 --- a/lib/commons/actions/convert_image_file_to_base64.dart +++ b/lib/custom_code/actions/convert_image_file_to_base64.dart @@ -1,14 +1,12 @@ + + // Automatic FlutterFlow imports -import '/commons/schema/structs/index.dart'; -import '/commons/schema/enums/enums.dart'; -import '/commons/actions/actions.dart' as action_blocks; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; + import 'index.dart'; // Imports other custom actions -import '/commons/widgets/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; import 'dart:convert'; import 'dart:typed_data'; +import '../../flutter_flow/uploaded_file.dart'; Future convertImageFileToBase64(FFUploadedFile imageFile) async { List? imageBytes = imageFile.bytes; @@ -16,4 +14,4 @@ Future convertImageFileToBase64(FFUploadedFile imageFile) async { String base64Image = base64Encode(imageBytes); return base64Image; } -} +} \ No newline at end of file diff --git a/lib/custom_code/actions/convert_image_file_to_base64.dart:Zone.Identifier b/lib/custom_code/actions/convert_image_file_to_base64.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/convert_to_upload_file.dart b/lib/custom_code/actions/convert_to_upload_file.dart similarity index 73% rename from lib/commons/actions/convert_to_upload_file.dart rename to lib/custom_code/actions/convert_to_upload_file.dart index 2ddde316..e72f0efe 100644 --- a/lib/commons/actions/convert_to_upload_file.dart +++ b/lib/custom_code/actions/convert_to_upload_file.dart @@ -1,11 +1,11 @@ // Automatic FlutterFlow imports -import '/commons/schema/structs/index.dart'; -import '/commons/schema/enums/enums.dart'; -import '/commons/actions/actions.dart' as action_blocks; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/backend/schema/structs/index.dart'; +import '/backend/schema/enums/enums.dart'; +import '/actions/actions.dart' as action_blocks; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'index.dart'; // Imports other custom actions -import '/commons/widgets/custom_functions.dart'; // Imports custom functions +import '/flutter_flow/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; // Begin custom action code // DO NOT REMOVE OR MODIFY THE CODE ABOVE! @@ -14,6 +14,7 @@ import 'dart:convert'; // Import for base64 decoding import 'dart:io'; // Import for file operations import 'package:path_provider/path_provider.dart'; // Import for temporary directory + Future convertToUploadFile(String img) async { // Decode the base64 string into bytes Uint8List bytes = base64.decode(img); @@ -29,4 +30,4 @@ Future convertToUploadFile(String img) async { bytes: bytes, name: 'image.jpg', ); -} +} \ No newline at end of file diff --git a/lib/custom_code/actions/convert_to_upload_file.dart:Zone.Identifier b/lib/custom_code/actions/convert_to_upload_file.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/get_dev_u_u_i_d.dart b/lib/custom_code/actions/get_dev_u_u_i_d.dart similarity index 91% rename from lib/commons/actions/get_dev_u_u_i_d.dart rename to lib/custom_code/actions/get_dev_u_u_i_d.dart index b9226900..e5df025d 100644 --- a/lib/commons/actions/get_dev_u_u_i_d.dart +++ b/lib/custom_code/actions/get_dev_u_u_i_d.dart @@ -1,17 +1,20 @@ -import '/commons/schema/structs/index.dart'; +import '/backend/schema/structs/index.dart'; import 'dart:developer'; -import '/commons/schema/enums/enums.dart'; -import '/commons/actions/actions.dart' as action_blocks; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; +import '/backend/schema/enums/enums.dart'; +import '/actions/actions.dart' as action_blocks; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import 'index.dart'; // Imports other custom actions -import '/commons/widgets/custom_functions.dart'; // Imports custom functions +import '/flutter_flow/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; + + + Future getDevUUID() async { var deviceInfo = DeviceInfoPlugin(); if (Platform.isIOS) { @@ -58,4 +61,4 @@ Future getSerialNumber() async { log('DeviceInfoPLugin => androidDeviceInfo.id: ${androidDeviceInfo.id}'); // e.g. "iPhone" return androidDeviceInfo.serialNumber; // unique ID on Android } -} +} \ No newline at end of file diff --git a/lib/custom_code/actions/get_dev_u_u_i_d.dart:Zone.Identifier b/lib/custom_code/actions/get_dev_u_u_i_d.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/index.dart b/lib/custom_code/actions/index.dart similarity index 60% rename from lib/commons/actions/index.dart rename to lib/custom_code/actions/index.dart index 0a097ef0..2110f043 100644 --- a/lib/commons/actions/index.dart +++ b/lib/custom_code/actions/index.dart @@ -1,6 +1,3 @@ export 'convert_image_file_to_base64.dart' show convertImageFileToBase64; export 'convert_to_upload_file.dart' show convertToUploadFile; export 'get_dev_u_u_i_d.dart' show getDevUUID; -export 'actions.dart' show Actions; -export 'api_calls.dart' show ApiCalls; -export 'api_manager.dart' show ApiManager; diff --git a/lib/custom_code/actions/index.dart:Zone.Identifier b/lib/custom_code/actions/index.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/image_cropper.dart b/lib/custom_code/widgets/image_cropper.dart similarity index 97% rename from lib/commons/widgets/image_cropper.dart rename to lib/custom_code/widgets/image_cropper.dart index 242d059a..90704f46 100644 --- a/lib/commons/widgets/image_cropper.dart +++ b/lib/custom_code/widgets/image_cropper.dart @@ -1,6 +1,6 @@ // // Automatic FlutterFlow imports -// import '/commons/schema/structs/index.dart'; -// import '/commons/schema/enums/enums.dart'; +// import '/backend/schema/structs/index.dart'; +// import '/backend/schema/enums/enums.dart'; // import '/actions/actions.dart' as action_blocks; // import '/flutter_flow/flutter_flow_theme.dart'; // import '/flutter_flow/flutter_flow_util.dart'; @@ -13,7 +13,9 @@ // import 'package:crop_your_image/crop_your_image.dart'; // import 'package:google_fonts/google_fonts.dart'; -// import '/commons/firebase_storage/storage.dart'; +// import '/backend/firebase_storage/storage.dart'; + +// ///////////////// // class ImageCropper extends StatefulWidget { // const ImageCropper({ diff --git a/lib/custom_code/widgets/image_cropper.dart:Zone.Identifier b/lib/custom_code/widgets/image_cropper.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/index.dart b/lib/custom_code/widgets/index.dart similarity index 100% rename from lib/commons/widgets/index.dart rename to lib/custom_code/widgets/index.dart diff --git a/lib/custom_code/widgets/index.dart:Zone.Identifier b/lib/custom_code/widgets/index.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/menu.dart b/lib/custom_code/widgets/menu.dart similarity index 100% rename from lib/commons/widgets/menu.dart rename to lib/custom_code/widgets/menu.dart diff --git a/lib/custom_code/widgets/menu.dart:Zone.Identifier b/lib/custom_code/widgets/menu.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/firebase_options.dart:Zone.Identifier b/lib/firebase_options.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/custom_functions.dart b/lib/flutter_flow/custom_functions.dart similarity index 97% rename from lib/commons/widgets/custom_functions.dart rename to lib/flutter_flow/custom_functions.dart index 1c663fdc..f33176c1 100644 --- a/lib/commons/widgets/custom_functions.dart +++ b/lib/flutter_flow/custom_functions.dart @@ -8,8 +8,7 @@ import 'package:timeago/timeago.dart' as timeago; import 'lat_lng.dart'; import 'place.dart'; import 'uploaded_file.dart'; -import '/commons/schema/structs/index.dart'; -import '/commons/schema/enums/enums.dart'; + String? isOneAcliID(String jsonString) { // Converte o JSON em um Map diff --git a/lib/flutter_flow/custom_functions.dart:Zone.Identifier b/lib/flutter_flow/custom_functions.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/custom_icons.dart b/lib/flutter_flow/custom_icons.dart similarity index 99% rename from lib/commons/widgets/custom_icons.dart rename to lib/flutter_flow/custom_icons.dart index 52991086..07cebe2e 100644 --- a/lib/commons/widgets/custom_icons.dart +++ b/lib/flutter_flow/custom_icons.dart @@ -18,4 +18,4 @@ class FFIcons { IconData(0xe900, fontFamily: _menuFamily); static const IconData kvector2 = IconData(0xe905, fontFamily: _menuFamily); static const IconData kvector3 = IconData(0xe906, fontFamily: _menuFamily); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/custom_icons.dart:Zone.Identifier b/lib/flutter_flow/custom_icons.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_animations.dart b/lib/flutter_flow/flutter_flow_animations.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_animations.dart rename to lib/flutter_flow/flutter_flow_animations.dart index 486179ca..c101a376 100644 --- a/lib/commons/widgets/flutter_flow_animations.dart +++ b/lib/flutter_flow/flutter_flow_animations.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; + enum AnimationTrigger { onPageLoad, onActionTrigger, @@ -108,4 +109,4 @@ class TiltEffect extends Effect { ), ); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_animations.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_animations.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_button_tabbar.dart b/lib/flutter_flow/flutter_flow_button_tabbar.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_button_tabbar.dart rename to lib/flutter_flow/flutter_flow_button_tabbar.dart index fcf320b3..4ea6374d 100644 --- a/lib/commons/widgets/flutter_flow_button_tabbar.dart +++ b/lib/flutter_flow/flutter_flow_button_tabbar.dart @@ -6,6 +6,8 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; + + const double _kTabHeight = 46.0; typedef _LayoutCallback = void Function( @@ -851,4 +853,4 @@ class _FlutterFlowButtonTabBarState extends State return tabBar; } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_button_tabbar.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_button_tabbar.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_checkbox_group.dart b/lib/flutter_flow/flutter_flow_checkbox_group.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_checkbox_group.dart rename to lib/flutter_flow/flutter_flow_checkbox_group.dart index 61e5f3df..fc089d10 100644 --- a/lib/commons/widgets/flutter_flow_checkbox_group.dart +++ b/lib/flutter_flow/flutter_flow_checkbox_group.dart @@ -4,6 +4,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; +//// + + class FlutterFlowCheckboxGroup extends StatefulWidget { const FlutterFlowCheckboxGroup({ super.key, @@ -131,4 +134,4 @@ class _FlutterFlowCheckboxGroupState extends State { ); }, ); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_checkbox_group.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_checkbox_group.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_drop_down.dart b/lib/flutter_flow/flutter_flow_drop_down.dart similarity index 83% rename from lib/commons/widgets/flutter_flow_drop_down.dart rename to lib/flutter_flow/flutter_flow_drop_down.dart index 0e7bc61c..ab6bdf5e 100644 --- a/lib/commons/widgets/flutter_flow_drop_down.dart +++ b/lib/flutter_flow/flutter_flow_drop_down.dart @@ -1,5 +1,7 @@ import 'package:dropdown_button2/dropdown_button2.dart'; +import 'package:dropdown_button2/dropdown_button2.dart'; + import 'form_field_controller.dart'; import 'package:flutter/material.dart'; @@ -212,12 +214,11 @@ class _FlutterFlowDropDownState extends State> { List> _createMenuItems() => widget.options .map( (option) => DropdownMenuItem( - value: option, - child: Padding( - padding: _useDropdown2() ? horizontalMargin : EdgeInsets.zero, - child: Text(optionLabels[option] ?? '', style: widget.textStyle), - ), - ), + value: option, + child: Padding( + padding: _useDropdown2() ? horizontalMargin : EdgeInsets.zero, + child: Text(optionLabels[option] ?? '', style: widget.textStyle), + )), ) .toList(); @@ -232,37 +233,36 @@ class _FlutterFlowDropDownState extends State> { final isSelected = multiSelectController.value?.contains(item) ?? false; return InkWell( - onTap: () { - multiSelectController.value ??= []; - isSelected - ? multiSelectController.value!.remove(item) - : multiSelectController.value!.add(item); - multiSelectController.update(); - // This rebuilds the StatefulWidget to update the button's text. - setState(() {}); - // This rebuilds the dropdownMenu Widget to update the check mark. - menuSetState(() {}); - }, - child: Container( - height: double.infinity, - padding: horizontalMargin, - child: Row( - children: [ - if (isSelected) - const Icon(Icons.check_box_outlined) - else - const Icon(Icons.check_box_outline_blank), - const SizedBox(width: 16), - Expanded( - child: Text( - optionLabels[item]!, - style: widget.textStyle, + onTap: () { + multiSelectController.value ??= []; + isSelected + ? multiSelectController.value!.remove(item) + : multiSelectController.value!.add(item); + multiSelectController.update(); + // This rebuilds the StatefulWidget to update the button's text. + setState(() {}); + // This rebuilds the dropdownMenu Widget to update the check mark. + menuSetState(() {}); + }, + child: Container( + height: double.infinity, + padding: horizontalMargin, + child: Row( + children: [ + if (isSelected) + const Icon(Icons.check_box_outlined) + else + const Icon(Icons.check_box_outline_blank), + const SizedBox(width: 16), + Expanded( + child: Text( + optionLabels[item]!, + style: widget.textStyle, + ), ), - ), - ], - ), - ), - ); + ], + ), + )); }, ), ), @@ -305,21 +305,19 @@ class _FlutterFlowDropDownState extends State> { : (isMultiSelect ? (_) {} : (val) => widget.controller!.value = val), isExpanded: true, selectedItemBuilder: (context) => widget.options - .map( - (item) => Align( - alignment: AlignmentDirectional.centerStart, - child: Text( - isMultiSelect - ? currentValues - .where((v) => optionLabels.containsKey(v)) - .map((v) => optionLabels[v]) - .join(', ') - : optionLabels[item]!, - style: widget.textStyle, - maxLines: 1, - ), - ), - ) + .map((item) => Align( + alignment: AlignmentDirectional.centerStart, + child: Text( + isMultiSelect + ? currentValues + .where((v) => optionLabels.containsKey(v)) + .map((v) => optionLabels[v]) + .join(', ') + : optionLabels[item]!, + style: widget.textStyle, + maxLines: 1, + ), + )) .toList(), dropdownSearchData: widget.isSearchable ? DropdownSearchData( @@ -370,4 +368,4 @@ class _FlutterFlowDropDownState extends State> { : null, ); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_drop_down.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_drop_down.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_icon_button.dart b/lib/flutter_flow/flutter_flow_icon_button.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_icon_button.dart rename to lib/flutter_flow/flutter_flow_icon_button.dart index 6e77c8a0..d41b72bb 100644 --- a/lib/commons/widgets/flutter_flow_icon_button.dart +++ b/lib/flutter_flow/flutter_flow_icon_button.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + + class FlutterFlowIconButton extends StatefulWidget { const FlutterFlowIconButton({ super.key, @@ -167,4 +169,4 @@ class _FlutterFlowIconButtonState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_icon_button.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_icon_button.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_model.dart b/lib/flutter_flow/flutter_flow_model.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_model.dart rename to lib/flutter_flow/flutter_flow_model.dart index 5a1225da..93752ff6 100644 --- a/lib/commons/widgets/flutter_flow_model.dart +++ b/lib/flutter_flow/flutter_flow_model.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:provider/provider.dart'; + Widget wrapWithModel({ required T model, required Widget child, @@ -164,4 +165,4 @@ T? _getDefaultValue() { extension TextValidationExtensions on String? Function(BuildContext, String?)? { String? Function(String?)? asValidator(BuildContext context) => this != null ? (val) => this!(context, val) : null; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_model.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_theme.dart b/lib/flutter_flow/flutter_flow_theme.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_theme.dart rename to lib/flutter_flow/flutter_flow_theme.dart index 9bc83617..a924cb38 100644 --- a/lib/commons/widgets/flutter_flow_theme.dart +++ b/lib/flutter_flow/flutter_flow_theme.dart @@ -5,6 +5,7 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:shared_preferences/shared_preferences.dart'; + const kThemeModeKey = '__theme_mode__'; SharedPreferences? _prefs; @@ -619,4 +620,4 @@ extension TextStyleHelper on TextStyle { height: lineHeight, shadows: shadows, ); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_theme.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_theme.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart similarity index 84% rename from lib/commons/widgets/flutter_flow_util.dart rename to lib/flutter_flow/flutter_flow_util.dart index 3d793c08..8a3cc1be 100644 --- a/lib/commons/widgets/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -11,8 +11,7 @@ import 'package:json_path/json_path.dart'; import 'package:timeago/timeago.dart' as timeago; import 'package:url_launcher/url_launcher.dart'; -import '/main.dart'; - +import '../main.dart'; export 'keep_alive_wrapper.dart'; export 'lat_lng.dart'; @@ -27,7 +26,6 @@ export 'package:intl/intl.dart'; export 'package:page_transition/page_transition.dart'; export 'custom_icons.dart' show FFIcons; export 'internationalization.dart' show FFLocalizations; -export 'package:hub/commons/actions/nav.dart'; T valueOrDefault(T? value, T defaultValue) => (value is String && value.isEmpty) || value == null ? defaultValue : value; @@ -88,6 +86,46 @@ Theme wrapInMaterialDatePickerTheme( return Theme( data: baseTheme.copyWith( + textSelectionTheme: baseTheme.textSelectionTheme.copyWith( + cursorColor: headerBackgroundColor, + selectionColor: headerBackgroundColor.withOpacity(0.4), + selectionHandleColor: headerBackgroundColor, + ), + inputDecorationTheme: baseTheme.inputDecorationTheme.copyWith( + isDense: true, + hoverColor: headerBackgroundColor.withOpacity(0.04), + floatingLabelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + labelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor.withOpacity(0.6), + ), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + ), colorScheme: baseTheme.colorScheme.copyWith( onSurface: pickerForegroundColor, ), @@ -150,9 +188,54 @@ Theme wrapInMaterialTimePickerTheme( final baseTheme = Theme.of(context); return Theme( data: baseTheme.copyWith( + focusColor: headerBackgroundColor, iconTheme: baseTheme.iconTheme.copyWith( size: iconSize, ), + textSelectionTheme: baseTheme.textSelectionTheme.copyWith( + cursorColor: headerBackgroundColor, + selectionColor: headerBackgroundColor.withOpacity(0.4), + selectionHandleColor: headerBackgroundColor, + ), + inputDecorationTheme: baseTheme.inputDecorationTheme.copyWith( + isDense: true, + focusColor: headerBackgroundColor, + hoverColor: headerBackgroundColor.withOpacity(0.04), + floatingLabelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + labelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + outlineBorder: BorderSide( + color: headerBackgroundColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor.withOpacity(0.6), + ), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + ), textButtonTheme: TextButtonThemeData( style: ButtonStyle( foregroundColor: WidgetStatePropertyAll( @@ -170,6 +253,7 @@ Theme wrapInMaterialTimePickerTheme( })), ), timePickerTheme: baseTheme.timePickerTheme.copyWith( + hourMinuteColor: selectedDateTimeBackgroundColor, backgroundColor: pickerBackgroundColor, hourMinuteTextColor: pickerForegroundColor, dialHandColor: selectedDateTimeBackgroundColor, @@ -396,8 +480,15 @@ extension FFTextEditingControllerExt on TextEditingController? { } extension IterableExt on Iterable { - List sortedList([S Function(T)? keyOf]) => toList() - ..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b)))); + List sortedList( + {S Function(T)? keyOf, bool desc = false}) { + final sortedAscending = toList() + ..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b)))); + if (desc) { + return sortedAscending.reversed.toList(); + } + return sortedAscending; + } List mapIndexed(S Function(int, T) func) => toList() .asMap() diff --git a/lib/flutter_flow/flutter_flow_util.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/flutter_flow_widgets.dart b/lib/flutter_flow/flutter_flow_widgets.dart similarity index 99% rename from lib/commons/widgets/flutter_flow_widgets.dart rename to lib/flutter_flow/flutter_flow_widgets.dart index 5f36df96..f9db2be0 100644 --- a/lib/commons/widgets/flutter_flow_widgets.dart +++ b/lib/flutter_flow/flutter_flow_widgets.dart @@ -2,6 +2,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:flutter/material.dart'; import 'package:auto_size_text/auto_size_text.dart'; + class FFButtonOptions { const FFButtonOptions({ this.textAlign, @@ -285,4 +286,4 @@ double? _getTextWidth(String? text, TextStyle? style, int maxLines) => )..layout()) .size .width - : null; + : null; \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_widgets.dart:Zone.Identifier b/lib/flutter_flow/flutter_flow_widgets.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/form_field_controller.dart b/lib/flutter_flow/form_field_controller.dart similarity index 99% rename from lib/commons/widgets/form_field_controller.dart rename to lib/flutter_flow/form_field_controller.dart index b8020e3b..1d152bb9 100644 --- a/lib/commons/widgets/form_field_controller.dart +++ b/lib/flutter_flow/form_field_controller.dart @@ -1,5 +1,6 @@ import 'package:flutter/foundation.dart'; + class FormFieldController extends ValueNotifier { FormFieldController(this.initialValue) : super(initialValue); @@ -20,4 +21,4 @@ class FormListFieldController extends FormFieldController> { @override void reset() => value = List.from(_initialListValue ?? []); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/form_field_controller.dart:Zone.Identifier b/lib/flutter_flow/form_field_controller.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/internationalization.dart b/lib/flutter_flow/internationalization.dart similarity index 94% rename from lib/commons/widgets/internationalization.dart rename to lib/flutter_flow/internationalization.dart index 9b26d8dd..ca57ae4a 100644 --- a/lib/commons/widgets/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -152,7 +152,7 @@ final kTranslationsMap = >>[ 'en': 'FREE ACCESS', }, 'mp6igsok': { - 'pt': 'Home', + 'pt': '', 'en': '', }, }, @@ -241,10 +241,6 @@ final kTranslationsMap = >>[ 'pt': 'Qual o período de validade da visita?', 'en': 'Visit Validity Period', }, - 'qygj6ra5': { - 'pt': 'Inicio da Visita', - 'en': 'Start of Visit', - }, 'bv2edxku': { 'pt': '', 'en': 'End of Visit', @@ -253,10 +249,6 @@ final kTranslationsMap = >>[ 'pt': 'Quando você inicia a visita?', 'en': 'When do you start the visit?', }, - 'p4ws3t66': { - 'pt': 'Fim da Visita', - 'en': 'End of Visit', - }, 'yw6d2jj8': { 'pt': '', 'en': 'End of Visit', @@ -269,10 +261,6 @@ final kTranslationsMap = >>[ 'pt': 'Quais são os motivos da visita?', 'en': 'What are the reasons for the visit?', }, - '2f68zi9t': { - 'pt': 'Motivo da Visita', - 'en': 'End of Visit', - }, '6p3e0bzr': { 'pt': 'Escolha um motivo aqui', 'en': 'Choose a reason here', @@ -281,10 +269,6 @@ final kTranslationsMap = >>[ 'pt': 'Search for an item...', 'en': '', }, - 'il4di4ln': { - 'pt': 'Nível de Acesso', - 'en': 'End of Visit', - }, '2wun8p6c': { 'pt': 'Escolha um nível de acesso aqui', 'en': 'Choose an access level here', @@ -490,6 +474,28 @@ final kTranslationsMap = >>[ 'en': '', }, }, + // preferencesPage + { + '1vyj6y7n': { + 'pt': 'Preferencias', + 'en': '', + }, + 'sejj3t8w': { + 'pt': '', + 'en': '', + }, + }, + // settingsPage + { + 'bc698859': { + 'pt': 'Preferencias', + 'en': '', + }, + 'sejj3t8w': { + 'pt': '', + 'en': '', + }, + }, // visitorDetailsModalTemplateComponent { 'kqzf7nx2': { @@ -563,8 +569,8 @@ final kTranslationsMap = >>[ // throwException { 'e58xxxiq': { - 'pt': 'ERRO', - 'en': 'ERROR', + 'pt': 'Falha :(', + 'en': 'Fail :(', }, }, // regisiterVistorTemplateComponent @@ -844,6 +850,10 @@ final kTranslationsMap = >>[ 'pt': 'Histórico\nde Liberação', 'en': 'Liberation\nHistory', }, + 'dzk31zpc': { + 'pt': 'Preferencias\ndo Sistema', + 'en': '', + }, }, // messageWellComponent { @@ -863,24 +873,28 @@ final kTranslationsMap = >>[ 'en': 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT', }, '1ltg0ylb': { - 'pt': 'Email', - 'en': 'Email', + 'pt': 'E-mail', + 'en': 'E-mail', }, '2x19ce8k': { 'pt': 'Senha', 'en': 'Password', }, 'xhnawzcb': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'E-mail é Obrigatório', + 'en': 'E-mail is required', + }, + 's3j1hjqx': { + 'pt': 'E-mail Inválido', + 'en': 'Invalid E-mail', }, '2ib9bf67': { 'pt': 'Please choose an option from the dropdown', 'en': '', }, '9cs5wlmc': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'Senha é Obrigatório', + 'en': 'Password is required', }, 'rkxwb0sg': { 'pt': 'Please choose an option from the dropdown', @@ -908,7 +922,7 @@ final kTranslationsMap = >>[ }, 'p5c6d54y': { 'pt': ' Recupere aqui', - 'en': 'recover here', + 'en': ' Recover here', }, 'olf967cj': { 'pt': 'Termo de Uso', @@ -938,24 +952,32 @@ final kTranslationsMap = >>[ 'en': 'Password', }, '3bs10dfq': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'Nome é Obrigatório', + 'en': 'Name is required', }, 'ph22karc': { 'pt': 'Please choose an option from the dropdown', 'en': '', }, 'mlvw63yj': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'E-mail é Obrigatório', + 'en': 'E-mail is required', + }, + 'vobnktrz': { + 'pt': 'E-mail Inválido.', + 'en': 'Invalid E-mail', }, 'z0bv6wi2': { 'pt': 'Please choose an option from the dropdown', 'en': '', }, '6nn79lmh': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'Senha é Obrigatório', + 'en': 'Password is required', + }, + 'duq5gpp6': { + 'pt': 'Mínimo 8 caracteres.', + 'en': 'Minimum 8 characters.', }, 'rcikqhf1': { 'pt': 'Please choose an option from the dropdown', @@ -1018,12 +1040,24 @@ final kTranslationsMap = >>[ 'Don\'t worry, we will help you, enter the email registered in the application and click send.', }, 'mtz8l7ft': { - 'pt': 'Email', - 'en': 'Email', + 'pt': 'E-mail', + 'en': 'E-mail', }, 'w7y5wlnv': { - 'pt': 'digite o seu email.....', - 'en': 'enter your email.....', + 'pt': '', + 'en': '', + }, + '3hqg8buh': { + 'pt': 'E-mail é Obrigatório', + 'en': 'E-mail is Required', + }, + 'jh5r2b1w': { + 'pt': 'E-mail Inválido', + 'en': 'Invalid E-mail', + }, + '1p76vmkn': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', }, '74rnd5bu': { 'pt': 'Enviar', diff --git a/lib/flutter_flow/internationalization.dart:Zone.Identifier b/lib/flutter_flow/internationalization.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/keep_alive_wrapper.dart b/lib/flutter_flow/keep_alive_wrapper.dart similarity index 99% rename from lib/commons/widgets/keep_alive_wrapper.dart rename to lib/flutter_flow/keep_alive_wrapper.dart index 286bde09..fd9c5150 100644 --- a/lib/commons/widgets/keep_alive_wrapper.dart +++ b/lib/flutter_flow/keep_alive_wrapper.dart @@ -22,4 +22,4 @@ class _KeepAliveWidgetWrapperState extends State super.build(context); return widget.builder(context); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/keep_alive_wrapper.dart:Zone.Identifier b/lib/flutter_flow/keep_alive_wrapper.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/lat_lng.dart b/lib/flutter_flow/lat_lng.dart similarity index 99% rename from lib/commons/widgets/lat_lng.dart rename to lib/flutter_flow/lat_lng.dart index 9e7b8ea8..68758f91 100644 --- a/lib/commons/widgets/lat_lng.dart +++ b/lib/flutter_flow/lat_lng.dart @@ -16,4 +16,4 @@ class LatLng { other is LatLng && latitude == other.latitude && longitude == other.longitude; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/lat_lng.dart:Zone.Identifier b/lib/flutter_flow/lat_lng.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/nav.dart b/lib/flutter_flow/nav/nav.dart similarity index 89% rename from lib/commons/actions/nav.dart rename to lib/flutter_flow/nav/nav.dart index 955e4cce..86f9ca21 100644 --- a/lib/commons/actions/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -1,32 +1,17 @@ import 'dart:async'; -// import 'package:hub/pages/consult/access/acess_history_page_widget.dart'; -// import 'package:hub/pages/schedule/visit/fastpass/fast_pass_page_widget.dart'; -// import 'package:hub/pages/consult/message/message_history_page_widget.dart'; -// import 'package:hub/pages/settings/preferences_settings_widget.dart'; -// import 'package:hub/pages/consult/visit/visit_history_page_widget.dart'; - import 'package:flutter/material.dart'; -import 'package:hub/pages/consults/access/widget.dart'; -import 'package:hub/pages/consults/liberation/widget.dart'; -import 'package:hub/pages/consults/message/widget.dart'; -import 'package:hub/pages/consults/poeple/widget.dart'; -import 'package:hub/pages/consults/qrcode/widget.dart'; -import 'package:hub/pages/consults/visit/widget.dart'; -import 'package:hub/pages/home/widget.dart'; -import 'package:hub/pages/onboarding/signin/widget.dart'; -import 'package:hub/pages/onboarding/signup/widget.dart'; -import 'package:hub/pages/onboarding/welcome/widget.dart'; -import 'package:hub/pages/registers/visitor/widget.dart'; -import 'package:hub/pages/schedules/visit/complete/widget.dart'; -import 'package:hub/pages/schedules/visit/fastpass/widget.dart'; -import 'package:hub/pages/schedules/visit/provisional/widget.dart'; -import 'package:hub/pages/settings/widget.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/fast_pass_page/fast_pass_page_widget.dart'; +import 'package:hub/pages/message_history_page/message_history_page_widget.dart'; +import 'package:hub/pages/preferences_settings_page/preferences_settings_widget.dart'; import 'package:provider/provider.dart'; -import '/commons/schema/structs/index.dart'; -import '/commons/widgets/flutter_flow_util.dart'; + +import '../../main.dart'; +import '/backend/schema/structs/index.dart'; +import '/flutter_flow/flutter_flow_util.dart'; import '/index.dart'; -// import '../../pages//visit_history_page_widget.dart'; +import '../../pages/visit_history_page/visit_history_page_widget.dart'; export 'package:go_router/go_router.dart'; @@ -34,6 +19,8 @@ export 'serialization_util.dart'; const kTransitionInfoKey = '__transition_info__'; +/// + class AppStateNotifier extends ChangeNotifier { AppStateNotifier._(); @@ -89,7 +76,9 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( FFRoute( name: 'homePage', path: '/homePage', - builder: (context, params) => const HomePageWidget(), + builder: (context, params) => params.isEmpty + ? const HomePageWidget() + : const HomePageWidget(), ), FFRoute( name: 'visitHistoryPage', @@ -199,7 +188,19 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( name: 'qrCodePage', path: '/qrCodePage', builder: (context, params) => const QrCodePageWidget(), - ) + ), + FFRoute( + name: 'preferencesPage', + path: '/preferencesPage', + builder: (context, params) => const PreferencesPageWidget(), + ), + // FFRoute( + // name: 'settingsPage', + // path: '/settingsPage', + // builder: (context, params) => params.isEmpty + // ? const NavBarPage(initialPage: 'settingsPage') + // : const SettingsPageWidget(), + // ) ].map((r) => r.toRoute(appStateNotifier)).toList(), ); @@ -396,4 +397,4 @@ extension GoRouterLocationExtension on GoRouter { : routerDelegate.currentConfiguration; return matchList.uri.toString(); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/nav/nav.dart:Zone.Identifier b/lib/flutter_flow/nav/nav.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/actions/serialization_util.dart b/lib/flutter_flow/nav/serialization_util.dart similarity index 96% rename from lib/commons/actions/serialization_util.dart rename to lib/flutter_flow/nav/serialization_util.dart index 6b04b1b2..887c8eec 100644 --- a/lib/commons/actions/serialization_util.dart +++ b/lib/flutter_flow/nav/serialization_util.dart @@ -3,12 +3,13 @@ import 'dart:developer'; import 'package:flutter/material.dart'; -import '/commons/schema/structs/index.dart'; -import '/commons/schema/enums/enums.dart'; +import '/backend/schema/structs/index.dart'; +import '/backend/schema/enums/enums.dart'; + +import '../../flutter_flow/lat_lng.dart'; +import '../../flutter_flow/place.dart'; +import '../../flutter_flow/uploaded_file.dart'; -import '/commons/widgets/lat_lng.dart'; -import '/commons/widgets/place.dart'; -import '/commons/widgets/uploaded_file.dart'; /// SERIALIZATION HELPERS @@ -228,4 +229,4 @@ dynamic deserializeParam( log('Error deserializing parameter: $e'); return null; } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/nav/serialization_util.dart:Zone.Identifier b/lib/flutter_flow/nav/serialization_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/permissions_util.dart b/lib/flutter_flow/permissions_util.dart similarity index 94% rename from lib/commons/widgets/permissions_util.dart rename to lib/flutter_flow/permissions_util.dart index c7b8c2ff..304c8a17 100644 --- a/lib/commons/widgets/permissions_util.dart +++ b/lib/flutter_flow/permissions_util.dart @@ -15,4 +15,4 @@ Future getPermissionStatus(Permission setting) async { } Future requestPermission(Permission setting) async => - await setting.request(); + await setting.request(); \ No newline at end of file diff --git a/lib/flutter_flow/permissions_util.dart:Zone.Identifier b/lib/flutter_flow/permissions_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/place.dart b/lib/flutter_flow/place.dart similarity index 99% rename from lib/commons/widgets/place.dart rename to lib/flutter_flow/place.dart index e3589b3b..972fb8be 100644 --- a/lib/commons/widgets/place.dart +++ b/lib/flutter_flow/place.dart @@ -43,4 +43,4 @@ class FFPlace { state == other.state && country == other.country && zipCode == other.zipCode; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/place.dart:Zone.Identifier b/lib/flutter_flow/place.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/random_data_util.dart b/lib/flutter_flow/random_data_util.dart similarity index 99% rename from lib/commons/widgets/random_data_util.dart rename to lib/flutter_flow/random_data_util.dart index 6599e5a6..fd966a2c 100644 --- a/lib/commons/widgets/random_data_util.dart +++ b/lib/flutter_flow/random_data_util.dart @@ -48,4 +48,4 @@ String randomImageUrl(int width, int height) { Color randomColor() { return Color.fromARGB( 255, _random.nextInt(255), _random.nextInt(255), _random.nextInt(255)); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/random_data_util.dart:Zone.Identifier b/lib/flutter_flow/random_data_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/request_manager.dart b/lib/flutter_flow/request_manager.dart similarity index 98% rename from lib/commons/widgets/request_manager.dart rename to lib/flutter_flow/request_manager.dart index f26ed03b..c9b4dcc8 100644 --- a/lib/commons/widgets/request_manager.dart +++ b/lib/flutter_flow/request_manager.dart @@ -90,4 +90,4 @@ class StreamRequestManager { } String _requestKey(String? key) => - key == null || key.isEmpty ? '__DEFAULT_KEY__' : key; + key == null || key.isEmpty ? '__DEFAULT_KEY__' : key; \ No newline at end of file diff --git a/lib/flutter_flow/request_manager.dart:Zone.Identifier b/lib/flutter_flow/request_manager.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/upload_data.dart b/lib/flutter_flow/upload_data.dart similarity index 87% rename from lib/commons/widgets/upload_data.dart rename to lib/flutter_flow/upload_data.dart index 11219e59..c7c4c597 100644 --- a/lib/commons/widgets/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -52,32 +52,32 @@ Future?> selectMediaWithSourceBottomSheet({ required bool allowPhoto, bool allowVideo = false, String pickerFontFamily = 'Roboto', - Color textColor = const Color(0xFF111417), - Color backgroundColor = const Color(0xFFF5F5F5), + // Color textColor = const Color(0xFF111417), + // Color backgroundColor = const Color(0xFFF5F5F5), bool includeDimensions = false, bool includeBlurHash = false, }) async { createUploadMediaListTile(String label, MediaSource mediaSource) => ListTile( - title: Text( - label, - textAlign: TextAlign.center, - style: GoogleFonts.getFont( - pickerFontFamily, - color: textColor, - fontWeight: FontWeight.w600, - fontSize: 20, - ), - ), - tileColor: backgroundColor, - dense: false, - onTap: () => Navigator.pop( - context, - mediaSource, - ), - ); + title: Text( + label, + textAlign: TextAlign.center, + style: GoogleFonts.getFont( + pickerFontFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontWeight: FontWeight.w600, + fontSize: 20, + ), + ), + tileColor: FlutterFlowTheme.of(context).primaryBackground, + dense: false, + onTap: () => Navigator.pop( + context, + mediaSource, + ), + ); final mediaSource = await showModalBottomSheet( context: context, - backgroundColor: backgroundColor, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, builder: (context) { return Column( mainAxisSize: MainAxisSize.min, @@ -91,13 +91,15 @@ Future?> selectMediaWithSourceBottomSheet({ textAlign: TextAlign.center, style: GoogleFonts.getFont( pickerFontFamily, - color: textColor.withOpacity(0.65), + color: FlutterFlowTheme.of(context) + .primaryText + .withOpacity(0.65), fontWeight: FontWeight.w500, fontSize: 20, ), ), - tileColor: backgroundColor, - dense: false, + tileColor: FlutterFlowTheme.of(context).primaryBackground, + dense: true, ), ), const Divider(), @@ -360,14 +362,22 @@ void showUploadMessage( child: CircularProgressIndicator( valueColor: Theme.of(context).brightness == Brightness.dark ? AlwaysStoppedAnimation( - FlutterFlowTheme.of(context).accent4) + FlutterFlowTheme.of(context).info) : null, ), ), - Text(message), + Text(message, style: FlutterFlowTheme.of(context).bodyMedium), ], ), - duration: showLoading ? const Duration(days: 1) : const Duration(seconds: 4), + backgroundColor: FlutterFlowTheme.of(context).primary, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), + ), + duration: + showLoading ? const Duration(days: 1) : const Duration(seconds: 4), ), ); } diff --git a/lib/flutter_flow/upload_data.dart:Zone.Identifier b/lib/flutter_flow/upload_data.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/commons/widgets/uploaded_file.dart b/lib/flutter_flow/uploaded_file.dart similarity index 99% rename from lib/commons/widgets/uploaded_file.dart rename to lib/flutter_flow/uploaded_file.dart index 2dfd2ff1..cbe68cad 100644 --- a/lib/commons/widgets/uploaded_file.dart +++ b/lib/flutter_flow/uploaded_file.dart @@ -65,4 +65,4 @@ class FFUploadedFile { height == other.height && width == other.width && blurHash == other.blurHash; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/uploaded_file.dart:Zone.Identifier b/lib/flutter_flow/uploaded_file.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/index.dart b/lib/index.dart index 461cd5e3..0e675d5a 100644 --- a/lib/index.dart +++ b/lib/index.dart @@ -1,27 +1,27 @@ +export '/pages/home_page/home_page_widget.dart' show HomePageWidget; +export '/pages/register_visitor_page/register_visitor_page_widget.dart' + show RegisterVisitorPageWidget; -export 'pages/index.dart'; +export '/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart' + show ScheduleCompleteVisitPageWidget; -// // CONSULT -// export 'pages/consults/access/' show AcessHistoryPageModel; -// export 'pages/consult/liberation/liberation_history_widget.dart' show LiberationHistoryWidget; -// export 'pages/consult/people/people_on_the_property_page_widget.dart' show PeopleOnThePropertyPageWidget; -// export 'pages/consult/qrcode/qr_code_page_widget.dart' show QrCodePageWidget; -// export 'pages/consult/message/message_history_page_widget.dart' show MessageHistoryPageWidget; -// export 'pages/consult/visit/visit_history_page_widget.dart' show VisitHistoryPageWidget; -// /// HOME -// export 'pages/home/home_page_widget.dart' show HomePageWidget; -// /// REGISTER -// export 'pages/register/visitor/register_visitor_page_widget.dart' show RegisterVisitorPageWidget; -// /// SCHEDULE -// export 'pages/schedule/visit/complete/schedule_complete_visit_page_widget.dart' show ScheduleCompleteVisitPageWidget; -// export 'pages/schedule/visit/provisional/schedule_provisional_visit_page_widget.dart' show ScheduleProvisionalVisitPageWidget; -// export 'pages/schedule/visit/fastpass/fast_pass_page_widget.dart' show FastPassPageWidget; -// /// SETTINGS -// export 'pages/settings/preferences_settings_widget.dart' show PreferencesSettingsWidget; -// /// WELCOME -// export 'pages/welcome/welcome_page_widget.dart' show WelcomePageWidget; -// export 'pages/welcome/signin/sign_in_page_widget.dart' show SignInPageWidget; -// export 'pages/welcome/signup/sign_up_page_widget.dart' show SignUpPageWidget; +export '/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart' + show ScheduleProvisionalVisitPageWidget; +export '/pages/people_on_the_property_page/people_on_the_property_page_widget.dart' + show PeopleOnThePropertyPageWidget; +export '/pages/acess_history_page/acess_history_page_widget.dart' + show AcessHistoryPageWidget; + +export '/pages/liberation_history/liberation_history_widget.dart' + show LiberationHistoryWidget; + +export '/pages/sign_in_page/sign_in_page_widget.dart' show SignInPageWidget; + +export '/pages/sign_up_page/sign_up_page_widget.dart' show SignUpPageWidget; + +export '/pages/welcome_page/welcome_page_widget.dart' show WelcomePageWidget; +export '/pages/qr_code_page/qr_code_page_widget.dart' show QrCodePageWidget; +export '/pages/preferences_settings_page/preferences_settings_widget.dart' show PreferencesPageWidget; diff --git a/lib/index.dart:Zone.Identifier b/lib/index.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/main.dart b/lib/main.dart index e15dc32e..2590c721 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,14 +1,16 @@ import 'package:firebase_core/firebase_core.dart'; +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:provider/provider.dart'; import 'package:flutter/material.dart'; import 'package:responsive_framework/responsive_framework.dart'; import 'firebase_options.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_web_plugins/url_strategy.dart'; -import 'commons/widgets/flutter_flow_theme.dart'; -import 'commons/widgets/flutter_flow_util.dart'; -import 'commons/widgets/internationalization.dart'; import 'package:flutter/services.dart'; final GlobalKey navigatorKey = GlobalKey(); @@ -28,6 +30,8 @@ void main() async { Future initializeApp() async { await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); + FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError; + await FlutterFlowTheme.initialize(); await FFLocalizations.initialize(); final appState = FFAppState(); @@ -56,6 +60,9 @@ class _MyAppState extends State { @override void initState() { super.initState(); + + FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); + _appStateNotifier = AppStateNotifier.instance; _router = createRouter(_appStateNotifier); Future.delayed(const Duration(milliseconds: 1000), @@ -134,4 +141,4 @@ class _MyAppState extends State { routerConfig: _router, ); } -} +} \ No newline at end of file diff --git a/lib/main.dart:Zone.Identifier b/lib/main.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/modals/browsers/visitor_browser/widget.dart b/lib/modals/browsers/visitor_browser/widget.dart deleted file mode 100644 index 926c3f6e..00000000 --- a/lib/modals/browsers/visitor_browser/widget.dart +++ /dev/null @@ -1,536 +0,0 @@ - -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/modals/details/visitor_details_modal/widget.dart'; -import 'package:hub/modals/exceptions/not_found/widget.dart'; - -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; - -class VisitorSearchModalTemplateComponentWidget extends StatefulWidget { - const VisitorSearchModalTemplateComponentWidget({ - super.key, - this.getVisitors, - this.getDocs, - }); - - final Future Function(List? visitorsParam)? getVisitors; - final Future Function(List? docsParam)? getDocs; - - @override - State createState() => - _VisitorSearchModalTemplateComponentWidgetState(); -} - -class _VisitorSearchModalTemplateComponentWidgetState - extends State - with TickerProviderStateMixin { - late VisitorSearchModalTemplateComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = - createModel(context, () => VisitorSearchModalTemplateComponentModel()); - - _model.textController ??= TextEditingController(); - _model.textFieldFocusNode ??= FocusNode(); - - WidgetsBinding.instance.addPostFrameCallback((_) => setState(() { - _model.textController?.text = FFLocalizations.of(context).getText( - 'oj12tamm' /* test */, - ); - })); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 300.0, 0.0, 0.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 10.0, 16.0, 0.0), - child: TextFormField( - controller: _model.textController, - focusNode: _model.textFieldFocusNode, - onFieldSubmitted: (_) async { - setState(() { - _model.textController?.text = valueOrDefault( - _model.textController.text, - '69696777', - ); - _model.textController?.selection = - TextSelection.collapsed( - offset: _model.textController!.text.length); - }); - _model.getVisitorByDoc = - await PhpGroup.getVisitorByDocCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitante', - documento: _model.textController.text, - ); - - if (PhpGroup.getVisitorByDocCall.vistanteId( - (_model.getVisitorByDoc?.jsonBody ?? ''), - ) != - '0') { - _model - .addToVisitors(PhpGroup.getVisitorByDocCall.visitante( - (_model.getVisitorByDoc?.jsonBody ?? ''), - )); - setState(() {}); - _model.addToDocs(_model.textController.text); - setState(() {}); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const VisitorNotFoundComponentWidget(), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - autofocus: false, - textInputAction: TextInputAction.done, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: FFLocalizations.of(context).getText( - 'cjlpru1m' /* Procure pelo documento do visi... */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - '8i1qszba' /* test */, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, - prefixIcon: Icon( - Icons.search_outlined, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - keyboardType: TextInputType.number, - validator: - _model.textControllerValidator.asValidator(context), - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '9coywebh' /* Visitantes encontrados */, - ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(4.0, 12.0, 16.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '6f5p0fv6' /* 24 */, - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ], - ), - Expanded( - child: Builder( - builder: (context) { - if (_model.visitors.isNotEmpty) { - return Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(8.0, 8.0, 8.0, 0.0), - child: Builder( - builder: (context) { - final visitor = - _model.visitors.map((e) => e).toList(); - - return ListView.builder( - padding: EdgeInsets.zero, - scrollDirection: Axis.vertical, - itemCount: visitor.length, - itemBuilder: (context, visitorIndex) { - final visitorItem = visitor[visitorIndex]; - return Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: const SizedBox( - height: 610.0, - child: - VisitorDetailsModalTemplateComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: Container( - width: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .secondaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 0.0, - color: FlutterFlowTheme.of(context) - .alternate, - offset: const Offset( - 0.0, - 1.0, - ), - ) - ], - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - ClipRRect( - borderRadius: - BorderRadius.circular(40.0), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: - valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - width: 60.0, - height: 60.0, - fit: BoxFit.cover, - ), - ), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(12.0, 0.0, - 0.0, 0.0), - child: Text( - valueOrDefault( - getJsonField( - visitorItem, - r'''$.VTE_NOME''', - )?.toString(), - 'NOT FOUND', - ), - style: - FlutterFlowTheme.of( - context) - .bodyLarge - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyLargeFamily, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyLargeFamily), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(4.0, 4.0, - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .start, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, - 0.0, - 0.0, - 0.0), - child: Text( - getJsonField( - visitorItem, - r'''$.VTE_TELEFONE''', - ).toString(), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of( - context) - .primary, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ), - ], - ), - ), - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.restore_from_trash, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - onPressed: () async { - _model.removeFromVisitors( - visitorItem); - setState(() {}); - }, - ), - ], - ), - ), - ), - ), - ); - }, - ); - }, - ), - ); - } else { - return Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).secondaryBackground, - ), - ); - } - }, - ), - ), - FFButtonWidget( - onPressed: () async { - await widget.getVisitors?.call( - _model.visitors, - ); - await widget.getDocs?.call( - _model.docs, - ); - Navigator.pop(context); - }, - text: FFLocalizations.of(context).getText( - 'ug6qzyla' /* Adicionar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 30.0, - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: - FlutterFlowTheme.of(context).titleSmallFamily, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleSmallFamily), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/modals/details/schedule_visit_detail/widget.dart b/lib/modals/details/schedule_visit_detail/widget.dart deleted file mode 100644 index 60bd9005..00000000 --- a/lib/modals/details/schedule_visit_detail/widget.dart +++ /dev/null @@ -1,981 +0,0 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; -import 'package:hub/modals/details/visitor_details_modal/widget.dart'; - -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; - -class ScheduleVisitDetailWidget extends StatefulWidget { - const ScheduleVisitDetailWidget({ - super.key, - required this.visitorJsonList, - required this.visitorStrList, - this.visitorImgPath, - required this.visitStartDate, - required this.visitEndDate, - required this.visitResonStr, - required this.visitLevelStr, - required this.visitTempStr, - required this.visitObsStr, - }); - - final List? visitorJsonList; - final String? visitorStrList; - final String? visitorImgPath; - final String? visitStartDate; - final String? visitEndDate; - final String? visitResonStr; - final String? visitLevelStr; - final String? visitTempStr; - final String? visitObsStr; - - @override - State createState() => - _ScheduleVisitDetailWidgetState(); -} - -class _ScheduleVisitDetailWidgetState extends State { - late ScheduleVisitDetailModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => ScheduleVisitDetailModel()); - - _model.textController1 ??= - TextEditingController(text: widget.visitTempStr); - _model.textFieldFocusNode1 ??= FocusNode(); - - _model.textController2 ??= - TextEditingController(text: widget.visitStartDate); - _model.textFieldFocusNode2 ??= FocusNode(); - - _model.textController3 ??= - TextEditingController(text: widget.visitEndDate); - _model.textFieldFocusNode3 ??= FocusNode(); - - _model.textController4 ??= TextEditingController( - text: functions.extractDescToStr(widget.visitResonStr!)); - _model.textFieldFocusNode4 ??= FocusNode(); - - _model.textController5 ??= TextEditingController( - text: functions.extractDescToStr(widget.visitLevelStr!)); - _model.textFieldFocusNode5 ??= FocusNode(); - - _model.textController6 ??= TextEditingController(text: widget.visitObsStr); - _model.textFieldFocusNode6 ??= FocusNode(); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Container( - width: double.infinity, - height: 35.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - child: Visibility( - visible: widget.visitorStrList != null && - widget.visitorStrList != '', - child: Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 0.0, 0.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.keyboard_return, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 24.0, - ), - onPressed: () async { - Navigator.pop(context); - }, - ), - ), - ), - ), - ), - ), - Container( - decoration: const BoxDecoration( - shape: BoxShape.rectangle, - ), - child: Stack( - children: [ - Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 5.0, 0.0, 5.0, 20.0), - child: Container( - width: 100.0, - decoration: const BoxDecoration(), - child: Builder( - builder: (context) { - final visitorsData = widget.visitorJsonList! - .toList() - .take(1) - .toList(); - - return SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: List.generate(visitorsData.length, - (visitorsDataIndex) { - final visitorsDataItem = - visitorsData[visitorsDataIndex]; - return Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(100.0), - ), - child: Align( - alignment: - const AlignmentDirectional(1.0, -1.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - Navigator.pop(context); - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: - Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf( - context), - child: - const VisitorDetailsModalTemplateComponentWidget(), - ); - }, - ).then((value) => - safeSetState(() {})); - }, - child: ClipRRect( - borderRadius: - BorderRadius.circular(100.0), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: - valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorsDataItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - width: 100.0, - height: 100.0, - fit: BoxFit.cover, - ), - ), - ), - ), - ); - }), - ), - ); - }, - ), - ), - ), - ), - Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 10.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: - FFLocalizations.of(context).getText( - '7w4fohoa' /* Encerramento da Visita */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController1Validator - .asValidator(context), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 10.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'snah4iet' /* Início */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '0cp1e31d' /* dd/mm/yyyy */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController2Validator - .asValidator(context), - ), - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'abppdgz3' /* Término */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - 'kqralft4' /* dd/mm/yyyy */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController3Validator - .asValidator(context), - ), - ), - ), - ], - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 10.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController4, - focusNode: _model.textFieldFocusNode4, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'xjxhzqqm' /* Motivo da Visita */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '47oezdm6' /* Motivo */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController4Validator - .asValidator(context), - ), - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController5, - focusNode: _model.textFieldFocusNode5, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - '2ujg7u18' /* Nível de Acesso */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '3emmbbfv' /* Nível de Acesso */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController5Validator - .asValidator(context), - ), - ), - ), - ], - ), - ), - Container( - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController6, - focusNode: _model.textFieldFocusNode6, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'ritce5uw' /* Observações da Visita */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController6Validator - .asValidator(context), - ), - ), - ), - ], - ), - Container( - width: double.infinity, - height: 22.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).secondaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - ), - ] - .divide(const SizedBox(height: 30.0)) - .addToStart(const SizedBox(height: 100.0)), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: 35.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - _model.postScheduleVisit = - await PhpGroup.postScheduleVisitCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - atividade: 'putVisita', - devDesc: widget.visitObsStr, - idVisitante: widget.visitorStrList, - dtInicio: widget.visitStartDate, - dtFim: widget.visitEndDate, - unica: widget.visitTempStr, - idMotivo: - functions.extractIdToStr(widget.visitResonStr!), - idNAC: functions.extractIdToStr(widget.visitLevelStr!), - obs: widget.visitObsStr, - cliID: FFAppState().cliUUID, - ); - - if (PhpGroup.postScheduleVisitCall.error( - (_model.postScheduleVisit?.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.postScheduleVisitCall.errorMsg( - (_model.postScheduleVisit?.jsonBody ?? ''), - )!, - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - child: Icon( - Icons.save_alt, - color: FlutterFlowTheme.of(context).secondaryText, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/modals/details/visit_details_modal/widget.dart b/lib/modals/details/visit_details_modal/widget.dart deleted file mode 100644 index 2d468235..00000000 --- a/lib/modals/details/visit_details_modal/widget.dart +++ /dev/null @@ -1,124 +0,0 @@ - - -import 'package:hub/modals/details/schedule_visit_detail/widget.dart'; -import 'package:hub/modals/details/view_visit_detail/widget.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'model.dart'; -export 'model.dart'; - -class VisitDetailsModalTemplateComponentWidget extends StatefulWidget { - const VisitDetailsModalTemplateComponentWidget({ - super.key, - this.visitStatusStr, - this.visitStartDateStr, - this.visitEndDateStr, - this.visitReasonStr, - this.visitLevelStr, - this.visitTempStr, - this.visitObsStr, - this.visitorStrList, - this.visitorJsonList, - this.visitorImgPath, - this.visitorImgList, - this.visitIdStr, - this.updateToggleIdx, - this.repeatVisitSchedule, - this.visitStatusColor, - }); - - final String? visitStatusStr; - final String? visitStartDateStr; - final String? visitEndDateStr; - final String? visitReasonStr; - final String? visitLevelStr; - final String? visitTempStr; - final String? visitObsStr; - final String? visitorStrList; - final List? visitorJsonList; - final String? visitorImgPath; - final List? visitorImgList; - final String? visitIdStr; - final Future Function()? updateToggleIdx; - final Future Function()? repeatVisitSchedule; - final Color? visitStatusColor; - - @override - State createState() => - _VisitDetailsModalTemplateComponentWidgetState(); -} - -class _VisitDetailsModalTemplateComponentWidgetState - extends State { - late VisitDetailsModalTemplateComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = - createModel(context, () => VisitDetailsModalTemplateComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Builder( - builder: (context) { - if (widget.visitStatusStr != null && widget.visitStatusStr != '') { - return wrapWithModel( - model: _model.viewVisitDetailModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: ViewVisitDetailWidget( - visitorImgPath: widget.visitorImgPath, - visitStartDate: widget.visitStartDateStr!, - visitEndDate: widget.visitEndDateStr!, - visitReasonStr: widget.visitReasonStr!, - visitLevelStr: widget.visitLevelStr!, - visitTempStr: widget.visitTempStr!, - visitObsStr: widget.visitObsStr!, - visitStatusStr: widget.visitStatusStr!, - visitorStrList: widget.visitorStrList!, - visitorJsonList: widget.visitorJsonList, - visitIdStr: widget.visitIdStr!, - visitStatusColor: widget.visitStatusColor!, - ), - ); - } else { - return wrapWithModel( - model: _model.scheduleVisitDetailModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: ScheduleVisitDetailWidget( - visitorStrList: widget.visitorStrList!, - visitorImgPath: widget.visitorImgPath, - visitStartDate: widget.visitStartDateStr!, - visitEndDate: widget.visitEndDateStr!, - visitResonStr: widget.visitReasonStr!, - visitLevelStr: widget.visitLevelStr!, - visitTempStr: widget.visitTempStr!, - visitObsStr: widget.visitObsStr!, - visitorJsonList: widget.visitorJsonList!, - ), - ); - } - }, - ), - ); - } -} diff --git a/lib/modals/details/visitor_details_modal/widget.dart b/lib/modals/details/visitor_details_modal/widget.dart deleted file mode 100644 index a52cc175..00000000 --- a/lib/modals/details/visitor_details_modal/widget.dart +++ /dev/null @@ -1,282 +0,0 @@ -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; - -class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget { - const VisitorDetailsModalTemplateComponentWidget({super.key}); - - @override - State createState() => - _VisitorDetailsModalTemplateComponentWidgetState(); -} - -class _VisitorDetailsModalTemplateComponentWidgetState - extends State { - late VisitorDetailsModalTemplateComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = - createModel(context, () => VisitorDetailsModalTemplateComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: BorderRadius.circular(25.0), - ), - child: Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: 34.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryText, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 40.0, 20.0, 0.0), - child: Container( - decoration: const BoxDecoration( - shape: BoxShape.rectangle, - ), - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 0.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: 100.0, - height: 100.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - fit: BoxFit.cover, - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'kqzf7nx2' /* Nome do Visitante */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'hz7ivuqn' /* Tipo de Visitante */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Icon( - Icons.phone, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'rwqn0det' /* (00) 0 0000-0000 */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Icon( - Icons.email, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '0wqbiekp' /* email@provider.etc */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ], - ), - ), - ], - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, -1.0), - child: Container( - width: double.infinity, - height: 34.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryText, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - shape: BoxShape.rectangle, - ), - child: Align( - alignment: const AlignmentDirectional(1.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(10.0, 5.0, 15.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - Navigator.pop(context); - }, - child: Icon( - Icons.close, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 24.0, - ), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/modals/exceptions/not_found/widget.dart b/lib/modals/exceptions/not_found/widget.dart deleted file mode 100644 index 2a86f8bb..00000000 --- a/lib/modals/exceptions/not_found/widget.dart +++ /dev/null @@ -1,179 +0,0 @@ - -import 'package:hub/pages/registers/visitor/component.dart'; - -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; - -class VisitorNotFoundComponentWidget extends StatefulWidget { - const VisitorNotFoundComponentWidget({super.key}); - - @override - State createState() => - _VisitorNotFoundComponentWidgetState(); -} - -class _VisitorNotFoundComponentWidgetState - extends State { - late VisitorNotFoundComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => VisitorNotFoundComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Container( - width: 350.0, - height: 350.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Align( - alignment: const AlignmentDirectional(1.0, -1.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.close, - color: FlutterFlowTheme.of(context).accent1, - size: 24.0, - ), - onPressed: () async { - Navigator.pop(context); - }, - ), - ), - ), - Icon( - Icons.notifications_none, - color: FlutterFlowTheme.of(context).accent1, - size: 72.0, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '1p9mykbj' /* Usuário não encontrado */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: - FlutterFlowTheme.of(context).headlineMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).headlineMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(10.0, 4.0, 10.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'kt937sp6' /* O documento inserido não corre... */, - ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontStyle: FontStyle.italic, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - ), - ), - Expanded( - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: FFButtonWidget( - onPressed: () async { - Navigator.pop(context); - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const RegisiterVistorTemplateComponentWidget(), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: FFLocalizations.of(context).getText( - 'y2x4nfcn' /* Adicionar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 30.0, - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: - FlutterFlowTheme.of(context).titleSmallFamily, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleSmallFamily), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/modals/forms/forgot_password/model.dart b/lib/modals/forms/forgot_password/model.dart deleted file mode 100644 index b1d69f20..00000000 --- a/lib/modals/forms/forgot_password/model.dart +++ /dev/null @@ -1,28 +0,0 @@ - -import 'package:hub/commons/actions/api_manager.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show ForgotPasswordTemplateComponentWidget; -import 'package:flutter/material.dart'; - -class ForgotPasswordTemplateComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - // State field(s) for emailAddress widget. - FocusNode? emailAddressFocusNode; - TextEditingController? emailAddressTextController; - String? Function(BuildContext, String?)? emailAddressTextControllerValidator; - // Stores action output result for [Backend Call - API (forgotPassword)] action in Button-Login widget. - ApiCallResponse? req; - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - emailAddressFocusNode?.dispose(); - emailAddressTextController?.dispose(); - } -} diff --git a/lib/modals/forms/forgot_password/widget.dart b/lib/modals/forms/forgot_password/widget.dart deleted file mode 100644 index b5bbc5b7..00000000 --- a/lib/modals/forms/forgot_password/widget.dart +++ /dev/null @@ -1,313 +0,0 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'model.dart'; -export 'model.dart'; - -class ForgotPasswordTemplateComponentWidget extends StatefulWidget { - const ForgotPasswordTemplateComponentWidget({super.key}); - - @override - State createState() => - _ForgotPasswordTemplateComponentWidgetState(); -} - -class _ForgotPasswordTemplateComponentWidgetState - extends State { - late ForgotPasswordTemplateComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => ForgotPasswordTemplateComponentModel()); - - _model.emailAddressTextController ??= TextEditingController(); - _model.emailAddressFocusNode ??= FocusNode(); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: 300.0, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well. - if (responsiveVisibility( - context: context, - phone: false, - tablet: false, - )) - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - context.safePop(); - }, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - const Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), - child: Icon( - Icons.arrow_back_rounded, - color: Color(0xFF15161E), - size: 24.0, - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), - child: Text( - '', - style: - FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: const Color(0xFF15161E), - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - ), - ), - ], - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'xxm3ajsy' /* ESQUECEU SUA SENHA? */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Outfit', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), - child: Text( - FFLocalizations.of(context).getText( - 'wu2f7yzo' /* Não se preucupe nós vamos te a... */, - ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model.emailAddressTextController, - focusNode: _model.emailAddressFocusNode, - autofillHints: const [AutofillHints.email], - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'mtz8l7ft' /* Email */, - ), - labelStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).accent1, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - hintText: FFLocalizations.of(context).getText( - 'w7y5wlnv' /* digite o seu email..... */, - ), - hintStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, - contentPadding: - const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0), - suffixIcon: Icon( - Icons.email, - color: FlutterFlowTheme.of(context).accent1, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - maxLines: null, - keyboardType: TextInputType.emailAddress, - cursorColor: const Color(0xFF6F61EF), - validator: _model.emailAddressTextControllerValidator - .asValidator(context), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - _model.req = await PhpGroup.forgotPasswordCall.call( - email: _model.emailAddressTextController.text, - ); - - if (PhpGroup.forgotPasswordCall.error( - (_model.req?.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.forgotPasswordCall.msg( - (_model.req?.jsonBody ?? ''), - )!, - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - '74rnd5bu' /* Enviar */, - ), - options: FFButtonOptions( - width: 270.0, - height: 50.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: const Color(0xFF1AAB5F), - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: Colors.white, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - ), - showLoadingIndicator: false, - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/modals/selection/bottom_arrow_linked_locals/widget.dart b/lib/modals/selection/bottom_arrow_linked_locals/widget.dart deleted file mode 100644 index 2bc89653..00000000 --- a/lib/modals/selection/bottom_arrow_linked_locals/widget.dart +++ /dev/null @@ -1,258 +0,0 @@ -import 'dart:developer'; - -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; - -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_spinkit/flutter_spinkit.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; - -class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget { - const BottomArrowLinkedLocalsComponentWidget({super.key}); - - @override - State createState() => - _BottomArrowLinkedLocalsComponentWidgetState(); -} - -class _BottomArrowLinkedLocalsComponentWidgetState - extends State { - late BottomArrowLinkedLocalsComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = - createModel(context, () => BottomArrowLinkedLocalsComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: 150.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - height: 150.0, - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - child: FutureBuilder( - future: PhpGroup.getLocalsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), - ), - ); - } - final localsResponse = snapshot.data!; - return Builder( - builder: (context) { - final linkedLocals = PhpGroup.getLocalsCall - .locais( - localsResponse.jsonBody, - ) - ?.map((e) => e) - .toList() - .toList() ?? - []; - - return GridView.builder( - padding: EdgeInsets.zero, - gridDelegate: - const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 1, - crossAxisSpacing: 10.0, - mainAxisSpacing: 0.0, - childAspectRatio: 1.0, - ), - scrollDirection: Axis.horizontal, - itemCount: linkedLocals.length, - itemBuilder: (context, index) { - final localItem = - linkedLocals[index]; - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - if (localItem['CLU_STATUS'] == 'A') { - - FFAppState().cliUUID = localItem['CLI_ID']; - setState(() {}); - FFAppState().local = localItem['CLI_NOME']; - setState(() {}); - FFAppState().ownerUUID = localItem['CLU_OWNER_ID']; - setState(() {}); - log('Local: ${FFAppState().local}'); - Navigator.pop(context); - } else { - log('Local não disponível'); - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text( - 'Local não disponível', - ), - ), - ); - } - - }, - child: Container( - width: 50.0, - height: double.infinity, - decoration: const BoxDecoration(), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryText, - borderRadius: - const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: - Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - border: Border.all( - color: - FlutterFlowTheme.of(context) - .secondaryText, - width: 3.0, - ), - ), - child: ClipRRect( - borderRadius: - const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: - Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - child: Image.network( - 'https://freaccess.com.br/freaccess/Images/Clients/${getJsonField( - localItem, - r'''$.CLI_ID''', - ).toString()}.png', - width: double.infinity, - height: double.infinity, - fit: BoxFit.fill, - alignment: - const Alignment(0.0, 0.0), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(0.0, 10.0, 0.0, 0.0), - child: Text( - getJsonField( - localItem, - r'''$.CLI_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ], - ), - ), - ); - }, - ); - }, - ); - }, - ), - ), - ], - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/pages/consults/access/model.dart b/lib/pages/acess_history_page/acess_history_page_model.dart similarity index 74% rename from lib/pages/consults/access/model.dart rename to lib/pages/acess_history_page/acess_history_page_model.dart index cdd7163a..4d633ac2 100644 --- a/lib/pages/consults/access/model.dart +++ b/lib/pages/acess_history_page/acess_history_page_model.dart @@ -1,12 +1,13 @@ -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/modals/filters/options/widget.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/request_manager.dart'; - -import 'widget.dart' show AcessHistoryPageWidget; import 'package:flutter/material.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_widget.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; +import 'package:hub/pages/acess_history_page/acess_history_page_widget.dart'; +import 'package:hub/pages/liberation_history/liberation_history_model.dart'; class AcessHistoryPageModel extends FlutterFlowModel { final unfocusNode = FocusNode(); @@ -56,4 +57,4 @@ class AcessHistoryPageModel extends FlutterFlowModel { }, ); } -} +} \ No newline at end of file diff --git a/lib/pages/acess_history_page/acess_history_page_model.dart:Zone.Identifier b/lib/pages/acess_history_page/acess_history_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/access/widget.dart b/lib/pages/acess_history_page/acess_history_page_widget.dart similarity index 95% rename from lib/pages/consults/access/widget.dart rename to lib/pages/acess_history_page/acess_history_page_widget.dart index cec1e538..58976eb6 100644 --- a/lib/pages/consults/access/widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -3,19 +3,24 @@ import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/components/molecules/card/widget.dart'; -import 'package:hub/modals/filters/options/widget.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_widget.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/pages/acess_history_page/acess_history_page_model.dart'; import 'package:rxdart/rxdart.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import 'model.dart'; -export 'model.dart'; + @immutable class AcessHistoryPageWidget extends StatefulWidget { @@ -405,8 +410,8 @@ Widget _cardHeaderAtomWidget(BuildContext context, String urlImagem, decoration: BoxDecoration( color: (() { // Extrai o valor de PES_TIPO, converte para String, remove espaços em branco e aspas - final pesTipo = functions - .jsonToStr(getJsonField( + final pesTipo = + jsonToStr(getJsonField( accessHistoryItem, r'''$.PES_TIPO''', )) @@ -548,4 +553,4 @@ String imageUrlAtomWidget(String document, String type) { "https://freaccess.com.br/freaccess/getImage.php?&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=$document&tipo=$type", "https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg", ); -} +} \ No newline at end of file diff --git a/lib/pages/acess_history_page/acess_history_page_widget.dart:Zone.Identifier b/lib/pages/acess_history_page/acess_history_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/schedules/visit/fastpass/widget.dart b/lib/pages/fast_pass_page/fast_pass_page_widget.dart similarity index 98% rename from lib/pages/schedules/visit/fastpass/widget.dart rename to lib/pages/fast_pass_page/fast_pass_page_widget.dart index 36f5312f..96dfaf9a 100644 --- a/lib/pages/schedules/visit/fastpass/widget.dart +++ b/lib/pages/fast_pass_page/fast_pass_page_widget.dart @@ -7,7 +7,6 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:url_launcher/url_launcher_string.dart'; import 'package:webview_flutter/webview_flutter.dart'; import 'dart:io' show Platform; -import '/commons/widgets/flutter_flow_util.dart'; class FastPassPageWidget extends StatefulWidget { final String freToken = FFAppState().userUUID; @@ -95,4 +94,4 @@ class _FastPassPageWidgetState extends State { ); } -} +} \ No newline at end of file diff --git a/lib/pages/fast_pass_page/fast_pass_page_widget.dart:Zone.Identifier b/lib/pages/fast_pass_page/fast_pass_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/home/widget.dart b/lib/pages/home/widget.dart deleted file mode 100644 index d66d6199..00000000 --- a/lib/pages/home/widget.dart +++ /dev/null @@ -1,670 +0,0 @@ -// import 'package:hub/backend/push_notification/pushNotification.dart'; -import 'dart:developer'; - -import 'package:hub/commons/actions/actions.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/commons/actions/pushNotificationService.dart'; -import 'package:hub/commons/components/atoms/local_header/widget.dart'; -import 'package:hub/commons/components/atoms/menu_button_item/widget.dart'; -import 'package:hub/commons/components/molecules/message_well/widget.dart'; -import 'package:hub/commons/components/organisms/menu/widget.dart'; - -import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart'; -import 'package:hub/pages/schedules/visit/complete/widget.dart'; -import 'package:provider/provider.dart'; - - -import '../../commons/schema/enums/enums.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import 'model.dart'; -export 'model.dart'; - -class HomePageWidget extends StatefulWidget { - const HomePageWidget({super.key}); - - - - - @override - State createState() => _HomePageWidgetState(); -} - -class _HomePageWidgetState extends State { - late HomePageModel _model; - bool localStatus = false; - final scaffoldKey = GlobalKey(); - - - Future checkLocalStatus() async { - localStatus = await checkLocals( - context: context, - model: _model, - safeSetState: safeSetState, - ); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => HomePageModel()); - SchedulerBinding.instance.addPostFrameCallback((_) async { - await PushNotificationService().initialize(context); - - - - - @override - void initState() { - super.initState(); - checkLocalStatus(); - } - - // Rest of your code... - if (FFAppState().cliUUID == null || FFAppState().cliUUID.isEmpty) { - showModalBottomSheet( - isScrollControlled: false, - backgroundColor: Colors.transparent, - enableDrag: false, - isDismissible: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const BottomArrowLinkedLocalsComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } else { - return; - } - }); - - _model.textController ??= TextEditingController(); - _model.textFieldFocusNode ??= FocusNode(); - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - - context.watch(); - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).secondaryBackground, - drawer: buildDrawer(context), - body: buildPage(context, localStatus), - ), - ); - } - - Container buildPage(BuildContext context, bool localStatus) { - return Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - createHeader(context), - createLocal(localStatus), - createBody(), - ], - ), - ], - ), - ), - ); - } - - Wrap createBody() { - return Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: MenuComponentWidget( - options: [ - - ], - expandable: true, - style: MenuView.list_grid, - item: MenuItem.button, - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Provider( - create: (_) => MessageWellNotifier(), - child: wrapWithModel( - model: _model.messageWellComponentModel, - updateCallback: () => setState(() {}), - child: const MessageWellComponentWidget(), - ), - ), - ), - //footer - const SizedBox( - height: 100, - width: double.infinity, - ) - ], - ); - } - - Widget createLocal(bool localStatus) { - return wrapWithModel( - model: _model.localComponentModel, - updateCallback: () => setState(() {}), - child: LocalProfileComponentWidget( - localStatus: localStatus, - ), - ); - } - - Row createHeader(BuildContext context) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: const BoxDecoration( - color: Color(0xFF1AAB5F), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 1.0), - child: Container( - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: - FlutterFlowTheme.of(context) - .primary, - icon: const Icon( - Icons.menu_rounded, - color: Colors.white, - size: 28.0, - ), - onPressed: () async { - scaffoldKey.currentState! - .openDrawer(); - }, - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 60.0, 15.0, 0.0, 0.0), - child: ClipRRect( - borderRadius: - BorderRadius.circular(8.0), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', - width: 50.0, - height: 200.0, - fit: BoxFit.none, - ), - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, 15.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'rg9pzkpz' /* FRE ACCESS */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme - .of(context) - .info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ), - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 1.0), - child: Container( - width: 100.0, - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(1.0, 1.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.notifications_sharp, - color: - FlutterFlowTheme.of(context).info, - size: 24.0, - ), - onPressed: () { - log('IconButton pressed ...'); - }, - ), - ), - ), - ), - ], - ), - ), - ), - ], - ); - } - - SizedBox buildDrawer(BuildContext context) { - return SizedBox( - width: 750.0, - child: Drawer( - elevation: 16.0, - child: Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - shape: BoxShape.rectangle, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: double.infinity, - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(5.0), - bottomRight: Radius.circular(5.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - shape: BoxShape.rectangle, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(30, 30, 10, 0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Flexible( - child: Container( - width: double.infinity, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.network( - valueOrDefault( - 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), - ), - Container( - width: 150.0, - child: Text( - valueOrDefault( - functions.convertToUppercase( - FFAppState().local), - 'NOME DO LOCAL', - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: 'Nunito Sans', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito Sans'), - ), - ), - ), - ].divide(const SizedBox(width: 20.0)), - ), - ), - ), - Container( - width: 50.0, - child: Container( - height: 30.0, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Flexible( - child: FlutterFlowIconButton( - borderRadius: 100.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.close_sharp, - color: FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - onPressed: () async { - if (scaffoldKey.currentState! - .isDrawerOpen || - scaffoldKey.currentState! - .isEndDrawerOpen) { - Navigator.pop(context); - } - }, - ), - ), - ], - ), - ), - ), - ] - .divide(const SizedBox(width: 0.0)) - .around(const SizedBox(width: 0.0)), - ), - ), - ].addToStart(const SizedBox(height: 30.0)), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController, - focusNode: _model.textFieldFocusNode, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - alignLabelWithHint: false, - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .customColor1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - errorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedErrorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - prefixIcon: const Icon( - Icons.search_sharp, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textControllerValidator - .asValidator(context), - ), - ), - ), - ] - .addToStart(const SizedBox(width: 30.0)) - .addToEnd(const SizedBox(width: 30.0)), - ), - ), - Flexible( - child: Container( - width: double.infinity, - height: double.infinity, - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 20.0, 10.0, 0.0), - child: wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: MenuComponentWidget( - options: [ - MenuButtonWidget( - action: () => scheduleVisitOptAction(context), - title: FFLocalizations.of(context).getVariableText( - enText: 'Register Visitor', - ptText: 'Registrar Visitante', - ), - icon: Icons.person_add_alt_1_outlined, - ), - MenuButtonWidget( - action: () => scheduleVisitOptAction(context), - title: FFLocalizations.of(context).getVariableText( - enText: 'Register Visitors', - ptText: 'Registrar Visitantes', - ), - icon: Icons.person_add_alt_1_outlined, - ), - - ], - expandable: false, - style: MenuView.list, - item: MenuItem.card, - ), - ), - ), - ), - ), - FFButtonWidget( - onPressed: () async { - FFAppState().isLogged = false; - setState(() {}); - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - }, - text: FFLocalizations.of(context).getText( - 'xx0db4wi' /* Sair */, - ), - options: FFButtonOptions( - height: 40.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: const Color(0x00D70000), - textStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - elevation: 0.0, - borderSide: const BorderSide( - width: 0.0, - ), - borderRadius: BorderRadius.circular(50.0), - ), - ), - ].addToEnd(const SizedBox(height: 64.0)), - ), - ), - ), - ); - } -} diff --git a/lib/pages/home/model.dart b/lib/pages/home_page/home_page_model.dart similarity index 74% rename from lib/pages/home/model.dart rename to lib/pages/home_page/home_page_model.dart index dde633a3..7c227e9c 100644 --- a/lib/pages/home/model.dart +++ b/lib/pages/home_page/home_page_model.dart @@ -1,14 +1,10 @@ -import 'package:hub/commons/components/atoms/local_header/model.dart'; -import 'package:hub/commons/components/molecules/message_well/model.dart'; -import 'package:hub/commons/components/organisms/menu/model.dart'; -import 'package:hub/modals/filters/selections/widget.dart'; - - - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show HomePageWidget; import 'package:flutter/material.dart'; +import 'package:hub/components/organism_components/local_profile_component/local_profile_component_model.dart'; +import 'package:hub/components/organism_components/menu_component/menu_component_model.dart'; +import 'package:hub/components/organism_components/message_well_component/message_well_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/pages/home_page/home_page_widget.dart'; class HomePageModel extends FlutterFlowModel { /// Local state fields for this page. @@ -50,4 +46,4 @@ class HomePageModel extends FlutterFlowModel { } -} +} \ No newline at end of file diff --git a/lib/pages/home_page/home_page_model.dart:Zone.Identifier b/lib/pages/home_page/home_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart new file mode 100644 index 00000000..6cf9f539 --- /dev/null +++ b/lib/pages/home_page/home_page_widget.dart @@ -0,0 +1,791 @@ +// import 'package:hub/backend/push_notification/pushNotification.dart'; +import 'dart:developer'; + +import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/actions/actions.dart'; +import 'package:hub/backend/push_notification/pushNotificationService.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/components/organism_components/local_profile_component/local_profile_component_widget.dart'; +import 'package:hub/components/organism_components/menu_component/menu_component_widget.dart'; +import 'package:hub/components/organism_components/message_well_component/message_well_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; + +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/home_page/home_page_model.dart'; + +import 'package:provider/provider.dart'; + +class HomePageWidget extends StatefulWidget { + const HomePageWidget({super.key}); + + @override + State createState() => _HomePageWidgetState(); +} + +class _HomePageWidgetState extends State { + late HomePageModel _model; + bool localStatus = false; + final scaffoldKey = GlobalKey(); + + Future checkLocalStatus() async { + localStatus = await checkLocals( + context: context, + model: _model, + safeSetState: safeSetState, + ); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => HomePageModel()); + SchedulerBinding.instance.addPostFrameCallback((_) async { + await PushNotificationService().initialize(context); + + @override + void initState() { + super.initState(); + checkLocalStatus(); + } + + // Rest of your code... + if (FFAppState().cliUUID == null || FFAppState().cliUUID.isEmpty) { + showModalBottomSheet( + isScrollControlled: false, + backgroundColor: Colors.transparent, + enableDrag: false, + isDismissible: false, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const BottomArrowLinkedLocalsComponentWidget(), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } else { + return; + } + }); + + _model.textController ??= TextEditingController(); + _model.textFieldFocusNode ??= FocusNode(); + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).secondaryBackground, + drawer: buildDrawer(context), + body: buildPage(context, localStatus), + ), + ); + } + + Container buildPage(BuildContext context, bool localStatus) { + return Container( + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + createHeader(context), + createLocal(localStatus), + createBody(), + ], + ), + ], + ), + ), + ); + } + + Wrap createBody() { + return Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: const MenuComponentWidget( + expandable: true, + style: MenuView.list_grid, + item: MenuItem.button, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Provider( + create: (_) => MessageWellNotifier(), + child: wrapWithModel( + model: _model.messageWellComponentModel, + updateCallback: () => setState(() {}), + child: const MessageWellComponentWidget(), + ), + ), + ), + //footer + const SizedBox( + height: 100, + width: double.infinity, + ) + ], + ); + } + + Widget createLocal(bool localStatus) { + return wrapWithModel( + model: _model.localComponentModel, + updateCallback: () => setState(() {}), + child: LocalProfileComponentWidget( + localStatus: localStatus, + ), + ); + } + + Row createHeader(BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Container( + width: 100.0, + height: 100.0, + decoration: const BoxDecoration( + color: Color(0xFF1AAB5F), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + height: 50.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).primary, + icon: const Icon( + Icons.menu_rounded, + color: Colors.white, + size: 28.0, + ), + onPressed: () async { + scaffoldKey.currentState!.openDrawer(); + }, + ), + ), + ), + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 60.0, 15.0, 0.0, 0.0), + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Image.network( + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', + width: 50.0, + height: 200.0, + fit: BoxFit.none, + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 15.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'rg9pzkpz' /* FRE ACCESS */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + width: 100.0, + height: 50.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(1.0, 1.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.notifications_sharp, + color: FlutterFlowTheme.of(context).info, + size: 24.0, + ), + onPressed: () { + log('IconButton pressed ...'); + }, + ), + ), + ), + ), + ], + ), + ), + ), + ], + ); + } + + SizedBox buildDrawer(BuildContext context) { + return SizedBox( + width: 750.0, + child: Drawer( + elevation: 16.0, + child: Container( + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + shape: BoxShape.rectangle, + ), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: double.infinity, + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), + ), + shape: BoxShape.rectangle, + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(30, 30, 10, 0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Flexible( + child: Container( + width: double.infinity, + decoration: const BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.network( + valueOrDefault( + 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + fit: BoxFit.cover, + ), + ), + Container( + width: 150.0, + child: Text( + valueOrDefault( + convertToUppercase(FFAppState().local), + 'NOME DO LOCAL', + ), + style: FlutterFlowTheme.of(context) + .bodyLarge + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito Sans'), + ), + ), + ), + ].divide(const SizedBox(width: 20.0)), + ), + ), + ), + Container( + width: 50.0, + child: Container( + height: 30.0, + decoration: const BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Flexible( + child: FlutterFlowIconButton( + borderRadius: 100.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.close_sharp, + color: FlutterFlowTheme.of(context) + .primary, + size: 20.0, + ), + onPressed: () async { + if (scaffoldKey + .currentState!.isDrawerOpen || + scaffoldKey.currentState! + .isEndDrawerOpen) { + Navigator.pop(context); + } + }, + ), + ), + ], + ), + ), + ), + ] + .divide(const SizedBox(width: 0.0)) + .around(const SizedBox(width: 0.0)), + ), + ), + ].addToStart(const SizedBox(height: 30.0)), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: + FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + alignLabelWithHint: false, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).customColor1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + errorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + focusedErrorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + prefixIcon: const Icon( + Icons.search_sharp, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textControllerValidator + .asValidator(context), + ), + ), + ), + ] + .addToStart(const SizedBox(width: 30.0)) + .addToEnd(const SizedBox(width: 30.0)), + ), + ), + Expanded( + child: wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: MenuComponentWidget( + expandable: false, + style: MenuView.list, + item: MenuItem.card, + ), + ), + ), + FFButtonWidget( + onPressed: () async { + FFAppState().isLogged = false; + setState(() {}); + + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }, + text: FFLocalizations.of(context).getText( + 'xx0db4wi' /* Sair */, + ), + options: FFButtonOptions( + height: 40.0, + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + color: const Color(0x00D70000), + textStyle: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 0.0, + borderSide: const BorderSide( + width: 0.0, + ), + borderRadius: BorderRadius.circular(50.0), + ), + ), + ].addToEnd(const SizedBox(height: 64.0)), + ), + ), + ), + ); + + // body: Container( + // decoration: BoxDecoration( + // color: FlutterFlowTheme.of(context).primaryBackground, + // ), + // child: SingleChildScrollView( + // child: Column( + // mainAxisSize: MainAxisSize.max, + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Wrap( + // spacing: 0.0, + // runSpacing: 0.0, + // alignment: WrapAlignment.start, + // crossAxisAlignment: WrapCrossAlignment.start, + // direction: Axis.horizontal, + // runAlignment: WrapAlignment.start, + // verticalDirection: VerticalDirection.down, + // clipBehavior: Clip.none, + // children: [ + // Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // Expanded( + // child: Container( + // width: 100.0, + // height: 100.0, + // decoration: const BoxDecoration( + // color: Color(0xFF1AAB5F), + // ), + // child: Row( + // mainAxisSize: MainAxisSize.min, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Align( + // alignment: const AlignmentDirectional(0.0, 1.0), + // child: Container( + // height: 50.0, + // decoration: const BoxDecoration(), + // child: Align( + // alignment: const AlignmentDirectional(0.0, 0.0), + // child: Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // Align( + // alignment: + // const AlignmentDirectional(-1.0, 0.0), + // child: Padding( + // padding: const EdgeInsetsDirectional + // .fromSTEB( + // 10.0, 0.0, 0.0, 0.0), + // child: FlutterFlowIconButton( + // borderRadius: 20.0, + // borderWidth: 1.0, + // buttonSize: 40.0, + // fillColor: + // FlutterFlowTheme.of(context) + // .primary, + // icon: const Icon( + // Icons.menu_rounded, + // color: Colors.white, + // size: 28.0, + // ), + // onPressed: () async { + // scaffoldKey.currentState! + // .openDrawer(); + // }, + // ), + // ), + // ), + // Align( + // alignment: + // const AlignmentDirectional(-1.0, 0.0), + // child: Padding( + // padding: const EdgeInsetsDirectional + // .fromSTEB( + // 60.0, 15.0, 0.0, 0.0), + // child: ClipRRect( + // borderRadius: + // BorderRadius.circular(8.0), + // child: Image.network( + // 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', + // width: 50.0, + // height: 200.0, + // fit: BoxFit.none, + // ), + // ), + // ), + // ), + // Align( + // alignment: + // const AlignmentDirectional(0.0, 0.0), + // child: Padding( + // padding: const EdgeInsetsDirectional + // .fromSTEB( + // 0.0, 15.0, 0.0, 0.0), + // child: Text( + // FFLocalizations.of(context) + // .getText( + // 'rg9pzkpz' /* FRE ACCESS */, + // ), + // style: + // FlutterFlowTheme.of(context) + // .bodyMedium + // .override( + // fontFamily: + // FlutterFlowTheme.of( + // context) + // .bodyMediumFamily, + // color: FlutterFlowTheme + // .of(context) + // .info, + // letterSpacing: 0.0, + // useGoogleFonts: GoogleFonts + // .asMap() + // .containsKey( + // FlutterFlowTheme.of( + // context) + // .bodyMediumFamily), + // ), + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ), + // Align( + // alignment: const AlignmentDirectional(0.0, 1.0), + // child: Container( + // width: 100.0, + // height: 50.0, + // decoration: const BoxDecoration(), + // child: Align( + // alignment: const AlignmentDirectional(1.0, 1.0), + // child: FlutterFlowIconButton( + // borderRadius: 20.0, + // borderWidth: 1.0, + // buttonSize: 40.0, + // icon: Icon( + // Icons.notifications_sharp, + // color: + // FlutterFlowTheme.of(context).info, + // size: 24.0, + // ), + // onPressed: () { + // print('IconButton pressed ...'); + // }, + // ), + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ], + // ), + // wrapWithModel( + // model: _model.localComponentModel, + // updateCallback: () => setState(() {}), + // child: const LocalProfileComponentWidget(), + // ), + // Wrap( + // spacing: 0.0, + // runSpacing: 0.0, + // alignment: WrapAlignment.start, + // crossAxisAlignment: WrapCrossAlignment.start, + // direction: Axis.horizontal, + // runAlignment: WrapAlignment.start, + // verticalDirection: VerticalDirection.down, + // clipBehavior: Clip.none, + // children: [ + // wrapWithModel( + // model: _model.menuComponentModel, + // updateCallback: () => setState(() {}), + // child: const MenuComponentWidget(), + // ), + // Align( + // alignment: const AlignmentDirectional(0.0, 0.0), + // child: wrapWithModel( + // model: _model.messageWellComponentModel, + // updateCallback: () => setState(() {}), + // child: const MessageWellComponentWidget(), + // ), + // ), + // ], + // ), + // ], + // ), + // ], + // ), + // ), + // ), + // ), + // ); + } +} diff --git a/lib/pages/home_page/home_page_widget.dart:Zone.Identifier b/lib/pages/home_page/home_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/index.dart b/lib/pages/index.dart deleted file mode 100644 index e3e432c0..00000000 --- a/lib/pages/index.dart +++ /dev/null @@ -1,8 +0,0 @@ - - -import 'consults/index.dart'; -import 'home/index.dart'; -import 'registers/index.dart'; -import 'schedules/index.dart'; -import 'settings/index.dart'; -import 'onboarding/index.dart'; \ No newline at end of file diff --git a/lib/pages/consults/liberation/model.dart b/lib/pages/liberation_history/liberation_history_model.dart similarity index 83% rename from lib/pages/consults/liberation/model.dart rename to lib/pages/liberation_history/liberation_history_model.dart index a0622162..a26534bb 100644 --- a/lib/pages/consults/liberation/model.dart +++ b/lib/pages/liberation_history/liberation_history_model.dart @@ -1,10 +1,10 @@ -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/request_manager.dart'; -import 'widget.dart' show LiberationHistoryWidget; import 'package:flutter/material.dart'; +import 'package:hub/pages/liberation_history/liberation_history_widget.dart'; class LiberationHistoryModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. @@ -45,4 +45,4 @@ class LiberationHistoryModel extends FlutterFlowModel { clearGetLiberationsCache(); } -} +} \ No newline at end of file diff --git a/lib/pages/liberation_history/liberation_history_model.dart:Zone.Identifier b/lib/pages/liberation_history/liberation_history_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/liberation/widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart similarity index 93% rename from lib/pages/consults/liberation/widget.dart rename to lib/pages/liberation_history/liberation_history_widget.dart index 3be711e8..3627c1b4 100644 --- a/lib/pages/consults/liberation/widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -2,23 +2,25 @@ import 'dart:developer'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/actions.dart'; -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/actions/pushNotificationService.dart'; -import 'package:hub/commons/components/molecules/card/widget.dart'; -import 'package:hub/modals/notifications/visit_request/widget.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/custom_functions.dart' as functions; +import 'package:hub/actions/actions.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/push_notification/pushNotificationService.dart'; + +import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/pages/liberation_history/liberation_history_model.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; + class LiberationHistoryWidget extends StatefulWidget { const LiberationHistoryWidget({super.key}); @@ -253,8 +255,7 @@ Widget liberationDynamicListView( []; final filteredLiberationHistory = _model.textController.text.isNotEmpty ? liberationHistory - .where((item) => functions - .jsonToStr(getJsonField( + .where((item) => jsonToStr(getJsonField( item, r'''$.VTE_NOME''', )) @@ -379,4 +380,4 @@ Widget liberationHistoryItemCard( }); }, ); -} +} \ No newline at end of file diff --git a/lib/pages/liberation_history/liberation_history_widget.dart:Zone.Identifier b/lib/pages/liberation_history/liberation_history_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/message/model.dart b/lib/pages/message_history_page/message_history_page_model.dart similarity index 77% rename from lib/pages/consults/message/model.dart rename to lib/pages/message_history_page/message_history_page_model.dart index a53ccc06..8d11df7b 100644 --- a/lib/pages/consults/message/model.dart +++ b/lib/pages/message_history_page/message_history_page_model.dart @@ -1,15 +1,16 @@ -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:flutter_spinkit/flutter_spinkit.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/request_manager.dart'; - -import 'widget.dart' show MessageHistoryPageWidget; import 'package:flutter/material.dart'; +import 'package:hub/pages/message_history_page/message_history_page_widget.dart'; -class MessageHistoryPageModel extends FlutterFlowModel { +class MessageHistoryPageModel + extends FlutterFlowModel { /// State fields for stateful widgets in this page. - /// - + /// + //copyWith final unfocusNode = FocusNode(); @@ -49,7 +50,6 @@ class MessageHistoryPageModel extends FlutterFlowModel textController?.dispose(); tabBarController?.dispose(); - /// Dispose query cache managers for this widget. clearGetLiberationsCache(); diff --git a/lib/pages/message_history_page/message_history_page_model.dart:Zone.Identifier b/lib/pages/message_history_page/message_history_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/message/widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart similarity index 68% rename from lib/pages/consults/message/widget.dart rename to lib/pages/message_history_page/message_history_page_widget.dart index d390f66d..8d9d7d5c 100644 --- a/lib/pages/consults/message/widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -2,17 +2,20 @@ import 'dart:developer'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/message_history_page/message_history_page_model.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; class MessageHistoryPageWidget extends StatefulWidget { const MessageHistoryPageWidget({super.key}); @@ -22,7 +25,8 @@ class MessageHistoryPageWidget extends StatefulWidget { _MessageHistoryPageWidgetState(); } -class _MessageHistoryPageWidgetState extends State with TickerProviderStateMixin { +class _MessageHistoryPageWidgetState extends State + with TickerProviderStateMixin { late MessageHistoryPageModel _model; final scaffoldKey = GlobalKey(); @@ -32,7 +36,7 @@ class _MessageHistoryPageWidgetState extends State wit super.initState(); _model = createModel(context, () => MessageHistoryPageModel()); - _model.tabBarController = TabController( + _model.tabBarController = TabController( vsync: this, length: 3, initialIndex: 1, @@ -102,8 +106,7 @@ PreferredSizeWidget appBarMessage(BuildContext context) { ); } -Widget bodyMessage( - BuildContext context, MessageHistoryPageModel _model) { +Widget bodyMessage(BuildContext context, MessageHistoryPageModel _model) { return SafeArea( top: true, child: Column( @@ -151,33 +154,26 @@ Widget bodyMessage( }, ), ), - Expanded(child: TabBarView( - controller: _model.tabBarController, - children: [ - liberationDynamicListView(context, _model, 'P'), - liberationDynamicListView(context, _model, 'A'), - liberationDynamicListView(context, _model, 'T'), - ] - )), + Expanded( + child: TabBarView(controller: _model.tabBarController, children: [ + liberationDynamicListView(context, _model, 'P'), + liberationDynamicListView(context, _model, 'A'), + liberationDynamicListView(context, _model, 'T'), + ])), ].addToStart(const SizedBox(height: 0)), ), ); } - - - Widget liberationDynamicListView( - BuildContext context, - MessageHistoryPageModel _model, - String DestIndex -) { + BuildContext context, MessageHistoryPageModel _model, String DestIndex) { return Container( width: double.infinity, height: double.infinity, decoration: const BoxDecoration(), child: FutureBuilder( - future: PhpGroup.getMessagesCall.call( + future: PhpGroup.getMessagesCall + .call( devUUID: FFAppState().devUUID.toString(), userUUID: FFAppState().userUUID.toString(), cliID: FFAppState().cliUUID.toString(), @@ -185,7 +181,8 @@ Widget liberationDynamicListView( pageSize: '100', pageNumber: '1', tipoDestino: DestIndex, - ).catchError((error) { + ) + .catchError((error) { log('Error: ${error.toString()}'); return Future.delayed(Duration(seconds: 1), () { return Center( @@ -213,8 +210,15 @@ Widget liberationDynamicListView( child: Text('Erro ao carregar mensagens'), ); } + final mensagens = snapshot.data!.jsonBody['mensagens']; + final totalRows = snapshot.data!.jsonBody['total_rows']; + if (totalRows == 0 || mensagens == null || mensagens.isEmpty) { + return const Center( + child: Text('Nenhuma mensagem encontrada'), + ); + } return ListView.builder( - itemCount: snapshot.data!.jsonBody['total_rows'], + itemCount: totalRows, addAutomaticKeepAlives: false, addRepaintBoundaries: true, cacheExtent: 1000.0, @@ -230,8 +234,7 @@ Widget liberationDynamicListView( ); } -Widget messageHistoryItem( - BuildContext context, dynamic jsonBody) { +Widget messageHistoryItem(BuildContext context, dynamic jsonBody) { log(jsonBody.toString()); return Padding( padding: const EdgeInsets.symmetric(horizontal: 15), @@ -246,55 +249,60 @@ Widget messageHistoryItem( Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Padding( - padding: const EdgeInsets.only(left: 15.0), - child: Text( - jsonBody['MSG_DATE'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, - overflow: TextOverflow.ellipsis, - ), - ), - ), - Icon( - jsonBody['MSG_DESTINO_TP'] == 'T' - ? Icons.group - : Icons.person, - color: FlutterFlowTheme.of(context).accent1, - ) - ], - ), - SizedBox(height: 8), - Row( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Text( - jsonBody['MSG_ORIGEM_DESC'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, + Row( + mainAxisAlignment: MainAxisAlignment.end, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.only(left: 15.0), + child: Text( + jsonBody['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 10, + color: FlutterFlowTheme.of(context).customColor6, + overflow: TextOverflow.ellipsis, + ), ), - overflow: TextOverflow.fade, ), - ), + ], + ), + Row( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Text( + jsonBody['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 12, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.fade, + ), + ), + Icon( + jsonBody['MSG_DESTINO_TP'] == 'T' + ? Icons.group + : Icons.person, + color: FlutterFlowTheme.of(context).primary, + ), + ], ), ], ), SizedBox(height: 8), - Text(jsonBody['MSG_TEXTO'].toString(),), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + jsonBody['MSG_TEXTO'].toString(), + ), + ), + SizedBox(height: 8), ], ), ), ), ), ); - - } diff --git a/lib/pages/message_history_page/message_history_page_widget.dart:Zone.Identifier b/lib/pages/message_history_page/message_history_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/poeple/model.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart similarity index 68% rename from lib/pages/consults/poeple/model.dart rename to lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart index 02e2d099..cc62f4f5 100644 --- a/lib/pages/consults/poeple/model.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart @@ -1,7 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show PeopleOnThePropertyPageWidget; + import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_widget.dart'; class PeopleOnThePropertyPageModel extends FlutterFlowModel { @@ -16,4 +16,4 @@ class PeopleOnThePropertyPageModel void dispose() { unfocusNode.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart:Zone.Identifier b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/poeple/widget.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart similarity index 93% rename from lib/pages/consults/poeple/widget.dart rename to lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart index 313bff9f..0dbfce20 100644 --- a/lib/pages/consults/poeple/widget.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart @@ -1,16 +1,18 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_model.dart'; + -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; + class PeopleOnThePropertyPageWidget extends StatefulWidget { const PeopleOnThePropertyPageWidget({super.key}); @@ -159,4 +161,4 @@ class _PeopleOnThePropertyPageWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart:Zone.Identifier b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart new file mode 100644 index 00000000..d7c05015 --- /dev/null +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -0,0 +1,244 @@ +import 'dart:developer'; + +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:flutter/material.dart'; +import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:share_plus/share_plus.dart'; + +class PreferencesPageModel with ChangeNotifier { + final unfocusNode = FocusNode(); + + Future toggleFingerprint(BuildContext context) async { + // FFAppState().checkBiometrics() + // .then((value) => FFAppState().authenticateBiometric() + // .then( (value) { + // FFAppState().fingerprint = !FFAppState().fingerprint; + + // }) + // .whenComplete(() => notifyListeners())); + + if (FFAppState().fingerprint) { + FFAppState().fingerprint = false; + FFAppState().deleteFingerprintPass(); + notifyListeners(); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + log(key); + FFAppState().fingerprintPass = key; + FFAppState().fingerprint = true; + }, + ), + ); + }, + ).whenComplete(() => notifyListeners()); + } + } + + void enablePerson(BuildContext context) { + notifyListeners(); + Share.share( + FFAppState().userDevUUID, + ); + } + + void toggleNotify(BuildContext context) { + FFAppState().notify = !FFAppState().notify; + PhpGroup.changeNotifica + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + atividade: 'updVisitado', + notifica: FFAppState().notify ? 'S' : 'N', + ) + .catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error changing notification', + ptText: 'Erro ao alterar notificação', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }); + notifyListeners(); + } + + void localUnlink(BuildContext context) { + PhpGroup.resopndeVinculo + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + tarefa: 'I', + ) + .catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error unlinking device', + ptText: 'Erro ao desvincular dispositivo', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).then( + (value) { + FFAppState().deleteCliUUID(); + FFAppState().deleteLocal(); + FFAppState().deleteOwnerUUID(); + Navigator.pop(context); + }, + ); + notifyListeners(); + } + + void deleteAccount(BuildContext context) { + FFAppState().deleteAll(); + FFAppState().isLogged = false; + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + Future togglePass(BuildContext context) async { + debugPrint('pass: ${FFAppState().pass}'); + if (FFAppState().pass) { + FFAppState().pass = false; + FFAppState().deleteAccessPass(); + notifyListeners(); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + FFAppState().accessPass = key; + notifyListeners(); + debugPrint('key: $key'); + await PhpGroup.changePass + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + atividade: 'updVisitado', + newSenha: FFAppState().accessPass, + ) + .then((value) { + FFAppState().pass = true; + // var error = jsonDecode(value.jsonBody['error'].toString()); + // log('${jsonDecode(value.jsonBody['error'].toString())}'); + if (jsonDecode(value.jsonBody['error'].toString()) == false) { + FFAppState().pass = true; + } else { + FFAppState().pass = false; + } + }).onError((error, StackTrace) { + FFAppState().pass = false; + log(error.toString()); + log(StackTrace.toString()); + }).whenComplete(() => notifyListeners()); + }, + ), + ); + }, + ); + } + } + + Future togglePanic(BuildContext context) async { + if (FFAppState().panic) { + FFAppState().panic = false; + FFAppState().deletePanicPass(); + notifyListeners(); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + FFAppState().panicPass = key; + notifyListeners(); + await PhpGroup.changePass + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + atividade: 'updVisitado', + newSenha: FFAppState().panicPass, + ) + .then((value) { + FFAppState().panic = true; + if (jsonDecode(value.jsonBody['error'].toString()) == false) { + FFAppState().panic = true; + } else { + FFAppState().panic = false; + } + }).onError((e, s) { + FFAppState().panic = false; + log(e.toString()); + log(s.toString()); + }).whenComplete(() => notifyListeners()); + }, + ), + ); + }, + ); + } + } + + @override + void dispose() { + unfocusNode.dispose(); + super.dispose(); + } +} diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart:Zone.Identifier b/lib/pages/preferences_settings_page/preferences_settings_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/settings/widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart similarity index 65% rename from lib/pages/settings/widget.dart rename to lib/pages/preferences_settings_page/preferences_settings_widget.dart index fda23372..e0aa39c1 100644 --- a/lib/pages/settings/widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -1,11 +1,13 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/pages/settings/model.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart'; import 'package:provider/provider.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; class PreferencesPageWidget extends StatelessWidget { const PreferencesPageWidget({super.key}); @@ -43,7 +45,7 @@ class PreferencesPageWidget extends StatelessWidget { FFLocalizations.of(context).getVariableText( enText: 'Preferences', ptText: 'Preferências', - ), + ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, @@ -71,7 +73,7 @@ class PreferencesPageWidget extends StatelessWidget { // childAspectRatio: 1.0, // mainAxisExtent: 100.0, // ), - itemCount: 6, // Assuming 4 items for simplicity + itemCount: 7, // Assuming 4 items for simplicity padding: const EdgeInsets.symmetric(horizontal: 20.0), physics: const AlwaysScrollableScrollPhysics(), itemBuilder: (BuildContext context, int index) { @@ -87,82 +89,110 @@ class PreferencesPageWidget extends StatelessWidget { ); } - Widget _buildIconButton(BuildContext context, int index, PreferencesPageModel model) { + Widget _buildIconButton( + BuildContext context, int index, PreferencesPageModel model) { IconData icon; - Function() onPressed =() => {}; + Function() onPressed = () => {}; bool isEnabled; String content; switch (index) { case 0: icon = Icons.fingerprint; - onPressed = () => model.toggleFingerprint(context); // Disable if fingerprint is false + onPressed = () => + model.toggleFingerprint(context); // Disable if fingerprint is false isEnabled = FFAppState().fingerprint; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Ative a autenticação por impressão digital para login seguro.', + content = FFLocalizations.of(context).getVariableText( + ptText: + 'Ative a autenticação por impressão digital para login seguro.', enText: 'Enable fingerprint authentication for secure login.', - ); + ); break; case 1: icon = Icons.person; onPressed = () => model.enablePerson(context); isEnabled = FFAppState().person; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Exibir código de identificação remota', - enText: 'Display remote identification code', - ); + content = FFLocalizations.of(context).getVariableText( + ptText: 'Compartilhe o código de identificação remota', + enText: 'Share the remote identification code', + ); break; case 2: icon = Icons.notifications; - onPressed = model.toggleNotify; + onPressed = () => model.toggleNotify(context); isEnabled = FFAppState().notify; - content = FFLocalizations.of(context).getVariableText( + content = FFLocalizations.of(context).getVariableText( ptText: 'Ative para receber sua notificação de acesso', enText: 'Enable to receive your access notification', - ); + ); break; case 3: - icon = Icons.lock_clock_sharp; + icon = Icons.lock; // onLongPress = model.togglePass(context, model); isEnabled = FFAppState().pass; - content = FFLocalizations.of(context).getVariableText( + content = FFLocalizations.of(context).getVariableText( ptText: 'Ative para inserir uma credencial de acesso para o QRCode', enText: 'Enable to enter an access credential for the QRCode', - ); + ); break; case 4: - icon = Icons.landscape; - onPressed = model.localLogout; - isEnabled = false; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Ative para se desvincular do local selecionado', - enText: 'Enable to unlink from the selected location', - ); + icon = Icons.lock_clock_sharp; + // onLongPress = model.togglePass(context, model); + isEnabled = FFAppState().panic; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para inserir uma credencial de pânico para o QRCode', + enText: 'Enable to enter an panic credential for the QRCode', + ); break; case 5: + icon = Icons.landscape; + onPressed = () => model.localUnlink(context); + isEnabled = true; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Desative para se desvincular do local selecionado', + enText: 'Enable to unlink from the selected location', + ); + break; + case 6: icon = Icons.delete; onPressed = () => model.deleteAccount(context); - isEnabled = false; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Delete sua conta e todos os dados associados permanentemente.', + isEnabled = true; + content = FFLocalizations.of(context).getVariableText( + ptText: + 'Delete sua conta e todos os dados associados permanentemente.', enText: 'Delete your account and all associated data permanently.', - ); + ); break; default: throw Exception('Invalid index: $index'); } - return Container( + return SizedBox( height: 100, child: GestureDetector( - onTap: index != 3 ? onPressed : () {model.togglePass(context);}, + onTap: () { + switch (index) { + case 3: + model.togglePass(context); + break; + case 4: + model.togglePanic(context); + break; + default: + onPressed(); + } + }, child: Row( children: [ CircleAvatar( - backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + backgroundColor: isEnabled + ? FlutterFlowTheme.of(context).primary + : FlutterFlowTheme.of(context).alternate, child: Icon( icon, - color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, + color: isEnabled + ? FlutterFlowTheme.of(context).primaryBackground + : FlutterFlowTheme.of(context).primary, // icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0), // onPressed: index != 3 ? onPressed : () {model.togglePass(context);}, // borderRadius: 20.0, @@ -178,13 +208,13 @@ class PreferencesPageWidget extends StatelessWidget { child: Text( content, style: FlutterFlowTheme.of(context).bodySmall.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, - ), + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), overflow: TextOverflow.clip, ), ), @@ -193,4 +223,4 @@ class PreferencesPageWidget extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart:Zone.Identifier b/lib/pages/preferences_settings_page/preferences_settings_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/qrcode/model.dart b/lib/pages/qr_code_page/qr_code_page_model.dart similarity index 81% rename from lib/pages/consults/qrcode/model.dart rename to lib/pages/qr_code_page/qr_code_page_model.dart index d1317102..40e016ab 100644 --- a/lib/pages/consults/qrcode/model.dart +++ b/lib/pages/qr_code_page/qr_code_page_model.dart @@ -1,7 +1,7 @@ -import '/commons/widgets/flutter_flow_util.dart'; import 'dart:async'; -import 'widget.dart' show QrCodePageWidget; import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/pages/qr_code_page/qr_code_page_widget.dart'; class QrCodePageModel extends FlutterFlowModel { /// Local state fields for this page. @@ -29,4 +29,4 @@ class QrCodePageModel extends FlutterFlowModel { BuildContext context, { required String? key, }) async {} -} +} \ No newline at end of file diff --git a/lib/pages/qr_code_page/qr_code_page_model.dart:Zone.Identifier b/lib/pages/qr_code_page/qr_code_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/qrcode/widget.dart b/lib/pages/qr_code_page/qr_code_page_widget.dart similarity index 95% rename from lib/pages/consults/qrcode/widget.dart rename to lib/pages/qr_code_page/qr_code_page_widget.dart index c95570b3..a6994b95 100644 --- a/lib/pages/consults/qrcode/widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -1,27 +1,30 @@ import 'dart:developer'; import 'package:barcode_widget/barcode_widget.dart'; -import 'package:hub/commons/actions/actions.dart'; -import 'package:hub/commons/widgets/custom_functions.dart'; +import 'package:hub/actions/actions.dart'; -import 'package:hub/modals/forms/qr_code/widget.dart'; +import 'package:hub/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_animations.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import 'package:hub/pages/qr_code_page/qr_code_page_model.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; -import '/commons/widgets/flutter_flow_animations.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; + import 'dart:async'; -import '/commons/widgets/custom_functions.dart' as functions; // import 'package:barcode_widget/barcode_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; // import 'package:percent_indicator/percent_indicator.dart'; -import 'model.dart'; -export 'model.dart'; + import 'package:qr_flutter/qr_flutter.dart'; @@ -308,7 +311,7 @@ void dispose() { padding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 20.0, 0.0), child: StreamBuilder( - stream: functions.getProgressValue(), + stream: getProgressValue(), builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { return CircularProgressIndicator(); @@ -474,4 +477,4 @@ void dispose() { elevation: 0.0, ); } -} +} \ No newline at end of file diff --git a/lib/pages/qr_code_page/qr_code_page_widget.dart:Zone.Identifier b/lib/pages/qr_code_page/qr_code_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart b/lib/pages/register_visitor_page/register_visitor_page_model.dart new file mode 100644 index 00000000..85e15627 --- /dev/null +++ b/lib/pages/register_visitor_page/register_visitor_page_model.dart @@ -0,0 +1,21 @@ +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; + +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/form_field_controller.dart'; +import 'register_visitor_page_widget.dart' show RegisterVisitorPageWidget; +import 'package:flutter/material.dart'; + +class RegisterVisitorPageModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this page. + + late RegisiterVistorTemplateComponentModel + regisiterVistorTemplateComponentModel; + + @override + void initState(BuildContext context) {} + + @override + void dispose() {} +} diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart:Zone.Identifier b/lib/pages/register_visitor_page/register_visitor_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/register_visitor_page/register_visitor_page_widget.dart new file mode 100644 index 00000000..67eae017 --- /dev/null +++ b/lib/pages/register_visitor_page/register_visitor_page_widget.dart @@ -0,0 +1,83 @@ +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'register_visitor_page_model.dart'; +export 'register_visitor_page_model.dart'; + +class RegisterVisitorPageWidget extends StatefulWidget { + const RegisterVisitorPageWidget({super.key}); + + @override + State createState() => + _RegisterVisitorPageWidgetState(); +} + +class _RegisterVisitorPageWidgetState extends State { + late RegisterVisitorPageModel _model; + + final scaffoldKey = GlobalKey(); + + @override + void initState() { + super.initState(); + _model = createModel(context, () => RegisterVisitorPageModel()); + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + return Scaffold( + appBar: AppBar( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, + ), + onPressed: () async { + context.pop(); + }, + ), + title: Text( + FFLocalizations.of(context).getText( + 'megskb6s' /* Cadastro Visitante */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), + ), + ), + actions: const [], + centerTitle: true, + elevation: 0.0, + ), + body: const SafeArea( + top: true, + child: RegisiterVistorTemplateComponentWidget( + source: 'RegisterVisitorPage', + )), + ); + } +} diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart:Zone.Identifier b/lib/pages/register_visitor_page/register_visitor_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/registers/visitor/model.dart b/lib/pages/registers/visitor/model.dart deleted file mode 100644 index 7023085b..00000000 --- a/lib/pages/registers/visitor/model.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:hub/commons/actions/api_manager.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/form_field_controller.dart'; -import 'widget.dart' show RegisterVisitorPageWidget; -import 'package:flutter/material.dart'; - -class RegisterVisitorPageModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - bool isDataUploading = false; - FFUploadedFile uploadedLocalFile = - FFUploadedFile(bytes: Uint8List.fromList([])); - - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode1; - TextEditingController? textController1; - String? Function(BuildContext, String?)? textController1Validator; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode2; - TextEditingController? textController2; - String? Function(BuildContext, String?)? textController2Validator; - // State field(s) for DropDown widget. - String? dropDownValue; - FormFieldController? dropDownValueController; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode3; - TextEditingController? textController3; - String? Function(BuildContext, String?)? textController3Validator; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode4; - TextEditingController? textController4; - String? Function(BuildContext, String?)? textController4Validator; - // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. - String? imgBase64; - // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. - ApiCallResponse? scheduleVisitor; - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - unfocusNode.dispose(); - textFieldFocusNode1?.dispose(); - textController1?.dispose(); - - textFieldFocusNode2?.dispose(); - textController2?.dispose(); - - textFieldFocusNode3?.dispose(); - textController3?.dispose(); - - textFieldFocusNode4?.dispose(); - textController4?.dispose(); - } -} diff --git a/lib/pages/registers/visitor/widget.dart b/lib/pages/registers/visitor/widget.dart deleted file mode 100644 index 63b6267b..00000000 --- a/lib/pages/registers/visitor/widget.dart +++ /dev/null @@ -1,893 +0,0 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; - -import '/commons/widgets/flutter_flow_drop_down.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import '/commons/widgets/form_field_controller.dart'; -import '/commons/widgets/upload_data.dart'; -import '/commons/actions/index.dart' as actions; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; - -class RegisterVisitorPageWidget extends StatefulWidget { - const RegisterVisitorPageWidget({super.key}); - - @override - State createState() => - _RegisterVisitorPageWidgetState(); -} - -class _RegisterVisitorPageWidgetState extends State { - late RegisterVisitorPageModel _model; - - final scaffoldKey = GlobalKey(); - - @override - void initState() { - super.initState(); - _model = createModel(context, () => RegisterVisitorPageModel()); - - _model.textController1 ??= TextEditingController(); - _model.textFieldFocusNode1 ??= FocusNode(); - - _model.textController2 ??= TextEditingController(); - _model.textFieldFocusNode2 ??= FocusNode(); - - _model.textController3 ??= TextEditingController(); - _model.textFieldFocusNode3 ??= FocusNode(); - - _model.textController4 ??= TextEditingController(); - _model.textFieldFocusNode4 ??= FocusNode(); - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - forceMaterialTransparency: true, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, - ), - title: Text( - FFLocalizations.of(context).getText( - 'megskb6s' /* Cadastro Visitante */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).headlineMediumFamily), - ), - ), - actions: const [], - centerTitle: true, - elevation: 0.0, - ), - body: SafeArea( - top: true, - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Builder( - builder: (context) { - if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? - false)) { - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - setState(() { - _model.isDataUploading = false; - _model.uploadedLocalFile = FFUploadedFile( - bytes: Uint8List.fromList([])); - }); - }, - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.memory( - _model.uploadedLocalFile.bytes ?? - Uint8List.fromList([]), - width: 300.0, - height: 200.0, - fit: BoxFit.cover, - ), - ), - ); - } else { - return Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: FFButtonWidget( - onPressed: () async { - final selectedMedia = - await selectMediaWithSourceBottomSheet( - context: context, - maxWidth: 300.00, - maxHeight: 300.00, - imageQuality: 0, - allowPhoto: true, - includeDimensions: true, - ); - if (selectedMedia != null && - selectedMedia.every((m) => - validateFileFormat( - m.storagePath, context))) { - setState( - () => _model.isDataUploading = true); - var selectedUploadedFiles = - []; - - try { - showUploadMessage( - context, - 'Uploading file...', - showLoading: true, - ); - selectedUploadedFiles = selectedMedia - .map((m) => FFUploadedFile( - name: m.storagePath - .split('/') - .last, - bytes: m.bytes, - height: m.dimensions?.height, - width: m.dimensions?.width, - blurHash: m.blurHash, - )) - .toList(); - } finally { - ScaffoldMessenger.of(context) - .hideCurrentSnackBar(); - _model.isDataUploading = false; - } - if (selectedUploadedFiles.length == - selectedMedia.length) { - setState(() { - _model.uploadedLocalFile = - selectedUploadedFiles.first; - }); - showUploadMessage(context, 'Success!'); - } else { - setState(() {}); - showUploadMessage( - context, 'Failed to upload data'); - return; - } - } - }, - text: '', - icon: Icon( - Icons.photo_camera, - color: FlutterFlowTheme.of(context).accent1, - size: 30.0, - ), - options: FFButtonOptions( - width: 300.0, - height: 80.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'p4ftwxcy' /* Clique para adicionar a foto p... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ); - } - }, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'zazj5d8b' /* Preencha o formulário com os d... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'v7g73yik' /* Nome */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.person, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - maxLines: null, - keyboardType: TextInputType.name, - validator: _model.textController1Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'rl8tvwnr' /* Documento */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.document_scanner, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController2Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.95, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 7.0), - child: Text( - FFLocalizations.of(context).getText( - 'yp23q90m' /* Selecione o tipo: */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 5.0), - child: FlutterFlowDropDown( - controller: _model.dropDownValueController ??= - FormFieldController(null), - options: [ - FFLocalizations.of(context).getText( - 'n8vddmcq' /* Visitante */, - ), - FFLocalizations.of(context).getText( - '9luaa09e' /* Prestador de Serviço */, - ) - ], - onChanged: (val) => - setState(() => _model.dropDownValue = val), - width: 200.0, - height: 44.0, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'pmezihb4' /* Selecione... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: - FlutterFlowTheme.of(context).primaryText, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context).customColor6, - borderWidth: 0.5, - borderRadius: 8.0, - margin: const EdgeInsetsDirectional.fromSTEB( - 16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ), - ), - ] - .divide(const SizedBox(width: 19.0)) - .addToStart(const SizedBox(width: 30.0)), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'bqpucwh0' /* Contatos */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'h84ls2r6' /* Telefone */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.phone, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController3Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController4, - focusNode: _model.textFieldFocusNode4, - autofocus: false, - textInputAction: TextInputAction.done, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'fqp7qmka' /* Email */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.email, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - keyboardType: TextInputType.emailAddress, - validator: _model.textController4Validator - .asValidator(context), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - if (((_model.uploadedLocalFile.bytes - ?.isNotEmpty ?? - false)) && - (_model.textController1.text != '') && - (_model.dropDownValue != null && - _model.dropDownValue != '') && - (_model.textController2.text != '')) { - _model.imgBase64 = - await actions.convertImageFileToBase64( - _model.uploadedLocalFile, - ); - _model.scheduleVisitor = - await PhpGroup.postScheduleVisitorCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putVisitante', - documento: '7654553234232342', - nome: 'Test', - tipo: 'V', - foto: 'base64;jpeg,klajsalkjslkajslkajl', - ); - - if (PhpGroup.postScheduleVisitorCall.error( - (_model.scheduleVisitor?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clear(); - _model.textController2?.clear(); - _model.textController3?.clear(); - _model.textController4?.clear(); - }); - setState(() { - _model.dropDownValueController?.reset(); - }); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - '\\devUUID=${FFAppState().devUUID}\\userUUID=${FFAppState().userUUID}\\cliID=${FFAppState().cliUUID}\\Documento=${_model.textController2.text}\\Nome=${_model.textController1.text}\\dropdown${_model.dropDownValue}\\${PhpGroup.postScheduleVisitorCall.errorMsg( - (_model.scheduleVisitor?.jsonBody ?? - ''), - )}', - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento estão foram preenchidos corretamente.- devUUID=${FFAppState().devUUID}- userUUID=${FFAppState().userUUID}- cliID=${FFAppState().cliUUID}- Documento=${_model.textController2.text}- Nome=${_model.textController1.text}- Tipo=${_model.dropDownValue}', - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - 'okbw0aiu' /* Cadastrar */, - ), - options: FFButtonOptions( - width: 250.0, - height: 36.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 80.0, 0.0, 80.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: const BorderSide( - color: Colors.transparent, - width: 30.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - ), - ), - ), - ] - .divide(const SizedBox(height: 10.0)) - .addToStart(const SizedBox(height: 30.0)), - ), - ), - ), - ), - ), - ), - ); - } -} diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart new file mode 100644 index 00000000..23a7f0d0 --- /dev/null +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -0,0 +1,213 @@ +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; + +import 'package:flutter/material.dart'; +import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; +import 'package:intl/intl.dart'; + +class ScheduleCompleteVisitPageModel + extends FlutterFlowModel { + final _visitHistoryManager = FutureRequestManager(); + Future visitHistory({ + String? uniqueQueryKey, + bool? overrideCache, + required Future Function() requestFn, + }) => + _visitHistoryManager.performRequest( + uniqueQueryKey: uniqueQueryKey, + overrideCache: overrideCache, + requestFn: requestFn, + ); + void clearVisitHistoryCache() => _visitHistoryManager.clear(); + void clearVisitHistoryCacheKey(String? uniqueKey) => + _visitHistoryManager.clearRequest(uniqueKey); + + /// Local state fields for this page. + + List visitorJsonList = []; + void addToVisitorJsonList(dynamic item) => visitorJsonList.add(item); + void removeFromVisitorJsonList(dynamic item) => visitorJsonList.remove(item); + void removeAtIndexFromVisitorJsonList(int index) => + visitorJsonList.removeAt(index); + void insertAtIndexInVisitorJsonList(int index, dynamic item) => + visitorJsonList.insert(index, item); + void updateVisitorJsonListAtIndex(int index, Function(dynamic) updateFn) => + visitorJsonList[index] = updateFn(visitorJsonList[index]); + + String visitorStrList = '0'; + bool? dropDownValidator1; + bool? dropDownValidator2; + + bool isValid() { + if ((textController1!.text != '') && + (textController2!.text != '') && + (dropDownValue1 != null && dropDownValue1 != '') && + (dropDownValue2 != null && dropDownValue2 != '')) { + return true; + } + return false; + } + + /// State fields for stateful widgets in this page. + + final unfocusNode = FocusNode(); + // State field(s) for TabBar widget. + TabController? tabBarController; + int get tabBarCurrentIndex => + tabBarController != null ? tabBarController!.index : 0; + + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode1; + TextEditingController? textController1; + String? Function(BuildContext, String?)? textController1Validator; + String? _textController1Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required.', + ptText: 'Este campo é obrigatório.', + ); + } + if (val != null) { + try { + DateTime startDate = DateFormat('d/M/y H:mm:ss').parse(val); + DateTime endDate = + DateFormat('d/M/y H:mm:ss').parse(textController2!.text); + if (startDate.isAfter(endDate)) { + return FFLocalizations.of(context).getVariableText( + ptText: 'A data de início deve ser anterior à data de término.', + enText: 'Start date must be before end date.', + ); + } + if (startDate.isBefore(DateTime.now())) { + return FFLocalizations.of(context).getVariableText( + enText: 'Start date must be after current date.', + ptText: 'A data de início deve ser posterior à data atual.', + ); + } + } catch (e) { + return '$e'; + } + } + return null; + } + + DateTime? datePicked1; + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode2; + TextEditingController? textController2; + String? Function(BuildContext, String?)? textController2Validator; + String? _textController2Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required.', + ptText: 'Este campo é obrigatório.', + ); + } + if (val != null) { + try { + DateTime endDate = DateFormat('d/M/y H:mm:ss').parse(val); + DateTime startDate = + DateFormat('d/M/y H:mm:ss').parse(textController1!.text); + if (endDate.isBefore(startDate)) { + return FFLocalizations.of(context).getVariableText( + enText: 'End date must be after start date.', + ptText: 'A data de término deve ser posterior à data de início.', + ); + } + if (endDate.isBefore(DateTime.now())) { + return FFLocalizations.of(context).getVariableText( + enText: 'End date must be after current date.', + ptText: 'A data de término deve ser posterior à data atual.', + ); + } + } catch (e) { + return '$e'; + } + } + return null; + } + + DateTime? datePicked2; + // State field(s) for DropDown widget. + String? dropDownValue1; + FormFieldController? dropDownValueController1; + + // State field(s) for DropDown widget. + String? dropDownValue2; + FormFieldController? dropDownValueController2; + // State field(s) for Switch widget. + bool? switchValue; + // State field(s) for TextField widget. + FocusNode? textFieldFocusNode3; + TextEditingController? textController3; + String? Function(BuildContext, String?)? textController3Validator; + String? _textController3Validator(BuildContext context, String? val) { + // if (val == null || val.isEmpty) { + // return FFLocalizations.of(context).getVariableText( + // enText: 'This field is required.', + // ptText: 'Este campo é obrigatório.', + // ); + // } + return null; + } + + @override + void initState(BuildContext context) { + tabBarController = TabController( + vsync: Navigator.of(context), + length: 2, + ); + + textFieldFocusNode1 = FocusNode(); + textController1 = TextEditingController(); + textController1Validator = _textController1Validator; + + textFieldFocusNode2 = FocusNode(); + textController2 = TextEditingController(); + textController2Validator = _textController2Validator; + + textFieldFocusNode3 = FocusNode(); + textController3 = TextEditingController(); + textController3Validator = _textController3Validator; + } + + @override + void dispose() { + unfocusNode.dispose(); + tabBarController?.dispose(); + textFieldFocusNode1?.dispose(); + textController1?.dispose(); + + textFieldFocusNode2?.dispose(); + textController2?.dispose(); + + textFieldFocusNode3?.dispose(); + textController3?.dispose(); + + clearVisitHistoryCache(); + } + + /// Action blocks. + Future getVisitorsActionPage( + BuildContext context, { + List? visitorsJsonList, + }) async { + visitorJsonList = visitorsJsonList!.toList().cast(); + } + + Future toggleCurrentSelectionHeader( + BuildContext context, { + required bool? toggleIndexValue, + }) async { + if (toggleIndexValue == true) { + return true; + } + + return false; + } +} diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart:Zone.Identifier b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart new file mode 100644 index 00000000..20874759 --- /dev/null +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -0,0 +1,2219 @@ +import 'dart:developer'; + +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:flutter_spinkit/flutter_spinkit.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_drop_down.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart'; +import 'package:provider/provider.dart'; + +class ScheduleCompleteVisitPageWidget extends StatefulWidget { + const ScheduleCompleteVisitPageWidget({ + super.key, + this.visitorStrList, + this.visitStartDateStr, + this.visitEndDateStr, + this.visitReasonStr, + this.visitLevelStr, + this.visitTempBol, + this.visitObsStr, + this.visitorJsonList, + }); + + final String? visitorStrList; + final String? visitStartDateStr; + final String? visitEndDateStr; + final String? visitReasonStr; + final String? visitLevelStr; + final bool? visitTempBol; + final String? visitObsStr; + final List? visitorJsonList; + + @override + State createState() => + _ScheduleCompleteVisitPageWidgetState(); +} + +class _ScheduleCompleteVisitPageWidgetState + extends State + with TickerProviderStateMixin { + late ScheduleCompleteVisitPageModel _model; + int _visitHistoryLoadingIdx = 0; + final int _visitHistoryLoadingCount = 10; + List _visitHistoryList = []; + ScrollController _visitHistoryController = ScrollController(); + + final scaffoldKey = GlobalKey(); + + @override + void initState() { + super.initState(); + _model = createModel(context, () => ScheduleCompleteVisitPageModel()); + + // On page load action. + SchedulerBinding.instance.addPostFrameCallback((_) async { + if ((widget.visitorStrList != null && widget.visitorStrList != '') && + ((widget.visitorJsonList != null && + (widget.visitorJsonList)!.isNotEmpty) != + null)) { + _model.visitorJsonList = widget.visitorJsonList! + .where((e) => + widget.visitorStrList == + getJsonField( + e, + r'''$.VTE_DOCUMENTO''', + ).toString().toString()) + .toList() + .toList() + .cast(); + _model.visitorStrList = widget.visitorStrList!; + setState(() {}); + } else { + return; + } + }); + + _model.tabBarController = TabController( + vsync: this, + length: 2, + initialIndex: 0, + )..addListener(() => setState(() {})); + _model.textController1 ??= TextEditingController(); + _model.textFieldFocusNode1 ??= FocusNode(); + + _model.textController2 ??= TextEditingController(); + _model.textFieldFocusNode2 ??= FocusNode(); + + _model.switchValue = true; + _model.textController3 ??= TextEditingController(); + _model.textFieldFocusNode3 ??= FocusNode(); + } + + void _loadMoreVisitHistory() async { + // Simulate fetching data from an API or database + Future> fetchVisitHistory(int start, int limit) async { + // Simulate network delay + await Future.delayed(const Duration(seconds: 1)); + // Generate a list of visit history items + return List.generate(limit, (index) => "Item ${start + index}"); + } + + // Calculate the start index for the next batch of items to load + final int start = _visitHistoryLoadingIdx * _visitHistoryLoadingCount; + // Fetch the next batch of items + final List newItems = + await fetchVisitHistory(start, _visitHistoryLoadingCount); + + // If new items were fetched, add them to the list and update the index + if (newItems.isNotEmpty) { + _visitHistoryList.addAll(newItems); + _visitHistoryLoadingIdx++; + setState(() {}); + } + } + + void_scrollListener() { + if (_visitHistoryController.position.pixels == + _visitHistoryController.position.maxScrollExtent) { + _loadMoreVisitHistory(); + } + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: appBarScheduleCompleteVisit(context), + body: + bodyScheduleCompleteVisit(context, _model, setState, safeSetState), + ), + ); + } +} + +PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { + return AppBar( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + forceMaterialTransparency: true, + elevation: 0.0, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, + ), + onPressed: () async { + context.pop(); + }, + ), + title: Text( + FFLocalizations.of(context).getText( + '61lcxdgm' /* Agendar Visita */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + ); +} + +Widget bodyScheduleCompleteVisit( + BuildContext context, + ScheduleCompleteVisitPageModel _model, + Function setState, + Function safeSetState) { + return SafeArea( + top: true, + child: Column( + children: [ + Align( + alignment: const Alignment(0.0, 0), + child: TabBar( + labelColor: FlutterFlowTheme.of(context).primaryText, + unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, + labelStyle: FlutterFlowTheme.of(context).titleMedium.override( + fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, + fontSize: 13.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleMediumFamily), + ), + unselectedLabelStyle: const TextStyle(), + indicatorColor: FlutterFlowTheme.of(context).primary, + padding: const EdgeInsets.all(4.0), + tabs: [ + Tab( + text: FFLocalizations.of(context).getText( + 'ueth1f4g' /* Cadastrar Visita */, + ), + ), + Tab( + text: FFLocalizations.of(context).getText( + 'k4uraqam' /* Histórico de Visitas */, + ), + ), + ], + controller: _model.tabBarController, + onTap: (i) async { + [() async {}, () async {}][i](); + }, + ), + ), + Expanded( + child: TabBarView( + controller: _model.tabBarController, + children: [ + scheduleVisit(context, _model, setState, safeSetState), + visitHistory(context, _model, safeSetState), + ], + ), + ), + ], + ), + ); +} + +Widget scheduleVisit( + BuildContext context, + ScheduleCompleteVisitPageModel _model, + Function setState, + Function safeSetState) { + return SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Form( + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Column(mainAxisSize: MainAxisSize.max, children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '98evnbbe' /* Qual o período de validade da ... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ), + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: 60.0, + // decoration: const BoxDecoration(), + child: Stack( + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController1, + readOnly: true, + focusNode: _model.textFieldFocusNode1, + autovalidateMode: + AutovalidateMode.onUserInteraction, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + '53cbwqh9' /* Quando você inicia a visita? */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + lineHeight: 1.0, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).accent4, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + lineHeight: 1.8, + ), + textAlign: TextAlign.center, + validator: _model.textController1Validator + .asValidator(context)), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final datePicked1Date = await showDatePicker( + context: context, + initialDate: getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context).primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context).primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + + TimeOfDay? datePicked1Time; + if (datePicked1Date != null) { + datePicked1Time = await showTimePicker( + context: context, + initialTime: TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + } + + if (datePicked1Date != null && + datePicked1Time != null) { + safeSetState(() { + _model.datePicked1 = DateTime( + datePicked1Date.year, + datePicked1Date.month, + datePicked1Date.day, + datePicked1Time!.hour, + datePicked1Time.minute, + ); + }); + } + setState(() { + _model.textController1?.text = dateTimeFormat( + 'd/M/y H:mm:ss', + _model.datePicked1, + locale: FFLocalizations.of(context) + .languageCode, + ); + _model.textController1?.selection = + TextSelection.collapsed( + offset: _model + .textController1!.text.length); + }); + }, + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + ], + ), + ), + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: 60.0, + // decoration: const BoxDecoration(), + child: Stack( + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + readOnly: true, + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autovalidateMode: + AutovalidateMode.onUserInteraction, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'xpgc5e8d' /* Quando a visita terminá? */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + lineHeight: 1.0, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + lineHeight: 1.8, + ), + textAlign: TextAlign.center, + validator: _model.textController2Validator + .asValidator(context), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final datePicked2Date = await showDatePicker( + context: context, + initialDate: getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context).primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context).primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + + TimeOfDay? datePicked2Time; + if (datePicked2Date != null) { + datePicked2Time = await showTimePicker( + context: context, + initialTime: TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + } + + if (datePicked2Date != null && + datePicked2Time != null) { + safeSetState(() { + _model.datePicked2 = DateTime( + datePicked2Date.year, + datePicked2Date.month, + datePicked2Date.day, + datePicked2Time!.hour, + datePicked2Time.minute, + ); + }); + } + setState(() { + _model.textController2?.text = dateTimeFormat( + 'd/M/y H:mm:ss', + _model.datePicked2, + locale: FFLocalizations.of(context) + .languageCode, + ); + _model.textController2?.selection = + TextSelection.collapsed( + offset: _model + .textController2!.text.length); + }); + }, + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ] + // .divide(const SizedBox(height: 0.0)), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'u0jocx7e' /* Quais visitantes você deseja c... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + if (_model.visitorJsonList.isNotEmpty) + Builder( + builder: (context) { + final visitorListView = + _model.visitorJsonList.map((e) => e).toList(); + return ListView.separated( + padding: const EdgeInsets.fromLTRB( + 0, + 0, + 20, + 20, + ), + shrinkWrap: true, + scrollDirection: Axis.vertical, + itemCount: visitorListView.length, + separatorBuilder: (_, __) => + const SizedBox(height: 5.0), + itemBuilder: (context, visitorListViewIndex) { + final visitorListViewItem = + visitorListView[visitorListViewIndex]; + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + // context: context, + // builder: (context) { + // return GestureDetector( + // onTap: () => _model + // .unfocusNode.canRequestFocus + // ? FocusScope.of(context) + // .requestFocus(_model.unfocusNode) + // : FocusScope.of(context).unfocus(), + // child: Padding( + // padding: + // MediaQuery.viewInsetsOf(context), + // child: + // const VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: '', + // visitorEmail: '', + // visitorName: '', + // visitorPhone: '', + // visitorType: '', + // ), + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); + }, + onLongPress: () async { + // _model.removeFromVisitorJsonList( + // visitorListViewItem); + // setState(() {}); + }, + child: Container( + width: MediaQuery.of(context).size.width, + height: 70.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), + imageUrl: + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorListViewItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + fit: BoxFit.cover, + ), + ), + Text( + getJsonField( + visitorListViewItem, + r'''$.VTE_NOME''', + ).toString(), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + Expanded( + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + IconButton( + onPressed: () async { + _model + .removeFromVisitorJsonList( + visitorListViewItem); + setState(() {}); + }, + icon: const Icon(Icons.close)), + ], + ), + ), + ] + .divide(const SizedBox(width: 30.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + ), + ); + }, + ); + }, + ), + Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.01, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 20.0), + child: FFButtonWidget( + onPressed: () async { + await showModalBottomSheet( + isScrollControlled: true, + isDismissible: true, + backgroundColor: FlutterFlowTheme.of(context) + .primaryBackground, + enableDrag: true, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model + .unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: SizedBox( + height: + MediaQuery.of(context).size.height * + 0.7, + width: MediaQuery.of(context).size.width, + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: + VisitorSearchModalTemplateComponentWidget( + getVisitors: (visitorsParam) async { + _model.visitorJsonList = + visitorsParam! + .toList() + .cast(); + setState(() {}); + }, + getDocs: (docsParam) async { + _model.visitorStrList = + strListToStr( + docsParam!.toList()); + setState(() {}); + }, + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + }, + text: '', + icon: Icon( + Icons.add, + color: FlutterFlowTheme.of(context).primary, + size: 30.0, + ), + options: FFButtonOptions( + width: MediaQuery.sizeOf(context).width * 0.8, + height: 80.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 14.0, 0.0, 0.0, 20.0), + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + width: 1.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 50.0, 0.0, 0.0), + child: Container( + width: MediaQuery.sizeOf(context).width * 0.8, + height: 20.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: AutoSizeText( + FFLocalizations.of(context).getText( + 'r8soavtz' /* Clique para adicionar um visit... */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ), + ), + ], + ), + ], + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '0meymh6u' /* Quais são os motivos da visita... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: Container( + width: 100.0, + height: 45.0, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getDadosCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'getDados', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final dropDownGetDadosResponse = + snapshot.data!; + final reasonsJsonList = + PhpGroup.getDadosCall.reasonsJsonList( + dropDownGetDadosResponse.jsonBody, + ); + return FlutterFlowDropDown( + fillColor: FlutterFlowTheme.of(context) + .primaryBackground, + controller: + _model.dropDownValueController1 ??= + FormFieldController( + _model.dropDownValue1 ??= '', + ), + options: reasonsJsonList != null && + reasonsJsonList != [] + ? List.from( + PhpGroup.getDadosCall + .reasonsJsonList( + dropDownGetDadosResponse + .jsonBody, + )! + .map((e) => e.toString()) + .toList()) + : [], + optionLabels: PhpGroup.getDadosCall + .reasonsMotDescStrList( + dropDownGetDadosResponse.jsonBody, + ), + onChanged: (val) => setState( + () => _model.dropDownValue1 = val), + width: double.infinity, + height: double.infinity, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '6p3e0bzr' /* Escolha um motivo aqui */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).accent4, + borderWidth: 0.5, + borderRadius: 10.0, + margin: + const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), + ), + ), + ), + ], + ), + if (_model.dropDownValue1 == '') + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Field is Required', + ptText: 'Campo Obrigatório', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: 12.0)), + ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: Container( + width: 100.0, + height: 45.0, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getDadosCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'getDados', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final dropDownGetDadosResponse = + snapshot.data!; + final lavelList = + PhpGroup.getDadosCall.levelJsonList( + dropDownGetDadosResponse.jsonBody, + ); + return FlutterFlowDropDown( + controller: + _model.dropDownValueController2 ??= + FormFieldController( + _model.dropDownValue2 ??= '', + ), + options: + lavelList != null && lavelList != [] + ? List.from(lavelList! + .map((e) => e.toString()) + .toList()) + : [], + optionLabels: PhpGroup.getDadosCall + .levelNACDescricaoStrList( + dropDownGetDadosResponse.jsonBody, + ), + onChanged: (val) => setState( + () => _model.dropDownValue2 = val), + width: double.infinity, + height: double.infinity, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '2wun8p6c' /* Escolha um nível de acesso aqu... */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).accent4, + borderWidth: 0.5, + borderRadius: 10.0, + margin: + const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + fillColor: FlutterFlowTheme.of(context) + .primaryBackground, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), + ), + ), + ), + ], + ), + if (_model.dropDownValue1 == '') + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Field is Required', + ptText: 'Campo Obrigatório', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: 12.0)), + ), + ], + ), + ], + ), + ].divide(const SizedBox(height: 10.0)), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '8rk26eg1' /* Visita se encerra após o prime... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 30.0, 0.0, 30.0, 20.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 130.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'lgv0q5ht' /* Visita única */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Switch.adaptive( + value: _model.switchValue!, + onChanged: (newValue) async { + setState(() => _model.switchValue = newValue); + }, + applyCupertinoTheme: false, + focusColor: FlutterFlowTheme.of(context).primary, + trackColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).alternate; + } + return FlutterFlowTheme.of(context).alternate; + }, + ), + hoverColor: + FlutterFlowTheme.of(context).primaryBackground, + // thumbColor: WidgetStateColor.resolveWith( + // (states) { + // if (states.contains(WidgetState.disabled)) { + // return FlutterFlowTheme.of(context) + // .alternate; + // } + // return FlutterFlowTheme.of(context) + // .alternate; + // }, + // ), + overlayColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + trackOutlineColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + activeColor: FlutterFlowTheme.of(context).success, + activeTrackColor: + FlutterFlowTheme.of(context).primaryBackground, + inactiveTrackColor: + FlutterFlowTheme.of(context).primaryBackground, + inactiveThumbColor: + FlutterFlowTheme.of(context).error, + ), + ], + ), + ), + ], + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + 'eftcs67c' /* Você tem alguma observação sob... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: FFLocalizations.of(context).getText( + 't0q2vuup' /* Observações da Visita */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'w18iztdm' /* Escreva as suas observações aq... */, + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.text_fields, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.start, + maxLines: null, + maxLength: 80, + validator: _model.textController3Validator + .asValidator(context), + ), + ), + ), + ], + ), + Container( + width: 100.0, + height: 54.0, + decoration: const BoxDecoration(), + ), + ], + ), + ), + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'Schedule', + ptText: 'Agendar', + ), + onPressed: _model.isValid() + ? () async { + await showDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Dialog( + alignment: Alignment.topCenter, + child: SizedBox( + // width: MediaQuery.of(context).size.width, + // height: MediaQuery.of(context).size.height * 0.7, + child: VisitDetailsModalTemplateComponentWidget( + visitStartDateStr: _model.textController1.text, + visitEndDateStr: _model.textController2.text, + visitReasonStr: _model.dropDownValue1, + visitLevelStr: _model.dropDownValue2, + visitTempStr: + _model.switchValue == true ? 'Sim' : 'Não', + visitObsStr: _model.textController3.text, + visitorStrList: _model.visitorStrList, + visitorJsonList: _model.visitorJsonList, + updateToggleIdx: () async {}, + repeatVisitSchedule: () async {}, + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + : null, + options: FFButtonOptions( + height: MediaQuery.of(context).size.height * 0.05, + width: MediaQuery.of(context).size.height * 0.2, + color: FlutterFlowTheme.of(context).primary, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + disabledColor: FlutterFlowTheme.of(context).customColor5), + showLoadingIndicator: true, + ), + ].addToEnd(const SizedBox(height: 30.0)), + ), + ); +} + +Widget visitHistory( + BuildContext context, + ScheduleCompleteVisitPageModel _model, + Function safeSetState, +) { + return Container( + width: double.infinity, + height: 900.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.settings_sharp, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, + ), + onPressed: () { + log('IconButton pressed ...'); + }, + ), + ], + ), + FutureBuilder( + future: _model.visitHistory( + requestFn: () => PhpGroup.getVisitsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitas', + ), + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context).primary, + size: 50.0, + ), + ), + ); + } + final wrapGetVisitsResponse = snapshot.data!; + return Builder( + builder: (context) { + final visitaWrap = PhpGroup.getVisitsCall + .visitasList( + wrapGetVisitsResponse.jsonBody, + ) + ?.toList() ?? + []; + return ListView.builder( + itemCount: visitaWrap.length, + shrinkWrap: true, + scrollDirection: Axis.vertical, + physics: const BouncingScrollPhysics(), + addAutomaticKeepAlives: true, + cacheExtent: 1000.0, + addRepaintBoundaries: true, + addSemanticIndexes: true, + itemBuilder: (context, index) { + final visitaWrapItem = visitaWrap[index]; + // visitaWrap.length, (visitaWrapIndex) { + + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + useSafeArea: true, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => + _model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: + VisitDetailsModalTemplateComponentWidget( + visitStatusStr: getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + ).toString(), + visitStartDateStr: getJsonField( + visitaWrapItem, + r'''$.VAW_DTINICIO''', + ).toString(), + visitEndDateStr: getJsonField( + visitaWrapItem, + r'''$.VAW_DTFIM''', + ).toString(), + visitReasonStr: getJsonField( + visitaWrapItem, + r'''$.MOT_DESCRICAO''', + ).toString(), + visitLevelStr: getJsonField( + visitaWrapItem, + r'''$.NAC_DESCRICAO''', + ).toString(), + visitTempStr: getJsonField( + visitaWrapItem, + r'''$.VTE_UNICA''', + ).toString(), + visitObsStr: getJsonField( + visitaWrapItem, + r'''$.VAW_OBS''', + ).toString(), + visitorImgPath: valueOrDefault( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + visitorStrList: getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString(), + visitIdStr: getJsonField( + visitaWrapItem, + r'''$.VAW_ID''', + ).toString(), + visitStatusColor: getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + ).toString() == + 'A' + ? FlutterFlowTheme.of(context).success + : FlutterFlowTheme.of(context).error, + visitorJsonList: + PhpGroup.getVisitsCall.visitasList( + wrapGetVisitsResponse.jsonBody, + ), + updateToggleIdx: () async {}, + repeatVisitSchedule: () async {}, + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + }, + child: Card( + clipBehavior: Clip.antiAliasWithSaveLayer, + color: + FlutterFlowTheme.of(context).primaryBackground, + elevation: 5.0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.0), + ), + child: Container( + width: 350.0, + height: 115.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Container( + width: 100.0, + height: 100.0, + decoration: const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Text( + FFLocalizations.of(context) + .getText( + 'i46frqyi' /* Visitante: */, + ), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + fontSize: 12.5, + letterSpacing: 0.0, + fontWeight: + FontWeight.bold, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1.0, -1.0), + child: Text( + getJsonField( + visitaWrapItem, + r'''$.VTE_NOME''', + ).toString(), + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + fontSize: 12.5, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ].addToStart( + const SizedBox(width: 10.0)), + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Text( + FFLocalizations.of(context) + .getText( + '73b1kj59' /* Início em: */, + ), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + fontSize: 12.5, + letterSpacing: 0.0, + fontWeight: + FontWeight.bold, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + Text( + getJsonField( + visitaWrapItem, + r'''$.VAW_DTINICIO''', + ).toString(), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + fontSize: 12.5, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ].addToStart( + const SizedBox(width: 10.0)), + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Text( + FFLocalizations.of(context) + .getText( + 'klzzrfbn' /* Fim em: */, + ), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + fontSize: 12.5, + letterSpacing: 0.0, + fontWeight: + FontWeight.bold, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + Text( + getJsonField( + visitaWrapItem, + r'''$.VAW_DTFIM''', + ).toString(), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + fontSize: 12.5, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ].addToStart( + const SizedBox(width: 10.0)), + ), + Align( + alignment: + const AlignmentDirectional( + -1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: Container( + width: 200.0, + height: 27.0, + decoration: BoxDecoration( + color: valueOrDefault( + () { + if (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FlutterFlowTheme + .of(context) + .success; + } else if ((jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') || + (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"F\"') || + (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"B\"') || + (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"')) { + return FlutterFlowTheme + .of(context) + .error; + } else if (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"') { + return FlutterFlowTheme + .of(context) + .warning; + } else { + return FlutterFlowTheme + .of(context) + .primary; + } + }(), + FlutterFlowTheme.of(context) + .primary, + ), + borderRadius: + BorderRadius.circular( + 5.0), + ), + child: Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + () { + if (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FFLocalizations + .of(context) + .getVariableText( + ptText: 'Ativo', + enText: 'Active', + ); + } else if ((jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"F\"') || + (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') || + (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"B\"') || + (jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"')) { + return FFLocalizations + .of(context) + .getVariableText( + ptText: 'Cancelado', + enText: 'Canceled', + ); + } else { + return FFLocalizations + .of(context) + .getVariableText( + ptText: 'Pendente', + enText: 'Pending', + ); + } + }(), + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + color: FlutterFlowTheme + .of(context) + .info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ), + ), + ), + ].divide(const SizedBox(height: 3.0)), + ), + ), + ), + ClipRRect( + borderRadius: BorderRadius.circular(0.0), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), + imageUrl: valueOrDefault( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + fit: BoxFit.cover, + ), + ), + ], + ), + ), + ), + ); + }); + }, + ); + }, + ) + ], + ), + ), + ); +} diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart:Zone.Identifier b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/schedules/visit/provisional/model.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart similarity index 90% rename from lib/pages/schedules/visit/provisional/model.dart rename to lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart index 9fe405f5..8baf87a9 100644 --- a/lib/pages/schedules/visit/provisional/model.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart @@ -1,9 +1,9 @@ -import 'package:hub/commons/actions/api_manager.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' - show ScheduleProvisionalVisitPageWidget; import 'package:flutter/material.dart'; +import 'package:hub/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart'; class ScheduleProvisionalVisitPageModel extends FlutterFlowModel { @@ -62,4 +62,4 @@ class ScheduleProvisionalVisitPageModel textFieldFocusNode3?.dispose(); textController3?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart:Zone.Identifier b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/schedules/visit/provisional/widget.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart similarity index 98% rename from lib/pages/schedules/visit/provisional/widget.dart rename to lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart index 52dee3ab..6200de1c 100644 --- a/lib/pages/schedules/visit/provisional/widget.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart @@ -1,19 +1,22 @@ -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + -import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; + class ScheduleProvisionalVisitPageWidget extends StatefulWidget { const ScheduleProvisionalVisitPageWidget({super.key}); @@ -865,4 +868,4 @@ class _ScheduleProvisionalVisitPageWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart:Zone.Identifier b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/schedules/visit/complete/model.dart b/lib/pages/schedules/visit/complete/model.dart deleted file mode 100644 index d2ce64db..00000000 --- a/lib/pages/schedules/visit/complete/model.dart +++ /dev/null @@ -1,109 +0,0 @@ -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/widgets/request_manager.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/form_field_controller.dart'; -import 'widget.dart' - show ScheduleCompleteVisitPageWidget; -import 'package:flutter/material.dart'; - -class ScheduleCompleteVisitPageModel - extends FlutterFlowModel { - final _visitHistoryManager = FutureRequestManager(); - Future visitHistory({ - String? uniqueQueryKey, - bool? overrideCache, - required Future Function() requestFn, - }) => - _visitHistoryManager.performRequest( - uniqueQueryKey: uniqueQueryKey, - overrideCache: overrideCache, - requestFn: requestFn, - ); - void clearVisitHistoryCache() => _visitHistoryManager.clear(); - void clearVisitHistoryCacheKey(String? uniqueKey) => - _visitHistoryManager.clearRequest(uniqueKey); - - /// Local state fields for this page. - - List visitorJsonList = []; - void addToVisitorJsonList(dynamic item) => visitorJsonList.add(item); - void removeFromVisitorJsonList(dynamic item) => visitorJsonList.remove(item); - void removeAtIndexFromVisitorJsonList(int index) => - visitorJsonList.removeAt(index); - void insertAtIndexInVisitorJsonList(int index, dynamic item) => - visitorJsonList.insert(index, item); - void updateVisitorJsonListAtIndex(int index, Function(dynamic) updateFn) => - visitorJsonList[index] = updateFn(visitorJsonList[index]); - - String visitorStrList = '0'; - - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - // State field(s) for TabBar widget. - TabController? tabBarController; - int get tabBarCurrentIndex => - tabBarController != null ? tabBarController!.index : 0; - - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode1; - TextEditingController? textController1; - String? Function(BuildContext, String?)? textController1Validator; - DateTime? datePicked1; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode2; - TextEditingController? textController2; - String? Function(BuildContext, String?)? textController2Validator; - DateTime? datePicked2; - // State field(s) for DropDown widget. - String? dropDownValue1; - FormFieldController? dropDownValueController1; - // State field(s) for DropDown widget. - String? dropDownValue2; - FormFieldController? dropDownValueController2; - // State field(s) for Switch widget. - bool? switchValue; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode3; - TextEditingController? textController3; - String? Function(BuildContext, String?)? textController3Validator; - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - unfocusNode.dispose(); - tabBarController?.dispose(); - textFieldFocusNode1?.dispose(); - textController1?.dispose(); - - textFieldFocusNode2?.dispose(); - textController2?.dispose(); - - textFieldFocusNode3?.dispose(); - textController3?.dispose(); - - clearVisitHistoryCache(); - } - - /// Action blocks. - Future getVisitorsActionPage( - BuildContext context, { - List? visitorsJsonList, - }) async { - visitorJsonList = visitorsJsonList!.toList().cast(); - } - - Future toggleCurrentSelectionHeader( - BuildContext context, { - required bool? toggleIndexValue, - }) async { - if (toggleIndexValue == true) { - return true; - } - - return false; - } -} \ No newline at end of file diff --git a/lib/pages/schedules/visit/complete/widget.dart b/lib/pages/schedules/visit/complete/widget.dart deleted file mode 100644 index 7dbda87d..00000000 --- a/lib/pages/schedules/visit/complete/widget.dart +++ /dev/null @@ -1,2365 +0,0 @@ -import 'dart:developer'; - -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/components/templates/exception/widget.dart'; -import 'package:hub/modals/browsers/visitor_browser/widget.dart'; -import 'package:hub/modals/details/visit_details_modal/widget.dart'; -import 'package:hub/modals/details/visitor_details_modal/widget.dart'; - -import '/commons/widgets/flutter_flow_drop_down.dart'; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/flutter_flow_widgets.dart'; -import '/commons/widgets/form_field_controller.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import 'package:auto_size_text/auto_size_text.dart'; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; -import 'package:flutter_spinkit/flutter_spinkit.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; - -class ScheduleCompleteVisitPageWidget extends StatefulWidget { - const ScheduleCompleteVisitPageWidget({ - super.key, - this.visitorStrList, - this.visitStartDateStr, - this.visitEndDateStr, - this.visitReasonStr, - this.visitLevelStr, - this.visitTempBol, - this.visitObsStr, - this.visitorJsonList, - }); - - final String? visitorStrList; - final String? visitStartDateStr; - final String? visitEndDateStr; - final String? visitReasonStr; - final String? visitLevelStr; - final bool? visitTempBol; - final String? visitObsStr; - final List? visitorJsonList; - - @override - State createState() => - _ScheduleCompleteVisitPageWidgetState(); -} - -class _ScheduleCompleteVisitPageWidgetState - extends State - with TickerProviderStateMixin { - late ScheduleCompleteVisitPageModel _model; - int _visitHistoryLoadingIdx = 0; - final int _visitHistoryLoadingCount = 10; - List _visitHistoryList = []; - ScrollController _visitHistoryController = ScrollController(); - - final scaffoldKey = GlobalKey(); - - @override - void initState() { - super.initState(); - _model = createModel(context, () => ScheduleCompleteVisitPageModel()); - - // On page load action. - SchedulerBinding.instance.addPostFrameCallback((_) async { - if ((widget.visitorStrList != null && widget.visitorStrList != '') && - ((widget.visitorJsonList != null && - (widget.visitorJsonList)!.isNotEmpty) != - null)) { - _model.visitorJsonList = widget.visitorJsonList! - .where((e) => - widget.visitorStrList == - getJsonField( - e, - r'''$.VTE_DOCUMENTO''', - ).toString().toString()) - .toList() - .toList() - .cast(); - _model.visitorStrList = widget.visitorStrList!; - setState(() {}); - } else { - return; - } - }); - - _model.tabBarController = TabController( - vsync: this, - length: 2, - initialIndex: 0, - )..addListener(() => setState(() {})); - _model.textController1 ??= TextEditingController(); - _model.textFieldFocusNode1 ??= FocusNode(); - - _model.textController2 ??= TextEditingController(); - _model.textFieldFocusNode2 ??= FocusNode(); - - _model.switchValue = true; - _model.textController3 ??= TextEditingController(); - _model.textFieldFocusNode3 ??= FocusNode(); - } - - void _loadMoreVisitHistory() async { - // Simulate fetching data from an API or database - Future> fetchVisitHistory(int start, int limit) async { - // Simulate network delay - await Future.delayed(Duration(seconds: 1)); - // Generate a list of visit history items - return List.generate(limit, (index) => "Item ${start + index}"); - } - - // Calculate the start index for the next batch of items to load - final int start = _visitHistoryLoadingIdx * _visitHistoryLoadingCount; - // Fetch the next batch of items - final List newItems = - await fetchVisitHistory(start, _visitHistoryLoadingCount); - - // If new items were fetched, add them to the list and update the index - if (newItems.isNotEmpty) { - _visitHistoryList.addAll(newItems); - _visitHistoryLoadingIdx++; - setState(() {}); - } - } - - void_scrollListener() { - if (_visitHistoryController.position.pixels == - _visitHistoryController.position.maxScrollExtent) { - _loadMoreVisitHistory(); - } - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: appBarScheduleCompleteVisit(context), - body: - bodyScheduleCompleteVisit(context, _model, setState, safeSetState), - ), - ); - } -} - - -PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { - return AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - forceMaterialTransparency: true, - elevation: 0.0, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, - ), - title: Text( - FFLocalizations.of(context).getText( - '61lcxdgm' /* Agendar Visita */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - ); -} - -Widget bodyScheduleCompleteVisit( - BuildContext context, - ScheduleCompleteVisitPageModel _model, - Function setState, - Function safeSetState) { - return SafeArea( - top: true, - child: Column( - children: [ - Align( - alignment: const Alignment(0.0, 0), - child: TabBar( - labelColor: FlutterFlowTheme.of(context).primaryText, - unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, - labelStyle: FlutterFlowTheme.of(context).titleMedium.override( - fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, - fontSize: 13.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleMediumFamily), - ), - unselectedLabelStyle: const TextStyle(), - indicatorColor: FlutterFlowTheme.of(context).primary, - padding: const EdgeInsets.all(4.0), - tabs: [ - Tab( - text: FFLocalizations.of(context).getText( - 'ueth1f4g' /* Cadastrar Visita */, - ), - ), - Tab( - text: FFLocalizations.of(context).getText( - 'k4uraqam' /* Histórico de Visitas */, - ), - ), - ], - controller: _model.tabBarController, - onTap: (i) async { - [() async {}, () async {}][i](); - }, - ), - ), - Expanded( - child: TabBarView( - controller: _model.tabBarController, - children: [ - scheduleVisit(context, _model, setState, safeSetState), - visitHistory(context, _model, safeSetState), - ], - ), - ), - ], - ), - ); -} - -Widget scheduleVisit( - BuildContext context, - ScheduleCompleteVisitPageModel _model, - Function setState, - Function safeSetState) { - return SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Stack( - children: [ - Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'u0jocx7e' /* Quais visitantes você deseja c... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - if (_model.visitorJsonList.isNotEmpty) - Builder( - builder: (context) { - final visitorListView = - _model.visitorJsonList.map((e) => e).toList(); - return ListView.separated( - padding: const EdgeInsets.fromLTRB( - 0, - 0, - 0, - 20.0, - ), - shrinkWrap: true, - scrollDirection: Axis.vertical, - itemCount: visitorListView.length, - separatorBuilder: (_, __) => - const SizedBox(height: 5.0), - itemBuilder: (context, visitorListViewIndex) { - final visitorListViewItem = - visitorListView[visitorListViewIndex]; - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus( - _model.unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: - const VisitorDetailsModalTemplateComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - onLongPress: () async { - _model.removeFromVisitorJsonList( - visitorListViewItem); - setState(() {}); - }, - child: Container( - width: 100.0, - height: 70.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .secondaryBackground, - ), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: const Duration( - milliseconds: 500), - fadeOutDuration: const Duration( - milliseconds: 500), - imageUrl: valueOrDefault( - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorListViewItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), - ), - Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_NOME''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_TIPO''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ], - ), - ] - .divide(const SizedBox(width: 30.0)) - .addToStart( - const SizedBox(width: 30.0)), - ), - ), - ); - }, - ); - }, - ), - Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 20.0), - child: FFButtonWidget( - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: - FlutterFlowTheme.of(context) - .primaryBackground, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus( - _model.unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: - VisitorSearchModalTemplateComponentWidget( - getVisitors: - (visitorsParam) async { - _model.visitorJsonList = - visitorsParam! - .toList() - .cast(); - setState(() {}); - }, - getDocs: (docsParam) async { - _model.visitorStrList = - functions.strListToStr( - docsParam!.toList()); - setState(() {}); - }, - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: '', - icon: Icon( - Icons.add, - color: FlutterFlowTheme.of(context).primary, - size: 30.0, - ), - options: FFButtonOptions( - width: - MediaQuery.sizeOf(context).width * 0.8, - height: 80.0, - padding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent4, - width: 1.0, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.8, - height: 20.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: AutoSizeText( - FFLocalizations.of(context).getText( - 'r8soavtz' /* Clique para adicionar um visit... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - ), - ], - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '98evnbbe' /* Qual o período de validade da ... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Row( - children: [ - Expanded( - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: SizedBox( - height: double.infinity, - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: - FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context) - .getText( - '53cbwqh9' /* Quando você inicia a visita? */, - ), - hintStyle: - FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - lineHeight: 1.0, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .accent4, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: - FlutterFlowTheme.of(context) - .accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - lineHeight: 1.0, - ), - textAlign: TextAlign.center, - validator: _model - .textController1Validator - .asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final datePicked1Date = - await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: getCurrentTimestamp, - lastDate: DateTime(2050), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - TimeOfDay? datePicked1Time; - if (datePicked1Date != null) { - datePicked1Time = - await showTimePicker( - context: context, - initialTime: - TimeOfDay.fromDateTime( - getCurrentTimestamp), - builder: (context, child) { - return wrapInMaterialTimePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - } - - if (datePicked1Date != null && - datePicked1Time != null) { - safeSetState(() { - _model.datePicked1 = DateTime( - datePicked1Date.year, - datePicked1Date.month, - datePicked1Date.day, - datePicked1Time!.hour, - datePicked1Time.minute, - ); - }); - } - setState(() { - _model.textController1?.text = - dateTimeFormat( - 'd/M/y H:mm:ss', - _model.datePicked1, - locale: - FFLocalizations.of(context) - .languageCode, - ); - _model.textController1 - ?.selection = - TextSelection.collapsed( - offset: _model - .textController1! - .text - .length); - }); - }, - child: Container( - width: double.infinity, - height: 55.0, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(8.0), - ), - ), - ), - ), - ], - ), - ), - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: SizedBox( - height: double.infinity, - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: - FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context) - .getText( - 'xpgc5e8d' /* Quando a visita terminá? */, - ), - hintStyle: - FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - lineHeight: 1.0, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .accent4, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: - FlutterFlowTheme.of(context) - .accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - lineHeight: 1.0, - ), - textAlign: TextAlign.center, - validator: _model - .textController2Validator - .asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final datePicked2Date = - await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: getCurrentTimestamp, - lastDate: DateTime(2050), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - TimeOfDay? datePicked2Time; - if (datePicked2Date != null) { - datePicked2Time = - await showTimePicker( - context: context, - initialTime: - TimeOfDay.fromDateTime( - getCurrentTimestamp), - builder: (context, child) { - return wrapInMaterialTimePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - } - - if (datePicked2Date != null && - datePicked2Time != null) { - safeSetState(() { - _model.datePicked2 = DateTime( - datePicked2Date.year, - datePicked2Date.month, - datePicked2Date.day, - datePicked2Time!.hour, - datePicked2Time.minute, - ); - }); - } - setState(() { - _model.textController2?.text = - dateTimeFormat( - 'd/M/y H:mm:ss', - _model.datePicked2, - locale: - FFLocalizations.of(context) - .languageCode, - ); - _model.textController2 - ?.selection = - TextSelection.collapsed( - offset: _model - .textController2! - .text - .length); - }); - }, - child: Container( - width: double.infinity, - height: 39.0, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(8.0), - ), - ), - ), - ), - ], - ), - ), - ), - ), - ], - ), - ].divide(const SizedBox(height: 10.0)), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '0meymh6u' /* Quais são os motivos da visita... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: FutureBuilder( - future: PhpGroup.getDadosCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliUUID: FFAppState().cliUUID, - atividade: 'getDados', - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: - FlutterFlowTheme.of(context) - .primary, - size: 50.0, - ), - ), - ); - } - final dropDownGetDadosResponse = - snapshot.data!; - return FlutterFlowDropDown( - controller: - _model.dropDownValueController1 ??= - FormFieldController( - _model.dropDownValue1 ??= '', - ), - options: List.from( - PhpGroup.getDadosCall - .reasonsJsonList( - dropDownGetDadosResponse - .jsonBody, - )! - .map((e) => e.toString()) - .toList()), - optionLabels: PhpGroup.getDadosCall - .reasonsMotDescStrList( - dropDownGetDadosResponse.jsonBody, - )!, - onChanged: (val) => setState( - () => _model.dropDownValue1 = val), - width: double.infinity, - height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '6p3e0bzr' /* Escolha um motivo aqui */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context) - .accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: const EdgeInsetsDirectional - .fromSTEB(16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ); - }, - ), - ), - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: FutureBuilder( - future: PhpGroup.getDadosCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliUUID: FFAppState().cliUUID, - atividade: 'getDados', - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: - FlutterFlowTheme.of(context) - .primary, - size: 50.0, - ), - ), - ); - } - final dropDownGetDadosResponse = - snapshot.data!; - return FlutterFlowDropDown( - controller: - _model.dropDownValueController2 ??= - FormFieldController( - _model.dropDownValue2 ??= '', - ), - options: List.from( - PhpGroup.getDadosCall - .levelJsonList( - dropDownGetDadosResponse - .jsonBody, - )! - .map((e) => e.toString()) - .toList()), - optionLabels: PhpGroup.getDadosCall - .levelNACDescricaoStrList( - dropDownGetDadosResponse.jsonBody, - )!, - onChanged: (val) => setState( - () => _model.dropDownValue2 = val), - width: double.infinity, - height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '2wun8p6c' /* Escolha um nível de acesso aqu... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context) - .accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: const EdgeInsetsDirectional - .fromSTEB(16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ); - }, - ), - ), - ), - ), - ], - ), - ].divide(const SizedBox(height: 10.0)), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '8rk26eg1' /* Visita se encerra após o prime... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 30.0, 0.0, 30.0, 20.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 130.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'lgv0q5ht' /* Visita única */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Switch.adaptive( - value: _model.switchValue!, - onChanged: (newValue) async { - setState(() => _model.switchValue = newValue); - }, - activeColor: - FlutterFlowTheme.of(context).success, - activeTrackColor: - FlutterFlowTheme.of(context).customColor4, - inactiveTrackColor: - FlutterFlowTheme.of(context).customColor4, - inactiveThumbColor: - FlutterFlowTheme.of(context).error, - ), - ], - ), - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - 'eftcs67c' /* Você tem alguma observação sob... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 't0q2vuup' /* Observações da Visita */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'w18iztdm' /* Escreva as suas observações aq... */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent4, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.text_fields, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.start, - maxLines: null, - maxLength: 80, - validator: _model.textController3Validator - .asValidator(context), - ), - ), - ), - ], - ), - Container( - width: 100.0, - height: 54.0, - decoration: const BoxDecoration(), - ), - ], - ), - ), - ), - ], - ), - InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - if ((_model.textController1.text != '') && - (_model.textController2.text != '') && - (_model.dropDownValue1 != null && - _model.dropDownValue1 != '') && - (_model.dropDownValue2 != null && - _model.dropDownValue2 != '')) { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: VisitDetailsModalTemplateComponentWidget( - visitStartDateStr: _model.textController1.text, - visitEndDateStr: _model.textController2.text, - visitReasonStr: _model.dropDownValue1, - visitLevelStr: _model.dropDownValue2, - visitTempStr: - _model.switchValue == true ? 'Sim' : 'Não', - visitObsStr: _model.textController3.text, - visitorStrList: _model.visitorStrList, - visitorJsonList: _model.visitorJsonList, - updateToggleIdx: () async {}, - repeatVisitSchedule: () async {}, - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const ThrowExceptionWidget( - msg: 'Campos obrigatórios imcompletos.', - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - }, - child: Container( - width: MediaQuery.sizeOf(context).width * 0.5, - height: 40.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: BorderRadius.circular(10.0), - ), - alignment: const AlignmentDirectional(0.0, 1.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.save_alt, - color: FlutterFlowTheme.of(context).info, - size: 24.0, - ), - ), - ), - ), - ].addToEnd(const SizedBox(height: 30.0)), - ), - ); -} - -Widget visitHistory( - BuildContext context, - ScheduleCompleteVisitPageModel _model, - Function safeSetState, -) { - return Container( - width: double.infinity, - height: 900.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.settings_sharp, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - onPressed: () { - log('IconButton pressed ...'); - }, - ), - ], - ), - FutureBuilder( - future: _model.visitHistory( - requestFn: () => PhpGroup.getVisitsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitas', - ), - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), - ), - ); - } - final wrapGetVisitsResponse = snapshot.data!; - return Builder( - builder: (context) { - final visitaWrap = PhpGroup.getVisitsCall - .visitasList( - wrapGetVisitsResponse.jsonBody, - ) - ?.toList() ?? - []; - return ListView.builder( - itemCount: visitaWrap.length, - shrinkWrap: true, - scrollDirection: Axis.vertical, - physics: const BouncingScrollPhysics(), - addAutomaticKeepAlives: true, - cacheExtent: 1000.0, - addRepaintBoundaries: true, - addSemanticIndexes: true, - itemBuilder: (context, index) { - final visitaWrapItem = visitaWrap[index]; - // visitaWrap.length, (visitaWrapIndex) { - - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - useSafeArea: true, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => - _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: - VisitDetailsModalTemplateComponentWidget( - visitStatusStr: getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - ).toString(), - visitStartDateStr: getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', - ).toString(), - visitEndDateStr: getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', - ).toString(), - visitReasonStr: getJsonField( - visitaWrapItem, - r'''$.MOT_DESCRICAO''', - ).toString(), - visitLevelStr: getJsonField( - visitaWrapItem, - r'''$.NAC_DESCRICAO''', - ).toString(), - visitTempStr: getJsonField( - visitaWrapItem, - r'''$.VTE_UNICA''', - ).toString(), - visitObsStr: getJsonField( - visitaWrapItem, - r'''$.VAW_OBS''', - ).toString(), - visitorImgPath: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - visitorStrList: getJsonField( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString(), - visitIdStr: getJsonField( - visitaWrapItem, - r'''$.VAW_ID''', - ).toString(), - visitStatusColor: getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - ).toString() == - 'A' - ? FlutterFlowTheme.of(context).success - : FlutterFlowTheme.of(context).error, - visitorJsonList: - PhpGroup.getVisitsCall.visitasList( - wrapGetVisitsResponse.jsonBody, - ), - updateToggleIdx: () async {}, - repeatVisitSchedule: () async {}, - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: Card( - clipBehavior: Clip.antiAliasWithSaveLayer, - color: FlutterFlowTheme.of(context) - .secondaryBackground, - elevation: 5.0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.0), - ), - child: Container( - width: 350.0, - height: 115.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .secondaryBackground, - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: const BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Text( - FFLocalizations.of(context) - .getText( - 'i46frqyi' /* Visitante: */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, -1.0), - child: Text( - getJsonField( - visitaWrapItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ].addToStart( - const SizedBox(width: 10.0)), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context) - .getText( - '73b1kj59' /* Início em: */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Text( - getJsonField( - visitaWrapItem, - r'''$.VAW_DTINICIO''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ].addToStart( - const SizedBox(width: 10.0)), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context) - .getText( - 'klzzrfbn' /* Fim em: */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: - FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Text( - getJsonField( - visitaWrapItem, - r'''$.VAW_DTFIM''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ].addToStart( - const SizedBox(width: 10.0)), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Container( - width: 200.0, - height: 27.0, - decoration: BoxDecoration( - color: valueOrDefault( - () { - if (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FlutterFlowTheme - .of(context) - .success; - } else if ((functions - .jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') || - (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"F\"') || - (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"B\"') || - (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"')) { - return FlutterFlowTheme - .of(context) - .error; - } else if (functions - .jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"') { - return FlutterFlowTheme - .of(context) - .warning; - } else { - return FlutterFlowTheme - .of(context) - .primary; - } - }(), - FlutterFlowTheme.of(context) - .primary, - ), - borderRadius: - BorderRadius.circular( - 5.0), - ), - child: Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - () { - if (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"A\"') { - return FFLocalizations - .of(context) - .getVariableText( - ptText: 'Ativo', - enText: 'Active', - ); - } else if ((functions - .jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"F\"') || - (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') || - (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"B\"') || - (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"I\"')) { - return FFLocalizations - .of(context) - .getVariableText( - ptText: 'Cancelado', - enText: 'Canceled', - ); - } else { - return FFLocalizations - .of(context) - .getVariableText( - ptText: 'Pendente', - enText: 'Pending', - ); - } - }(), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme - .of(context) - .info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - ), - ].divide(const SizedBox(height: 3.0)), - ), - ), - ), - ClipRRect( - borderRadius: BorderRadius.circular(0.0), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitaWrapItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), - ), - ], - ), - ), - ), - ); - }); - }, - ); - }, - ) - ], - ), - ), - ); - - -} \ No newline at end of file diff --git a/lib/pages/settings/model.dart b/lib/pages/settings/model.dart deleted file mode 100644 index 7f78258f..00000000 --- a/lib/pages/settings/model.dart +++ /dev/null @@ -1,170 +0,0 @@ - -import 'dart:developer'; - - -// import 'package:hub/commons/actions/api_calls.dart'; -// import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/app_state.dart'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/widgets/flutter_flow_theme.dart'; -// import 'package:hub/commons/widgets/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:hub/commons/widgets/flutter_flow_util.dart'; -import 'package:hub/modals/forms/change_password/widget.dart'; - -class PreferencesPageModel with ChangeNotifier { - final unfocusNode = FocusNode(); - - - Future toggleFingerprint(BuildContext context) async { - - // FFAppState().checkBiometrics() - // .then((value) => FFAppState().authenticateBiometric() - // .then( (value) { - // FFAppState().fingerprint = !FFAppState().fingerprint; - - // }) - // .whenComplete(() => notifyListeners())); - - if(FFAppState().fingerprint) { - FFAppState().fingerprint = false; - FFAppState().deleteFingerprintPass(); - notifyListeners(); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - PassKeyTemplateWidget( - toggleActionStatus: (key) async { - log(key); - FFAppState().fingerprintPass = key; - FFAppState().fingerprint = true; - }, - ), - ); - }, - ).whenComplete(() => notifyListeners()); - } - - } - - void enablePerson(BuildContext context) { - - notifyListeners(); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text(FFAppState().userDevUUID, style: TextStyle(color: FlutterFlowTheme.of(context).info) ), - backgroundColor: FlutterFlowTheme.of(context).primary, - duration: const Duration(seconds: 1), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ); - } - - void toggleNotify() { - FFAppState().notify = !FFAppState().notify; - PhpGroup.changeNotifica.call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - atividade: 'updVisitado', - notifica: FFAppState().notify ? 'S' : 'N', - ); - notifyListeners(); - } - - void localLogout(){ - PhpGroup.resopndeVinculo.call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - tarefa: 'I', - ); - notifyListeners(); - } - - void deleteAccount(BuildContext context) { - FFAppState().deleteAll(); - FFAppState().isLogged = false; - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - - Future togglePass(BuildContext context) async { - debugPrint('pass: ${FFAppState().pass}'); - if(FFAppState().pass) { - FFAppState().pass = false; - FFAppState().deleteAccessPass(); - notifyListeners(); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - PassKeyTemplateWidget( - toggleActionStatus: (key) async { - FFAppState().accessPass = key; - notifyListeners(); - debugPrint('key: $key'); - await PhpGroup.changePass.call( - userUUID: FFAppState().userUUID, - devUUID: FFAppState().devUUID, - cliID: FFAppState().cliUUID, - atividade: 'updVisitado', - newSenha: FFAppState().accessPass, - ) - .then((value) { - FFAppState().pass = true; - // var error = jsonDecode(value.jsonBody['error'].toString()); - // log('${jsonDecode(value.jsonBody['error'].toString())}'); - if(jsonDecode(value.jsonBody['error'].toString()) == false) { - FFAppState().pass = true; - } else { - FFAppState().pass = false; - } - }) - .onError((error, StackTrace) { - FFAppState().pass = false; - log(error.toString()); - log(StackTrace.toString()); - }) - .whenComplete(() => notifyListeners()); - }, - ), - ); - }, - ); - } - } - - @override - void dispose() { - unfocusNode.dispose(); - super.dispose(); - } -} \ No newline at end of file diff --git a/lib/pages/onboarding/signin/model.dart b/lib/pages/sign_in_page/sign_in_page_model.dart similarity index 73% rename from lib/pages/onboarding/signin/model.dart rename to lib/pages/sign_in_page/sign_in_page_model.dart index c5f0d901..6cea2517 100644 --- a/lib/pages/onboarding/signin/model.dart +++ b/lib/pages/sign_in_page/sign_in_page_model.dart @@ -1,7 +1,6 @@ -import 'package:hub/pages/onboarding/signin/component.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show SignInPageWidget; +import '/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'sign_in_page_widget.dart' show SignInPageWidget; import 'package:flutter/material.dart'; class SignInPageModel extends FlutterFlowModel { @@ -22,4 +21,4 @@ class SignInPageModel extends FlutterFlowModel { unfocusNode.dispose(); signInTemplateComponentModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_in_page/sign_in_page_model.dart:Zone.Identifier b/lib/pages/sign_in_page/sign_in_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/signin/widget.dart b/lib/pages/sign_in_page/sign_in_page_widget.dart similarity index 81% rename from lib/pages/onboarding/signin/widget.dart rename to lib/pages/sign_in_page/sign_in_page_widget.dart index b450d0da..23b13170 100644 --- a/lib/pages/onboarding/signin/widget.dart +++ b/lib/pages/sign_in_page/sign_in_page_widget.dart @@ -1,11 +1,10 @@ -import 'package:hub/pages/onboarding/signin/component.dart'; - -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/actions/actions.dart' as action_blocks; +import '/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/actions/actions.dart' as action_blocks; import 'package:flutter/material.dart'; -import 'model.dart'; -export 'model.dart'; +import 'sign_in_page_model.dart'; +export 'sign_in_page_model.dart'; class SignInPageWidget extends StatefulWidget { const SignInPageWidget({super.key}); @@ -57,4 +56,4 @@ class _SignInPageWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_in_page/sign_in_page_widget.dart:Zone.Identifier b/lib/pages/sign_in_page/sign_in_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/signup/model.dart b/lib/pages/sign_up_page/sign_up_page_model.dart similarity index 73% rename from lib/pages/onboarding/signup/model.dart rename to lib/pages/sign_up_page/sign_up_page_model.dart index 94958f8b..349ee990 100644 --- a/lib/pages/onboarding/signup/model.dart +++ b/lib/pages/sign_up_page/sign_up_page_model.dart @@ -1,8 +1,6 @@ - -import 'package:hub/pages/onboarding/signup/component.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show SignUpPageWidget; +import '/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'sign_up_page_widget.dart' show SignUpPageWidget; import 'package:flutter/material.dart'; class SignUpPageModel extends FlutterFlowModel { @@ -23,4 +21,4 @@ class SignUpPageModel extends FlutterFlowModel { unfocusNode.dispose(); signUpTemplateComponentModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_up_page/sign_up_page_model.dart:Zone.Identifier b/lib/pages/sign_up_page/sign_up_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/signup/widget.dart b/lib/pages/sign_up_page/sign_up_page_widget.dart similarity index 81% rename from lib/pages/onboarding/signup/widget.dart rename to lib/pages/sign_up_page/sign_up_page_widget.dart index a0a9c30a..8d68605b 100644 --- a/lib/pages/onboarding/signup/widget.dart +++ b/lib/pages/sign_up_page/sign_up_page_widget.dart @@ -1,11 +1,10 @@ -import 'package:hub/pages/onboarding/signup/component.dart'; - -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/actions/actions.dart' as action_blocks; +import '/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/actions/actions.dart' as action_blocks; import 'package:flutter/material.dart'; -import 'model.dart'; -export 'model.dart'; +import 'sign_up_page_model.dart'; +export 'sign_up_page_model.dart'; class SignUpPageWidget extends StatefulWidget { const SignUpPageWidget({super.key}); @@ -58,4 +57,4 @@ class _SignUpPageWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_up_page/sign_up_page_widget.dart:Zone.Identifier b/lib/pages/sign_up_page/sign_up_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/test_page/test_page.dart b/lib/pages/test_page/test_page.dart new file mode 100644 index 00000000..c8e9cc15 --- /dev/null +++ b/lib/pages/test_page/test_page.dart @@ -0,0 +1,63 @@ +// import 'dart:developer'; + +// import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; +// import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; +// import 'package:flutter/material.dart'; + +// class TestPage extends StatelessWidget { +// const TestPage({Key? key}) : super(key: key); + +// @override +// Widget build(BuildContext context) { +// // Exemplo de dados para os HashMaps +// final Map labelsHashMap = { +// 'Nome:': 'Gabriel da Silva', +// 'Entrada:': '08:00 AM 01/01/2022', +// 'Saída:': '17:00 PM 01/01/2022', +// }; + +// // Ajuste para o novo tipo esperado pelo componente +// final Map statusHashMap = { +// 'Ativo': FlutterFlowTheme.of(context).success, +// }; + +// // função set statusHashMap que recebe um String status faz um switch case e retorna um Map +// Map getStatusHashMap(String status) { +// switch (status) { +// case 'Ativo': +// return {'Ativo': FlutterFlowTheme.of(context).success}; +// case 'Inativo': +// return {'Inativo': FlutterFlowTheme.of(context).error}; +// default: +// return {'Desconhecido': FlutterFlowTheme.of(context).primaryColor}; +// } +// } + +// // Ajuste para passar os valores corretos para a URL da imagem +// final Map imageKeyValue = { +// 'key': 'docID', +// 'value': 'imageType', +// }; + +// return Scaffold( +// appBar: AppBar( +// title: const Text('Test Page'), +// ), +// body: Center( +// child: ListView.builder( +// itemCount: 10, +// itemBuilder: (context, index) { +// return CardItemTemplateComponentWidget( +// labelsHashMap: labelsHashMap, +// statusHashMap: statusHashMap, +// imageHashMap: imageKeyValue, +// onTapCardItemAction: () async { +// // Ação ao tocar no card +// log('Card tapped'); +// }, +// ); +// }), +// ), +// ); +// } +// } diff --git a/lib/pages/test_page/test_page.dart:Zone.Identifier b/lib/pages/test_page/test_page.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/visit/model.dart b/lib/pages/visit_history_page/visit_history_page_model.dart similarity index 91% rename from lib/pages/consults/visit/model.dart rename to lib/pages/visit_history_page/visit_history_page_model.dart index c334b012..c0c3bed8 100644 --- a/lib/pages/consults/visit/model.dart +++ b/lib/pages/visit_history_page/visit_history_page_model.dart @@ -1,10 +1,11 @@ -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/widgets/request_manager.dart'; -import 'package:flutter/material.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/form_field_controller.dart'; -import 'widget.dart' show VisitHistoryPageWidget; + +import 'package:flutter/material.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; +import 'package:hub/pages/visit_history_page/visit_history_page_widget.dart'; class VisitHistoryPageModel extends FlutterFlowModel { final _visitHistoryManager = FutureRequestManager(); @@ -104,4 +105,4 @@ class VisitHistoryPageModel extends FlutterFlowModel { return false; } -} +} \ No newline at end of file diff --git a/lib/pages/visit_history_page/visit_history_page_model.dart:Zone.Identifier b/lib/pages/visit_history_page/visit_history_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/consults/visit/widget.dart b/lib/pages/visit_history_page/visit_history_page_widget.dart similarity index 96% rename from lib/pages/consults/visit/widget.dart rename to lib/pages/visit_history_page/visit_history_page_widget.dart index f04af3ed..3e813f39 100644 --- a/lib/pages/consults/visit/widget.dart +++ b/lib/pages/visit_history_page/visit_history_page_widget.dart @@ -5,16 +5,18 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/modals/details/visit_details_modal/widget.dart'; -import 'package:hub/pages/consults/visit/model.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import 'package:hub/pages/visit_history_page/visit_history_page_model.dart'; import 'package:provider/provider.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import '/commons/widgets/flutter_flow_icon_button.dart'; -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; class VisitHistoryPageWidget extends StatefulWidget { const VisitHistoryPageWidget({ @@ -328,10 +330,10 @@ Widget visitHistory( r'''$.VAW_OBS''', ).toString(), visitorImgPath: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( visitaWrapItem, r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', + ).toString()}&tipo=E", 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), visitorStrList: getJsonField( @@ -575,7 +577,7 @@ Widget visitHistory( decoration: BoxDecoration( color: valueOrDefault( () { - if (functions.jsonToStr( + if (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -584,26 +586,26 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .success; - } else if ((functions - .jsonToStr( + } else if (( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"C\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"F\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"B\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -612,8 +614,8 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .error; - } else if (functions - .jsonToStr( + } else if ( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -641,7 +643,7 @@ Widget visitHistory( 0.0, 0.0), child: Text( () { - if (functions.jsonToStr( + if (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -653,26 +655,26 @@ Widget visitHistory( ptText: 'Ativo', enText: 'Active', ); - } else if ((functions - .jsonToStr( + } else if (( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"F\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"C\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"B\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -752,4 +754,4 @@ Widget visitHistory( ), ), ); -} +} \ No newline at end of file diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart:Zone.Identifier b/lib/pages/visit_history_page/visit_history_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/welcome/model.dart b/lib/pages/welcome_page/welcome_page_model.dart similarity index 75% rename from lib/pages/onboarding/welcome/model.dart rename to lib/pages/welcome_page/welcome_page_model.dart index 2ad92294..4c08929e 100644 --- a/lib/pages/onboarding/welcome/model.dart +++ b/lib/pages/welcome_page/welcome_page_model.dart @@ -1,7 +1,6 @@ -import 'package:hub/pages/onboarding/welcome/component.dart'; - -import '/commons/widgets/flutter_flow_util.dart'; -import 'widget.dart' show WelcomePageWidget; +import '/components/templates_components/welcome_template_component/welcome_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'welcome_page_widget.dart' show WelcomePageWidget; import 'package:flutter/material.dart'; class WelcomePageModel extends FlutterFlowModel { @@ -26,4 +25,4 @@ class WelcomePageModel extends FlutterFlowModel { unfocusNode.dispose(); welcomeTemplateComponentModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/welcome_page/welcome_page_model.dart:Zone.Identifier b/lib/pages/welcome_page/welcome_page_model.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/onboarding/welcome/widget.dart b/lib/pages/welcome_page/welcome_page_widget.dart similarity index 86% rename from lib/pages/onboarding/welcome/widget.dart rename to lib/pages/welcome_page/welcome_page_widget.dart index af1a8f7d..5ec8a486 100644 --- a/lib/pages/onboarding/welcome/widget.dart +++ b/lib/pages/welcome_page/welcome_page_widget.dart @@ -1,13 +1,12 @@ -import 'package:hub/pages/onboarding/welcome/component.dart'; - -import '/commons/widgets/flutter_flow_theme.dart'; -import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/actions/actions.dart' as action_blocks; +import '/components/templates_components/welcome_template_component/welcome_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/actions/actions.dart' as action_blocks; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:provider/provider.dart'; -import 'model.dart'; -export 'model.dart'; +import 'welcome_page_model.dart'; +export 'welcome_page_model.dart'; class WelcomePageWidget extends StatefulWidget { const WelcomePageWidget({super.key}); @@ -78,4 +77,4 @@ class _WelcomePageWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/welcome_page/welcome_page_widget.dart:Zone.Identifier b/lib/pages/welcome_page/welcome_page_widget.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/shared/components/atoms/atom_terms_of_use.dart b/lib/shared/components/atoms/atom_terms_of_use.dart new file mode 100644 index 00000000..e1f29b9b --- /dev/null +++ b/lib/shared/components/atoms/atom_terms_of_use.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; + +import '../../../flutter_flow/flutter_flow_theme.dart'; +import '../../../flutter_flow/flutter_flow_util.dart'; + +class AtomTermsOfUse extends StatelessWidget { + + const AtomTermsOfUse({super.key}); + + @override + Widget build(BuildContext context) { + return InkWell( + child: Text( + FFLocalizations.of(context).getText( + 'olf967cj' /* Termo de Uso */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + onTap: () => launchURL('https://freaccess.com.br/pp'), + ); + } +} \ No newline at end of file diff --git a/lib/shared/components/atoms/atom_terms_of_use.dart:Zone.Identifier b/lib/shared/components/atoms/atom_terms_of_use.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/shared/enums/enum_throw_exception.dart b/lib/shared/enums/enum_throw_exception.dart new file mode 100644 index 00000000..f1bf2a08 --- /dev/null +++ b/lib/shared/enums/enum_throw_exception.dart @@ -0,0 +1,5 @@ +enum EnumThrowException { + success, + error, + warning +} \ No newline at end of file diff --git a/lib/shared/enums/enum_throw_exception.dart:Zone.Identifier b/lib/shared/enums/enum_throw_exception.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/shared/utils/dialog_util.dart b/lib/shared/utils/dialog_util.dart new file mode 100644 index 00000000..6db1ed89 --- /dev/null +++ b/lib/shared/utils/dialog_util.dart @@ -0,0 +1,59 @@ + +import 'package:flutter/material.dart'; +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/shared/enums/enum_throw_exception.dart'; + +class DialogUtil { + static const double _height = 350; + + static Future errorDefault(BuildContext context) { + return error(context, FFLocalizations.of(context).getVariableText( + ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.", + enText: "Failed to perform operation, please try again later." + )); + } + + static Future error(BuildContext context, String message) async { + return await showDialog( + context: context, + builder: (context) { + return Dialog( + child: SizedBox( + height: _height, + child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.error)) + ) + ); + } + ); + } + + static Future warning(BuildContext context, String message) async { + return await showDialog( + context: context, + builder: (context) { + return Dialog( + child: SizedBox( + height: _height, + child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.warning)) + ) + ); + } + ); + } + + static Future success(BuildContext context, String message) async { + return await showDialog( + context: context, + builder: (context) { + return Dialog( + child: SizedBox( + height: _height, + child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.success)) + ) + ); + } + ); + } + +} \ No newline at end of file diff --git a/lib/shared/utils/dialog_util.dart:Zone.Identifier b/lib/shared/utils/dialog_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/shared/utils/log_util.dart b/lib/shared/utils/log_util.dart new file mode 100644 index 00000000..64a30e12 --- /dev/null +++ b/lib/shared/utils/log_util.dart @@ -0,0 +1,15 @@ +import 'dart:developer'; + +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +class LogUtil { + + static void requestAPIFailed(String url, String body, String reason, dynamic error, StackTrace stack) async { + FirebaseCrashlytics.instance.setCustomKey('URL', "${PhpGroup.getBaseUrl()}/$url"); + FirebaseCrashlytics.instance.setCustomKey('Body', body); + + await FirebaseCrashlytics.instance.recordError(error, stack, reason: reason); + } + +} \ No newline at end of file diff --git a/lib/shared/utils/log_util.dart:Zone.Identifier b/lib/shared/utils/log_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/lib/shared/utils/validator_util.dart b/lib/shared/utils/validator_util.dart new file mode 100644 index 00000000..3188c18e --- /dev/null +++ b/lib/shared/utils/validator_util.dart @@ -0,0 +1,17 @@ +class ValidatorUtil { + static bool isValidEmail(String email) { + if (RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$').hasMatch(email)) { + return true; + } else { + return false; + } + } + + static bool isValidPassword(String password) { + if (password.length >= 8) { + return true; + } else { + return false; + } + } +} diff --git a/lib/shared/utils/validator_util.dart:Zone.Identifier b/lib/shared/utils/validator_util.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/pubspec.lock b/pubspec.lock index a64d3263..db941ddb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -345,6 +345,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.17.2" + firebase_crashlytics: + dependency: "direct main" + description: + name: firebase_crashlytics + sha256: ad7510d9bcf1f40fc895944942f553a4c5603acb4715c0d6386dd587f82f6ae5 + url: "https://pub.dev" + source: hosted + version: "4.0.1" + firebase_crashlytics_platform_interface: + dependency: transitive + description: + name: firebase_crashlytics_platform_interface + sha256: "318589f1da3bb858872002fa20170234566f0fb080669a8256c85a81513a802a" + url: "https://pub.dev" + source: hosted + version: "3.6.37" firebase_messaging: dependency: "direct main" description: diff --git a/pubspec.lock:Zone.Identifier b/pubspec.lock:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/pubspec.yaml b/pubspec.yaml index 9df0cbc2..8efce314 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -107,6 +107,7 @@ dependencies: flutter_riverpod: ^2.5.1 qr_flutter: ^4.1.0 permission_handler: ^11.3.1 + firebase_crashlytics: ^4.0.1 dependency_overrides: http: 1.2.1 @@ -198,4 +199,3 @@ flutter: # # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages - diff --git a/pubspec.yaml:Zone.Identifier b/pubspec.yaml:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/test/widget_test.dart b/test/widget_test.dart index fce5c632..76de18a9 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -1,17 +1,17 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. +// // This is a basic Flutter widget test. +// // +// // To perform an interaction with a widget in your test, use the WidgetTester +// // utility that Flutter provides. For example, you can send tap and scroll +// // gestures. You can also use WidgetTester to find child widgets in the widget +// // tree, read text, and verify that the values of widget properties are correct. -import 'package:flutter_test/flutter_test.dart'; +// import 'package:flutter_test/flutter_test.dart'; -import 'package:hub/main.dart'; +// import 'package:f_r_e_hub/main.dart'; -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); - }); -} +// void main() { +// testWidgets('Counter increments smoke test', (WidgetTester tester) async { +// // Build our app and trigger a frame. +// await tester.pumpWidget(MyApp()); +// }); +// } diff --git a/test/widget_test.dart:Zone.Identifier b/test/widget_test.dart:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/web/favicon.png:Zone.Identifier b/web/favicon.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/web/icons/Icon-192.png:Zone.Identifier b/web/icons/Icon-192.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/web/icons/Icon-512.png:Zone.Identifier b/web/icons/Icon-512.png:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/web/icons/app_launcher_icon.svg:Zone.Identifier b/web/icons/app_launcher_icon.svg:Zone.Identifier new file mode 100644 index 00000000..e69de29b diff --git a/web/index.html:Zone.Identifier b/web/index.html:Zone.Identifier new file mode 100644 index 00000000..e69de29b