Merge pull request #23 from FRE-Informatica/fix/fd-685

Fix/fd 685
This commit is contained in:
Jônatas Antunes Messias 2024-08-21 15:23:02 -03:00 committed by GitHub
commit fc06f41a25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
55 changed files with 1436 additions and 15777 deletions

View File

@ -30,6 +30,7 @@ if (keystorePropertiesFile.exists()) {
android { android {
compileSdkVersion 34 compileSdkVersion 34
compileSdk 34
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
@ -46,8 +47,19 @@ android {
targetSdkVersion 34 targetSdkVersion 34
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
multiDexEnabled true
} }
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
signingConfigs { signingConfigs {
release { release {
keyAlias keystoreProperties['keyAlias'] keyAlias keystoreProperties['keyAlias']
@ -57,6 +69,10 @@ android {
} }
} }
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
}
buildTypes { buildTypes {
release { release {
signingConfig signingConfigs.debug signingConfig signingConfigs.debug
@ -74,6 +90,9 @@ dependencies {
implementation 'com.android.support:multidex:1.0.3' // Se necessário, adicione suporte ao multidex implementation 'com.android.support:multidex:1.0.3' // Se necessário, adicione suporte ao multidex
// Adicione outras dependências do seu aplicativo aqui // Adicione outras dependências do seu aplicativo aqui
implementation 'androidx.window:window:1.0.0'
implementation 'androidx.window:window-java:1.0.0'
} }
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'

View File

@ -1,13 +1,14 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.freaccess.hub" package="com.freaccess.hub"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"/> <uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.USE_BIOMETRIC"/> <uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<application <application
android:label="FREHub" android:label="FREHub"
@ -22,36 +23,41 @@
android:theme="@style/LaunchTheme" android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize"
android:showWhenLocked="true"
android:turnScreenOn="true">
<!-- Specifies an Android theme to apply to this Activity as soon as <!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. --> to determine the Window background behind the Flutter UI. -->
<meta-data <meta-data
android:name="io.flutter.embedding.android.NormalTheme" android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" android:resource="@style/NormalTheme"
/> />
<!-- Displays an Android View that continues showing the launch screen <!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of gap between the end of Android's launch screen and the painting of
Flutter's first frame. --> Flutter's first frame. -->
<meta-data <meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable" android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" android:resource="@drawable/launch_background"
/> />
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
<!-- Deep linking --> <!-- Deep linking -->
<meta-data android:name="flutter_deeplinking_enabled" android:value="true" /> <meta-data android:name="flutter_deeplinking_enabled" android:value="true" />
<meta-data <meta-data
android:name="com.google.firebase.messaging.default_notification_icon" android:name="com.google.firebase.messaging.ic_fre_black"
android:resource="@drawable/ic_fre_black" /> android:resource="@drawable/ic_fre_black" />
<intent-filter android:autoVerify="true"> <intent-filter android:autoVerify="true">
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
@ -67,6 +73,17 @@
android:value="2" /> android:value="2" />
<receiver android:exported="false"
android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<receiver android:exported="false"
android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver>
</application> </application>
</manifest> </manifest>

View File

@ -5,7 +5,7 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.0.2' // Use a versão do Gradle que corresponde à sua configuração classpath 'com.android.tools.build:gradle:7.3.1' // Use a versão do Gradle que corresponde à sua configuração
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10' // Kotlin Gradle plugin classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10' // Kotlin Gradle plugin
classpath 'com.google.gms:google-services:4.4.2' // Google Services plugin classpath 'com.google.gms:google-services:4.4.2' // Google Services plugin
// Certifique-se de adicionar outras dependências do classpath aqui, se necessário. // Certifique-se de adicionar outras dependências do classpath aqui, se necessário.

View File

@ -1,6 +1,6 @@
#Sat Jun 15 18:23:23 BRT 2024
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -42,4 +42,12 @@ post_install do |installer|
end end
end end
awesome_pod_file = File.expand_path(File.join('plugins', 'awesome_notifications', 'ios', 'Scripts', 'AwesomePodFile'), '.symlinks')
require awesome_pod_file
update_awesome_pod_build_settings(installer)
end end
awesome_pod_file = File.expand_path(File.join('plugins', 'awesome_notifications', 'ios', 'Scripts', 'AwesomePodFile'), '.symlinks')
require awesome_pod_file
update_awesome_main_target_settings('Runner', File.dirname(File.realpath(__FILE__)), flutter_root)

View File

@ -1,4 +1,7 @@
PODS: PODS:
- awesome_notifications (0.9.3):
- Flutter
- IosAwnCore (~> 0.9.3)
- connectivity_plus (0.0.1): - connectivity_plus (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
@ -133,8 +136,6 @@ PODS:
- flutter_inappwebview_ios/Core (0.0.1): - flutter_inappwebview_ios/Core (0.0.1):
- Flutter - Flutter
- OrderedSet (~> 5.0) - OrderedSet (~> 5.0)
- flutter_local_notifications (0.0.1):
- Flutter
- flutter_secure_storage (6.0.0): - flutter_secure_storage (6.0.0):
- Flutter - Flutter
- fluttertoast (0.0.2): - fluttertoast (0.0.2):
@ -194,8 +195,10 @@ PODS:
- GoogleUtilities/Privacy - GoogleUtilities/Privacy
- image_picker_ios (0.0.1): - image_picker_ios (0.0.1):
- Flutter - Flutter
- IosAwnCore (0.9.3)
- local_auth_darwin (0.0.1): - local_auth_darwin (0.0.1):
- Flutter - Flutter
- FlutterMacOS
- nanopb (2.30910.0): - nanopb (2.30910.0):
- nanopb/decode (= 2.30910.0) - nanopb/decode (= 2.30910.0)
- nanopb/encode (= 2.30910.0) - nanopb/encode (= 2.30910.0)
@ -232,6 +235,7 @@ PODS:
- Flutter - Flutter
DEPENDENCIES: DEPENDENCIES:
- awesome_notifications (from `.symlinks/plugins/awesome_notifications/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`)
@ -241,7 +245,6 @@ DEPENDENCIES:
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`) - flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
@ -272,6 +275,7 @@ SPEC REPOS:
- GoogleAppMeasurement - GoogleAppMeasurement
- GoogleDataTransport - GoogleDataTransport
- GoogleUtilities - GoogleUtilities
- IosAwnCore
- nanopb - nanopb
- OrderedSet - OrderedSet
- PromisesObjC - PromisesObjC
@ -281,6 +285,8 @@ SPEC REPOS:
- Toast - Toast
EXTERNAL SOURCES: EXTERNAL SOURCES:
awesome_notifications:
:path: ".symlinks/plugins/awesome_notifications/ios"
connectivity_plus: connectivity_plus:
:path: ".symlinks/plugins/connectivity_plus/darwin" :path: ".symlinks/plugins/connectivity_plus/darwin"
device_info_plus: device_info_plus:
@ -299,8 +305,6 @@ EXTERNAL SOURCES:
:path: Flutter :path: Flutter
flutter_inappwebview_ios: flutter_inappwebview_ios:
:path: ".symlinks/plugins/flutter_inappwebview_ios/ios" :path: ".symlinks/plugins/flutter_inappwebview_ios/ios"
flutter_local_notifications:
:path: ".symlinks/plugins/flutter_local_notifications/ios"
flutter_secure_storage: flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios" :path: ".symlinks/plugins/flutter_secure_storage/ios"
fluttertoast: fluttertoast:
@ -327,6 +331,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios" :path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
awesome_notifications: 66d28ab7174ca2823b04d275cb043e0a4a3eb9cf
connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
@ -348,14 +353,14 @@ SPEC CHECKSUMS:
FirebaseSessions: dbd14adac65ce996228652c1fc3a3f576bdf3ecc FirebaseSessions: dbd14adac65ce996228652c1fc3a3f576bdf3ecc
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0 flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12 flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c
GoogleAppMeasurement: f65fc137531af9ad647f1c0a42f3b6a4d3a98049 GoogleAppMeasurement: f65fc137531af9ad647f1c0a42f3b6a4d3a98049
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1 image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
local_auth_darwin: 4d56c90c2683319835a61274b57620df9c4520ab IosAwnCore: b8601fbb37f7b3560f31b84ebf55a72f65812e05
local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3
nanopb: 438bc412db1928dac798aa6fd75726007be04262 nanopb: 438bc412db1928dac798aa6fd75726007be04262
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
@ -370,8 +375,8 @@ SPEC CHECKSUMS:
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3 video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36 webview_flutter_wkwebview: 2a23822e9039b7b1bc52e5add778e5d89ad488d1
PODFILE CHECKSUM: d7f4d1b71f8c708247c1078c4aec33a28c763405 PODFILE CHECKSUM: 3bb356a4513d56583f2f2461d3d8eefb4cd4c3a4
COCOAPODS: 1.14.3 COCOAPODS: 1.14.3

View File

@ -41,8 +41,8 @@
4C588A6A63D12FBFE8C3D586 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; }; 4C588A6A63D12FBFE8C3D586 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
4C7A2C30DCF835BA60FAD235 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; }; 4C7A2C30DCF835BA60FAD235 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
50BE974D08F66282C0031620 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; }; 50BE974D08F66282C0031620 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
6436409127A31CDB00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 6436409227A31CDD00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6436409227A31CD800820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 6436409B27A31CD600820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@ -53,8 +53,6 @@
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6436409227A31CDD00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6436409B27A31CD600820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
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 = "<group>"; }; 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 = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
@ -382,8 +380,10 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
APPLICATION_EXTENSION_API_ONLY = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
@ -528,8 +528,10 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = { buildSettings = {
APPLICATION_EXTENSION_API_ONLY = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
@ -568,8 +570,10 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
APPLICATION_EXTENSION_API_ONLY = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";

View File

@ -1,7 +1,6 @@
import UIKit import UIKit
import Flutter import Flutter
import flutter_local_notifications
@UIApplicationMain @UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate { @objc class AppDelegate: FlutterAppDelegate {
@ -9,15 +8,6 @@ import flutter_local_notifications
_ application: UIApplication, _ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> Bool {
FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in
GeneratedPluginRegistrant.register(with: registry)
}
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
}
GeneratedPluginRegistrant.register(with: self) GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
} }

View File

@ -1,22 +1,16 @@
import 'dart:developer'; import 'package:flutter/material.dart';
// import 'package:hub/components/organisms/bottom_arrow_linked_locals/bottom_arrow_linked_locals_component_widget.dart'; // 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_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/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/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/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_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/nav/nav.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/flutter_flow/random_data_util.dart';
import 'package:hub/pages/home_page/home_page_model.dart'; import 'package:hub/pages/home_page/home_page_model.dart';
import 'package:hub/shared/utils/dialog_util.dart'; import 'package:hub/shared/utils/dialog_util.dart';
import 'package:qr_flutter/qr_flutter.dart'; import 'package:qr_flutter/qr_flutter.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../shared/utils/log_util.dart'; import '../shared/utils/log_util.dart';
@ -112,23 +106,23 @@ Future singInLoginAction(
await Future.wait([ await Future.wait([
Future(() async { Future(() async {
FFAppState().email = emailAdress!; AppState().email = emailAdress!;
}), }),
Future(() async { Future(() async {
FFAppState().passwd = password!; AppState().passwd = password!;
}), }),
]); ]);
if ((FFAppState().email != '') && (FFAppState().passwd != '')) { if ((AppState().email != '') && (AppState().passwd != '')) {
devUUID = await getDevUUID(); devUUID = await getDevUUID();
FFAppState().devUUID = devUUID!; AppState().devUUID = devUUID!;
loginCall = await PhpGroup.loginCall.call( loginCall = await PhpGroup.loginCall.call(
email: FFAppState().email, email: AppState().email,
password: FFAppState().passwd, password: AppState().passwd,
uuid: FFAppState().devUUID, uuid: AppState().devUUID,
type: FFAppState().device, type: AppState().device,
description: randomString( description: randomString(
10, 10,
10, 10,
@ -139,30 +133,30 @@ Future singInLoginAction(
); );
if (PhpGroup.loginCall.error((loginCall.jsonBody ?? '')) == false) { if (PhpGroup.loginCall.error((loginCall.jsonBody ?? '')) == false) {
FFAppState().userUUID = PhpGroup.loginCall.userUUID( AppState().userUUID = PhpGroup.loginCall.userUUID(
(loginCall.jsonBody ?? ''), (loginCall.jsonBody ?? ''),
)!; )!;
FFAppState().createdAt = dateTimeFormat( AppState().createdAt = dateTimeFormat(
'd/M/y H:mm:ss', 'd/M/y H:mm:ss',
getCurrentTimestamp, getCurrentTimestamp,
locale: FFLocalizations.of(context).languageCode, locale: FFLocalizations.of(context).languageCode,
); );
FFAppState().updatedAt = '00/00/0000 00:00:00'; AppState().updatedAt = '00/00/0000 00:00:00';
FFAppState().status = AppState().status =
PhpGroup.loginCall.userStatus((loginCall.jsonBody ?? ''))!; PhpGroup.loginCall.userStatus((loginCall.jsonBody ?? ''))!;
FFAppState().userDevUUID = AppState().userDevUUID =
PhpGroup.loginCall.userDeviceId((loginCall.jsonBody ?? ''))!; PhpGroup.loginCall.userDeviceId((loginCall.jsonBody ?? ''))!;
FFAppState().name = AppState().name =
PhpGroup.loginCall.userName((loginCall.jsonBody ?? ''))!; PhpGroup.loginCall.userName((loginCall.jsonBody ?? ''))!;
FFAppState().serialNumber = await getSerialNumber() ?? ''; AppState().serialNumber = await getSerialNumber() ?? '';
FFAppState().isLogged = true; AppState().isLogged = true;
await toggleHomePage(context); await toggleHomePage(context);
} else { } else {
@ -173,13 +167,13 @@ Future singInLoginAction(
PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')).toString()); PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')).toString());
} }
FFAppState().deleteEmail(); AppState().deleteEmail();
FFAppState().email = ''; AppState().email = '';
FFAppState().deletePasswd(); AppState().deletePasswd();
FFAppState().passwd = ''; AppState().passwd = '';
FFAppState().update(() {}); AppState().update(() {});
} }
} }
@ -271,15 +265,15 @@ Future forgotPasswdAction(
} }
Future cachingLoginActionApp(BuildContext context) async { Future cachingLoginActionApp(BuildContext context) async {
if (FFAppState().isLogged == true) { if (AppState().isLogged == true) {
context.pushNamed('homePage'); context.pushNamed('homePage');
} else { } else {
if (isAndroid == true) { if (isAndroid == true) {
FFAppState().device = 'Android'; AppState().device = 'Android';
} else if (isiOS == true) { } else if (isiOS == true) {
FFAppState().device = 'iOS'; AppState().device = 'iOS';
} else { } else {
FFAppState().device = 'Web'; AppState().device = 'Web';
} }
} }
} }
@ -328,9 +322,9 @@ Future<bool> visitCancelAction(BuildContext context,
ApiCallResponse? apiCallResponse; ApiCallResponse? apiCallResponse;
apiCallResponse = await PhpGroup.cancelaVisita.call( apiCallResponse = await PhpGroup.cancelaVisita.call(
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
atividade: 'cancelaVisita', atividade: 'cancelaVisita',
idDestino: idDestino, idDestino: idDestino,
idVisita: idVisita, idVisita: idVisita,
@ -381,8 +375,8 @@ Future<bool> checkLocals({
}) async { }) async {
// A chamada para a API permanece a mesma, assumindo que é necessária sempre. // A chamada para a API permanece a mesma, assumindo que é necessária sempre.
final response = await PhpGroup.getLocalsCall.call( final response = await PhpGroup.getLocalsCall.call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
); );
// Verificação rápida de erro para evitar processamento desnecessário. // Verificação rápida de erro para evitar processamento desnecessário.
@ -391,7 +385,7 @@ Future<bool> checkLocals({
} }
// Uso eficiente de coleções para verificar a condição desejada. // Uso eficiente de coleções para verificar a condição desejada.
final String uuid = cliUUID ?? FFAppState().cliUUID; final String uuid = cliUUID ?? AppState().cliUUID;
final bool itemFound = response.jsonBody['locais'].any( final bool itemFound = response.jsonBody['locais'].any(
(local) => local['CLI_ID'] == uuid && local['CLU_STATUS'] == "A", (local) => local['CLI_ID'] == uuid && local['CLU_STATUS'] == "A",
); );
@ -422,33 +416,25 @@ Future<bool> checkLocals({
} }
} }
Future<String> answersRequest(BuildContext context, String? ref, String? task, String? response, String? id) async { Future answersRequest(BuildContext context, String? ref, String? task,
try { String? response, String? id) async {
ApiCallResponse? respondeSolicitacaoCall; ApiCallResponse? respondeSolicitacaoCall;
respondeSolicitacaoCall = await PhpGroup.respondeSolicitacaoCall.call( respondeSolicitacaoCall = await PhpGroup.respondeSolicitacaoCall.call(
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
cliUUID: FFAppState().cliUUID, cliUUID: AppState().cliUUID,
atividade: 'respondeSolicitacao', atividade: 'respondeSolicitacao',
referencia: ref, referencia: ref,
tarefa: task, tarefa: task,
resposta: response, resposta: response,
idVisitante: id, idVisitante: id,
); );
if (respondeSolicitacaoCall.statusCode == 200) {
if (respondeSolicitacaoCall.statusCode == 200) { return !respondeSolicitacaoCall.jsonBody['error'];
if (!respondeSolicitacaoCall.jsonBody['error']) { } else {
return ''; return false;
} else {
return respondeSolicitacaoCall.jsonBody['error_msg'].toString();
}
} else {
return FFLocalizations.of(context).getVariableText(ptText: 'Falha ao Responder Solicitação', enText: 'Failed to Response Request');
}
} catch (e, s) {
return FFLocalizations.of(context).getVariableText(ptText: 'Falha ao Responder Solicitação', enText: 'Failed to Response Request');
} }
} }

View File

@ -1,12 +1,12 @@
// import 'dart:ffi'; // import 'dart:ffi';
import 'package:csv/csv.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:csv/csv.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:synchronized/synchronized.dart'; import 'package:synchronized/synchronized.dart';
class FFAppState extends ChangeNotifier { class AppState extends ChangeNotifier {
// Adiciona a variável para controle de autenticação biométrica // Adiciona a variável para controle de autenticação biométrica
bool _isBiometricAuthenticated = false; bool _isBiometricAuthenticated = false;
bool get isBiometricAuthenticated => _isBiometricAuthenticated; bool get isBiometricAuthenticated => _isBiometricAuthenticated;
@ -57,16 +57,16 @@ class FFAppState extends ChangeNotifier {
// Limpar a informação salva, se necessário // Limpar a informação salva, se necessário
} }
static FFAppState _instance = FFAppState._internal(); static AppState _instance = AppState._internal();
factory FFAppState() { factory AppState() {
return _instance; return _instance;
} }
FFAppState._internal(); AppState._internal();
static void reset() { static void reset() {
_instance = FFAppState._internal(); _instance = AppState._internal();
} }
Future initializePersistedState() async { Future initializePersistedState() async {
@ -150,6 +150,9 @@ class FFAppState extends ChangeNotifier {
_fingerprintPass = _fingerprintPass =
await secureStorage.getString('fingerprintPass') ?? _fingerprintPass; await secureStorage.getString('fingerprintPass') ?? _fingerprintPass;
}); });
await _safeInitAsync(() async {
_context = await secureStorage.getObject('ff_context') ?? _context;
});
} }
void update(VoidCallback callback) { void update(VoidCallback callback) {
@ -159,6 +162,17 @@ class FFAppState extends ChangeNotifier {
late FlutterSecureStorage secureStorage; late FlutterSecureStorage secureStorage;
BuildContext? _context;
BuildContext? get context => _context;
set context(BuildContext? value) {
_context = value;
secureStorage.setString('ff_context', value.toString());
}
void deleteContext() {
secureStorage.delete(key: 'ff_context');
}
bool _panicOPT = false; bool _panicOPT = false;
bool get panic => _panicOPT; bool get panic => _panicOPT;
set panic(bool value) { set panic(bool value) {
@ -481,6 +495,14 @@ extension FlutterSecureStorageExtensions on FlutterSecureStorage {
Future<void> setDouble(String key, double value) async => Future<void> setDouble(String key, double value) async =>
await writeSync(key: key, value: value.toString()); await writeSync(key: key, value: value.toString());
Future<BuildContext?> getObject(String key) async {
final value = await read(key: key);
if (value == null || value.isEmpty) {
return null;
}
return value as BuildContext;
}
Future<List<String>?> getStringList(String key) async => Future<List<String>?> getStringList(String key) async =>
await read(key: key).then((result) { await read(key: key).then((result) {
if (result == null || result.isEmpty) { if (result == null || result.isEmpty) {

View File

@ -7,13 +7,12 @@ import 'dart:io';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:http/http.dart' as http;
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:http/http.dart' as http;
import 'package:http_parser/http_parser.dart'; import 'package:http_parser/http_parser.dart';
import 'package:mime_type/mime_type.dart'; import 'package:mime_type/mime_type.dart';
import '/flutter_flow/uploaded_file.dart'; import '/flutter_flow/uploaded_file.dart';
import 'get_streamed_response.dart'; import 'get_streamed_response.dart';
enum ApiCallType { enum ApiCallType {
@ -411,7 +410,6 @@ class ApiManager {
ApiCallOptions? options, ApiCallOptions? options,
http.Client? client, http.Client? client,
}) async { }) async {
final callOptions = options ?? final callOptions = options ??
ApiCallOptions( ApiCallOptions(
callName: callName, callName: callName,
@ -512,6 +510,8 @@ class ApiManager {
result = ApiCallResponse(null, {}, -1, exception: e); result = ApiCallResponse(null, {}, -1, exception: e);
} }
log('Params: $params');
log('JsonBody: ${result.jsonBody}');
return result; return result;
} }
} }

View File

@ -0,0 +1,73 @@
import 'dart:developer';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:hub/app_state.dart';
import 'package:hub/backend/api_requests/api_calls.dart';
import 'package:hub/shared/utils/log_util.dart';
import 'notification_service.dart';
Future<void> handleMessage(RemoteMessage message) async {
NotificationService.show(
title: message.notification!.title!,
body: message.notification!.body!,
payload: Map<String, String>.from(message.data));
}
class FirebaseMessagingService {
// Singleton instance
static final FirebaseMessagingService _instance =
FirebaseMessagingService._internal();
// Factory constructor
factory FirebaseMessagingService() => _instance;
// Private constructor
FirebaseMessagingService._internal();
final _firebaseMessaging = FirebaseMessaging.instance;
Future<void> initNotifications() async {
await _firebaseMessaging.requestPermission();
_refreshToken();
_firebaseMessaging.setAutoInitEnabled(false);
_firebaseMessaging.pluginConstants;
FirebaseMessaging.onBackgroundMessage(handleMessage);
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
handleMessage(message);
});
}
Future<void> updateDeviceToken() async {
try {
final String? deviceToken = await _firebaseMessaging.getToken();
if (deviceToken != null) {
AppState().token = deviceToken;
final ApiCallResponse? response = await PhpGroup.updToken.call(
token: AppState().token,
devid: AppState().devUUID,
useruuid: AppState().userUUID);
if (PhpGroup.updToken.error((response?.jsonBody ?? '')) == false) {
log('Token Atualizado com Sucesso!');
} else {
log('Falha ao Atualizar Token: ${response?.jsonBody}');
}
} else {
log('Falha ao Pegar Token do Firebase');
}
} catch (e, s) {
LogUtil.requestAPIFailed("updToken.php", "", "Atualizar Token", e, s);
}
}
void _refreshToken() {
_firebaseMessaging.onTokenRefresh.listen((token) => updateDeviceToken);
}
}

View File

@ -0,0 +1,352 @@
import 'dart:developer';
import 'package:awesome_notifications/awesome_notifications.dart';
import 'package:flutter/material.dart';
import 'package:hub/actions/actions.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/details_component/details_component_widget.dart';
import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_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/shared/utils/dialog_util.dart';
class NotificationService {
static Future<void> initialize() async {
await AwesomeNotifications().initialize(
null,
[
NotificationChannel(
channelKey: 'basic_channel',
channelGroupKey: 'basic_channel',
channelName: 'Basic notifications',
channelDescription: 'Notification channel for tests',
importance: NotificationImportance.Max,
channelShowBadge: true,
playSound: true,
criticalAlerts: true,
onlyAlertOnce: true,
defaultColor: const Color(0xFF9D58D0),
ledColor: Colors.white)
],
channelGroups: [
NotificationChannelGroup(
channelGroupKey: 'basic_channel_group',
channelGroupName: 'group_1')
],
debug: true);
await AwesomeNotifications()
.isNotificationAllowed()
.then((isAllowed) async {
if (!isAllowed) {
await AwesomeNotifications().requestPermissionToSendNotifications();
}
});
await AwesomeNotifications().setListeners(
onActionReceivedMethod: onActionReceivedMethod,
onNotificationCreatedMethod: onNotificationCreatedMethod,
onNotificationDisplayedMethod: onNotificationDisplayedMethod,
onDismissActionReceivedMethod: onDismissActionReceivedMethod);
}
static Future<void> onActionReceivedMethod(
ReceivedAction receivedAction) async {
final payload = receivedAction.payload ?? {};
final extra = receivedAction.body;
final handleClick = payload['click_action'];
final localId = jsonDecode(payload['local']!)['CLI_ID'];
log('payload: $payload');
log('extra: $extra');
switch (handleClick) {
case 'visit_request':
showDialog(
context: AppState().context!,
barrierColor: Colors.transparent,
barrierDismissible: true,
builder: (BuildContext context) {
return Dialog(
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.8,
height: MediaQuery.of(context).size.height * 0.6,
child: DetailsComponentWidget(
buttons: [
FlutterFlowIconButton(
icon: const Icon(Icons.done),
onPressed: () async {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
FFLocalizations.of(context).getVariableText(
ptText: 'Aprovar Visita',
enText: 'Approve Visit',
),
),
content: Text(
FFLocalizations.of(context).getVariableText(
ptText:
'Você tem certeza que deseja aprovar essa visita?',
enText:
'Are you sure you want to approve this visit?',
),
),
backgroundColor: FlutterFlowTheme.of(context)
.primaryBackground,
actions: [
FFButtonWidget(
text: FFLocalizations.of(context)
.getVariableText(
enText: 'No',
ptText: 'Não',
),
onPressed: () {
Navigator.pop(context);
},
options: FFButtonOptions(
width: 100,
height: 40,
color: FlutterFlowTheme.of(context)
.primaryBackground,
textStyle: TextStyle(
color: FlutterFlowTheme.of(context)
.primaryText,
),
borderSide: BorderSide(
color: FlutterFlowTheme.of(context)
.primaryBackground,
width: 1,
),
borderRadius:
BorderRadius.circular(10)),
),
FFButtonWidget(
text: FFLocalizations.of(context)
.getVariableText(
enText: 'Yes',
ptText: 'Sim',
),
onPressed: () async {
log("payload: $payload");
await answersRequest
.call(
context,
payload['referencia'].toString(),
'L',
'Mensagem',
payload['idVisitante'].toString(),
)
.then((value) {
if (value) {
Navigator.pop(context);
Navigator.pop(context);
} else {
Navigator.pop(context);
Navigator.pop(context);
DialogUtil.errorDefault(context);
}
}).catchError((e) {
Navigator.pop(context);
Navigator.pop(context);
DialogUtil.errorDefault(context);
});
},
options: FFButtonOptions(
width: 100,
height: 40,
color: FlutterFlowTheme.of(context)
.primaryBackground,
textStyle: TextStyle(
color: FlutterFlowTheme.of(context)
.primaryText,
),
borderSide: BorderSide(
color: FlutterFlowTheme.of(context)
.primaryBackground,
width: 1,
),
borderRadius: BorderRadius.circular(10),
),
),
],
);
});
},
),
FlutterFlowIconButton(
icon: const Icon(Icons.close),
onPressed: () async {
showAlertDialog(
context,
FFLocalizations.of(context).getVariableText(
ptText: 'Bloquear Visita',
enText: 'Block Visit',
),
FFLocalizations.of(context).getVariableText(
ptText:
'Você tem certeza que deseja bloquear essa visita?',
enText:
'Are you sure you want to block this visit?',
), () async {
await answersRequest
.call(
context,
payload['referencia'].toString(),
'B',
'Mensagem',
payload['idVisitante'].toString(),
)
.then((value) {
if (value) {
Navigator.pop(context);
Navigator.pop(context);
} else {
Navigator.pop(context);
Navigator.pop(context);
DialogUtil.errorDefault(context);
}
}).catchError((e) {
Navigator.pop(context);
Navigator.pop(context);
DialogUtil.errorDefault(context);
});
});
},
),
],
labelsHashMap: Map<String, String>.from({
FFLocalizations.of(context).getVariableText(
enText: 'Visitor',
ptText: 'Visitante',
): payload['nomevisita'],
FFLocalizations.of(context).getVariableText(
enText: 'Reason',
ptText: 'Motivo',
): payload['motivo'],
FFLocalizations.of(context).getVariableText(
enText: 'Message',
ptText: 'Mensagem',
): payload['mensagem'],
}),
imagePath:
'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${payload['documento'] ?? ''}&tipo=E',
statusHashMap: [
{
FFLocalizations.of(context).getVariableText(
enText: 'Active',
ptText: 'Ativo',
): FlutterFlowTheme.of(context).warning,
},
],
),
),
);
});
break;
case 'access':
showDialog(
context: AppState().context!,
barrierColor: Colors.transparent,
barrierDismissible: true,
builder: (BuildContext context) {
return Dialog(
backgroundColor: Colors.transparent,
child: AccessNotificationModalTemplateComponentWidget(
datetime: payload['ACE_DATAHORA'].toString(),
drive: payload['ACI_DESCRICAO'].toString(),
id: payload['USR_TIPO'].toString() == 'O'
? payload['USR_ID'].toString() == ''
? '0'
: payload['USR_ID'].toString()
: payload['USR_DOCUMENTO'].toString() == ''
? '0'
: payload['USR_DOCUMENTO'].toString(),
name: payload['PES_NOME'].toString(),
type: payload['USR_TIPO'],
),
);
});
break;
case 'mensagem':
showDialog(
context: AppState().context!,
barrierColor: Colors.transparent,
barrierDismissible: true,
builder: (BuildContext context) {
return Dialog(
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.3,
height: MediaQuery.of(context).size.height * 0.3,
child: MessageNotificationModalTemplateComponentWidget(
id: localId,
from: payload['remetente'].toString(),
to: payload['destinatario'].toString() == 'O'
? 'Morador'
: 'Visitante',
message:
extra.toString().isEmpty ? 'Unknown' : extra.toString(),
),
),
);
});
break;
default:
log('default');
break;
}
// showAlertDialog(AppState().context!, 'Test', 'Test', () async {});
}
static Future<void> onNotificationCreatedMethod(
ReceivedNotification receivedNotification) async {}
static Future<void> onNotificationDisplayedMethod(
ReceivedNotification receivedNotification) async {}
static Future<void> onDismissActionReceivedMethod(
ReceivedAction receivedAction) async {}
static Future<void> show({
required final String title,
required final String body,
final String? summary,
final Map<String, String>? payload,
final ActionType actionType = ActionType.Default,
final NotificationLayout notificationLayout = NotificationLayout.Default,
final NotificationCategory? category,
final String? bigPicture,
final List<NotificationActionButton>? actionButtons,
final bool scheduled = false,
final int? interval,
}) async {
assert(!scheduled || (scheduled && interval != null));
await AwesomeNotifications().createNotification(
content: NotificationContent(
id: 0,
channelKey: 'basic_channel',
title: title,
body: body,
actionType: actionType,
notificationLayout: notificationLayout,
summary: summary,
category: category,
payload: payload,
bigPicture: bigPicture,
),
actionButtons: actionButtons,
schedule: scheduled
? NotificationInterval(
interval: interval,
timeZone:
await AwesomeNotifications().getLocalTimeZoneIdentifier(),
preciseAlarm: true)
: null);
}
}

View File

@ -1,571 +0,0 @@
import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'dart:io';
import 'dart:math' as math;
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/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/details_component/details_component_widget.dart';
import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart';
import 'package:hub/components/templates_components/details_component/details_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/internationalization.dart';
import 'package:rxdart/rxdart.dart';
//
class PushNotificationService {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
final Subject<RemoteMessage> _onMessage = BehaviorSubject<RemoteMessage>();
final BehaviorSubject<BuildContext> _context =
BehaviorSubject<BuildContext>();
final BehaviorSubject<Map<String, dynamic>> _notificationDetails =
BehaviorSubject<Map<String, dynamic>>();
PushNotificationService() {
_initializeLocalNotifications(_context);
_createNotificationChannels();
}
Subject<RemoteMessage> getOnMessage() {
return _onMessage;
}
Future<void> initialize(BuildContext context) async {
_context.add(context);
await _requestPermissions();
_listenToForegroundMessages(context);
_listenToBackgroundMessages();
_listenToNotificationClicks(context);
await updateDeviceToken();
}
Future<void> _requestPermissions() async {
NotificationSettings settings = await _firebaseMessaging.requestPermission(
alert: true,
badge: true,
sound: true,
);
if (settings.authorizationStatus == AuthorizationStatus.authorized) {
} else {}
}
Map<String, dynamic> validJsonFromString(String? jsonString) {
if (jsonString == null || jsonString.isEmpty) {
return {};
}
// Passo 1 e 2: Adiciona aspas duplas em torno das chaves e valores que não estão corretamente delimitados
String correctedJson = jsonString.replaceAllMapped(
RegExp(r'([a-zA-Z0-9_]+)\s*:\s*([^",\}\]]+)'), (match) {
var key = '"${match[1]!}"'; // Chaves sempre recebem aspas
var value = match[2]!.trim();
// Verifica se o valor é uma string (não numérica, booleana, nula ou objeto JSON)
bool isStringValue = !RegExp(r'^-?\d+(\.\d+)?$').hasMatch(value) &&
value != 'true' &&
value != 'false' &&
value != 'null' &&
!value.startsWith('{') &&
!value.endsWith('}');
// Adiciona aspas duplas em torno do valor se for uma string
String quotedValue = isStringValue ? '"$value"' : value;
return '$key: $quotedValue';
});
// Passo 3: Tratar corretamente strings JSON aninhadas
correctedJson =
correctedJson.replaceAllMapped(RegExp(r'"{([^"]+)}"'), (match) {
// Remove as aspas duplas extras em torno de objetos JSON aninhados
return '{${match[1]!}}';
});
try {
// Passo 4: Decodificar o JSON corrigido
return jsonDecode(correctedJson);
} catch (e) {
return {};
}
}
void _initializeLocalNotifications(
BehaviorSubject<BuildContext> context) async {
while (context.valueOrNull == null) {
await Future.delayed(Duration(milliseconds: 100));
}
var initializationSettingsAndroid =
AndroidInitializationSettings('mipmap/ic_fre_black');
var initializationSettingsIOS = DarwinInitializationSettings(
requestAlertPermission: true,
requestBadgePermission: true,
requestSoundPermission: true,
);
var initializationSettings = InitializationSettings(
android: initializationSettingsAndroid,
iOS: initializationSettingsIOS,
);
_flutterLocalNotificationsPlugin.initialize(
initializationSettings,
onDidReceiveNotificationResponse: (NotificationResponse response) async {
if (response.payload != null) {
try {
Map<String, dynamic> message = validJsonFromString(response.payload!);
var data = _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage
_handleNotificationClick(message, extra: data.value);
} catch (e) {}
}
},
);
}
void _createNotificationChannels() {
List<String> actions = [
'visit_request',
'visit_response',
'access',
'mensagem',
'enroll_cond',
'miscellaneous'
];
for (String action in actions) {
_createNotificationChannel(action, "Channel for $action");
}
}
void _createNotificationChannel(String channelId, String channelName) {
_flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.createNotificationChannel(
AndroidNotificationChannel(
channelId, // Use o click_action como ID do canal
channelName, // Nome descritivo baseado no click_action
description: 'Channel for $channelName notifications',
importance: Importance.max,
),
);
}
void _listenToForegroundMessages(BuildContext context) {
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
log("Message Foregroud: ${message.data}");
_onMessage.add(message);
_notificationDetails.add(message.toMap()['notification']);
_showNotification(message);
});
}
void _listenToBackgroundMessages() {
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
}
void _listenToNotificationClicks(BuildContext context) {
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
_onMessage.add(message);
NotificationHandler().handleMessage(message.data, context);
});
}
void configureTokenRefresh() {
_firebaseMessaging.onTokenRefresh
.listen(_handleTokenUpdate)
.onError((err) {});
}
Future<void> _updateToken(String token) async {
FFAppState().token = token;
final ApiCallResponse? response = await _updateTokenOnServer(token);
if (_isTokenUpdateSuccessful(response)) {
} else {}
}
Future<void> _handleTokenUpdate(String newToken) async {
await _updateToken(newToken);
}
Future<void> updateDeviceToken() async {
configureTokenRefresh();
final NotificationSettings settings =
await _requestNotificationPermission();
if (Platform.isIOS) await _fetchAndLogApnsToken(settings);
final String? deviceToken = await _firebaseMessaging.getToken();
if (deviceToken != null) {
await _updateToken(deviceToken);
} else {}
}
Future<NotificationSettings> _requestNotificationPermission() async {
final NotificationSettings settings =
await _firebaseMessaging.requestPermission();
log(settings.authorizationStatus == AuthorizationStatus.authorized
? 'User granted permission'
: 'User declined or has not accepted permission');
return settings;
}
Future<void> _fetchAndLogApnsToken(NotificationSettings settings) async {
if (settings.authorizationStatus == AuthorizationStatus.authorized) {
final String? apnsToken = await _firebaseMessaging.getAPNSToken();
log(apnsToken != null
? 'APNS Token: $apnsToken'
: 'Failed to get APNS token');
}
}
Future<ApiCallResponse?> _updateTokenOnServer(String deviceToken) async {
return await PhpGroup.updToken.call(
token: deviceToken,
devid: FFAppState().devUUID,
useruuid: FFAppState().userUUID,
);
}
bool _isTokenUpdateSuccessful(ApiCallResponse? response) {
return PhpGroup.updToken.error((response?.jsonBody ?? '')) == false;
}
String _getChannelIdBasedOnClickAction(String clickAction) {
final baseId = clickAction.hashCode;
return 'channel_$baseId';
}
void _showNotification(RemoteMessage message) async {
String channelId =
_getChannelIdBasedOnClickAction(message.data['click_action']);
var androidDetails = AndroidNotificationDetails(
channelId,
'Channel Name for $channelId',
channelDescription: 'Channel Description for $channelId',
importance: Importance.max,
priority: Priority.high,
);
var iOSDetails = DarwinNotificationDetails();
var generalNotificationDetails = NotificationDetails(android: androidDetails, iOS: iOSDetails);
await _flutterLocalNotificationsPlugin.show(
// DateTime.now().millisecondsSinceEpoch % (1 << 31),
math.Random().nextInt(1 << 30),
message.notification?.title,
message.notification?.body,
generalNotificationDetails,
payload: message.data.toString(),
);
}
_handleNotificationClick(Map<String, dynamic> payload,
{Map<String, dynamic> extra = const {}}) {
switch (payload.isNotEmpty) {
case true:
// Print the 'data' property
// Handle the message data as needed
NotificationHandler().handleMessage(payload, _context.value, extra: extra.isEmpty ? {} : extra);
// Access the 'data' property of 'RemoteMessage'
case false:
// Handle the message notification as needed
break;
}
}
static Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
log("Mensagem firebase: $message");
}
}
class NotificationHandler {
void handleMessage(Map<String, dynamic> message, BuildContext context, {Map<String, dynamic> extra = const {}}) {
message.forEach((key, value) {});
switch (message['click_action']) {
case 'visit_request':
_showVisitRequestDialog(message, context);
break;
case '':
break;
case 'access':
_showAcessNotificationModal(message, context);
break;
case 'mensagem':
log("Extra Handle Message: $extra");
_showMessageNotificationDialog(message, context, extra);
break;
case 'enroll_cond':
break;
default:
}
}
String _getIdBasedOnUserType(Map<String, dynamic> message) {
if (message['USR_TIPO'].toString() == 'O') {
// Retorna USR_ID se não estiver vazio/nulo, caso contrário retorna '0'
return message['USR_ID'].toString().isEmpty
? '0'
: message['USR_ID'].toString();
} else {
// Retorna USR_DOCUMENTO se não estiver vazio/nulo, caso contrário retorna '0'
return message['USR_DOCUMENTO'].toString().isEmpty
? '0'
: message['USR_DOCUMENTO'].toString();
}
}
void _showAcessNotificationModal(
Map<String, dynamic> message, BuildContext context) {
showDialog(
context: context,
builder: (BuildContext context) {
_getIdBasedOnUserType(message);
return Dialog(
backgroundColor: Colors.transparent,
child: AccessNotificationModalTemplateComponentWidget(
datetime: message['ACE_DATAHORA'].toString(),
drive: message['ACI_DESCRICAO'].toString(),
id: message['USR_TIPO'].toString() == 'O'
? message['USR_ID'].toString() == ''
? '0'
: message['USR_ID'].toString()
: message['USR_DOCUMENTO'].toString() == ''
? '0'
: message['USR_DOCUMENTO'].toString(),
name: message['PES_NOME'].toString(),
type: message['USR_TIPO'],
));
},
);
}
void _showMessageNotificationDialog(Map<String, dynamic> message, BuildContext context, Map<String, dynamic> extra) {
showDialog(
useSafeArea: true,
barrierDismissible: true,
context: context,
builder: (BuildContext context) {
String localId = '';
try {
localId = jsonDecode(message['local'])['CLI_ID'];
} catch(e, s) {
localId = message['local']['CLI_ID'].toString();
}
log("Mensagem: $message");
log("Extra: $extra");
return GestureDetector(
onTap: () => Navigator.of(context).pop(),
child: SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: Dialog(
backgroundColor: Colors.transparent,
child: GestureDetector(
onTap: () => Navigator.of(context).pop(),
child: SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: MessageNotificationModalTemplateComponentWidget(
id: localId,
from: message['remetente'].toString(),
to: message['destinatario'].toString() == 'O'
? 'Morador'
: 'Visitante',
message: extra['body'].toString().isEmpty
? 'Unknown'
: extra['body'].toString(),
),
),
),
),
),
);
},
);
}
void _showVisitRequestDialog(
Map<String, dynamic> message, BuildContext context) {
showDialog(
context: context,
barrierDismissible: true,
// barrierColor: Colors.green,
builder: (BuildContext context) {
_getIdBasedOnUserType(message);
return Dialog(
backgroundColor: Colors.transparent,
child: DetailsComponentWidget(
buttons: [
FlutterFlowIconButton(
icon: const Icon(Icons.done),
onPressed: () async {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
FFLocalizations.of(context).getVariableText(
ptText: 'Aprovar Visita',
enText: 'Approve Visit',
),
),
content: Text(
FFLocalizations.of(context).getVariableText(
ptText:
'Você tem certeza que deseja aprovar essa visita?',
enText:
'Are you sure you want to approve this visit?',
),
),
backgroundColor:
FlutterFlowTheme.of(context).primaryBackground,
actions: [
FFButtonWidget(
text: FFLocalizations.of(context).getVariableText(
enText: 'No',
ptText: 'Não',
),
onPressed: () {
Navigator.pop(context);
},
options: FFButtonOptions(
width: 100,
height: 40,
color: FlutterFlowTheme.of(context)
.primaryBackground,
textStyle: TextStyle(
color: FlutterFlowTheme.of(context)
.primaryText,
),
borderSide: BorderSide(
color: FlutterFlowTheme.of(context)
.primaryBackground,
width: 1,
),
borderRadius: BorderRadius.circular(10)),
),
FFButtonWidget(
text: FFLocalizations.of(context).getVariableText(
enText: 'Yes',
ptText: 'Sim',
),
onPressed: () async {
await answersRequest.call(
context,
message['referencia'].toString(),
'L',
'Mensagem',
message['idVisitante'].toString(),
);
},
options: FFButtonOptions(
width: 100,
height: 40,
color: FlutterFlowTheme.of(context)
.primaryBackground,
textStyle: TextStyle(
color:
FlutterFlowTheme.of(context).primaryText,
),
borderSide: BorderSide(
color: FlutterFlowTheme.of(context)
.primaryBackground,
width: 1,
),
borderRadius: BorderRadius.circular(10),
),
),
],
);
});
},
),
FlutterFlowIconButton(
icon: const Icon(Icons.close),
onPressed: () async {
showAlertDialog(
context,
FFLocalizations.of(context).getVariableText(
ptText: 'Bloquear Visita',
enText: 'Block Visit',
),
FFLocalizations.of(context).getVariableText(
ptText:
'Você tem certeza que deseja bloquear essa visita?',
enText: 'Are you sure you want to block this visit?',
), () async {
await answersRequest.call(
context,
message['referencia'].toString(),
'B',
'Mensagem',
message['idVisitante'].toString(),
);
});
},
),
],
labelsHashMap: Map<String, String>.from({
FFLocalizations.of(context).getVariableText(
enText: 'Visitor',
ptText: 'Visitante',
): message['nomevisita'],
FFLocalizations.of(context).getVariableText(
enText: 'Reason',
ptText: 'Motivo',
): message['motivo'],
FFLocalizations.of(context).getVariableText(
enText: 'Message',
ptText: 'Mensagem',
): message['mensagem'],
}),
imagePath:
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${message['documento'] ?? ''}&tipo=E',
statusHashMap: [
{
FFLocalizations.of(context).getVariableText(
enText: 'Active',
ptText: 'Ativo',
): FlutterFlowTheme.of(context).warning,
},
],
// changeStatusAction: answersRequest,
),
);
},
);
}
}
class PushNotificationManager {
final StreamController<RemoteMessage> _onMessageReceivedController =
StreamController<RemoteMessage>.broadcast();
Stream<RemoteMessage> get onMessageReceived =>
_onMessageReceivedController.stream;
PushNotificationManager() {
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
_onMessageReceivedController.add(message);
});
}
void dispose() {
_onMessageReceivedController.close();
}
}

View File

@ -1,14 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart'; import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:provider/provider.dart';
import '/backend/api_requests/api_calls.dart'; import '/backend/api_requests/api_calls.dart';
import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_icon_button.dart';
import '/flutter_flow/flutter_flow_theme.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 { class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget {
const BottomArrowLinkedLocalsComponentWidget({super.key}); const BottomArrowLinkedLocalsComponentWidget({super.key});
@ -44,7 +43,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return Align( return Align(
alignment: const AlignmentDirectional(0.0, 1.0), alignment: const AlignmentDirectional(0.0, 1.0),
@ -105,8 +104,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState
Expanded( Expanded(
child: FutureBuilder<ApiCallResponse>( child: FutureBuilder<ApiCallResponse>(
future: PhpGroup.getLocalsCall.call( future: PhpGroup.getLocalsCall.call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
), ),
builder: (context, snapshot) { builder: (context, snapshot) {
// Customize what your widget looks like when it's loading. // Customize what your widget looks like when it's loading.
@ -156,17 +155,17 @@ class _BottomArrowLinkedLocalsComponentWidgetState
hoverColor: Colors.transparent, hoverColor: Colors.transparent,
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
onTap: () async { onTap: () async {
FFAppState().cliUUID = getJsonField( AppState().cliUUID = getJsonField(
eachLocalsItem, eachLocalsItem,
r'''$.CLI_ID''', r'''$.CLI_ID''',
).toString(); ).toString();
setState(() {}); setState(() {});
FFAppState().local = getJsonField( AppState().local = getJsonField(
eachLocalsItem, eachLocalsItem,
r'''$.CLI_NOME''', r'''$.CLI_NOME''',
).toString(); ).toString();
setState(() {}); setState(() {});
FFAppState().ownerUUID = getJsonField( AppState().ownerUUID = getJsonField(
eachLocalsItem, eachLocalsItem,
r'''$.CLU_OWNER_ID''', r'''$.CLU_OWNER_ID''',
).toString(); ).toString();

View File

@ -43,7 +43,7 @@ class _LocalProfileComponentWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return Container( return Container(
decoration: const BoxDecoration(), decoration: const BoxDecoration(),
@ -92,7 +92,7 @@ class _LocalProfileComponentWidgetState
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(200.0), borderRadius: BorderRadius.circular(200.0),
child: Image.network( child: Image.network(
'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', 'https://freaccess.com.br/freaccess/Images/Clients/${AppState().cliUUID}.png',
width: 80.0, width: 80.0,
height: 80.0, height: 80.0,
fit: BoxFit.cover, fit: BoxFit.cover,
@ -117,7 +117,7 @@ class _LocalProfileComponentWidgetState
children: [ children: [
Text( Text(
valueOrDefault<String>( valueOrDefault<String>(
functions.convertToUppercase(FFAppState().local), functions.convertToUppercase(AppState().local),
'NOME DO LOCAL', 'NOME DO LOCAL',
), ),
style: FlutterFlowTheme.of(context).labelMedium.override( style: FlutterFlowTheme.of(context).labelMedium.override(

View File

@ -355,9 +355,9 @@ class MessageWellNotifier extends StateNotifier<MessageWellState> {
if (state.pageNumber <= totalPageNumber) { if (state.pageNumber <= totalPageNumber) {
var apiCall = GetMessagesCall(); var apiCall = GetMessagesCall();
var response = await apiCall.call( var response = await apiCall.call(
devUUID: FFAppState().devUUID.toString(), devUUID: AppState().devUUID.toString(),
userUUID: FFAppState().userUUID.toString(), userUUID: AppState().userUUID.toString(),
cliID: FFAppState().cliUUID.toString(), cliID: AppState().cliUUID.toString(),
atividade: 'getMensagens', atividade: 'getMensagens',
pageSize: '100', pageSize: '100',
pageNumber: state.pageNumber.toString(), pageNumber: state.pageNumber.toString(),

View File

@ -99,7 +99,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
final visitorsData = widget.visitorJsonList!.toList().take(2).toList(); final visitorsData = widget.visitorJsonList!.toList().take(2).toList();
final visitorsDataItem = visitorsData[0]; final visitorsDataItem = visitorsData[0];
@ -178,7 +178,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
fadeInDuration: const Duration(milliseconds: 500), fadeInDuration: const Duration(milliseconds: 500),
fadeOutDuration: const Duration(milliseconds: 500), fadeOutDuration: const Duration(milliseconds: 500),
imageUrl: valueOrDefault<String>( imageUrl: valueOrDefault<String>(
"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=${AppState().devUUID}&userUUID=${AppState().userUUID}&cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
visitorsDataItem, visitorsDataItem,
r'''$.VTE_DOCUMENTO''', r'''$.VTE_DOCUMENTO''',
).toString()}&tipo=E", ).toString()}&tipo=E",
@ -789,8 +789,8 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
onPressed: () async { onPressed: () async {
_model.postScheduleVisit = _model.postScheduleVisit =
await PhpGroup.postScheduleVisitCall.call( await PhpGroup.postScheduleVisitCall.call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
atividade: 'putVisita', atividade: 'putVisita',
devDesc: widget.visitObsStr, devDesc: widget.visitObsStr,
idVisitante: widget.visitorStrList, idVisitante: widget.visitorStrList,
@ -801,7 +801,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
idMotivo: extractIdToStr(widget.visitResonStr!), idMotivo: extractIdToStr(widget.visitResonStr!),
idNAC: extractIdToStr(widget.visitLevelStr!), idNAC: extractIdToStr(widget.visitLevelStr!),
obs: widget.visitObsStr, obs: widget.visitObsStr,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
); );
if (PhpGroup.postScheduleVisitCall.error( if (PhpGroup.postScheduleVisitCall.error(

View File

@ -5,13 +5,11 @@ import 'package:hub/components/organism_components/up_arrow_linked_locals_compon
import 'package:hub/flutter_flow/flutter_flow_theme.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_util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class UpArrowLinkedLocalsComponentWidget extends StatefulWidget { class UpArrowLinkedLocalsComponentWidget extends StatefulWidget {
const UpArrowLinkedLocalsComponentWidget({super.key}); const UpArrowLinkedLocalsComponentWidget({super.key});
@ -45,7 +43,7 @@ class _UpArrowLinkedLocalsComponentWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return Align( return Align(
alignment: const AlignmentDirectional(0.0, -1.0), alignment: const AlignmentDirectional(0.0, -1.0),
@ -82,8 +80,8 @@ class _UpArrowLinkedLocalsComponentWidgetState
), ),
child: FutureBuilder<ApiCallResponse>( child: FutureBuilder<ApiCallResponse>(
future: PhpGroup.getLocalsCall.call( future: PhpGroup.getLocalsCall.call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
), ),
builder: (context, snapshot) { builder: (context, snapshot) {
// Customize what your widget looks like when it's loading. // Customize what your widget looks like when it's loading.
@ -134,12 +132,12 @@ class _UpArrowLinkedLocalsComponentWidgetState
hoverColor: Colors.transparent, hoverColor: Colors.transparent,
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
onTap: () async { onTap: () async {
FFAppState().cliUUID = getJsonField( AppState().cliUUID = getJsonField(
eachLocalsItem, eachLocalsItem,
r'''$.CLI_ID''', r'''$.CLI_ID''',
).toString(); ).toString();
setState(() {}); setState(() {});
FFAppState().local = getJsonField( AppState().local = getJsonField(
eachLocalsItem, eachLocalsItem,
r'''$.CLI_NOME''', r'''$.CLI_NOME''',
).toString(); ).toString();
@ -150,7 +148,8 @@ class _UpArrowLinkedLocalsComponentWidgetState
width: 50.0, width: 50.0,
height: double.infinity, height: double.infinity,
decoration: const BoxDecoration(), decoration: const BoxDecoration(),
alignment: const AlignmentDirectional(0.0, 0.0), alignment:
const AlignmentDirectional(0.0, 0.0),
child: Column( child: Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: mainAxisAlignment:
@ -162,7 +161,8 @@ class _UpArrowLinkedLocalsComponentWidgetState
decoration: BoxDecoration( decoration: BoxDecoration(
color: FlutterFlowTheme.of(context) color: FlutterFlowTheme.of(context)
.primaryText, .primaryText,
borderRadius: const BorderRadius.only( borderRadius:
const BorderRadius.only(
bottomLeft: Radius.circular(25.0), bottomLeft: Radius.circular(25.0),
bottomRight: bottomRight:
Radius.circular(25.0), Radius.circular(25.0),
@ -177,7 +177,8 @@ class _UpArrowLinkedLocalsComponentWidgetState
), ),
), ),
child: ClipRRect( child: ClipRRect(
borderRadius: const BorderRadius.only( borderRadius:
const BorderRadius.only(
bottomLeft: Radius.circular(25.0), bottomLeft: Radius.circular(25.0),
bottomRight: bottomRight:
Radius.circular(25.0), Radius.circular(25.0),
@ -192,14 +193,14 @@ class _UpArrowLinkedLocalsComponentWidgetState
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
fit: BoxFit.fill, fit: BoxFit.fill,
alignment: const Alignment(0.0, 0.0), alignment:
const Alignment(0.0, 0.0),
), ),
), ),
), ),
Padding( Padding(
padding: padding: const EdgeInsetsDirectional
const EdgeInsetsDirectional.fromSTEB( .fromSTEB(0.0, 10.0, 0.0, 0.0),
0.0, 10.0, 0.0, 0.0),
child: Text( child: Text(
getJsonField( getJsonField(
eachLocalsItem, eachLocalsItem,

View File

@ -4,7 +4,6 @@ import 'access_notification_modal_template_component_widget.dart'
show AccessNotificationModalTemplateComponentWidget; show AccessNotificationModalTemplateComponentWidget;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class AccessNotificationModalTemplateComponentModel class AccessNotificationModalTemplateComponentModel
extends FlutterFlowModel<AccessNotificationModalTemplateComponentWidget> { extends FlutterFlowModel<AccessNotificationModalTemplateComponentWidget> {
/// State fields for stateful widgets in this component. /// State fields for stateful widgets in this component.
@ -55,9 +54,9 @@ class AccessNotificationModalTemplateComponentModel
ApiCallResponse? visitRequest; ApiCallResponse? visitRequest;
visitRequest = await PhpGroup.respondeSolicitacaoCall.call( visitRequest = await PhpGroup.respondeSolicitacaoCall.call(
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
cliUUID: FFAppState().cliUUID, cliUUID: AppState().cliUUID,
atividade: 'respondeSolicitacao', atividade: 'respondeSolicitacao',
referencia: refUUID, referencia: refUUID,
tarefa: actionValue, tarefa: actionValue,

View File

@ -7,9 +7,6 @@ import 'package:provider/provider.dart';
import 'access_notification_modal_template_component_model.dart'; import 'access_notification_modal_template_component_model.dart';
export 'access_notification_modal_template_component_model.dart'; export 'access_notification_modal_template_component_model.dart';
class AccessNotificationModalTemplateComponentWidget extends StatefulWidget { class AccessNotificationModalTemplateComponentWidget extends StatefulWidget {
const AccessNotificationModalTemplateComponentWidget({ const AccessNotificationModalTemplateComponentWidget({
super.key, super.key,
@ -70,17 +67,13 @@ class _AccessNotificationModalTemplateComponentWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
String labelTypeResident = FFLocalizations.of(context).getVariableText( String labelTypeResident = FFLocalizations.of(context)
enText: 'Resident', .getVariableText(enText: 'Resident', ptText: 'Morador');
ptText: 'Morador'
);
String labelTypeVisitor = FFLocalizations.of(context).getVariableText( String labelTypeVisitor = FFLocalizations.of(context)
enText: 'Visitor', .getVariableText(enText: 'Visitor', ptText: 'Visitante');
ptText: 'Visitante'
);
return Align( return Align(
alignment: const AlignmentDirectional(0.0, 0.0), alignment: const AlignmentDirectional(0.0, 0.0),
@ -118,9 +111,9 @@ class _AccessNotificationModalTemplateComponentWidgetState
fadeOutDuration: const Duration(milliseconds: 100), fadeOutDuration: const Duration(milliseconds: 100),
imageUrl: valueOrDefault<String>( imageUrl: valueOrDefault<String>(
// widget.type == 'O' // widget.type == 'O'
// ? 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.id}&tipo=O' // ? 'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${widget.id}&tipo=O'
// : 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.id}&tipo=E', // : 'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${widget.id}&tipo=E',
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.id}&tipo=${widget.type}', 'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${widget.id}&tipo=${widget.type}',
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
), ),
fit: BoxFit.cover, fit: BoxFit.cover,
@ -194,7 +187,10 @@ class _AccessNotificationModalTemplateComponentWidgetState
children: [ children: [
Expanded( Expanded(
child: TextFormField( child: TextFormField(
controller: TextEditingController(text: widget.type == 'O' ? labelTypeResident : labelTypeVisitor), controller: TextEditingController(
text: widget.type == 'O'
? labelTypeResident
: labelTypeVisitor),
focusNode: _model.textFieldFocusNode2, focusNode: _model.textFieldFocusNode2,
autofocus: false, autofocus: false,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
@ -329,7 +325,7 @@ class _AccessNotificationModalTemplateComponentWidgetState
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
labelText: FFLocalizations.of(context).getVariableText( labelText: FFLocalizations.of(context).getVariableText(
enText: 'Access Sector', enText: 'Access Sector',
ptText: 'Setor de Acesso', ptText: 'Setor de Acesso',
), ),
labelStyle: FlutterFlowTheme.of(context) labelStyle: FlutterFlowTheme.of(context)

View File

@ -83,7 +83,7 @@ class _CardItemTemplateComponentWidgetState
Widget build(BuildContext context) { Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width; double screenWidth = MediaQuery.of(context).size.width;
double screenHeight = MediaQuery.of(context).size.height; double screenHeight = MediaQuery.of(context).size.height;
context.watch<FFAppState>(); context.watch<AppState>();
return InkWell( return InkWell(
splashColor: Colors.transparent, splashColor: Colors.transparent,
focusColor: Colors.transparent, focusColor: Colors.transparent,

View File

@ -10,7 +10,6 @@ import 'package:google_fonts/google_fonts.dart';
import 'change_pass_model.dart'; import 'change_pass_model.dart';
export 'change_pass_model.dart'; export 'change_pass_model.dart';
class PassKeyTemplateWidget extends StatefulWidget { class PassKeyTemplateWidget extends StatefulWidget {
const PassKeyTemplateWidget({ const PassKeyTemplateWidget({
super.key, super.key,
@ -20,12 +19,10 @@ class PassKeyTemplateWidget extends StatefulWidget {
final Future Function(String key)? toggleActionStatus; final Future Function(String key)? toggleActionStatus;
@override @override
State<PassKeyTemplateWidget> createState() => State<PassKeyTemplateWidget> createState() => _PassKeyTemplateWidgetState();
_PassKeyTemplateWidgetState();
} }
class _PassKeyTemplateWidgetState class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
extends State<PassKeyTemplateWidget> {
late PassKeyTemplateComponentModel _model; late PassKeyTemplateComponentModel _model;
@override @override
@ -82,7 +79,8 @@ class _PassKeyTemplateWidgetState
tablet: false, tablet: false,
)) ))
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
child: InkWell( child: InkWell(
splashColor: Colors.transparent, splashColor: Colors.transparent,
focusColor: Colors.transparent, focusColor: Colors.transparent,
@ -104,8 +102,8 @@ class _PassKeyTemplateWidgetState
), ),
), ),
Padding( Padding(
padding: padding: const EdgeInsetsDirectional.fromSTEB(
const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), 12.0, 0.0, 0.0, 0.0),
child: Text( child: Text(
'', '',
style: style:
@ -125,11 +123,14 @@ class _PassKeyTemplateWidgetState
), ),
), ),
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
child: Text( child: Text(
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
enText: 'INSERT PASSWORD', enText: 'INSERT PASSWORD',
ptText: FFAppState().accessPass != '' ? 'ALTERAR SENHA' : 'ADICIONAR SENHA', ptText: AppState().accessPass != ''
? 'ALTERAR SENHA'
: 'ADICIONAR SENHA',
), ),
style: FlutterFlowTheme.of(context).headlineMedium.override( style: FlutterFlowTheme.of(context).headlineMedium.override(
fontFamily: 'Outfit', fontFamily: 'Outfit',
@ -142,12 +143,12 @@ class _PassKeyTemplateWidgetState
), ),
), ),
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
child: Text( child: Text(
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
enText: 'Enter your password to continue', enText: 'Enter your password to continue',
ptText: 'Digite sua senha para continuar' ptText: 'Digite sua senha para continuar'),
),
style: FlutterFlowTheme.of(context).labelMedium.override( style: FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans', fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
@ -165,7 +166,8 @@ class _PassKeyTemplateWidgetState
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), padding: const EdgeInsetsDirectional.fromSTEB(
16.0, 12.0, 16.0, 0.0),
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
child: TextFormField( child: TextFormField(
@ -175,7 +177,7 @@ class _PassKeyTemplateWidgetState
'_model.keyTextFieldTextController', '_model.keyTextFieldTextController',
const Duration(milliseconds: 2000), const Duration(milliseconds: 2000),
() { () {
if (mounted) setState(() {}); if (mounted) setState(() {});
}, },
), ),
autofillHints: const [AutofillHints.password], autofillHints: const [AutofillHints.password],
@ -184,120 +186,120 @@ class _PassKeyTemplateWidgetState
obscureText: !_model.keyTextFieldVisibility1, obscureText: !_model.keyTextFieldVisibility1,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
labelText: FFLocalizations.of(context).getVariableText( labelText:
ptText: 'Senha', FFLocalizations.of(context).getVariableText(
enText: 'Password', ptText: 'Senha',
enText: 'Password',
), ),
labelStyle: FlutterFlowTheme.of(context) labelStyle: FlutterFlowTheme.of(context)
.labelMedium .labelMedium
.override( .override(
fontFamily: 'Plus Jakarta Sans', fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0, fontSize: 14.0,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap() useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'), .containsKey('Plus Jakarta Sans'),
), ),
hintText: FFLocalizations.of(context).getVariableText( hintText: FFLocalizations.of(context).getVariableText(
ptText: 'Digite a sua senha.....', ptText: 'Digite a sua senha.....',
enText: 'Enter your password.....', enText: 'Enter your password.....',
), ),
hintStyle: FlutterFlowTheme.of(context) hintStyle: FlutterFlowTheme.of(context)
.labelMedium .labelMedium
.override( .override(
fontFamily: 'Plus Jakarta Sans', fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0, fontSize: 14.0,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap() useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'), .containsKey('Plus Jakarta Sans'),
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: FlutterFlowTheme.of(context).primary, color: FlutterFlowTheme.of(context).primary,
width: 2.0, width: 2.0,
), ),
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: FlutterFlowTheme.of(context).primary, color: FlutterFlowTheme.of(context).primary,
width: 2.0, width: 2.0,
), ),
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error, color: FlutterFlowTheme.of(context).error,
width: 2.0, width: 2.0,
), ),
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error, color: FlutterFlowTheme.of(context).error,
width: 2.0, width: 2.0,
), ),
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
filled: true, filled: true,
fillColor: fillColor:
FlutterFlowTheme.of(context).primaryBackground, FlutterFlowTheme.of(context).primaryBackground,
contentPadding: contentPadding: const EdgeInsetsDirectional.fromSTEB(
const EdgeInsetsDirectional.fromSTEB(
24.0, 24.0, 20.0, 24.0), 24.0, 24.0, 20.0, 24.0),
suffixIcon: InkWell( suffixIcon: InkWell(
onTap: () => setState( onTap: () => setState(
() => _model.keyTextFieldVisibility1 = () => _model.keyTextFieldVisibility1 =
!_model.keyTextFieldVisibility1, !_model.keyTextFieldVisibility1,
), ),
focusNode: FocusNode(skipTraversal: true), focusNode: FocusNode(skipTraversal: true),
child: Icon( child: Icon(
_model.keyTextFieldVisibility1 _model.keyTextFieldVisibility1
? Icons.visibility_outlined ? Icons.visibility_outlined
: Icons.visibility_off_outlined, : Icons.visibility_off_outlined,
color: FlutterFlowTheme.of(context).accent1, color: FlutterFlowTheme.of(context).accent1,
size: 22.0, size: 22.0,
), ),
), ),
), ),
style: FlutterFlowTheme.of(context).bodyMedium.override( style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: 'Plus Jakarta Sans', fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0, fontSize: 14.0,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap() useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'), .containsKey('Plus Jakarta Sans'),
), ),
maxLength: 4, maxLength: 4,
maxLengthEnforcement: MaxLengthEnforcement.enforced, maxLengthEnforcement: MaxLengthEnforcement.enforced,
buildCounter: (context, buildCounter: (context,
{required currentLength, {required currentLength,
required isFocused, required isFocused,
maxLength}) => maxLength}) =>
null, null,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
cursorColor: FlutterFlowTheme.of(context).primary, cursorColor: FlutterFlowTheme.of(context).primary,
validator: _model.keyTextFieldTextControllerValidator1 validator: _model.keyTextFieldTextControllerValidator1
.asValidator(context), .asValidator(context),
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow(RegExp('[0-9]')), FilteringTextInputFormatter.allow(RegExp('[0-9]')),
LengthLimitingTextInputFormatter(4), LengthLimitingTextInputFormatter(4),
], ],
), ),
), ),
), ),
], ],
), ),
), ),
Align( Align(
alignment: const AlignmentDirectional(0.0, 0.0), alignment: const AlignmentDirectional(0.0, 0.0),
child: Padding( child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), padding:
const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
child: FFButtonWidget( child: FFButtonWidget(
onPressed: () async { onPressed: () async {
if (_model.formKey.currentState == null || if (_model.formKey.currentState == null ||
@ -305,20 +307,24 @@ class _PassKeyTemplateWidgetState
return; return;
} }
await widget.toggleActionStatus?.call( await widget.toggleActionStatus?.call(
_model.keyTextFieldTextController1.text.isEmpty ? _model.keyTextFieldTextController2.text : _model.keyTextFieldTextController1.text, _model.keyTextFieldTextController1.text.isEmpty
? _model.keyTextFieldTextController2.text
: _model.keyTextFieldTextController1.text,
); );
Navigator.pop(context, true); Navigator.pop(context, true);
}, },
text: FFLocalizations.of(context).getVariableText( text: FFLocalizations.of(context).getVariableText(
ptText: FFAppState().accessPass != '' ? 'Alterar' : 'Adicionar', ptText:
enText: FFAppState().accessPass != '' ? 'Change' : 'Add', AppState().accessPass != '' ? 'Alterar' : 'Adicionar',
enText: AppState().accessPass != '' ? 'Change' : 'Add',
), ),
options: FFButtonOptions( options: FFButtonOptions(
width: 270.0, width: 270.0,
height: 50.0, height: 50.0,
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), padding: const EdgeInsetsDirectional.fromSTEB(
iconPadding: 0.0, 0.0, 0.0, 0.0),
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), color: const Color(0xFF1AAB5F),
textStyle: FlutterFlowTheme.of(context).titleSmall.override( textStyle: FlutterFlowTheme.of(context).titleSmall.override(
fontFamily: 'Plus Jakarta Sans', fontFamily: 'Plus Jakarta Sans',

View File

@ -109,12 +109,11 @@ Widget buildDetails(dynamic visitaWrapItem, BuildContext context, Future<dynamic
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => ScheduleCompleteVisitPageWidget( builder: (context) => ScheduleCompleteVisitPageWidget(
dropdownValue1: visitaWrapItem['MOT_DESCRICAO'], dropdownValue1: visitaWrapItem['MOT_DESCRICAO'],
dropdownValue2: visitaWrapItem['NAC_DESCRICAO'], dropdownValue2: visitaWrapItem['NAC_DESCRICAO'],
visitorJsonList: [visitaWrapItem], visitorJsonList: [visitaWrapItem],
visitorStrList: visitaWrapItem['VTE_DOCUMENTO'], visitorStrList: visitaWrapItem['VTE_DOCUMENTO'],
) )),
),
); );
}, },
options: FFButtonOptions( options: FFButtonOptions(
@ -173,7 +172,7 @@ URL do Convite: https://visita.freaccess.com.br/${visitaWrapItem['VAW_ID']}/${vi
'${FFLocalizations.of(context).getVariableText(ptText: "Fim", enText: "End")}:': visitaWrapItem['VAW_DTFIM'] != '' && visitaWrapItem['VAW_DTFIM'] != null ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTFIM']) : '', '${FFLocalizations.of(context).getVariableText(ptText: "Fim", enText: "End")}:': visitaWrapItem['VAW_DTFIM'] != '' && visitaWrapItem['VAW_DTFIM'] != null ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTFIM']) : '',
}), }),
imagePath: imagePath:
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${visitaWrapItem['VTE_DOCUMENTO'] ?? ''}&tipo=E', 'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${visitaWrapItem['VTE_DOCUMENTO'] ?? ''}&tipo=E',
statusHashMap: [ statusHashMap: [
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active)
Map<String, Color>.from({ Map<String, Color>.from({

View File

@ -28,12 +28,10 @@ class DetailsComponentWidget extends StatefulWidget {
final List<Widget> buttons; final List<Widget> buttons;
@override @override
State<DetailsComponentWidget> createState() => State<DetailsComponentWidget> createState() => _DetailsComponentWidgetState();
_DetailsComponentWidgetState();
} }
class _DetailsComponentWidgetState class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
extends State<DetailsComponentWidget> {
late DetailsComponentModel _model; late DetailsComponentModel _model;
LinkedHashMap<String, String> get labelsLinkedHashMap => LinkedHashMap<String, String> get labelsLinkedHashMap =>
@ -66,7 +64,7 @@ class _DetailsComponentWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return Container( return Container(
constraints: BoxConstraints( constraints: BoxConstraints(

View File

@ -58,9 +58,9 @@ class LiberationHistoryItemDetailsTemplateComponentModel
ApiCallResponse? visitRequest; ApiCallResponse? visitRequest;
visitRequest = await PhpGroup.respondeSolicitacaoCall.call( visitRequest = await PhpGroup.respondeSolicitacaoCall.call(
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
cliUUID: FFAppState().cliUUID, cliUUID: AppState().cliUUID,
atividade: 'respondeSolicitacao', atividade: 'respondeSolicitacao',
referencia: refUUID, referencia: refUUID,
tarefa: actionValue, tarefa: actionValue,

View File

@ -1,4 +1,3 @@
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
@ -69,7 +68,7 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return Align( return Align(
alignment: const AlignmentDirectional(0.0, 0.0), alignment: const AlignmentDirectional(0.0, 0.0),
@ -106,7 +105,7 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
fadeInDuration: const Duration(milliseconds: 100), fadeInDuration: const Duration(milliseconds: 100),
fadeOutDuration: const Duration(milliseconds: 100), fadeOutDuration: const Duration(milliseconds: 100),
imageUrl: valueOrDefault<String>( imageUrl: valueOrDefault<String>(
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.id}&tipo=E', 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${AppState().devUUID}&userUUID=${AppState().userUUID}&cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${widget.id}&tipo=E',
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
), ),
fit: BoxFit.cover, fit: BoxFit.cover,
@ -117,7 +116,8 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
.addToEnd(const SizedBox(width: 10.0)), .addToEnd(const SizedBox(width: 10.0)),
), ),
Padding( 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( child: TextFormField(
controller: _model.textController1, controller: _model.textController1,
focusNode: _model.textFieldFocusNode1, focusNode: _model.textFieldFocusNode1,
@ -242,7 +242,8 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
.addToEnd(const SizedBox(width: 24.0)), .addToEnd(const SizedBox(width: 24.0)),
), ),
Padding( 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( child: TextFormField(
controller: _model.textController3, controller: _model.textController3,
focusNode: _model.textFieldFocusNode3, focusNode: _model.textFieldFocusNode3,
@ -300,7 +301,8 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState
), ),
), ),
Padding( 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( child: TextFormField(
controller: _model.textController4, controller: _model.textController4,
focusNode: _model.textFieldFocusNode4, focusNode: _model.textFieldFocusNode4,

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hub/app_state.dart'; import 'package:hub/app_state.dart';
import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/backend/api_requests/api_calls.dart';
@ -56,9 +55,9 @@ class MessageNotificationModalTemplateComponentModel
ApiCallResponse? visitRequest; ApiCallResponse? visitRequest;
visitRequest = await PhpGroup.respondeSolicitacaoCall.call( visitRequest = await PhpGroup.respondeSolicitacaoCall.call(
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
cliUUID: FFAppState().cliUUID, cliUUID: AppState().cliUUID,
atividade: 'respondeSolicitacao', atividade: 'respondeSolicitacao',
referencia: refUUID, referencia: refUUID,
tarefa: actionValue, tarefa: actionValue,

View File

@ -1,13 +1,8 @@
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:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_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 'package:provider/provider.dart';
class MessageNotificationModalTemplateComponentWidget extends StatefulWidget { class MessageNotificationModalTemplateComponentWidget extends StatefulWidget {
@ -64,163 +59,86 @@ class _MessageNotificationModalTemplateComponentWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return Align( return Container(
alignment: const AlignmentDirectional(0.0, 0.0), width: MediaQuery.sizeOf(context).width,
child: Padding( height: MediaQuery.sizeOf(context).height,
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0), decoration: BoxDecoration(
child: Container( color: FlutterFlowTheme.of(context).primaryBackground,
width: MediaQuery.sizeOf(context).width, borderRadius: const BorderRadius.only(
decoration: BoxDecoration( bottomLeft: Radius.circular(25.0),
color: FlutterFlowTheme.of(context).primaryBackground, bottomRight: Radius.circular(25.0),
borderRadius: const BorderRadius.only( topLeft: Radius.circular(25.0),
bottomLeft: Radius.circular(25.0), topRight: Radius.circular(25.0),
bottomRight: Radius.circular(25.0), ),
topLeft: Radius.circular(25.0), ),
topRight: Radius.circular(25.0), child: SingleChildScrollView(
), child: Column(
), mainAxisSize: MainAxisSize.min,
child: SingleChildScrollView( mainAxisAlignment: MainAxisAlignment.start,
child: Column( children: [
mainAxisSize: MainAxisSize.min, Padding(
mainAxisAlignment: MainAxisAlignment.start, padding:
children: [ const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
Padding( child: TextFormField(
padding: const EdgeInsetsDirectional.fromSTEB( controller: _model.textController1,
24.0, 0.0, 24.0, 0.0), focusNode: _model.textFieldFocusNode1,
child: TextFormField( autofocus: false,
controller: _model.textController1, textInputAction: TextInputAction.next,
focusNode: _model.textFieldFocusNode1, readOnly: true,
autofocus: false, obscureText: false,
textInputAction: TextInputAction.next, decoration: InputDecoration(
readOnly: true, isDense: true,
obscureText: false, labelText: FFLocalizations.of(context).getVariableText(
decoration: InputDecoration( ptText: 'Mensagem',
isDense: true, enText: 'Message',
labelText: FFLocalizations.of(context).getVariableText( ),
ptText: 'Mensagem', labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
enText: 'Message', fontFamily:
FlutterFlowTheme.of(context).labelMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily),
), ),
labelStyle: FlutterFlowTheme.of(context) hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
.labelMedium fontFamily:
.override( FlutterFlowTheme.of(context).labelMediumFamily,
fontFamily: color: FlutterFlowTheme.of(context).primaryText,
FlutterFlowTheme.of(context).labelMediumFamily, letterSpacing: 0.0,
color: FlutterFlowTheme.of(context).primaryText, useGoogleFonts: GoogleFonts.asMap().containsKey(
letterSpacing: 0.0, FlutterFlowTheme.of(context).labelMediumFamily),
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: InputBorder.none,
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
suffixIcon: Icon(
Icons.message,
color: FlutterFlowTheme.of(context).accent1,
), ),
), enabledBorder: InputBorder.none,
style: FlutterFlowTheme.of(context).bodyMedium.override( focusedBorder: InputBorder.none,
fontFamily: errorBorder: InputBorder.none,
FlutterFlowTheme.of(context).bodyMediumFamily, focusedErrorBorder: InputBorder.none,
color: FlutterFlowTheme.of(context).primaryText, suffixIcon: Icon(
letterSpacing: 0.0, Icons.message,
useGoogleFonts: GoogleFonts.asMap().containsKey( color: FlutterFlowTheme.of(context).accent1,
FlutterFlowTheme.of(context).bodyMediumFamily),
),
textAlign: TextAlign.start,
maxLines: null,
keyboardType: TextInputType.name,
validator:
_model.textController1Validator.asValidator(context),
), ),
), ),
Row( style: FlutterFlowTheme.of(context).bodyMedium.override(
mainAxisSize: MainAxisSize.max, fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
children: [ color: FlutterFlowTheme.of(context).primaryText,
Expanded( letterSpacing: 0.0,
child: TextFormField( useGoogleFonts: GoogleFonts.asMap().containsKey(
controller: _model.textController2, FlutterFlowTheme.of(context).bodyMediumFamily),
focusNode: _model.textFieldFocusNode2,
autofocus: false,
textInputAction: TextInputAction.next,
readOnly: true,
obscureText: false,
decoration: InputDecoration(
isDense: true,
labelText:
FFLocalizations.of(context).getVariableText(
ptText: 'De',
enText: 'From',
),
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: InputBorder.none,
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
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),
),
textAlign: TextAlign.start,
maxLines: null,
keyboardType: TextInputType.name,
validator: _model.textController2Validator
.asValidator(context),
),
), ),
] textAlign: TextAlign.start,
.addToStart(const SizedBox(width: 24.0)) maxLines: null,
.addToEnd(const SizedBox(width: 24.0)), keyboardType: TextInputType.name,
), validator: _model.textController1Validator.asValidator(context),
Padding( ),
padding: const EdgeInsetsDirectional.fromSTEB( ),
24.0, 0.0, 24.0, 0.0), Row(
mainAxisSize: MainAxisSize.max,
children: [
Expanded(
child: TextFormField( child: TextFormField(
controller: _model.textController3, controller: _model.textController2,
focusNode: _model.textFieldFocusNode3, focusNode: _model.textFieldFocusNode2,
autofocus: false, autofocus: false,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
readOnly: true, readOnly: true,
@ -228,8 +146,8 @@ class _MessageNotificationModalTemplateComponentWidgetState
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
labelText: FFLocalizations.of(context).getVariableText( labelText: FFLocalizations.of(context).getVariableText(
ptText: 'Para', ptText: 'De',
enText: 'To', enText: 'From',
), ),
labelStyle: FlutterFlowTheme.of(context) labelStyle: FlutterFlowTheme.of(context)
.labelMedium .labelMedium
@ -272,15 +190,71 @@ class _MessageNotificationModalTemplateComponentWidgetState
maxLines: null, maxLines: null,
keyboardType: TextInputType.name, keyboardType: TextInputType.name,
validator: validator:
_model.textController3Validator.asValidator(context), _model.textController2Validator.asValidator(context),
), ),
), ),
] ]
.divide(const SizedBox(height: 10.0)) .addToStart(const SizedBox(width: 24.0))
.addToStart(const SizedBox(height: 20.0)) .addToEnd(const SizedBox(width: 24.0)),
.addToEnd(const SizedBox(height: 20.0)),
), ),
), 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,
readOnly: true,
obscureText: false,
decoration: InputDecoration(
isDense: true,
labelText: FFLocalizations.of(context).getVariableText(
ptText: 'Para',
enText: 'To',
),
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: InputBorder.none,
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
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),
),
textAlign: TextAlign.start,
maxLines: null,
keyboardType: TextInputType.name,
validator: _model.textController3Validator.asValidator(context),
),
),
]
.divide(const SizedBox(height: 10.0))
.addToStart(const SizedBox(height: 20.0))
.addToEnd(const SizedBox(height: 20.0)),
), ),
), ),
); );

View File

@ -46,9 +46,9 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVi
Future<bool> getVisitanteByDocument( Future<bool> getVisitanteByDocument(
String document, BuildContext context) async { String document, BuildContext context) async {
final response = await PhpGroup.getVisitorByDocCall.call( final response = await PhpGroup.getVisitorByDocCall.call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
atividade: 'getVisitante', atividade: 'getVisitante',
documento: document, documento: document,
); );

View File

@ -112,7 +112,7 @@ class _RegisiterVistorTemplateComponentWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return Align( return Align(
alignment: const AlignmentDirectional(0.0, 1.0), alignment: const AlignmentDirectional(0.0, 1.0),
child: Container( child: Container(
@ -820,9 +820,9 @@ class _RegisiterVistorTemplateComponentWidgetState
_model.scheduleVisitor = _model.scheduleVisitor =
await PhpGroup.postScheduleVisitorCall await PhpGroup.postScheduleVisitorCall
.call( .call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
atividade: 'putVisitante', atividade: 'putVisitante',
documento: _model.textController2.text, documento: _model.textController2.text,
nome: _model.textController1.text, nome: _model.textController1.text,

View File

@ -123,7 +123,7 @@ class _SignUpTemplateComponentWidgetState
return false; return false;
} }
context.watch<FFAppState>(); context.watch<AppState>();
return Row( return Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -701,7 +701,7 @@ class _SignUpTemplateComponentWidgetState
email: _model email: _model
.emailRegisterFormTextController .emailRegisterFormTextController
.text, .text,
device: FFAppState().device, device: AppState().device,
); );
shouldSetState = true; shouldSetState = true;
if (_model.signUp == true) { if (_model.signUp == true) {

View File

@ -128,7 +128,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
var filteredVisitorJsonList = var filteredVisitorJsonList =
findVisitorById(widget.visitorJsonList, widget.visitIdStr) ?? 'null'; findVisitorById(widget.visitorJsonList, widget.visitIdStr) ?? 'null';
context.watch<FFAppState>(); context.watch<AppState>();
return Padding( return Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 200.0, 0.0, 0.0), padding: const EdgeInsetsDirectional.fromSTEB(0.0, 200.0, 0.0, 0.0),
@ -829,9 +829,9 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
onPressed: () async { onPressed: () async {
_model.deleteVisit = _model.deleteVisit =
await PhpGroup.deleteVisitCall.call( await PhpGroup.deleteVisitCall.call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
atividade: 'cancelaVisita', atividade: 'cancelaVisita',
idVisita: widget.visitIdStr, idVisita: widget.visitIdStr,
); );

View File

@ -63,7 +63,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return Padding( return Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
@ -272,7 +272,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
fadeOutDuration: const Duration( fadeOutDuration: const Duration(
milliseconds: 500), milliseconds: 500),
imageUrl: imageUrl:
"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=${AppState().devUUID}&userUUID=${AppState().userUUID}&cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
visitorItem, visitorItem,
r'''$.VTE_DOCUMENTO''', r'''$.VTE_DOCUMENTO''',
).toString()}&tipo=E", ).toString()}&tipo=E",
@ -444,9 +444,9 @@ class _VisitorSearchModalTemplateComponentWidgetState
TextSelection.collapsed(offset: _model.textController!.text.length); TextSelection.collapsed(offset: _model.textController!.text.length);
}); });
_model.getVisitorByDoc = await PhpGroup.getVisitorByDocCall.call( _model.getVisitorByDoc = await PhpGroup.getVisitorByDocCall.call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
atividade: 'getVisitante', atividade: 'getVisitante',
documento: _model.textController.text, documento: _model.textController.text,
); );

View File

@ -1,14 +1,14 @@
import 'dart:io'; import 'dart:io';
import 'dart:math' show pow, pi, sin;
import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:collection/collection.dart';
import 'package:from_css_color/from_css_color.dart'; import 'package:from_css_color/from_css_color.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/flutter_flow/internationalization.dart';
import 'dart:math' show pow, pi, sin;
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:json_path/json_path.dart'; import 'package:json_path/json_path.dart';
import 'package:timeago/timeago.dart' as timeago; import 'package:timeago/timeago.dart' as timeago;
@ -16,19 +16,21 @@ import 'package:url_launcher/url_launcher.dart';
import '../main.dart'; import '../main.dart';
export 'dart:convert' show jsonEncode, jsonDecode;
export 'dart:math' show min, max;
export 'dart:typed_data' show Uint8List;
export 'package:intl/intl.dart';
export 'package:page_transition/page_transition.dart';
export '/app_state.dart';
export 'custom_icons.dart' show FFIcons;
export 'flutter_flow_model.dart';
export 'internationalization.dart' show FFLocalizations;
export 'keep_alive_wrapper.dart'; export 'keep_alive_wrapper.dart';
export 'lat_lng.dart'; export 'lat_lng.dart';
export 'place.dart'; export 'place.dart';
export 'uploaded_file.dart'; export 'uploaded_file.dart';
export '/app_state.dart';
export 'flutter_flow_model.dart';
export 'dart:math' show min, max;
export 'dart:typed_data' show Uint8List;
export 'dart:convert' show jsonEncode, jsonDecode;
export 'package:intl/intl.dart';
export 'package:page_transition/page_transition.dart';
export 'custom_icons.dart' show FFIcons;
export 'internationalization.dart' show FFLocalizations;
T valueOrDefault<T>(T? value, T defaultValue) => T valueOrDefault<T>(T? value, T defaultValue) =>
(value is String && value.isEmpty) || value == null ? defaultValue : value; (value is String && value.isEmpty) || value == null ? defaultValue : value;
@ -502,10 +504,10 @@ extension IterableExt<T> on Iterable<T> {
} }
void setAppLanguage(BuildContext context, String language) => void setAppLanguage(BuildContext context, String language) =>
MyApp.of(context).setLocale(language); App.of(context).setLocale(language);
void setDarkModeSetting(BuildContext context, ThemeMode themeMode) => void setDarkModeSetting(BuildContext context, ThemeMode themeMode) =>
MyApp.of(context).setThemeMode(themeMode); App.of(context).setThemeMode(themeMode);
void showSnackbar( void showSnackbar(
BuildContext context, BuildContext context,

View File

@ -69,7 +69,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
FFRoute( FFRoute(
name: '_initialize', name: '_initialize',
path: '/', path: '/',
builder: (context, _) => FFAppState().isLogged builder: (context, _) => AppState().isLogged
? const HomePageWidget() ? const HomePageWidget()
: const WelcomePageWidget(), : const WelcomePageWidget(),
), ),

View File

@ -1,54 +1,64 @@
import 'dart:developer';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_web_plugins/url_strategy.dart';
import 'package:hub/app_state.dart'; import 'package:hub/app_state.dart';
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
import 'package:hub/backend/notifications/notification_service.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.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/flutter_flow/internationalization.dart';
import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/flutter_flow/nav/nav.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter/material.dart';
import 'package:responsive_framework/responsive_framework.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 'package:flutter/services.dart';
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
void main() async { Future<void> initializeApp() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
await init();
runApp(ChangeNotifierProvider(
create: (context) => FFAppState(),
child: const MyApp(),
));
}
Future<void> init() async { await Firebase.initializeApp();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); await FirebaseMessagingService().initNotifications();
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError; await NotificationService.initialize();
setUrlStrategy(const PathUrlStrategy());
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
if (kDebugMode) {
log("Aplicativo em Debug Mode, crashlytics desabilitado!");
} else {
final crashlyticsInstance = FirebaseCrashlytics.instance;
if (crashlyticsInstance.isCrashlyticsCollectionEnabled) {
FlutterError.onError = crashlyticsInstance.recordFlutterError;
}
}
await FlutterFlowTheme.initialize(); await FlutterFlowTheme.initialize();
await FFLocalizations.initialize(); await FFLocalizations.initialize();
final appState = FFAppState(); final appState = AppState();
await appState.initializePersistedState(); await appState.initializePersistedState();
GoRouter.optionURLReflectsImperativeAPIs = true; GoRouter.optionURLReflectsImperativeAPIs = true;
usePathUrlStrategy(); usePathUrlStrategy();
} }
class MyApp extends StatefulWidget { void main() async {
const MyApp({super.key}); await initializeApp();
runApp(const App());
@override
State<MyApp> createState() => _MyAppState();
static _MyAppState of(BuildContext context) =>
context.findAncestorStateOfType<_MyAppState>()!;
} }
class _MyAppState extends State<MyApp> { class App extends StatefulWidget {
const App({super.key});
@override
State<App> createState() => _AppState();
static _AppState of(BuildContext context) =>
context.findAncestorStateOfType<_AppState>()!;
}
class _AppState extends State<App> {
Locale? _locale = FFLocalizations.getStoredLocale(); Locale? _locale = FFLocalizations.getStoredLocale();
ThemeMode _themeMode = FlutterFlowTheme.themeMode; ThemeMode _themeMode = FlutterFlowTheme.themeMode;
late AppStateNotifier _appStateNotifier; late AppStateNotifier _appStateNotifier;
@ -81,62 +91,67 @@ class _MyAppState extends State<MyApp> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp.router( return MultiProvider(
title: 'FREHub', providers: [
builder: (context, widget) => ResponsiveBreakpoints.builder( ChangeNotifierProvider(create: (_) => AppState()),
child: BouncingScrollWrapper.builder(context, widget!), ],
breakpoints: [ child: MaterialApp.router(
const Breakpoint(start: 0, end: 450, name: MOBILE), title: 'FREHub',
const Breakpoint(start: 451, end: 800, name: TABLET), builder: (context, widget) => ResponsiveBreakpoints.builder(
const Breakpoint(start: 801, end: 1920, name: DESKTOP), child: BouncingScrollWrapper.builder(context, widget!),
const Breakpoint(start: 1921, end: double.infinity, name: '4K'), breakpoints: [
const Breakpoint(start: 0, end: 450, name: MOBILE),
const Breakpoint(start: 451, end: 800, name: TABLET),
const Breakpoint(start: 801, end: 1920, name: DESKTOP),
const Breakpoint(start: 1921, end: double.infinity, name: '4K'),
],
),
localizationsDelegates: const [
FFLocalizationsDelegate(),
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
], ],
), locale: _locale,
localizationsDelegates: const [ supportedLocales: const [
FFLocalizationsDelegate(), Locale('pt'),
GlobalMaterialLocalizations.delegate, Locale('en'),
GlobalWidgetsLocalizations.delegate, ],
GlobalCupertinoLocalizations.delegate, theme: ThemeData(
], brightness: Brightness.light,
locale: _locale, scrollbarTheme: ScrollbarThemeData(
supportedLocales: const [ thumbVisibility: WidgetStateProperty.all(false),
Locale('pt'), interactive: false,
Locale('en'), thumbColor: WidgetStateProperty.resolveWith((states) {
], if (states.contains(WidgetState.dragged)) {
theme: ThemeData( return const Color(0xff1aab5f);
brightness: Brightness.light, }
scrollbarTheme: ScrollbarThemeData( if (states.contains(WidgetState.hovered)) {
thumbVisibility: WidgetStateProperty.all(false), return const Color(0xff1aab5f);
interactive: false, }
thumbColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.dragged)) {
return const Color(0xff1aab5f); return const Color(0xff1aab5f);
} }),
if (states.contains(WidgetState.hovered)) { ),
return const Color(0xff1aab5f);
}
return const Color(0xff1aab5f);
}),
), ),
), darkTheme: ThemeData(
darkTheme: ThemeData( brightness: Brightness.dark,
brightness: Brightness.dark, scrollbarTheme: ScrollbarThemeData(
scrollbarTheme: ScrollbarThemeData( thumbVisibility: WidgetStateProperty.all(false),
thumbVisibility: WidgetStateProperty.all(false), interactive: false,
interactive: false, thumbColor: WidgetStateProperty.resolveWith((states) {
thumbColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.dragged)) {
if (states.contains(WidgetState.dragged)) { return const Color(0xff1aab5f);
}
if (states.contains(WidgetState.hovered)) {
return const Color(0xff1aab5f);
}
return const Color(0xff1aab5f); return const Color(0xff1aab5f);
} }),
if (states.contains(WidgetState.hovered)) { ),
return const Color(0xff1aab5f);
}
return const Color(0xff1aab5f);
}),
), ),
themeMode: _themeMode,
routerConfig: _router,
), ),
themeMode: _themeMode,
routerConfig: _router,
); );
} }
} }

View File

@ -209,9 +209,9 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
try { try {
setState(() => _loading = true); setState(() => _loading = true);
var response = await PhpGroup.getAccessCall.call( var response = await PhpGroup.getAccessCall.call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
atividade: 'getAcessos', atividade: 'getAcessos',
pageSize: _pageSize.toString(), pageSize: _pageSize.toString(),
pageNumber: _pageNumber.toString(), pageNumber: _pageNumber.toString(),
@ -355,7 +355,7 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
BuildContext context, dynamic accessHistoryItem) { BuildContext context, dynamic accessHistoryItem) {
return CardItemTemplateComponentWidget( return CardItemTemplateComponentWidget(
imagePath: imagePath:
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${accessHistoryItem['PES_ID'] ?? ''}&tipo=${accessHistoryItem['PES_TIPO'] ?? ''}', 'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${accessHistoryItem['PES_ID'] ?? ''}&tipo=${accessHistoryItem['PES_TIPO'] ?? ''}',
labelsHashMap: Map<String, String>.from({ labelsHashMap: Map<String, String>.from({
'Nome:': accessHistoryItem['PES_NOME'] ?? '', 'Nome:': accessHistoryItem['PES_NOME'] ?? '',
'Acesso:': accessHistoryItem['ACE_DATAHORA'] ?? '', 'Acesso:': accessHistoryItem['ACE_DATAHORA'] ?? '',
@ -409,7 +409,7 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
String imageUrlAtomWidget(String document, String type) { String imageUrlAtomWidget(String document, String type) {
return valueOrDefault<String>( return valueOrDefault<String>(
"https://freaccess.com.br/freaccess/getImage.php?&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=$document&tipo=$type", "https://freaccess.com.br/freaccess/getImage.php?&cliID=${AppState().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", "https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg",
); );
} }

View File

@ -9,15 +9,15 @@ import 'package:webview_flutter/webview_flutter.dart';
import 'dart:io' show Platform; import 'dart:io' show Platform;
class FastPassPageWidget extends StatefulWidget { class FastPassPageWidget extends StatefulWidget {
final String freToken = FFAppState().userUUID; final String freToken = AppState().userUUID;
final String freUserData = "{\"name\": \"${FFAppState().name}\", " + final String freUserData = "{\"name\": \"${AppState().name}\", " +
"\"email\": \"${FFAppState().email}\"," + "\"email\": \"${AppState().email}\"," +
"\"dev_id\": \"${FFAppState().devUUID}\"," + "\"dev_id\": \"${AppState().devUUID}\"," +
"\"created_at\": \"${FFAppState().createdAt}\"," + "\"created_at\": \"${AppState().createdAt}\"," +
"\"updated_at\": \"0000-00-00 00:00:00\"," + "\"updated_at\": \"0000-00-00 00:00:00\"," +
"\"status\": \"A\" }"; "\"status\": \"A\" }";
final String clientId = FFAppState().cliUUID; final String clientId = AppState().cliUUID;
@override @override
_FastPassPageWidgetState createState() => _FastPassPageWidgetState(); _FastPassPageWidgetState createState() => _FastPassPageWidgetState();
@ -35,63 +35,69 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
name = FFAppState().name; name = AppState().name;
email = FFAppState().email; email = AppState().email;
userUUID = FFAppState().userUUID; userUUID = AppState().userUUID;
created_at = FFAppState().createdAt; created_at = AppState().createdAt;
url = 'https://hub.freaccess.com.br/hub/fast-pass/${widget.clientId}'; url = 'https://hub.freaccess.com.br/hub/fast-pass/${widget.clientId}';
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
body: Platform.isIOS ? InAppWebView( body: Platform.isIOS
initialUrlRequest: URLRequest(url: WebUri(url)), ? InAppWebView(
initialSettings: InAppWebViewSettings( initialUrlRequest: URLRequest(url: WebUri(url)),
allowsBackForwardNavigationGestures: true, initialSettings: InAppWebViewSettings(
javaScriptEnabled: true, allowsBackForwardNavigationGestures: true,
), javaScriptEnabled: true,
onWebViewCreated: (controller) async { ),
_controllerIOS = controller; onWebViewCreated: (controller) async {
}, _controllerIOS = controller;
onLoadStop: (controller, url) async { },
await controller.evaluateJavascript(source: "window.localStorage.setItem('fre-token', '\"${widget.freToken}\"')"); onLoadStop: (controller, url) async {
await controller.evaluateJavascript(source: "window.localStorage.setItem('fre-user-data', '${widget.freUserData}')"); await controller.evaluateJavascript(
}, source:
) : WebViewWidget( "window.localStorage.setItem('fre-token', '\"${widget.freToken}\"')");
controller: _controllerAll = WebViewController() await controller.evaluateJavascript(
..clearCache() source:
..clearLocalStorage() "window.localStorage.setItem('fre-user-data', '${widget.freUserData}')");
..setJavaScriptMode(JavaScriptMode.unrestricted) },
..setBackgroundColor(const Color(0x00000000)) )
..setNavigationDelegate( : WebViewWidget(
NavigationDelegate( controller: _controllerAll = WebViewController()
onProgress: (int progress) {}, ..clearCache()
onPageStarted: (String url) { ..clearLocalStorage()
final String token = "localStorage.setItem('fre-token', '\"${widget.freToken}\"');"; ..setJavaScriptMode(JavaScriptMode.unrestricted)
final String data = "localStorage.setItem('fre-user-data', '${widget.freUserData}');"; ..setBackgroundColor(const Color(0x00000000))
..setNavigationDelegate(
NavigationDelegate(
onProgress: (int progress) {},
onPageStarted: (String url) {
final String token =
"localStorage.setItem('fre-token', '\"${widget.freToken}\"');";
final String data =
"localStorage.setItem('fre-user-data', '${widget.freUserData}');";
_controllerAll.runJavaScript(token); _controllerAll.runJavaScript(token);
_controllerAll.runJavaScript(data); _controllerAll.runJavaScript(data);
}, },
onNavigationRequest: (NavigationRequest request) { onNavigationRequest: (NavigationRequest request) {
if (request.url.startsWith('http') || if (request.url.startsWith('http') ||
request.url.startsWith('https://api.whatsapp.com/send') || request.url
request.url.startsWith('https://wa.me')) { .startsWith('https://api.whatsapp.com/send') ||
launchUrlString(request.url); request.url.startsWith('https://wa.me')) {
return NavigationDecision.prevent; launchUrlString(request.url);
} return NavigationDecision.prevent;
return NavigationDecision.prevent; }
}, return NavigationDecision.prevent;
},
),
)
..loadRequest(Uri.parse(url)),
), ),
)
..loadRequest(Uri.parse(url)),
),
), ),
); );
} }
} }

View File

@ -1,27 +1,20 @@
// import 'package:hub/backend/push_notification/pushNotification.dart';
import 'dart:developer'; import 'dart:developer';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:hub/actions/actions.dart'; import 'package:hub/actions/actions.dart';
import 'package:hub/backend/push_notification/pushNotificationService.dart'; import 'package:hub/backend/notifications/firebase_messaging_service.dart';
import 'package:hub/backend/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/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_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/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/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/custom_functions.dart';
import 'package:hub/flutter_flow/flutter_flow_icon_button.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_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/flutter_flow_widgets.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/flutter_flow/nav/nav.dart';
import 'package:hub/pages/home_page/home_page_model.dart'; import 'package:hub/pages/home_page/home_page_model.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class HomePageWidget extends StatefulWidget { class HomePageWidget extends StatefulWidget {
@ -36,6 +29,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
bool localStatus = false; bool localStatus = false;
final scaffoldKey = GlobalKey<ScaffoldState>(); final scaffoldKey = GlobalKey<ScaffoldState>();
Future<void> checkLocalStatus() async { Future<void> checkLocalStatus() async {
localStatus = await checkLocals( localStatus = await checkLocals(
context: context, context: context,
@ -48,9 +42,14 @@ class _HomePageWidgetState extends State<HomePageWidget> {
void initState() { void initState() {
super.initState(); super.initState();
_model = createModel(context, () => HomePageModel()); _model = createModel(context, () => HomePageModel());
SchedulerBinding.instance.addPostFrameCallback((_) async {
await PushNotificationService().initialize(context);
AppState().context = context;
() async {
await FirebaseMessagingService().updateDeviceToken();
}();
WidgetsBinding.instance.addPostFrameCallback((_) async {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -58,7 +57,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
} }
// Rest of your code... // Rest of your code...
if (FFAppState().cliUUID == null || FFAppState().cliUUID.isEmpty) { if (AppState().cliUUID == null || AppState().cliUUID.isEmpty) {
showModalBottomSheet( showModalBottomSheet(
isScrollControlled: false, isScrollControlled: false,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
@ -95,7 +94,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return GestureDetector( return GestureDetector(
onTap: () => _model.unfocusNode.canRequestFocus onTap: () => _model.unfocusNode.canRequestFocus
? FocusScope.of(context).requestFocus(_model.unfocusNode) ? FocusScope.of(context).requestFocus(_model.unfocusNode)
@ -160,17 +159,17 @@ class _HomePageWidgetState extends State<HomePageWidget> {
item: MenuItem.button, item: MenuItem.button,
), ),
), ),
Align( // Align(
alignment: const AlignmentDirectional(0.0, 0.0), // alignment: const AlignmentDirectional(0.0, 0.0),
child: Provider<MessageWellNotifier>( // child: Provider<MessageWellNotifier>(
create: (_) => MessageWellNotifier(), // create: (_) => MessageWellNotifier(),
child: wrapWithModel( // child: wrapWithModel(
model: _model.messageWellComponentModel, // model: _model.messageWellComponentModel,
updateCallback: () => setState(() {}), // updateCallback: () => setState(() {}),
child: const MessageWellComponentWidget(), // child: const MessageWellComponentWidget(),
), // ),
), // ),
), // ),
//footer //footer
const SizedBox( const SizedBox(
height: 100, height: 100,
@ -363,7 +362,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
), ),
child: Image.network( child: Image.network(
valueOrDefault<String>( valueOrDefault<String>(
'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', 'https://freaccess.com.br/freaccess/Images/Clients/${AppState().cliUUID}.png',
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
), ),
fit: BoxFit.cover, fit: BoxFit.cover,
@ -373,7 +372,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
width: 150.0, width: 150.0,
child: Text( child: Text(
valueOrDefault<String>( valueOrDefault<String>(
convertToUppercase(FFAppState().local), convertToUppercase(AppState().local),
'NOME DO LOCAL', 'NOME DO LOCAL',
), ),
style: FlutterFlowTheme.of(context) style: FlutterFlowTheme.of(context)
@ -543,7 +542,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
), ),
FFButtonWidget( FFButtonWidget(
onPressed: () async { onPressed: () async {
FFAppState().deleteAll(); AppState().deleteAll();
setState(() {}); setState(() {});
context.goNamed( context.goNamed(
@ -588,202 +587,5 @@ class _HomePageWidgetState extends State<HomePageWidget> {
), ),
), ),
); );
// 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(),
// ),
// ),
// ],
// ),
// ],
// ),
// ],
// ),
// ),
// ),
// ),
// );
} }
} }

View File

@ -1,9 +1,7 @@
import 'dart:developer'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/actions/actions.dart'; import 'package:hub/actions/actions.dart';
import 'package:hub/backend/api_requests/api_calls.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/card_item_template_component/card_item_template_component_widget.dart';
import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
@ -11,11 +9,6 @@ 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_util.dart';
import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/flutter_flow/nav/nav.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:hub/shared/utils/dialog_util.dart'; import 'package:hub/shared/utils/dialog_util.dart';
import 'package:hub/shared/utils/log_util.dart'; import 'package:hub/shared/utils/log_util.dart';
import 'package:hub/shared/utils/validator_util.dart'; import 'package:hub/shared/utils/validator_util.dart';
@ -25,7 +18,8 @@ class LiberationHistoryWidget extends StatefulWidget {
const LiberationHistoryWidget({super.key}); const LiberationHistoryWidget({super.key});
@override @override
State<LiberationHistoryWidget> createState() => _LiberationHistoryWidgetState(); State<LiberationHistoryWidget> createState() =>
_LiberationHistoryWidgetState();
} }
class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> { class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
@ -53,33 +47,46 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
} }
String _imagePath(dynamic request) { String _imagePath(dynamic request) {
return 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${request['VTE_ID'] ?? ''}&tipo=E'; return 'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${request['VTE_ID'] ?? ''}&tipo=E';
} }
Map<String, String> _labelsHashMap(dynamic request, bool details) { Map<String, String> _labelsHashMap(dynamic request, bool details) {
return Map<String, String>.from({ return Map<String, String>.from({
'${FFLocalizations.of(context).getVariableText(ptText: 'Nome', enText: 'Name')}:': request['VTE_NOME'], '${FFLocalizations.of(context).getVariableText(ptText: 'Nome', enText: 'Name')}:':
'${FFLocalizations.of(context).getVariableText(ptText: 'Dt. Envio', enText: 'Date Send')}:': request['NOT_DTENVIO'] != null ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', request['NOT_DTENVIO']) : '', request['VTE_NOME'],
'${FFLocalizations.of(context).getVariableText(ptText: 'Motivo', enText: 'Reason')}:': request['NOT_MOTIVO'], '${FFLocalizations.of(context).getVariableText(ptText: 'Dt. Envio', enText: 'Date Send')}:':
request['NOT_DTENVIO'] != null
? ValidatorUtil.toLocalDateTime(
'yyyy-MM-dd HH:mm:ss', request['NOT_DTENVIO'])
: '',
'${FFLocalizations.of(context).getVariableText(ptText: 'Motivo', enText: 'Reason')}:':
request['NOT_MOTIVO'],
if (details == true) if (details == true)
'${FFLocalizations.of(context).getVariableText(ptText: 'Mensagem', enText: 'Message')}:': request['NOT_MSGENVIO'], '${FFLocalizations.of(context).getVariableText(ptText: 'Mensagem', enText: 'Message')}:':
request['NOT_MSGENVIO'],
}); });
} }
Map<String, Color> _statusHashMap(dynamic request) { Map<String, Color> _statusHashMap(dynamic request) {
return Map<String, Color>.from({ return Map<String, Color>.from({
if (request['NOT_STATUS'] == 'L') if (request['NOT_STATUS'] == 'L')
FFLocalizations.of(context).getVariableText(ptText: 'Finalizado', enText: 'Finished'): FlutterFlowTheme.of(context).success FFLocalizations.of(context).getVariableText(
ptText: 'Finalizado',
enText: 'Finished'): FlutterFlowTheme.of(context).success
else if (request['NOT_STATUS'] == 'B') else if (request['NOT_STATUS'] == 'B')
FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'): FlutterFlowTheme.of(context).error FFLocalizations.of(context).getVariableText(
ptText: 'Bloqueado',
enText: 'Blocked'): FlutterFlowTheme.of(context).error
else else
FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'): FlutterFlowTheme.of(context).warning FFLocalizations.of(context).getVariableText(
ptText: 'Ativo',
enText: 'Active'): FlutterFlowTheme.of(context).warning
}); });
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return Scaffold( return Scaffold(
key: scaffoldKey, key: scaffoldKey,
backgroundColor: FlutterFlowTheme.of(context).primaryBackground, backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
@ -112,12 +119,12 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
'784f83pc' /* Histórico de Liberação */, '784f83pc' /* Histórico de Liberação */,
), ),
style: FlutterFlowTheme.of(context).headlineMedium.override( style: FlutterFlowTheme.of(context).headlineMedium.override(
fontFamily: 'Nunito', fontFamily: 'Nunito',
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: 17.0, fontSize: 17.0,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
), ),
), ),
actions: const [], actions: const [],
centerTitle: true, centerTitle: true,
@ -146,9 +153,11 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
], ],
), ),
) )
else if (_hasData == true && _loading == false && _requestWrap.isNotEmpty) else if (_hasData == true &&
_loading == false &&
_requestWrap.isNotEmpty)
Expanded(child: _listItems(context)), Expanded(child: _listItems(context)),
if ( _loading == true) if (_loading == true)
Container( Container(
padding: const EdgeInsets.only(top: 15, bottom: 15), padding: const EdgeInsets.only(top: 15, bottom: 15),
child: Center( child: Center(
@ -203,7 +212,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
buttons: [ buttons: [
if (liberationHistoryItem['NOT_STATUS'] == 'S') if (liberationHistoryItem['NOT_STATUS'] == 'S')
FFButtonWidget( FFButtonWidget(
text: FFLocalizations.of(context).getVariableText(ptText: "Aceitar", enText: "Accept"), text: FFLocalizations.of(context)
.getVariableText(ptText: "Aceitar", enText: "Accept"),
options: FFButtonOptions( options: FFButtonOptions(
width: 130, width: 130,
height: 40, height: 40,
@ -218,17 +228,22 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
), ),
icon: const Icon(Icons.done), icon: const Icon(Icons.done),
onPressed: () async { onPressed: () async {
return answersRequest.call( return answersRequest
.call(
context, context,
liberationHistoryItem['NOT_ID'].toString(), liberationHistoryItem['NOT_ID'].toString(),
'L', 'L',
'', '',
liberationHistoryItem['VTE_ID'].toString(), liberationHistoryItem['VTE_ID'].toString(),
).then((message) { )
.then((message) {
if (message.isEmpty) { if (message.isEmpty) {
showSnackbar( showSnackbar(
context, context,
FFLocalizations.of(context).getVariableText(enText: 'Successfully resolved visit', ptText: 'Visita resolvida com sucesso'), false); FFLocalizations.of(context).getVariableText(
enText: 'Successfully resolved visit',
ptText: 'Visita resolvida com sucesso'),
false);
} else { } else {
showSnackbar(context, message, true); showSnackbar(context, message, true);
} }
@ -244,7 +259,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
), ),
if (liberationHistoryItem['NOT_STATUS'] == 'S') if (liberationHistoryItem['NOT_STATUS'] == 'S')
FFButtonWidget( FFButtonWidget(
text: FFLocalizations.of(context).getVariableText(ptText: "Bloquear", enText: "Block"), text: FFLocalizations.of(context)
.getVariableText(ptText: "Bloquear", enText: "Block"),
options: FFButtonOptions( options: FFButtonOptions(
width: 130, width: 130,
height: 40, height: 40,
@ -259,17 +275,22 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
), ),
icon: const Icon(Icons.close), icon: const Icon(Icons.close),
onPressed: () async { onPressed: () async {
return answersRequest.call( return answersRequest
.call(
context, context,
liberationHistoryItem['NOT_ID'].toString(), liberationHistoryItem['NOT_ID'].toString(),
'B', 'B',
'', '',
liberationHistoryItem['VTE_ID'].toString(), liberationHistoryItem['VTE_ID'].toString(),
).then((message) { )
.then((message) {
if (message.isEmpty) { if (message.isEmpty) {
showSnackbar( showSnackbar(
context, context,
FFLocalizations.of(context).getVariableText(enText: 'Successfully resolved visit', ptText: 'Visita resolvida com sucesso'), false); FFLocalizations.of(context).getVariableText(
enText: 'Successfully resolved visit',
ptText: 'Visita resolvida com sucesso'),
false);
} else { } else {
showSnackbar(context, message, true); showSnackbar(context, message, true);
} }
@ -290,43 +311,44 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
); );
}, },
).then((_) { ).then((_) {
() {}();
// PushNotificationManager _pushNotificationService =
// PushNotificationManager();
PushNotificationManager _pushNotificationService = PushNotificationManager(); // _pushNotificationService.onMessageReceived.listen((received) {
// if (received.data['click_action'] == 'cancel_request') {
_pushNotificationService.onMessageReceived.listen((received) { // _pushNotificationService.dispose();
if (received.data['click_action'] == 'cancel_request') { // showSnackbar(
_pushNotificationService.dispose(); // context,
showSnackbar( // FFLocalizations.of(context).getVariableText(
context, // enText: 'Successfully resolved visit',
FFLocalizations.of(context).getVariableText( // ptText: 'Visita resolvida com sucesso'),
enText: 'Successfully resolved visit', // false);
ptText: 'Visita resolvida com sucesso'), // context.pushReplacementNamed(
false); // 'liberationHistory',
context.pushReplacementNamed( // extra: <String, dynamic>{
'liberationHistory', // kTransitionInfoKey: const TransitionInfo(
extra: <String, dynamic>{ // hasTransition: true,
kTransitionInfoKey: const TransitionInfo( // transitionType: PageTransitionType.scale,
hasTransition: true, // alignment: Alignment.bottomCenter,
transitionType: PageTransitionType.scale, // ),
alignment: Alignment.bottomCenter, // },
), // );
}, // }
); // });
} // }).whenComplete(() {
}); // safeSetState(() {
// _requestWrap = [];
}).whenComplete(() { // _requestFuture = _fetchRequests();
safeSetState(() { // });
_requestWrap = []; // }).catchError((e, s) {
_requestFuture = _fetchRequests(); // DialogUtil.errorDefault(context);
}); // LogUtil.requestAPIFailed(
}).catchError((e, s) { // "proccessRequest.php", "", "Consulta de Solitiações", e, s);
DialogUtil.errorDefault(context); // safeSetState(() {
LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Solitiações", e, s); // _hasData = false;
safeSetState(() { // _loading = false;
_hasData = false; // });
_loading = false;
});
}); });
}, },
); );
@ -335,12 +357,14 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
Future<ApiCallResponse?> _fetchRequests() async { Future<ApiCallResponse?> _fetchRequests() async {
try { try {
setState(() => _loading = true); setState(() => _loading = true);
var response = await PhpGroup.getLiberationsCall.call( var response = await PhpGroup.getLiberationsCall
devUUID: FFAppState().devUUID, .call(
userUUID: FFAppState().userUUID, devUUID: AppState().devUUID,
cliID: FFAppState().cliUUID, userUUID: AppState().userUUID,
atividade: 'getSolicitacoes', cliID: AppState().cliUUID,
).first; atividade: 'getSolicitacoes',
)
.first;
final List<dynamic> requests = response.jsonBody['solicitacoes'] ?? []; final List<dynamic> requests = response.jsonBody['solicitacoes'] ?? [];
@ -364,7 +388,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
return null; return null;
} catch (e, s) { } catch (e, s) {
DialogUtil.errorDefault(context); DialogUtil.errorDefault(context);
LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Solicitações", e, s); LogUtil.requestAPIFailed(
"proccessRequest.php", "", "Consulta de Solicitações", e, s);
setState(() { setState(() {
_hasData = false; _hasData = false;
_loading = false; _loading = false;

View File

@ -91,7 +91,7 @@ class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return Scaffold( return Scaffold(
key: scaffoldKey, key: scaffoldKey,
backgroundColor: FlutterFlowTheme.of(context).primaryBackground, backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
@ -105,9 +105,9 @@ class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget>
setState(() => _loading = true); setState(() => _loading = true);
var response = await PhpGroup.getMessagesCall.call( var response = await PhpGroup.getMessagesCall.call(
devUUID: FFAppState().devUUID.toString(), devUUID: AppState().devUUID.toString(),
userUUID: FFAppState().userUUID.toString(), userUUID: AppState().userUUID.toString(),
cliID: FFAppState().cliUUID.toString(), cliID: AppState().cliUUID.toString(),
atividade: 'getMensagens', atividade: 'getMensagens',
pageSize: _pageSize.toString(), pageSize: _pageSize.toString(),
pageNumber: _pageNumber.toString(), pageNumber: _pageNumber.toString(),

View File

@ -9,7 +9,6 @@ import 'package:hub/flutter_flow/internationalization.dart';
import 'package:hub/flutter_flow/nav/nav.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 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_model.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart';
@ -19,7 +18,6 @@ import 'package:provider/provider.dart';
import '../../shared/utils/dialog_util.dart'; import '../../shared/utils/dialog_util.dart';
import '../../shared/utils/log_util.dart'; import '../../shared/utils/log_util.dart';
class PeopleOnThePropertyPageWidget extends StatefulWidget { class PeopleOnThePropertyPageWidget extends StatefulWidget {
const PeopleOnThePropertyPageWidget({super.key}); const PeopleOnThePropertyPageWidget({super.key});
@ -49,7 +47,7 @@ class _PeopleOnThePropertyPageWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return Scaffold( return Scaffold(
key: scaffoldKey, key: scaffoldKey,
@ -93,10 +91,10 @@ class _PeopleOnThePropertyPageWidgetState
top: true, top: true,
child: FutureBuilder<ApiCallResponse>( child: FutureBuilder<ApiCallResponse>(
future: PhpGroup.getPessoasLocalCall.call( future: PhpGroup.getPessoasLocalCall.call(
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
ownID: FFAppState().ownerUUID, ownID: AppState().ownerUUID,
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
), ),
builder: (context, snapshot) { builder: (context, snapshot) {
// Customize what your widget looks like when it's loading. // Customize what your widget looks like when it's loading.
@ -115,7 +113,12 @@ class _PeopleOnThePropertyPageWidgetState
if (snapshot.hasError || snapshot.data?.exception != null) { if (snapshot.hasError || snapshot.data?.exception != null) {
if (snapshot.error != null && snapshot.stackTrace != null) { if (snapshot.error != null && snapshot.stackTrace != null) {
LogUtil.requestAPIFailed('getPessoasLocal.php', "", 'Busca Pessoas no Local', snapshot.error, snapshot.stackTrace!); LogUtil.requestAPIFailed(
'getPessoasLocal.php',
"",
'Busca Pessoas no Local',
snapshot.error,
snapshot.stackTrace!);
} }
return Center( return Center(
@ -124,9 +127,8 @@ class _PeopleOnThePropertyPageWidgetState
height: 100, height: 100,
child: Text( child: Text(
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
ptText: "Pessoas não encontradas", ptText: "Pessoas não encontradas",
enText: "Persons not found" enText: "Persons not found"),
),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
@ -134,7 +136,12 @@ class _PeopleOnThePropertyPageWidgetState
} }
final columnGetPessoasLocalResponse = snapshot.data!; final columnGetPessoasLocalResponse = snapshot.data!;
final getPoepleProperty = PhpGroup.getPessoasLocalCall.pessoas(columnGetPessoasLocalResponse.jsonBody,)?.toList() ?? []; final getPoepleProperty = PhpGroup.getPessoasLocalCall
.pessoas(
columnGetPessoasLocalResponse.jsonBody,
)
?.toList() ??
[];
return ListView.builder( return ListView.builder(
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
@ -170,7 +177,8 @@ class _PeopleOnThePropertyPageWidgetState
r'''$.USU_NOME''', r'''$.USU_NOME''',
).toString(), ).toString(),
style: FlutterFlowTheme.of(context).bodyMedium.override( style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
fontSize: 14.0, fontSize: 14.0,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(

View File

@ -16,17 +16,17 @@ class PreferencesPageModel with ChangeNotifier {
final unfocusNode = FocusNode(); final unfocusNode = FocusNode();
Future<void> toggleFingerprint(BuildContext context) async { Future<void> toggleFingerprint(BuildContext context) async {
// FFAppState().checkBiometrics() // AppState().checkBiometrics()
// .then((value) => FFAppState().authenticateBiometric() // .then((value) => AppState().authenticateBiometric()
// .then( (value) { // .then( (value) {
// FFAppState().fingerprint = !FFAppState().fingerprint; // AppState().fingerprint = !AppState().fingerprint;
// }) // })
// .whenComplete(() => notifyListeners())); // .whenComplete(() => notifyListeners()));
if (FFAppState().fingerprint) { if (AppState().fingerprint) {
FFAppState().fingerprint = false; AppState().fingerprint = false;
FFAppState().deleteFingerprintPass(); AppState().deleteFingerprintPass();
notifyListeners(); notifyListeners();
} else { } else {
await showModalBottomSheet( await showModalBottomSheet(
@ -39,8 +39,8 @@ class PreferencesPageModel with ChangeNotifier {
padding: MediaQuery.viewInsetsOf(context), padding: MediaQuery.viewInsetsOf(context),
child: PassKeyTemplateWidget( child: PassKeyTemplateWidget(
toggleActionStatus: (key) async { toggleActionStatus: (key) async {
FFAppState().fingerprintPass = key; AppState().fingerprintPass = key;
FFAppState().fingerprint = true; AppState().fingerprint = true;
}, },
), ),
); );
@ -88,8 +88,8 @@ class PreferencesPageModel with ChangeNotifier {
Share.share( Share.share(
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
ptText: ptText:
'Este é o meu identificador de acesso: ${FFAppState().userDevUUID}', 'Este é o meu identificador de acesso: ${AppState().userDevUUID}',
enText: 'This is my access identifier: ${FFAppState().userDevUUID}', enText: 'This is my access identifier: ${AppState().userDevUUID}',
), ),
); );
} }
@ -102,19 +102,19 @@ class PreferencesPageModel with ChangeNotifier {
backgroundColor: FlutterFlowTheme.of(context).primaryBackground, backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
title: Text( title: Text(
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
enText: FFAppState().notify enText: AppState().notify
? 'Disable Access Notification' ? 'Disable Access Notification'
: 'Access Notification', : 'Access Notification',
ptText: FFAppState().notify ptText: AppState().notify
? 'Desativar notificação de acesso' ? 'Desativar notificação de acesso'
: 'Notificação de acesso'), : 'Notificação de acesso'),
), ),
content: Text( content: Text(
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
ptText: FFAppState().notify ptText: AppState().notify
? 'Tem certeza que deseja desativar as suas notificações de acesso?' ? 'Tem certeza que deseja desativar as suas notificações de acesso?'
: 'Tem certeza que deseja receber as suas notificações de acesso?', : 'Tem certeza que deseja receber as suas notificações de acesso?',
enText: FFAppState().notify enText: AppState().notify
? 'Are you sure you want to disable your access notifications?' ? 'Are you sure you want to disable your access notifications?'
: 'Are you sure you want to receive your access notifications?'), : 'Are you sure you want to receive your access notifications?'),
), ),
@ -150,17 +150,17 @@ class PreferencesPageModel with ChangeNotifier {
try { try {
PhpGroup.changeNotifica PhpGroup.changeNotifica
.call( .call(
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
atividade: 'updVisitado', atividade: 'updVisitado',
notifica: FFAppState().notify ? 'S' : 'N', notifica: AppState().notify ? 'S' : 'N',
) )
.then((value) { .then((value) {
if (value.jsonBody['error'] == false) { if (value.jsonBody['error'] == false) {
Navigator.pop(context); Navigator.pop(context);
FFAppState().notify = !FFAppState().notify; AppState().notify = !AppState().notify;
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text( content: Text(
@ -306,16 +306,16 @@ class PreferencesPageModel with ChangeNotifier {
try { try {
await PhpGroup.resopndeVinculo await PhpGroup.resopndeVinculo
.call( .call(
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
tarefa: 'I', tarefa: 'I',
) )
.then((value) { .then((value) {
if (value.jsonBody['error'] == false) { if (value.jsonBody['error'] == false) {
FFAppState().deleteCliUUID(); AppState().deleteCliUUID();
FFAppState().deleteLocal(); AppState().deleteLocal();
FFAppState().deleteOwnerUUID(); AppState().deleteOwnerUUID();
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
@ -460,13 +460,13 @@ class PreferencesPageModel with ChangeNotifier {
try { try {
await PhpGroup.deleteAccount await PhpGroup.deleteAccount
.call( .call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
) )
.then((value) { .then((value) {
if (value.jsonBody['error'] == false) { if (value.jsonBody['error'] == false) {
FFAppState().deleteAll(); AppState().deleteAll();
FFAppState().isLogged = false; AppState().isLogged = false;
context.goNamed( context.goNamed(
'welcomePage', 'welcomePage',
extra: <String, dynamic>{ extra: <String, dynamic>{
@ -550,9 +550,9 @@ class PreferencesPageModel with ChangeNotifier {
} }
Future<void> togglePass(BuildContext context) async { Future<void> togglePass(BuildContext context) async {
// if (FFAppState().pass) { // if (AppState().pass) {
// FFAppState().pass = false; // AppState().pass = false;
// FFAppState().deleteAccessPass(); // AppState().deleteAccessPass();
// notifyListeners(); // notifyListeners();
// } else { // } else {
await showModalBottomSheet( await showModalBottomSheet(
@ -565,20 +565,20 @@ class PreferencesPageModel with ChangeNotifier {
padding: MediaQuery.viewInsetsOf(context), padding: MediaQuery.viewInsetsOf(context),
child: PassKeyTemplateWidget( child: PassKeyTemplateWidget(
toggleActionStatus: (key) async { toggleActionStatus: (key) async {
FFAppState().accessPass = key; AppState().accessPass = key;
notifyListeners(); notifyListeners();
await PhpGroup.changePass await PhpGroup.changePass
.call( .call(
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
atividade: 'updVisitado', atividade: 'updVisitado',
newSenha: FFAppState().accessPass, newSenha: AppState().accessPass,
) )
.then((value) { .then((value) {
// var error = jsonDecode(value.jsonBody['error'].toString()); // var error = jsonDecode(value.jsonBody['error'].toString());
if (jsonDecode(value.jsonBody['error'].toString()) == false) { if (jsonDecode(value.jsonBody['error'].toString()) == false) {
FFAppState().pass = true; AppState().pass = true;
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text( content: Text(
@ -614,10 +614,10 @@ class PreferencesPageModel with ChangeNotifier {
), ),
), ),
); );
// FFAppState().pass = false; // AppState().pass = false;
} }
}).catchError((error, StackTrace) { }).catchError((error, StackTrace) {
// FFAppState().pass = false; // AppState().pass = false;
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text( content: Text(
@ -655,20 +655,20 @@ class PreferencesPageModel with ChangeNotifier {
padding: MediaQuery.viewInsetsOf(context), padding: MediaQuery.viewInsetsOf(context),
child: PassKeyTemplateWidget( child: PassKeyTemplateWidget(
toggleActionStatus: (key) async { toggleActionStatus: (key) async {
FFAppState().panicPass = key; AppState().panicPass = key;
notifyListeners(); notifyListeners();
await PhpGroup.changePanic await PhpGroup.changePanic
.call( .call(
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
atividade: 'updVisitado', atividade: 'updVisitado',
newSenhaPanico: FFAppState().panicPass, newSenhaPanico: AppState().panicPass,
) )
.then((value) { .then((value) {
FFAppState().panic = true; AppState().panic = true;
if (jsonDecode(value.jsonBody['error'].toString()) == false) { if (jsonDecode(value.jsonBody['error'].toString()) == false) {
FFAppState().panic = true; AppState().panic = true;
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text( content: Text(
@ -704,10 +704,10 @@ class PreferencesPageModel with ChangeNotifier {
), ),
), ),
); );
// FFAppState().panic = false; // AppState().panic = false;
} }
}).catchError((e, s) { }).catchError((e, s) {
// FFAppState().panic = false; // AppState().panic = false;
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(

View File

@ -101,7 +101,7 @@ class PreferencesPageWidget extends StatelessWidget {
icon = Icons.fingerprint; icon = Icons.fingerprint;
onPressed = () => onPressed = () =>
model.toggleFingerprint(context); // Disable if fingerprint is false model.toggleFingerprint(context); // Disable if fingerprint is false
isEnabled = FFAppState().fingerprint; isEnabled = AppState().fingerprint;
content = FFLocalizations.of(context).getVariableText( content = FFLocalizations.of(context).getVariableText(
ptText: ptText:
'Ative a autenticação por impressão digital para login seguro.', 'Ative a autenticação por impressão digital para login seguro.',
@ -111,7 +111,7 @@ class PreferencesPageWidget extends StatelessWidget {
case 1: case 1:
icon = Icons.person; icon = Icons.person;
onPressed = () => model.enablePerson(context); onPressed = () => model.enablePerson(context);
isEnabled = FFAppState().person; isEnabled = AppState().person;
content = FFLocalizations.of(context).getVariableText( content = FFLocalizations.of(context).getVariableText(
ptText: 'Compartilhe o código de identificação remota', ptText: 'Compartilhe o código de identificação remota',
enText: 'Share the remote identification code', enText: 'Share the remote identification code',
@ -120,7 +120,7 @@ class PreferencesPageWidget extends StatelessWidget {
case 2: case 2:
icon = Icons.notifications; icon = Icons.notifications;
onPressed = () => model.toggleNotify(context); onPressed = () => model.toggleNotify(context);
isEnabled = FFAppState().notify; isEnabled = AppState().notify;
content = FFLocalizations.of(context).getVariableText( content = FFLocalizations.of(context).getVariableText(
ptText: 'Ative para receber sua notificação de acesso', ptText: 'Ative para receber sua notificação de acesso',
enText: 'Enable to receive your access notification', enText: 'Enable to receive your access notification',
@ -129,7 +129,7 @@ class PreferencesPageWidget extends StatelessWidget {
case 3: case 3:
icon = Icons.lock; icon = Icons.lock;
// onLongPress = model.togglePass(context, model); // onLongPress = model.togglePass(context, model);
isEnabled = FFAppState().pass; isEnabled = AppState().pass;
content = FFLocalizations.of(context).getVariableText( content = FFLocalizations.of(context).getVariableText(
ptText: 'Ative para inserir uma credencial de acesso para o QRCode', ptText: 'Ative para inserir uma credencial de acesso para o QRCode',
enText: 'Enable to enter an access credential for the QRCode', enText: 'Enable to enter an access credential for the QRCode',
@ -138,7 +138,7 @@ class PreferencesPageWidget extends StatelessWidget {
case 4: case 4:
icon = Icons.lock_clock_sharp; icon = Icons.lock_clock_sharp;
// onLongPress = model.togglePass(context, model); // onLongPress = model.togglePass(context, model);
isEnabled = FFAppState().panic; isEnabled = AppState().panic;
content = FFLocalizations.of(context).getVariableText( content = FFLocalizations.of(context).getVariableText(
ptText: 'Ative para inserir uma credencial de pânico para o QRCode', ptText: 'Ative para inserir uma credencial de pânico para o QRCode',
enText: 'Enable to enter an panic credential for the QRCode', enText: 'Enable to enter an panic credential for the QRCode',

View File

@ -145,14 +145,14 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget>
safeSetState(() async { safeSetState(() async {
_resetAnimationAndToggleAccess(); _resetAnimationAndToggleAccess();
}); });
FFAppState().fingerprint AppState().fingerprint
? await _showBiometricsAuth(context) ? await _showBiometricsAuth(context)
: await _showQrCodeBottomSheet(context); : await _showQrCodeBottomSheet(context);
}, },
child: buildQrCode( child: buildQrCode(
dimension: dimension, dimension: dimension,
errorCorrectLevel: QrErrorCorrectLevel.M, errorCorrectLevel: QrErrorCorrectLevel.M,
identifier: FFAppState().userDevUUID, identifier: AppState().userDevUUID,
pass: _model.key!, pass: _model.key!,
direction: 5, direction: 5,
), ),
@ -200,7 +200,7 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget>
alignment: const AlignmentDirectional(0.0, 0.0), alignment: const AlignmentDirectional(0.0, 0.0),
child: FFButtonWidget( child: FFButtonWidget(
onPressed: () async { onPressed: () async {
FFAppState().fingerprint AppState().fingerprint
? await _showBiometricsAuth(context) ? await _showBiometricsAuth(context)
: await _showQrCodeBottomSheet(context); : await _showQrCodeBottomSheet(context);
}, },
@ -362,9 +362,9 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget>
} }
Future<void> _showBiometricsAuth(BuildContext context) async { Future<void> _showBiometricsAuth(BuildContext context) async {
FFAppState() AppState()
.checkBiometrics() .checkBiometrics()
.then((value) => FFAppState().authenticateBiometric().then((value) { .then((value) => AppState().authenticateBiometric().then((value) {
safeSetState(() { safeSetState(() {
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
animationsMap['barcodeOnActionTriggerAnimation']! animationsMap['barcodeOnActionTriggerAnimation']!
@ -375,7 +375,7 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget>
.reverse(); .reverse();
} }
_model.isAccess = !_model.isAccess; _model.isAccess = !_model.isAccess;
_model.key = FFAppState().fingerprintPass; _model.key = AppState().fingerprintPass;
}); });
})) }))
.onError((error, StackTrace) { .onError((error, StackTrace) {

View File

@ -37,7 +37,7 @@ class _RegisterVisitorPageWidgetState extends State<RegisterVisitorPageWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: FlutterFlowTheme.of(context).primaryBackground, backgroundColor: FlutterFlowTheme.of(context).primaryBackground,

View File

@ -1,22 +1,15 @@
import 'dart:developer';
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart'; import 'package:flutter/scheduler.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:hub/actions/actions.dart';
import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/backend/api_requests/api_calls.dart';
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
import 'package:hub/components/templates_components/details_component/details_component_action.dart';
import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; import 'package:hub/components/templates_components/details_component/details_component_widget.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_search_modal_template_component/visitor_search_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/custom_functions.dart';
import 'package:hub/flutter_flow/flutter_flow_drop_down.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_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_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
@ -149,7 +142,7 @@ class _ScheduleCompleteVisitPageWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return GestureDetector( return GestureDetector(
onTap: () => _model.unfocusNode.canRequestFocus onTap: () => _model.unfocusNode.canRequestFocus
@ -872,7 +865,7 @@ Widget scheduleVisit(BuildContext context,
fadeOutDuration: fadeOutDuration:
const Duration(milliseconds: 500), const Duration(milliseconds: 500),
imageUrl: 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", "https://freaccess.com.br/freaccess/getImage.php?devUUID=${AppState().devUUID}&userUUID=${AppState().userUUID}&cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(visitorListViewItem, r'''$.VTE_DOCUMENTO''').toString()}&tipo=E",
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -1086,9 +1079,9 @@ Widget scheduleVisit(BuildContext context,
decoration: const BoxDecoration(), decoration: const BoxDecoration(),
child: FutureBuilder<ApiCallResponse>( child: FutureBuilder<ApiCallResponse>(
future: PhpGroup.getDadosCall.call( future: PhpGroup.getDadosCall.call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
cliUUID: FFAppState().cliUUID, cliUUID: AppState().cliUUID,
atividade: 'getDados', atividade: 'getDados',
), ),
builder: (context, snapshot) { builder: (context, snapshot) {
@ -1239,9 +1232,9 @@ Widget scheduleVisit(BuildContext context,
decoration: const BoxDecoration(), decoration: const BoxDecoration(),
child: FutureBuilder<ApiCallResponse>( child: FutureBuilder<ApiCallResponse>(
future: PhpGroup.getDadosCall.call( future: PhpGroup.getDadosCall.call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
cliUUID: FFAppState().cliUUID, cliUUID: AppState().cliUUID,
atividade: 'getDados', atividade: 'getDados',
), ),
builder: (context, snapshot) { builder: (context, snapshot) {
@ -1667,8 +1660,8 @@ Widget scheduleVisit(BuildContext context,
), () async { ), () async {
await PhpGroup.postScheduleVisitCall await PhpGroup.postScheduleVisitCall
.call( .call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
atividade: 'putVisita', atividade: 'putVisita',
devDesc: _model.textController3.text, devDesc: _model.textController3.text,
idVisitante: _model.visitorStrList, idVisitante: _model.visitorStrList,
@ -1684,7 +1677,7 @@ Widget scheduleVisit(BuildContext context,
idNAC: extractIdToStr( idNAC: extractIdToStr(
_model.dropDownValue2!), _model.dropDownValue2!),
obs: _model.textController3.text, obs: _model.textController3.text,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
) )
.catchError((e) async { .catchError((e) async {
await DialogUtil.errorDefault(context); await DialogUtil.errorDefault(context);
@ -1738,7 +1731,7 @@ Widget scheduleVisit(BuildContext context,
), ),
], ],
imagePath: imagePath:
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${_model.visitorJsonList[0]['VTE_DOCUMENTO'] ?? ''}&tipo=E', 'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${_model.visitorJsonList[0]['VTE_DOCUMENTO'] ?? ''}&tipo=E',
labelsHashMap: { labelsHashMap: {
'Nome': _model.visitorJsonList[0]['VTE_NOME'], 'Nome': _model.visitorJsonList[0]['VTE_NOME'],
'Start': _model.textController1.text, 'Start': _model.textController1.text,

View File

@ -1,22 +1,19 @@
import 'dart:developer';
import 'package:hub/shared/utils/dialog_util.dart';
import 'package:hub/shared/utils/log_util.dart';
import '/backend/api_requests/api_calls.dart';
import '/components/molecular_components/throw_exception/throw_exception_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 '/flutter_flow/flutter_flow_widgets.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:easy_debounce/easy_debounce.dart'; import 'package:easy_debounce/easy_debounce.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:hub/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart'; import 'package:hub/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart';
import 'package:hub/shared/utils/dialog_util.dart';
import 'package:hub/shared/utils/log_util.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.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 '/flutter_flow/flutter_flow_widgets.dart';
class ScheduleProvisionalVisitPageWidget extends StatefulWidget { class ScheduleProvisionalVisitPageWidget extends StatefulWidget {
const ScheduleProvisionalVisitPageWidget({super.key}); const ScheduleProvisionalVisitPageWidget({super.key});
@ -68,7 +65,7 @@ class _ScheduleProvisionalVisitPageWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return GestureDetector( return GestureDetector(
onTap: () => FocusScope.of(context).unfocus(), onTap: () => FocusScope.of(context).unfocus(),
@ -226,7 +223,7 @@ class _ScheduleProvisionalVisitPageWidgetState
fadeOutDuration: const Duration( fadeOutDuration: const Duration(
milliseconds: 200), milliseconds: 200),
imageUrl: imageUrl:
'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', 'https://freaccess.com.br/freaccess/Images/Clients/${AppState().cliUUID}.png',
width: 35.0, width: 35.0,
height: 35.0, height: 35.0,
fit: BoxFit.contain, fit: BoxFit.contain,
@ -238,7 +235,7 @@ class _ScheduleProvisionalVisitPageWidgetState
padding: const EdgeInsetsDirectional padding: const EdgeInsetsDirectional
.fromSTEB(15.0, 0.0, 0.0, 0.0), .fromSTEB(15.0, 0.0, 0.0, 0.0),
child: Text( child: Text(
FFAppState().local, AppState().local,
style: style:
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.bodyMedium .bodyMedium
@ -983,16 +980,16 @@ class _ScheduleProvisionalVisitPageWidgetState
_model.provVisitSchedule = await PhpGroup _model.provVisitSchedule = await PhpGroup
.postProvVisitSchedulingCall .postProvVisitSchedulingCall
.call( .call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
atividade: 'putAgendamentoProv', atividade: 'putAgendamentoProv',
data: data:
_model.dateTimeTextController.text, _model.dateTimeTextController.text,
motivo: _model.notesTextController.text, motivo: _model.notesTextController.text,
nome: _model nome: _model
.personNameTextController.text, .personNameTextController.text,
proID: FFAppState().ownerUUID, proID: AppState().ownerUUID,
); );
if (PhpGroup.postProvVisitSchedulingCall if (PhpGroup.postProvVisitSchedulingCall

View File

@ -1,15 +1,10 @@
import 'dart:developer';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hub/actions/actions.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_calls.dart';
import 'package:hub/backend/api_requests/api_manager.dart';
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
import 'package:hub/components/templates_components/details_component/details_component_action.dart'; import 'package:hub/components/templates_components/details_component/details_component_action.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.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_util.dart';
import 'package:hub/flutter_flow/internationalization.dart';
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart';
import 'package:hub/shared/utils/dialog_util.dart'; import 'package:hub/shared/utils/dialog_util.dart';
import 'package:hub/shared/utils/log_util.dart'; import 'package:hub/shared/utils/log_util.dart';
@ -22,7 +17,8 @@ class VisitHistoryWidget extends StatefulWidget {
_VisitHistoryWidgetState createState() => _VisitHistoryWidgetState(); _VisitHistoryWidgetState createState() => _VisitHistoryWidgetState();
} }
class _VisitHistoryWidgetState extends State<VisitHistoryWidget> with TickerProviderStateMixin { class _VisitHistoryWidgetState extends State<VisitHistoryWidget>
with TickerProviderStateMixin {
late ScrollController _scrollController; late ScrollController _scrollController;
int _pageNumber = 1; int _pageNumber = 1;
final int _pageSize = 10; final int _pageSize = 10;
@ -37,11 +33,13 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget> with TickerProv
super.initState(); super.initState();
_visitFuture = _fetchVisits(); _visitFuture = _fetchVisits();
_scrollController = ScrollController()..addListener(() { _scrollController = ScrollController()
if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { ..addListener(() {
if (_scrollController.position.atEdge &&
_scrollController.position.pixels != 0) {
_loadMore(); _loadMore();
} }
}); });
} }
@override @override
@ -56,9 +54,9 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget> with TickerProv
var response = await ScheduleCompleteVisitPageModel().visitHistory( var response = await ScheduleCompleteVisitPageModel().visitHistory(
requestFn: () => PhpGroup.getVisitsCall.call( requestFn: () => PhpGroup.getVisitsCall.call(
devUUID: FFAppState().devUUID, devUUID: AppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: AppState().userUUID,
cliID: FFAppState().cliUUID, cliID: AppState().cliUUID,
atividade: 'getVisitas', atividade: 'getVisitas',
pageSize: _pageSize, pageSize: _pageSize,
pageNumber: _pageNumber, pageNumber: _pageNumber,
@ -87,7 +85,8 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget> with TickerProv
return null; return null;
} catch (e, s) { } catch (e, s) {
DialogUtil.errorDefault(context); DialogUtil.errorDefault(context);
LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Visitas", e, s); LogUtil.requestAPIFailed(
"proccessRequest.php", "", "Consulta de Visitas", e, s);
setState(() { setState(() {
_hasData = false; _hasData = false;
_loading = false; _loading = false;
@ -117,7 +116,6 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget> with TickerProv
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -138,21 +136,20 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget> with TickerProv
) )
else if (_hasData == true || _pageNumber >= 1) else if (_hasData == true || _pageNumber >= 1)
Expanded( Expanded(
child: FutureBuilder<void>( child: FutureBuilder<void>(
future: _visitFuture, future: _visitFuture,
builder: (context, snapshot) { builder: (context, snapshot) {
return ListView.builder( return ListView.builder(
shrinkWrap: true, shrinkWrap: true,
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
controller: _scrollController, controller: _scrollController,
itemCount: _visitWrap.length, itemCount: _visitWrap.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final item = _visitWrap[index]; final item = _visitWrap[index];
return _item(context, item); return _item(context, item);
}); });
}, },
) )),
),
if (_hasData == true && _loading == true) if (_hasData == true && _loading == true)
Container( Container(
padding: const EdgeInsets.only(top: 15, bottom: 15), padding: const EdgeInsets.only(top: 15, bottom: 15),
@ -166,18 +163,27 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget> with TickerProv
) )
].addToStart(const SizedBox(height: 0)), ].addToStart(const SizedBox(height: 0)),
); );
} }
Widget _item(BuildContext context, dynamic visitaWrapItem) { Widget _item(BuildContext context, dynamic visitaWrapItem) {
return CardItemTemplateComponentWidget( return CardItemTemplateComponentWidget(
imagePath: imagePath:
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${visitaWrapItem['VTE_DOCUMENTO'] ?? ''}&tipo=E', 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${AppState().devUUID}&userUUID=${AppState().userUUID}&cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${visitaWrapItem['VTE_DOCUMENTO'] ?? ''}&tipo=E',
labelsHashMap: { labelsHashMap: {
'${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': visitaWrapItem['VTE_NOME'] ?? '', '${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:':
'${FFLocalizations.of(context).getVariableText(ptText: "Inicio", enText: "Start")}:': visitaWrapItem['VAW_DTINICIO'] != '' && visitaWrapItem['VAW_DTINICIO'] != null ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTINICIO']) : '', visitaWrapItem['VTE_NOME'] ?? '',
'${FFLocalizations.of(context).getVariableText(ptText: "Fim", enText: "End")}:': visitaWrapItem['VAW_DTFIM'] != '' && visitaWrapItem['VAW_DTFIM'] != null ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTFIM']) : '', '${FFLocalizations.of(context).getVariableText(ptText: "Inicio", enText: "Start")}:':
visitaWrapItem['VAW_DTINICIO'] != '' &&
visitaWrapItem['VAW_DTINICIO'] != null
? ValidatorUtil.toLocalDateTime(
'yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTINICIO'])
: '',
'${FFLocalizations.of(context).getVariableText(ptText: "Fim", enText: "End")}:':
visitaWrapItem['VAW_DTFIM'] != '' &&
visitaWrapItem['VAW_DTFIM'] != null
? ValidatorUtil.toLocalDateTime(
'yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTFIM'])
: '',
}, },
statusHashMap: [ statusHashMap: [
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active)
@ -238,16 +244,15 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget> with TickerProv
); );
}, },
).whenComplete(() { ).whenComplete(() {
safeSetState(() { safeSetState(() {
_pageNumber = 1; _pageNumber = 1;
_visitWrap = []; _visitWrap = [];
_visitFuture = _fetchVisits(); _visitFuture = _fetchVisits();
}); });
}).catchError((e, s) { }).catchError((e, s) {
DialogUtil.errorDefault(context); DialogUtil.errorDefault(context);
LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Visitas", e, s); LogUtil.requestAPIFailed(
"proccessRequest.php", "", "Consulta de Visitas", e, s);
safeSetState(() { safeSetState(() {
_hasData = false; _hasData = false;
_loading = false; _loading = false;

View File

@ -28,13 +28,13 @@ class _WelcomePageWidgetState extends State<WelcomePageWidget> {
// On page load action. // On page load action.
SchedulerBinding.instance.addPostFrameCallback((_) async { SchedulerBinding.instance.addPostFrameCallback((_) async {
if (isAndroid == true) { if (isAndroid == true) {
FFAppState().device = 'Android'; AppState().device = 'Android';
setState(() {}); setState(() {});
} else if (isiOS == true) { } else if (isiOS == true) {
FFAppState().device = 'iOS'; AppState().device = 'iOS';
setState(() {}); setState(() {});
} else { } else {
FFAppState().device = 'Web'; AppState().device = 'Web';
setState(() {}); setState(() {});
} }
}); });
@ -49,7 +49,7 @@ class _WelcomePageWidgetState extends State<WelcomePageWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<AppState>();
return GestureDetector( return GestureDetector(
onTap: () => _model.unfocusNode.canRequestFocus onTap: () => _model.unfocusNode.canRequestFocus

View File

@ -1,15 +1,14 @@
import 'dart:developer';
import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/backend/api_requests/api_calls.dart';
class LogUtil { class LogUtil {
static void requestAPIFailed(String url, String body, String reason,
static void requestAPIFailed(String url, String body, String reason, dynamic error, StackTrace stack) async { dynamic error, StackTrace stack) async {
FirebaseCrashlytics.instance.setCustomKey('URL', "${PhpGroup.getBaseUrl()}/$url"); FirebaseCrashlytics.instance
.setCustomKey('URL', "${PhpGroup.getBaseUrl()}/$url");
FirebaseCrashlytics.instance.setCustomKey('Body', body); FirebaseCrashlytics.instance.setCustomKey('Body', body);
await FirebaseCrashlytics.instance.recordError(error, stack, reason: reason); await FirebaseCrashlytics.instance
.recordError(error, stack, reason: reason);
} }
} }

14051
log

File diff suppressed because one or more lines are too long

View File

@ -41,6 +41,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.0" version: "3.0.0"
awesome_notifications:
dependency: "direct main"
description:
name: awesome_notifications
sha256: d9e46ce7f5171ee1e9b1c5bc6dc40bd77528561f592842ce97ce3a0a9ae155ef
url: "https://pub.dev"
source: hosted
version: "0.9.3+1"
barcode: barcode:
dependency: transitive dependency: transitive
description: description:
@ -173,10 +181,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: crypto name: crypto
sha256: "1dceb0cf05cb63a7852c11560060e53ec2f182079a16ced6f4395c5b0875baf8" sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.4" version: "3.0.5"
csslib: csslib:
dependency: transitive dependency: transitive
description: description:
@ -518,30 +526,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.0.0" version: "4.0.0"
flutter_local_notifications:
dependency: "direct main"
description:
name: flutter_local_notifications
sha256: c500d5d9e7e553f06b61877ca6b9c8b92c570a4c8db371038702e8ce57f8a50f
url: "https://pub.dev"
source: hosted
version: "17.2.2"
flutter_local_notifications_linux:
dependency: transitive
description:
name: flutter_local_notifications_linux
sha256: c49bd06165cad9beeb79090b18cd1eb0296f4bf4b23b84426e37dd7c027fc3af
url: "https://pub.dev"
source: hosted
version: "4.0.1"
flutter_local_notifications_platform_interface:
dependency: transitive
description:
name: flutter_local_notifications_platform_interface
sha256: "85f8d07fe708c1bdcf45037f2c0109753b26ae077e9d9e899d55971711a4ea66"
url: "https://pub.dev"
source: hosted
version: "7.2.0"
flutter_localizations: flutter_localizations:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -1073,10 +1057,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_android name: permission_handler_android
sha256: eaf2a1ec4472775451e88ca6a7b86559ef2f1d1ed903942ed135e38ea0097dca sha256: "76e4ab092c1b240d31177bb64d2b0bea43f43d0e23541ec866151b9f7b2490fa"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "12.0.8" version: "12.0.12"
permission_handler_apple: permission_handler_apple:
dependency: transitive dependency: transitive
description: description:
@ -1089,10 +1073,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_html name: permission_handler_html
sha256: "6cac773d389e045a8d4f85418d07ad58ef9e42a56e063629ce14c4c26344de24" sha256: af26edbbb1f2674af65a8f4b56e1a6f526156bc273d0e65dd8075fab51c78851
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.1.2" version: "0.1.3+2"
permission_handler_platform_interface: permission_handler_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -1302,10 +1286,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: sqflite_common name: sqflite_common
sha256: c5e5b2a142a893a752cb36ae5888680248686725a54afceff31f9a3a76bc53c2 sha256: "7b41b6c3507854a159e24ae90a8e3e9cc01eb26a477c118d6dca065b5f55453e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.5.4+1" version: "2.5.4+2"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -1370,14 +1354,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.6.1" version: "3.6.1"
timezone:
dependency: transitive
description:
name: timezone
sha256: "2236ec079a174ce07434e89fcd3fcda430025eb7692244139a9cf54fdcf1fc7d"
url: "https://pub.dev"
source: hosted
version: "0.9.4"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@ -1550,10 +1526,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: webview_flutter name: webview_flutter
sha256: "6869c8786d179f929144b4a1f86e09ac0eddfe475984951ea6c634774c16b522" sha256: ec81f57aa1611f8ebecf1d2259da4ef052281cb5ad624131c93546c79ccc7736
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.8.0" version: "4.9.0"
webview_flutter_android: webview_flutter_android:
dependency: transitive dependency: transitive
description: description:
@ -1574,10 +1550,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: webview_flutter_wkwebview name: webview_flutter_wkwebview
sha256: "9c62cc46fa4f2d41e10ab81014c1de470a6c6f26051a2de32111b2ee55287feb" sha256: "1942a12224ab31e9508cf00c0c6347b931b023b8a4f0811e5dec3b06f94f117d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.14.0" version: "3.15.0"
win32: win32:
dependency: "direct overridden" dependency: "direct overridden"
description: description:
@ -1620,4 +1596,4 @@ packages:
version: "3.1.2" version: "3.1.2"
sdks: sdks:
dart: ">=3.5.0 <4.0.0" dart: ">=3.5.0 <4.0.0"
flutter: ">=3.22.0" flutter: ">=3.24.0"

View File

@ -24,7 +24,6 @@ dependencies:
crop_your_image: 1.1.0 crop_your_image: 1.1.0
csv: 6.0.0 csv: 6.0.0
device_info_plus: 10.1.0 device_info_plus: 10.1.0
flutter_local_notifications: ^17.2.2
firebase_messaging: 15.0.1 firebase_messaging: 15.0.1
dropdown_button2: 2.3.9 dropdown_button2: 2.3.9
easy_debounce: 2.0.3 easy_debounce: 2.0.3
@ -87,6 +86,7 @@ dependencies:
video_player_avfoundation: 2.6.1 video_player_avfoundation: 2.6.1
video_player_platform_interface: 6.2.2 video_player_platform_interface: 6.2.2
video_player_web: 2.3.1 video_player_web: 2.3.1
fluttertoast: ^8.2.8
cupertino_icons: ^1.0.0 cupertino_icons: ^1.0.0
flutter_bloc: ^8.1.6 flutter_bloc: ^8.1.6
@ -94,7 +94,7 @@ dependencies:
qr_flutter: ^4.1.0 qr_flutter: ^4.1.0
permission_handler: ^11.3.1 permission_handler: ^11.3.1
firebase_crashlytics: ^4.0.1 firebase_crashlytics: ^4.0.1
fluttertoast: ^8.2.8 awesome_notifications: ^0.9.3+1
dependency_overrides: dependency_overrides:
http: 1.2.1 http: 1.2.1