Merge branch 'main' into bugfix/fd-597
This commit is contained in:
commit
0ec7f051ad
|
@ -42,6 +42,9 @@ PODS:
|
||||||
- FirebaseAnalytics (~> 10.27.0)
|
- FirebaseAnalytics (~> 10.27.0)
|
||||||
- Firebase/CoreOnly (10.27.0):
|
- Firebase/CoreOnly (10.27.0):
|
||||||
- FirebaseCore (= 10.27.0)
|
- FirebaseCore (= 10.27.0)
|
||||||
|
- Firebase/Crashlytics (10.27.0):
|
||||||
|
- Firebase/CoreOnly
|
||||||
|
- FirebaseCrashlytics (~> 10.27.0)
|
||||||
- Firebase/Messaging (10.27.0):
|
- Firebase/Messaging (10.27.0):
|
||||||
- Firebase/CoreOnly
|
- Firebase/CoreOnly
|
||||||
- FirebaseMessaging (~> 10.27.0)
|
- FirebaseMessaging (~> 10.27.0)
|
||||||
|
@ -52,6 +55,10 @@ PODS:
|
||||||
- firebase_core (3.1.0):
|
- firebase_core (3.1.0):
|
||||||
- Firebase/CoreOnly (= 10.27.0)
|
- Firebase/CoreOnly (= 10.27.0)
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- firebase_crashlytics (4.0.1):
|
||||||
|
- Firebase/Crashlytics (= 10.27.0)
|
||||||
|
- firebase_core
|
||||||
|
- Flutter
|
||||||
- firebase_messaging (15.0.1):
|
- firebase_messaging (15.0.1):
|
||||||
- Firebase/Messaging (= 10.27.0)
|
- Firebase/Messaging (= 10.27.0)
|
||||||
- firebase_core
|
- firebase_core
|
||||||
|
@ -78,8 +85,19 @@ PODS:
|
||||||
- FirebaseCoreInternal (~> 10.0)
|
- FirebaseCoreInternal (~> 10.0)
|
||||||
- GoogleUtilities/Environment (~> 7.12)
|
- GoogleUtilities/Environment (~> 7.12)
|
||||||
- GoogleUtilities/Logger (~> 7.12)
|
- GoogleUtilities/Logger (~> 7.12)
|
||||||
|
- FirebaseCoreExtension (10.29.0):
|
||||||
|
- FirebaseCore (~> 10.0)
|
||||||
- FirebaseCoreInternal (10.28.0):
|
- FirebaseCoreInternal (10.28.0):
|
||||||
- "GoogleUtilities/NSData+zlib (~> 7.8)"
|
- "GoogleUtilities/NSData+zlib (~> 7.8)"
|
||||||
|
- FirebaseCrashlytics (10.27.0):
|
||||||
|
- FirebaseCore (~> 10.5)
|
||||||
|
- FirebaseInstallations (~> 10.0)
|
||||||
|
- FirebaseRemoteConfigInterop (~> 10.23)
|
||||||
|
- FirebaseSessions (~> 10.5)
|
||||||
|
- GoogleDataTransport (~> 9.2)
|
||||||
|
- GoogleUtilities/Environment (~> 7.8)
|
||||||
|
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||||
|
- PromisesObjC (~> 2.1)
|
||||||
- FirebaseInstallations (10.28.0):
|
- FirebaseInstallations (10.28.0):
|
||||||
- FirebaseCore (~> 10.0)
|
- FirebaseCore (~> 10.0)
|
||||||
- GoogleUtilities/Environment (~> 7.8)
|
- GoogleUtilities/Environment (~> 7.8)
|
||||||
|
@ -94,6 +112,16 @@ PODS:
|
||||||
- GoogleUtilities/Reachability (~> 7.8)
|
- GoogleUtilities/Reachability (~> 7.8)
|
||||||
- GoogleUtilities/UserDefaults (~> 7.8)
|
- GoogleUtilities/UserDefaults (~> 7.8)
|
||||||
- nanopb (< 2.30911.0, >= 2.30908.0)
|
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||||
|
- FirebaseRemoteConfigInterop (10.29.0)
|
||||||
|
- FirebaseSessions (10.29.0):
|
||||||
|
- FirebaseCore (~> 10.5)
|
||||||
|
- FirebaseCoreExtension (~> 10.0)
|
||||||
|
- FirebaseInstallations (~> 10.0)
|
||||||
|
- GoogleDataTransport (~> 9.2)
|
||||||
|
- GoogleUtilities/Environment (~> 7.13)
|
||||||
|
- GoogleUtilities/UserDefaults (~> 7.13)
|
||||||
|
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||||
|
- PromisesSwift (~> 2.1)
|
||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
- flutter_inappwebview_ios (0.0.1):
|
- flutter_inappwebview_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
@ -174,6 +202,8 @@ PODS:
|
||||||
- permission_handler_apple (9.3.0):
|
- permission_handler_apple (9.3.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
- PromisesObjC (2.4.0)
|
- PromisesObjC (2.4.0)
|
||||||
|
- PromisesSwift (2.4.0):
|
||||||
|
- PromisesObjC (= 2.4.0)
|
||||||
- SDWebImage (5.19.2):
|
- SDWebImage (5.19.2):
|
||||||
- SDWebImage/Core (= 5.19.2)
|
- SDWebImage/Core (= 5.19.2)
|
||||||
- SDWebImage/Core (5.19.2)
|
- SDWebImage/Core (5.19.2)
|
||||||
|
@ -199,6 +229,7 @@ DEPENDENCIES:
|
||||||
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
||||||
- firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)
|
- firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)
|
||||||
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
|
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
|
||||||
|
- firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`)
|
||||||
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
|
- 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`)
|
||||||
|
@ -222,15 +253,20 @@ SPEC REPOS:
|
||||||
- Firebase
|
- Firebase
|
||||||
- FirebaseAnalytics
|
- FirebaseAnalytics
|
||||||
- FirebaseCore
|
- FirebaseCore
|
||||||
|
- FirebaseCoreExtension
|
||||||
- FirebaseCoreInternal
|
- FirebaseCoreInternal
|
||||||
|
- FirebaseCrashlytics
|
||||||
- FirebaseInstallations
|
- FirebaseInstallations
|
||||||
- FirebaseMessaging
|
- FirebaseMessaging
|
||||||
|
- FirebaseRemoteConfigInterop
|
||||||
|
- FirebaseSessions
|
||||||
- GoogleAppMeasurement
|
- GoogleAppMeasurement
|
||||||
- GoogleDataTransport
|
- GoogleDataTransport
|
||||||
- GoogleUtilities
|
- GoogleUtilities
|
||||||
- nanopb
|
- nanopb
|
||||||
- OrderedSet
|
- OrderedSet
|
||||||
- PromisesObjC
|
- PromisesObjC
|
||||||
|
- PromisesSwift
|
||||||
- SDWebImage
|
- SDWebImage
|
||||||
- SwiftyGif
|
- SwiftyGif
|
||||||
|
|
||||||
|
@ -243,6 +279,8 @@ EXTERNAL SOURCES:
|
||||||
:path: ".symlinks/plugins/firebase_analytics/ios"
|
:path: ".symlinks/plugins/firebase_analytics/ios"
|
||||||
firebase_core:
|
firebase_core:
|
||||||
:path: ".symlinks/plugins/firebase_core/ios"
|
:path: ".symlinks/plugins/firebase_core/ios"
|
||||||
|
firebase_crashlytics:
|
||||||
|
:path: ".symlinks/plugins/firebase_crashlytics/ios"
|
||||||
firebase_messaging:
|
firebase_messaging:
|
||||||
:path: ".symlinks/plugins/firebase_messaging/ios"
|
:path: ".symlinks/plugins/firebase_messaging/ios"
|
||||||
Flutter:
|
Flutter:
|
||||||
|
@ -282,12 +320,17 @@ SPEC CHECKSUMS:
|
||||||
Firebase: 26b040b20866a55f55eb3611b9fcf3ae64816b86
|
Firebase: 26b040b20866a55f55eb3611b9fcf3ae64816b86
|
||||||
firebase_analytics: 0627e95b73eb9e04f59167687ed5bc3f6fb50f23
|
firebase_analytics: 0627e95b73eb9e04f59167687ed5bc3f6fb50f23
|
||||||
firebase_core: 483cfad66d24d8f3c233f31db4263830c625c909
|
firebase_core: 483cfad66d24d8f3c233f31db4263830c625c909
|
||||||
|
firebase_crashlytics: 8f04c663c8734f97c4ccbe81b8511ce7060e3b28
|
||||||
firebase_messaging: e60c0694699d8a2e56a319e043709583f6544123
|
firebase_messaging: e60c0694699d8a2e56a319e043709583f6544123
|
||||||
FirebaseAnalytics: f9211b719db260cc91aebee8bb539cb367d0dfd1
|
FirebaseAnalytics: f9211b719db260cc91aebee8bb539cb367d0dfd1
|
||||||
FirebaseCore: a2b95ae4ce7c83ceecfbbbe3b6f1cddc7415a808
|
FirebaseCore: a2b95ae4ce7c83ceecfbbbe3b6f1cddc7415a808
|
||||||
|
FirebaseCoreExtension: 705ca5b14bf71d2564a0ddc677df1fc86ffa600f
|
||||||
FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698
|
FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698
|
||||||
|
FirebaseCrashlytics: 81ea6ec96519388687f6061beb838a8eec482293
|
||||||
FirebaseInstallations: 60c1d3bc1beef809fd1ad1189a8057a040c59f2e
|
FirebaseInstallations: 60c1d3bc1beef809fd1ad1189a8057a040c59f2e
|
||||||
FirebaseMessaging: 585984d0a1df120617eb10b44cad8968b859815e
|
FirebaseMessaging: 585984d0a1df120617eb10b44cad8968b859815e
|
||||||
|
FirebaseRemoteConfigInterop: 6efda51fb5e2f15b16585197e26eaa09574e8a4d
|
||||||
|
FirebaseSessions: dbd14adac65ce996228652c1fc3a3f576bdf3ecc
|
||||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||||
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
|
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
|
||||||
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
|
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
|
||||||
|
@ -302,6 +345,7 @@ SPEC CHECKSUMS:
|
||||||
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
||||||
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
||||||
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
||||||
|
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
|
||||||
SDWebImage: dfe95b2466a9823cf9f0c6d01217c06550d7b29a
|
SDWebImage: dfe95b2466a9823cf9f0c6d01217c06550d7b29a
|
||||||
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
|
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
|
||||||
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
||||||
|
|
|
@ -51,8 +51,8 @@
|
||||||
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>"; };
|
||||||
6436409D27A31CDC00820AF7 /* 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>"; };
|
||||||
6436409227A31CDD00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
6436409127A31CDB00820AF7 /* 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 */
|
||||||
|
@ -301,8 +301,8 @@
|
||||||
6436409C27A31CD800820AF7 /* InfoPlist.strings */ = {
|
6436409C27A31CD800820AF7 /* InfoPlist.strings */ = {
|
||||||
isa = PBXVariantGroup;
|
isa = PBXVariantGroup;
|
||||||
children = (
|
children = (
|
||||||
6436409D27A31CDC00820AF7 /* pt */,
|
6436409227A31CD800820AF7 /* pt */,
|
||||||
6436409227A31CDD00820AF7 /* en */,
|
6436409127A31CDB00820AF7 /* en */,
|
||||||
);
|
);
|
||||||
name = InfoPlist.strings;
|
name = InfoPlist.strings;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
|
|
@ -14,13 +14,13 @@ import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:flutter/material.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: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';
|
||||||
|
|
||||||
Future<void> openTermsOfUse(BuildContext context) async {
|
Future<void> openTermsOfUse(BuildContext context) async {
|
||||||
log('openTermsOfUse');
|
log('openTermsOfUse');
|
||||||
final Uri url = Uri.parse('https://freaccess.com.br/pp/');
|
final Uri url = Uri.parse('https://freaccess.com.br/pp/');
|
||||||
|
@ -108,6 +108,7 @@ Future singInLoginAction(
|
||||||
String? emailAdress,
|
String? emailAdress,
|
||||||
String? password,
|
String? password,
|
||||||
}) async {
|
}) async {
|
||||||
|
try {
|
||||||
String? devUUID;
|
String? devUUID;
|
||||||
ApiCallResponse? loginCall;
|
ApiCallResponse? loginCall;
|
||||||
|
|
||||||
|
@ -119,9 +120,12 @@ Future singInLoginAction(
|
||||||
FFAppState().passwd = password!;
|
FFAppState().passwd = password!;
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ((FFAppState().email != '') && (FFAppState().passwd != '')) {
|
if ((FFAppState().email != '') && (FFAppState().passwd != '')) {
|
||||||
devUUID = await getDevUUID();
|
devUUID = await getDevUUID();
|
||||||
|
|
||||||
FFAppState().devUUID = devUUID!;
|
FFAppState().devUUID = devUUID!;
|
||||||
|
|
||||||
loginCall = await PhpGroup.loginCall.call(
|
loginCall = await PhpGroup.loginCall.call(
|
||||||
email: FFAppState().email,
|
email: FFAppState().email,
|
||||||
password: FFAppState().passwd,
|
password: FFAppState().passwd,
|
||||||
|
@ -136,50 +140,40 @@ Future singInLoginAction(
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (PhpGroup.loginCall.error(
|
if (PhpGroup.loginCall.error((loginCall.jsonBody ?? '')) == false) {
|
||||||
(loginCall.jsonBody ?? ''),
|
|
||||||
) ==
|
|
||||||
false) {
|
|
||||||
FFAppState().userUUID = PhpGroup.loginCall.userUUID(
|
FFAppState().userUUID = PhpGroup.loginCall.userUUID(
|
||||||
(loginCall.jsonBody ?? ''),
|
(loginCall.jsonBody ?? ''),
|
||||||
)!;
|
)!;
|
||||||
// FFAppState().token = await FirebaseMessaging.instance.getToken();
|
|
||||||
FFAppState().createdAt = dateTimeFormat(
|
FFAppState().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';
|
FFAppState().updatedAt = '00/00/0000 00:00:00';
|
||||||
FFAppState().status = PhpGroup.loginCall.userStatus(
|
|
||||||
(loginCall.jsonBody ?? ''),
|
FFAppState().status =
|
||||||
)!;
|
PhpGroup.loginCall.userStatus((loginCall.jsonBody ?? ''))!;
|
||||||
FFAppState().userDevUUID = PhpGroup.loginCall.userDeviceId(
|
|
||||||
(loginCall.jsonBody ?? ''),
|
FFAppState().userDevUUID =
|
||||||
)!;
|
PhpGroup.loginCall.userDeviceId((loginCall.jsonBody ?? ''))!;
|
||||||
FFAppState().name = PhpGroup.loginCall.userName(
|
|
||||||
(loginCall.jsonBody ?? ''),
|
FFAppState().name =
|
||||||
)!;
|
PhpGroup.loginCall.userName((loginCall.jsonBody ?? ''))!;
|
||||||
|
|
||||||
FFAppState().serialNumber = await getSerialNumber() ?? '';
|
FFAppState().serialNumber = await getSerialNumber() ?? '';
|
||||||
|
|
||||||
FFAppState().isLogged = true;
|
FFAppState().isLogged = true;
|
||||||
|
|
||||||
await toggleHomePage(context);
|
await toggleHomePage(context);
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
await showModalBottomSheet(
|
if (PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')) == null) {
|
||||||
isScrollControlled: true,
|
DialogUtil.errorDefault(context);
|
||||||
backgroundColor: Colors.transparent,
|
} else {
|
||||||
useSafeArea: true,
|
DialogUtil.error(context,
|
||||||
context: context,
|
PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')).toString());
|
||||||
builder: (context) {
|
}
|
||||||
return Padding(
|
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
|
||||||
child: ThrowExceptionWidget(
|
|
||||||
msg: PhpGroup.loginCall.msg(
|
|
||||||
(loginCall?.jsonBody ?? ''),
|
|
||||||
)!,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
FFAppState().deleteEmail();
|
FFAppState().deleteEmail();
|
||||||
FFAppState().email = '';
|
FFAppState().email = '';
|
||||||
|
@ -189,10 +183,13 @@ Future singInLoginAction(
|
||||||
|
|
||||||
FFAppState().update(() {});
|
FFAppState().update(() {});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} catch (e, s) {
|
||||||
return;
|
DialogUtil.errorDefault(context);
|
||||||
|
LogUtil.requestAPIFailed(
|
||||||
|
'login.php', emailAdress.toString(), "Login", e, s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,7 +330,6 @@ Future toggleSignInPage(BuildContext context) async {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future toggleSignUpPage(BuildContext context) async {
|
Future toggleSignUpPage(BuildContext context) async {
|
||||||
|
|
||||||
context.pushNamed(
|
context.pushNamed(
|
||||||
'signUpPage',
|
'signUpPage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
|
@ -468,12 +464,12 @@ Future<bool> checkLocals({
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
safeSetState(() {}); // Chamada otimizada fora do then para evitar encadeamentos desnecessários.
|
safeSetState(
|
||||||
|
() {}); // Chamada otimizada fora do then para evitar encadeamentos desnecessários.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Future changeStatusAction(
|
Future changeStatusAction(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
String status,
|
String status,
|
||||||
|
@ -523,14 +519,10 @@ Future changeStatusAction(
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// QR Code
|
/// QR Code
|
||||||
|
|
||||||
|
|
||||||
Uint8List assembleQRPacket(int direction, String identifier, String password) {
|
Uint8List assembleQRPacket(int direction, String identifier, String password) {
|
||||||
List<int> packet = [direction];
|
List<int> packet = [direction];
|
||||||
|
|
||||||
|
@ -569,13 +561,15 @@ Uint8List assembleQRPacket(int direction, String identifier, String password) {
|
||||||
check ^= b;
|
check ^= b;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (check == int.parse('0D', radix: 16) || check == int.parse('0A', radix: 16)) {
|
if (check == int.parse('0D', radix: 16) ||
|
||||||
|
check == int.parse('0A', radix: 16)) {
|
||||||
packet.add(int.parse('FF', radix: 16));
|
packet.add(int.parse('FF', radix: 16));
|
||||||
} else {
|
} else {
|
||||||
packet.add(check);
|
packet.add(check);
|
||||||
}
|
}
|
||||||
|
|
||||||
var bytes = packet.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join((' '));
|
var bytes =
|
||||||
|
packet.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join((' '));
|
||||||
|
|
||||||
log("Pacote: $packet");
|
log("Pacote: $packet");
|
||||||
log("Bytes: $bytes");
|
log("Bytes: $bytes");
|
||||||
|
@ -586,22 +580,24 @@ Uint8List hexStringToByteArray(String s) {
|
||||||
int len = s.length;
|
int len = s.length;
|
||||||
Uint8List data = Uint8List(len ~/ 2);
|
Uint8List data = Uint8List(len ~/ 2);
|
||||||
for (int i = 0; i < len; i += 2) {
|
for (int i = 0; i < len; i += 2) {
|
||||||
data[i ~/ 2] = ((int.parse(s[i], radix: 16) << 4) + int.parse(s[i + 1], radix: 16));
|
data[i ~/ 2] =
|
||||||
|
((int.parse(s[i], radix: 16) << 4) + int.parse(s[i + 1], radix: 16));
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
String byteToHexa(Uint8List pDados) {
|
String byteToHexa(Uint8List pDados) {
|
||||||
return pDados.map((byte) => byte.toRadixString(16).padLeft(2, '0').toUpperCase()).join();
|
return pDados
|
||||||
|
.map((byte) => byte.toRadixString(16).padLeft(2, '0').toUpperCase())
|
||||||
|
.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> byteToString(Uint8List bytes) async {
|
Future<String> byteToString(Uint8List bytes) async {
|
||||||
return String.fromCharCodes(bytes);
|
return String.fromCharCodes(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Widget buildQrCode(
|
Widget buildQrCode(
|
||||||
{
|
{
|
||||||
// required String data,
|
// required String data,
|
||||||
// required String type,
|
// required String type,
|
||||||
// required int version,
|
// required int version,
|
||||||
|
@ -610,75 +606,78 @@ Widget buildQrCode(
|
||||||
required double dimension,
|
required double dimension,
|
||||||
required String identifier,
|
required String identifier,
|
||||||
required String pass,
|
required String pass,
|
||||||
required int direction
|
required int direction}) {
|
||||||
}
|
|
||||||
) {
|
|
||||||
try {
|
try {
|
||||||
log("pass: $pass");
|
log("pass: $pass");
|
||||||
const Color backgroundColor = Colors.white;
|
const Color backgroundColor = Colors.white;
|
||||||
const Color foregroundColor = Colors.black;
|
const Color foregroundColor = Colors.black;
|
||||||
return QrImageView.withQr(qr: QrCode.fromUint8List(data: assembleQRPacket(direction, identifier, pass), errorCorrectLevel: errorCorrectLevel), size: dimension, padding: const EdgeInsets.all(10), backgroundColor: backgroundColor, foregroundColor: foregroundColor);
|
return QrImageView.withQr(
|
||||||
|
qr: QrCode.fromUint8List(
|
||||||
|
data: assembleQRPacket(direction, identifier, pass),
|
||||||
|
errorCorrectLevel: errorCorrectLevel),
|
||||||
|
size: dimension,
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
backgroundColor: backgroundColor,
|
||||||
|
foregroundColor: foregroundColor);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return Text("Erro ao gerar QR Code: ${e.toString()}");
|
return Text("Erro ao gerar QR Code: ${e.toString()}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// // Retorna o conteúdo a ser codificado no QR Code.
|
||||||
|
// String getContents() {
|
||||||
|
// return data;
|
||||||
|
// }
|
||||||
|
|
||||||
// // Retorna o conteúdo a ser codificado no QR Code.
|
// // Retorna uma versão do conteúdo otimizada para exibição.
|
||||||
// String getContents() {
|
// String getDisplayContents() {
|
||||||
// return data;
|
// return data.trim();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// // Retorna uma versão do conteúdo otimizada para exibição.
|
// // Retorna o título baseado no tipo de conteúdo.
|
||||||
// String getDisplayContents() {
|
// String getTitle() {
|
||||||
// return data.trim();
|
// return type;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// // Retorna o título baseado no tipo de conteúdo.
|
// // Codifica o conteúdo em uma string adequada para o QR Code.
|
||||||
// String getTitle() {
|
// Future<String> encodeContents() async {
|
||||||
// return type;
|
// // Implementação específica para codificar o conteúdo.
|
||||||
// }
|
// return data; // Exemplo simplificado.
|
||||||
|
// }
|
||||||
|
|
||||||
// // Codifica o conteúdo em uma string adequada para o QR Code.
|
// // Codifica o conteúdo específico do QR Code.
|
||||||
// Future<String> encodeContents() async {
|
// Future<Widget> encodeQRCodeContents() async {
|
||||||
// // Implementação específica para codificar o conteúdo.
|
// return getQrCode();
|
||||||
// return data; // Exemplo simplificado.
|
// }
|
||||||
// }
|
|
||||||
|
|
||||||
// // Codifica o conteúdo específico do QR Code.
|
// // Gera o QR Code como um widget.
|
||||||
// Future<Widget> encodeQRCodeContents() async {
|
|
||||||
// return getQrCode();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Gera o QR Code como um widget.
|
// // Codifica o conteúdo como um bitmap (pode ser útil para operações de baixo nível).
|
||||||
|
// // Future<Image> encodeAsBitmap() async {
|
||||||
|
// // // Implementação para codificar como bitmap.
|
||||||
|
// // return Image(image); // Exemplo simplificado.
|
||||||
|
// // }
|
||||||
|
|
||||||
|
// // Adivinha a codificação apropriada para o conteúdo.
|
||||||
|
// String guessAppropriateEncoding(String content) {
|
||||||
|
// // Implementação para adivinhar a codificação.
|
||||||
|
// return "UTF-8"; // Exemplo simplificado.
|
||||||
|
// }
|
||||||
|
|
||||||
// // Codifica o conteúdo como um bitmap (pode ser útil para operações de baixo nível).
|
// // Remove espaços em branco do início e do fim do conteúdo.
|
||||||
// // Future<Image> encodeAsBitmap() async {
|
// String trim(String content) {
|
||||||
// // // Implementação para codificar como bitmap.
|
// return content.trim();
|
||||||
// // return Image(image); // Exemplo simplificado.
|
// }
|
||||||
// // }
|
|
||||||
|
|
||||||
// // Adivinha a codificação apropriada para o conteúdo.
|
// // Escapa caracteres especiais para o formato MECARD.
|
||||||
// String guessAppropriateEncoding(String content) {
|
// String escapeMECARD(String content) {
|
||||||
// // Implementação para adivinhar a codificação.
|
// // Implementação para escapar caracteres.
|
||||||
// return "UTF-8"; // Exemplo simplificado.
|
// return content.replaceAll(':', '\\:'); // Exemplo simplificado.
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// // Remove espaços em branco do início e do fim do conteúdo.
|
/// menu
|
||||||
// String trim(String content) {
|
|
||||||
// return content.trim();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Escapa caracteres especiais para o formato MECARD.
|
Future scheduleVisitOptAction(BuildContext context) async {
|
||||||
// String escapeMECARD(String content) {
|
|
||||||
// // Implementação para escapar caracteres.
|
|
||||||
// return content.replaceAll(':', '\\:'); // Exemplo simplificado.
|
|
||||||
// }
|
|
||||||
|
|
||||||
/// menu
|
|
||||||
|
|
||||||
Future scheduleVisitOptAction(BuildContext context) async {
|
|
||||||
await showAdaptiveDialog(
|
await showAdaptiveDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
|
@ -713,9 +712,9 @@ Widget buildQrCode(
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future registerVisitorOptAction(BuildContext context) async {
|
Future registerVisitorOptAction(BuildContext context) async {
|
||||||
context.pushNamed(
|
context.pushNamed(
|
||||||
'registerVisitorPage',
|
'registerVisitorPage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
|
@ -726,9 +725,9 @@ Widget buildQrCode(
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future peopleOnThePropertyAction(BuildContext context) async {
|
Future peopleOnThePropertyAction(BuildContext context) async {
|
||||||
context.pushNamed(
|
context.pushNamed(
|
||||||
'peopleOnThePropertyPage',
|
'peopleOnThePropertyPage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
|
@ -738,9 +737,9 @@ Widget buildQrCode(
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future preferencesSettings(BuildContext context) async {
|
Future preferencesSettings(BuildContext context) async {
|
||||||
context.pushNamed(
|
context.pushNamed(
|
||||||
'preferencesSettings',
|
'preferencesSettings',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
|
@ -751,9 +750,9 @@ Widget buildQrCode(
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future liberationHistoryOptAction(BuildContext context) async {
|
Future liberationHistoryOptAction(BuildContext context) async {
|
||||||
await showAdaptiveDialog(
|
await showAdaptiveDialog(
|
||||||
// isScrollControlled: true,
|
// isScrollControlled: true,
|
||||||
// backgroundColor: Colors.transparent,
|
// backgroundColor: Colors.transparent,
|
||||||
|
@ -797,9 +796,9 @@ Widget buildQrCode(
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future accessQRCodeOptAction(BuildContext context) async {
|
Future accessQRCodeOptAction(BuildContext context) async {
|
||||||
context.pushNamed(
|
context.pushNamed(
|
||||||
'qrCodePage',
|
'qrCodePage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
|
@ -810,4 +809,4 @@ Widget buildQrCode(
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,8 +36,7 @@ class FFAppState extends ChangeNotifier {
|
||||||
stickyAuth: true,
|
stickyAuth: true,
|
||||||
useErrorDialogs: true,
|
useErrorDialogs: true,
|
||||||
sensitiveTransaction: true,
|
sensitiveTransaction: true,
|
||||||
)
|
));
|
||||||
);
|
|
||||||
if (authenticated) {
|
if (authenticated) {
|
||||||
_isBiometricAuthenticated = true;
|
_isBiometricAuthenticated = true;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
@ -50,7 +49,8 @@ class FFAppState extends ChangeNotifier {
|
||||||
clearBiometricAuthentication();
|
clearBiometricAuthentication();
|
||||||
return Future.error(e);
|
return Future.error(e);
|
||||||
}
|
}
|
||||||
return Future.error(''); // Add this line to ensure a value is always returned
|
return Future.error(
|
||||||
|
''); // Add this line to ensure a value is always returned
|
||||||
}
|
}
|
||||||
|
|
||||||
// Função para limpar o estado de autenticação biométrica
|
// Função para limpar o estado de autenticação biométrica
|
||||||
|
@ -60,9 +60,6 @@ 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 FFAppState _instance = FFAppState._internal();
|
||||||
|
|
||||||
factory FFAppState() {
|
factory FFAppState() {
|
||||||
|
@ -123,13 +120,16 @@ class FFAppState extends ChangeNotifier {
|
||||||
_tokenAPNS = await secureStorage.getString('ff_tokenAPNS') ?? _tokenAPNS;
|
_tokenAPNS = await secureStorage.getString('ff_tokenAPNS') ?? _tokenAPNS;
|
||||||
});
|
});
|
||||||
await _safeInitAsync(() async {
|
await _safeInitAsync(() async {
|
||||||
_userDevUUID = await secureStorage.getString('ff_user_dev_id') ?? _userDevUUID;
|
_userDevUUID =
|
||||||
|
await secureStorage.getString('ff_user_dev_id') ?? _userDevUUID;
|
||||||
});
|
});
|
||||||
await _safeInitAsync(() async {
|
await _safeInitAsync(() async {
|
||||||
_serialNumber = await secureStorage.getString('ff_serialNumber') ?? _serialNumber;
|
_serialNumber =
|
||||||
|
await secureStorage.getString('ff_serialNumber') ?? _serialNumber;
|
||||||
});
|
});
|
||||||
await _safeInitAsync(() async {
|
await _safeInitAsync(() async {
|
||||||
_fingerprintOPT = await secureStorage.getBool('fingerprint') ?? _fingerprintOPT;
|
_fingerprintOPT =
|
||||||
|
await secureStorage.getBool('fingerprint') ?? _fingerprintOPT;
|
||||||
});
|
});
|
||||||
await _safeInitAsync(() async {
|
await _safeInitAsync(() async {
|
||||||
_personOPT = await secureStorage.getBool('person') ?? _personOPT;
|
_personOPT = await secureStorage.getBool('person') ?? _personOPT;
|
||||||
|
@ -137,6 +137,9 @@ class FFAppState extends ChangeNotifier {
|
||||||
await _safeInitAsync(() async {
|
await _safeInitAsync(() async {
|
||||||
_passOPT = await secureStorage.getBool('pass') ?? _passOPT;
|
_passOPT = await secureStorage.getBool('pass') ?? _passOPT;
|
||||||
});
|
});
|
||||||
|
await _safeInitAsync(() async {
|
||||||
|
_panicOPT = await secureStorage.getBool('panic') ?? _panicOPT;
|
||||||
|
});
|
||||||
await _safeInitAsync(() async {
|
await _safeInitAsync(() async {
|
||||||
_notifyOPT = await secureStorage.getBool('notify') ?? _notifyOPT;
|
_notifyOPT = await secureStorage.getBool('notify') ?? _notifyOPT;
|
||||||
});
|
});
|
||||||
|
@ -147,9 +150,9 @@ class FFAppState extends ChangeNotifier {
|
||||||
_panicPass = await secureStorage.getString('panicPass') ?? _panicPass;
|
_panicPass = await secureStorage.getString('panicPass') ?? _panicPass;
|
||||||
});
|
});
|
||||||
await _safeInitAsync(() async {
|
await _safeInitAsync(() async {
|
||||||
_fingerprintPass = await secureStorage.getString('fingerprintPass') ?? _fingerprintPass;
|
_fingerprintPass =
|
||||||
|
await secureStorage.getString('fingerprintPass') ?? _fingerprintPass;
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void update(VoidCallback callback) {
|
void update(VoidCallback callback) {
|
||||||
|
@ -159,6 +162,17 @@ class FFAppState extends ChangeNotifier {
|
||||||
|
|
||||||
late FlutterSecureStorage secureStorage;
|
late FlutterSecureStorage secureStorage;
|
||||||
|
|
||||||
|
bool _panicOPT = false;
|
||||||
|
bool get panic => _panicOPT;
|
||||||
|
set panic(bool value) {
|
||||||
|
_panicOPT = value;
|
||||||
|
secureStorage.setBool('panic', value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void deletePanic() {
|
||||||
|
secureStorage.delete(key: 'panic');
|
||||||
|
}
|
||||||
|
|
||||||
String _fingerprintPass = '';
|
String _fingerprintPass = '';
|
||||||
String get fingerprintPass => _fingerprintPass;
|
String get fingerprintPass => _fingerprintPass;
|
||||||
set fingerprintPass(String value) {
|
set fingerprintPass(String value) {
|
||||||
|
@ -185,8 +199,7 @@ class FFAppState extends ChangeNotifier {
|
||||||
String get panicPass => _panicPass;
|
String get panicPass => _panicPass;
|
||||||
set panicPass(String value) {
|
set panicPass(String value) {
|
||||||
_panicPass = value;
|
_panicPass = value;
|
||||||
secureStorage.setString
|
secureStorage.setString('panicPass', value);
|
||||||
('panicPass', value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void deletePanicPass() {
|
void deletePanicPass() {
|
||||||
|
@ -203,8 +216,7 @@ class FFAppState extends ChangeNotifier {
|
||||||
bool _passOPT = false;
|
bool _passOPT = false;
|
||||||
bool get pass => _passOPT;
|
bool get pass => _passOPT;
|
||||||
set pass(bool value) {
|
set pass(bool value) {
|
||||||
_passOPT =
|
_passOPT = value;
|
||||||
value;
|
|
||||||
secureStorage.setBool('pass', value);
|
secureStorage.setBool('pass', value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'package:hub/shared/enums/enum_throw_exception.dart';
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_animations.dart';
|
import '/flutter_flow/flutter_flow_animations.dart';
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -7,15 +9,12 @@ import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'throw_exception_model.dart';
|
import 'throw_exception_model.dart';
|
||||||
export 'throw_exception_model.dart';
|
export 'throw_exception_model.dart';
|
||||||
|
|
||||||
///
|
|
||||||
|
|
||||||
class ThrowExceptionWidget extends StatefulWidget {
|
class ThrowExceptionWidget extends StatefulWidget {
|
||||||
const ThrowExceptionWidget({
|
ThrowExceptionWidget(
|
||||||
super.key,
|
{super.key, required this.msg, this.type = EnumThrowException.error});
|
||||||
required this.msg,
|
|
||||||
});
|
|
||||||
|
|
||||||
final String? msg;
|
final String? msg;
|
||||||
|
EnumThrowException type;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ThrowExceptionWidget> createState() => _ThrowExceptionWidgetState();
|
State<ThrowExceptionWidget> createState() => _ThrowExceptionWidgetState();
|
||||||
|
@ -61,6 +60,43 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color _getColorByType(BuildContext context) {
|
||||||
|
switch (widget.type) {
|
||||||
|
case EnumThrowException.error:
|
||||||
|
return FlutterFlowTheme.of(context).error;
|
||||||
|
case EnumThrowException.warning:
|
||||||
|
return FlutterFlowTheme.of(context).warning;
|
||||||
|
case EnumThrowException.success:
|
||||||
|
return FlutterFlowTheme.of(context).success;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IconData _getIconByType(BuildContext context) {
|
||||||
|
switch (widget.type) {
|
||||||
|
case EnumThrowException.error:
|
||||||
|
return Icons.cancel_outlined;
|
||||||
|
case EnumThrowException.warning:
|
||||||
|
return Icons.warning_amber_outlined;
|
||||||
|
case EnumThrowException.success:
|
||||||
|
return Icons.check_circle_outline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _getTitleByType(BuildContext context) {
|
||||||
|
switch (widget.type) {
|
||||||
|
case EnumThrowException.error:
|
||||||
|
return FFLocalizations.of(context)
|
||||||
|
.getVariableText(ptText: "Falha :(", enText: "Fail :(");
|
||||||
|
case EnumThrowException.warning:
|
||||||
|
return FFLocalizations.of(context)
|
||||||
|
.getVariableText(ptText: "Aviso :O", enText: "Warning :O");
|
||||||
|
case EnumThrowException.success:
|
||||||
|
return FFLocalizations.of(context)
|
||||||
|
.getVariableText(ptText: "Sucesso ;)", enText: "Success ;)");
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
|
@ -77,17 +113,6 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
child: Container(
|
|
||||||
height: 400.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(10.0),
|
|
||||||
bottomRight: Radius.circular(10.0),
|
|
||||||
topLeft: Radius.circular(10.0),
|
|
||||||
topRight: Radius.circular(10.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -97,30 +122,19 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.circle_outlined,
|
_getIconByType(context),
|
||||||
color: FlutterFlowTheme.of(context).error,
|
color: _getColorByType(context),
|
||||||
size: 200.0,
|
size: 150.0,
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Icon(
|
|
||||||
Icons.close_outlined,
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
size: 200.0,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
).animateOnPageLoad(
|
).animateOnPageLoad(animationsMap['stackOnPageLoadAnimation']!),
|
||||||
animationsMap['stackOnPageLoadAnimation']!),
|
|
||||||
Column(
|
Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
FFLocalizations.of(context).getText(
|
_getTitleByType(context),
|
||||||
'e58xxxiq' /* ERRO */,
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
|
@ -128,23 +142,20 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
0.0, 10.0, 0.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
valueOrDefault<String>(
|
valueOrDefault<String>(
|
||||||
widget.msg,
|
widget.msg,
|
||||||
'Message Not Found',
|
'Message Not Found',
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.bodyMedium
|
fontFamily:
|
||||||
.override(
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
|
@ -152,13 +163,12 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
].addToStart(const SizedBox(height: 50.0)),
|
].addToStart(const SizedBox(height: 20.0)),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,13 @@
|
||||||
|
|
||||||
import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart';
|
import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart';
|
||||||
import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart';
|
import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.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/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';
|
||||||
|
|
||||||
|
|
||||||
class VisitorNotFoundComponentWidget extends StatefulWidget {
|
class VisitorNotFoundComponentWidget extends StatefulWidget {
|
||||||
const VisitorNotFoundComponentWidget({super.key});
|
const VisitorNotFoundComponentWidget({super.key});
|
||||||
|
|
||||||
|
@ -44,11 +41,9 @@ class _VisitorNotFoundComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Align(
|
return Container(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
width: MediaQuery.of(context).size.height * 0.5,
|
||||||
child: Container(
|
height: MediaQuery.of(context).size.height * 0.4,
|
||||||
width: 350.0,
|
|
||||||
height: 350.0,
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
|
@ -102,14 +97,13 @@ class _VisitorNotFoundComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 4.0, 10.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 4.0, 20.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'kt937sp6' /* O documento inserido não corre... */,
|
'kt937sp6' /* O documento inserido não corre... */,
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
|
@ -128,24 +122,30 @@ class _VisitorNotFoundComponentWidgetState
|
||||||
await showModalBottomSheet(
|
await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
enableDrag: false,
|
enableDrag: true,
|
||||||
|
useSafeArea: true,
|
||||||
|
isDismissible: true,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
child: const RegisiterVistorTemplateComponentWidget(),
|
child: SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.9,
|
||||||
|
child: const RegisiterVistorTemplateComponentWidget(
|
||||||
|
source: 'VisitorNotFoundComponent',
|
||||||
|
)),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).then((value) => safeSetState(() {}));
|
).then((value) => safeSetState(() {}));
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context).getText(
|
text: FFLocalizations.of(context)
|
||||||
'y2x4nfcn' /* Adicionar */,
|
.getVariableText(enText: 'Add', ptText: 'Adicionar'),
|
||||||
),
|
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 30.0,
|
height: 30.0,
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
24.0, 0.0, 24.0, 0.0),
|
||||||
iconPadding:
|
iconPadding:
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
@ -174,7 +174,6 @@ class _VisitorNotFoundComponentWidgetState
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,9 +1,11 @@
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
class ScheduleVisitDetailModel
|
class ScheduleVisitDetailModel
|
||||||
extends FlutterFlowModel<ScheduleVisitDetailWidget> {
|
extends FlutterFlowModel<ScheduleVisitDetailWidget> {
|
||||||
|
@ -36,6 +38,36 @@ class ScheduleVisitDetailModel
|
||||||
// Stores action output result for [Backend Call - API (postScheduleVisit)] action in Icon widget.
|
// Stores action output result for [Backend Call - API (postScheduleVisit)] action in Icon widget.
|
||||||
ApiCallResponse? postScheduleVisit;
|
ApiCallResponse? postScheduleVisit;
|
||||||
|
|
||||||
|
String convertDateFormat(String dateStr) {
|
||||||
|
try {
|
||||||
|
log('Received date string: $dateStr');
|
||||||
|
|
||||||
|
// Formato original
|
||||||
|
DateFormat originalFormat = DateFormat('d/M/y H:mm:ss');
|
||||||
|
// Novo formato
|
||||||
|
DateFormat newFormat = DateFormat('y-M-d H:mm:ss');
|
||||||
|
|
||||||
|
// Validate the input string format
|
||||||
|
if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$')
|
||||||
|
.hasMatch(dateStr)) {
|
||||||
|
log('Invalid date format: $dateStr');
|
||||||
|
return 'Invalid date format';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Converte a string para DateTime
|
||||||
|
DateTime dateTime = originalFormat.parse(dateStr);
|
||||||
|
|
||||||
|
// Converte DateTime para a nova string formatada
|
||||||
|
String formattedDate = newFormat.format(dateTime);
|
||||||
|
log('Formatted date: $formattedDate');
|
||||||
|
return formattedDate;
|
||||||
|
} catch (e) {
|
||||||
|
// Handle the exception by returning an error message or a default value
|
||||||
|
log('Error parsing date: $e');
|
||||||
|
return 'Invalid date format';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,9 @@ 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_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:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
|
||||||
class ScheduleVisitDetailWidget extends StatefulWidget {
|
class ScheduleVisitDetailWidget extends StatefulWidget {
|
||||||
const ScheduleVisitDetailWidget({
|
const ScheduleVisitDetailWidget({
|
||||||
super.key,
|
super.key,
|
||||||
|
@ -47,6 +47,7 @@ class ScheduleVisitDetailWidget extends StatefulWidget {
|
||||||
|
|
||||||
class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
late ScheduleVisitDetailModel _model;
|
late ScheduleVisitDetailModel _model;
|
||||||
|
late FocusNode _focusNode;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void setState(VoidCallback callback) {
|
void setState(VoidCallback callback) {
|
||||||
|
@ -57,26 +58,25 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
_focusNode = FocusNode();
|
||||||
_model = createModel(context, () => ScheduleVisitDetailModel());
|
_model = createModel(context, () => ScheduleVisitDetailModel());
|
||||||
|
|
||||||
_model.textController1 ??=
|
_model.textController1 ??= TextEditingController(text: widget.visitTempStr);
|
||||||
TextEditingController(text: widget.visitTempStr);
|
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
_model.textFieldFocusNode1 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController2 ??=
|
_model.textController2 ??=
|
||||||
TextEditingController(text: widget.visitStartDate);
|
TextEditingController(text: widget.visitStartDate);
|
||||||
_model.textFieldFocusNode2 ??= FocusNode();
|
_model.textFieldFocusNode2 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController3 ??=
|
_model.textController3 ??= TextEditingController(text: widget.visitEndDate);
|
||||||
TextEditingController(text: widget.visitEndDate);
|
|
||||||
_model.textFieldFocusNode3 ??= FocusNode();
|
_model.textFieldFocusNode3 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController4 ??= TextEditingController(
|
_model.textController4 ??=
|
||||||
text: extractDescToStr(widget.visitResonStr!));
|
TextEditingController(text: extractDescToStr(widget.visitResonStr!));
|
||||||
_model.textFieldFocusNode4 ??= FocusNode();
|
_model.textFieldFocusNode4 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController5 ??= TextEditingController(
|
_model.textController5 ??=
|
||||||
text: extractDescToStr(widget.visitLevelStr!));
|
TextEditingController(text: extractDescToStr(widget.visitLevelStr!));
|
||||||
_model.textFieldFocusNode5 ??= FocusNode();
|
_model.textFieldFocusNode5 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController6 ??= TextEditingController(text: widget.visitObsStr);
|
_model.textController6 ??= TextEditingController(text: widget.visitObsStr);
|
||||||
|
@ -86,19 +86,33 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_model.maybeDispose();
|
_model.maybeDispose();
|
||||||
|
_focusNode.dispose();
|
||||||
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _requestFocus() {
|
||||||
|
if (mounted) {
|
||||||
|
_focusNode.requestFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<FFAppState>();
|
context.watch<FFAppState>();
|
||||||
|
final visitorsData = widget.visitorJsonList!.toList().take(2).toList();
|
||||||
|
final visitorsDataItem = visitorsData[0];
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
_requestFocus();
|
||||||
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
// color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
height: double.infinity,
|
width: MediaQuery.of(context).size.width,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.6,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
|
@ -112,13 +126,11 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Container(
|
||||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 35.0,
|
height: 35.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(0.0),
|
bottomLeft: Radius.circular(0.0),
|
||||||
bottomRight: Radius.circular(0.0),
|
bottomRight: Radius.circular(0.0),
|
||||||
|
@ -132,15 +144,15 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 0.0, 0.0),
|
15.0, 0.0, 0.0, 0.0),
|
||||||
child: FlutterFlowIconButton(
|
child: FlutterFlowIconButton(
|
||||||
borderRadius: 20.0,
|
borderRadius: 20.0,
|
||||||
borderWidth: 1.0,
|
borderWidth: 1.0,
|
||||||
buttonSize: 40.0,
|
buttonSize: 40.0,
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.keyboard_return,
|
Icons.keyboard_return,
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
@ -151,84 +163,21 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
shape: BoxShape.rectangle,
|
|
||||||
),
|
|
||||||
child: Stack(
|
|
||||||
children: [
|
|
||||||
Column(
|
Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Padding(
|
||||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
5.0, 0.0, 5.0, 20.0),
|
5.0, 0.0, 5.0, 20.0),
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: Builder(
|
|
||||||
builder: (context) {
|
|
||||||
final visitorsData = widget.visitorJsonList!
|
|
||||||
.toList()
|
|
||||||
.take(1)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
return SingleChildScrollView(
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: List.generate(visitorsData.length,
|
|
||||||
(visitorsDataIndex) {
|
|
||||||
final visitorsDataItem =
|
|
||||||
visitorsData[visitorsDataIndex];
|
|
||||||
return Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(100.0),
|
|
||||||
),
|
|
||||||
child: Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(1.0, -1.0),
|
|
||||||
child: InkWell(
|
|
||||||
splashColor: Colors.transparent,
|
|
||||||
focusColor: Colors.transparent,
|
|
||||||
hoverColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
onTap: () async {
|
|
||||||
Navigator.pop(context);
|
|
||||||
await showModalBottomSheet(
|
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor:
|
|
||||||
Colors.transparent,
|
|
||||||
useSafeArea: true,
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return Padding(
|
|
||||||
padding:
|
|
||||||
MediaQuery.viewInsetsOf(
|
|
||||||
context),
|
|
||||||
child:
|
|
||||||
const VisitorDetailsModalTemplateComponentWidget(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
).then((value) =>
|
|
||||||
safeSetState(() {}));
|
|
||||||
},
|
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
BorderRadius.circular(100.0),
|
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
fadeInDuration:
|
fadeInDuration: const Duration(milliseconds: 500),
|
||||||
const Duration(milliseconds: 500),
|
fadeOutDuration: const Duration(milliseconds: 500),
|
||||||
fadeOutDuration:
|
imageUrl: valueOrDefault<String>(
|
||||||
const Duration(milliseconds: 500),
|
|
||||||
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=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
||||||
visitorsDataItem,
|
visitorsDataItem,
|
||||||
r'''$.VTE_DOCUMENTO''',
|
r'''$.VTE_DOCUMENTO''',
|
||||||
|
@ -242,15 +191,6 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Column(
|
Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
|
@ -263,11 +203,11 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
controller: _model.textController1,
|
controller: _model.textController1,
|
||||||
focusNode: _model.textFieldFocusNode1,
|
focusNode: _model.textFieldFocusNode1,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
|
readOnly: true,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: false,
|
isDense: true,
|
||||||
labelText:
|
labelText: FFLocalizations.of(context).getText(
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'7w4fohoa' /* Encerramento da Visita */,
|
'7w4fohoa' /* Encerramento da Visita */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context)
|
||||||
|
@ -298,16 +238,14 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
FlutterFlowTheme.of(context).accent1,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
|
@ -334,8 +272,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
.bodyMediumFamily),
|
||||||
),
|
),
|
||||||
validator: _model.textController1Validator
|
validator: _model.textController1Validator
|
||||||
|
@ -359,10 +296,13 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
focusNode: _model.textFieldFocusNode2,
|
focusNode: _model.textFieldFocusNode2,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText:
|
isDense: true,
|
||||||
FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context)
|
||||||
'snah4iet' /* Início */,
|
.getVariableText(
|
||||||
|
enText: 'Start',
|
||||||
|
ptText: 'Início',
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context)
|
||||||
.labelMedium
|
.labelMedium
|
||||||
|
@ -370,15 +310,12 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily,
|
.labelMediumFamily,
|
||||||
color:
|
color: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
.primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(context)
|
||||||
context)
|
|
||||||
.labelMediumFamily),
|
.labelMediumFamily),
|
||||||
),
|
),
|
||||||
hintText:
|
hintText:
|
||||||
|
@ -391,15 +328,12 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily,
|
.labelMediumFamily,
|
||||||
color:
|
color: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
.primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(context)
|
||||||
context)
|
|
||||||
.labelMediumFamily),
|
.labelMediumFamily),
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -408,8 +342,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
.accent1,
|
.accent1,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -417,35 +350,32 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
.primary,
|
.primary,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color:
|
||||||
.error,
|
FlutterFlowTheme.of(context).error,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color:
|
||||||
.error,
|
FlutterFlowTheme.of(context).error,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
|
fontSize: 12,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
|
@ -466,7 +396,9 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
focusNode: _model.textFieldFocusNode3,
|
focusNode: _model.textFieldFocusNode3,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
isDense: true,
|
||||||
labelText:
|
labelText:
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'abppdgz3' /* Término */,
|
'abppdgz3' /* Término */,
|
||||||
|
@ -477,15 +409,12 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily,
|
.labelMediumFamily,
|
||||||
color:
|
color: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
.primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(context)
|
||||||
context)
|
|
||||||
.labelMediumFamily),
|
.labelMediumFamily),
|
||||||
),
|
),
|
||||||
hintText:
|
hintText:
|
||||||
|
@ -498,15 +427,12 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily,
|
.labelMediumFamily,
|
||||||
color:
|
color: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
.primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(context)
|
||||||
context)
|
|
||||||
.labelMediumFamily),
|
.labelMediumFamily),
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -515,8 +441,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
.accent1,
|
.accent1,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -524,35 +449,32 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
.primary,
|
.primary,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color:
|
||||||
.error,
|
FlutterFlowTheme.of(context).error,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color:
|
||||||
.error,
|
FlutterFlowTheme.of(context).error,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
|
fontSize: 12,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
|
@ -583,7 +505,9 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
focusNode: _model.textFieldFocusNode4,
|
focusNode: _model.textFieldFocusNode4,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
isDense: true,
|
||||||
labelText:
|
labelText:
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'xjxhzqqm' /* Motivo da Visita */,
|
'xjxhzqqm' /* Motivo da Visita */,
|
||||||
|
@ -594,15 +518,12 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily,
|
.labelMediumFamily,
|
||||||
color:
|
color: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
.primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(context)
|
||||||
context)
|
|
||||||
.labelMediumFamily),
|
.labelMediumFamily),
|
||||||
),
|
),
|
||||||
hintText:
|
hintText:
|
||||||
|
@ -615,15 +536,12 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily,
|
.labelMediumFamily,
|
||||||
color:
|
color: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
.primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(context)
|
||||||
context)
|
|
||||||
.labelMediumFamily),
|
.labelMediumFamily),
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -632,8 +550,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
.accent1,
|
.accent1,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -641,33 +558,29 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
.primary,
|
.primary,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color:
|
||||||
.error,
|
FlutterFlowTheme.of(context).error,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color:
|
||||||
.error,
|
FlutterFlowTheme.of(context).error,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
|
@ -690,7 +603,9 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
focusNode: _model.textFieldFocusNode5,
|
focusNode: _model.textFieldFocusNode5,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
isDense: true,
|
||||||
labelText:
|
labelText:
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'2ujg7u18' /* Nível de Acesso */,
|
'2ujg7u18' /* Nível de Acesso */,
|
||||||
|
@ -701,15 +616,12 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily,
|
.labelMediumFamily,
|
||||||
color:
|
color: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
.primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(context)
|
||||||
context)
|
|
||||||
.labelMediumFamily),
|
.labelMediumFamily),
|
||||||
),
|
),
|
||||||
hintText:
|
hintText:
|
||||||
|
@ -722,15 +634,12 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily,
|
.labelMediumFamily,
|
||||||
color:
|
color: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
.primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(context)
|
||||||
context)
|
|
||||||
.labelMediumFamily),
|
.labelMediumFamily),
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -739,8 +648,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
.accent1,
|
.accent1,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -748,33 +656,29 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
.primary,
|
.primary,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color:
|
||||||
.error,
|
FlutterFlowTheme.of(context).error,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color:
|
||||||
.error,
|
FlutterFlowTheme.of(context).error,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
|
@ -801,9 +705,10 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
focusNode: _model.textFieldFocusNode6,
|
focusNode: _model.textFieldFocusNode6,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText:
|
isDense: true,
|
||||||
FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'ritce5uw' /* Observações da Visita */,
|
'ritce5uw' /* Observações da Visita */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context)
|
||||||
|
@ -834,16 +739,14 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
FlutterFlowTheme.of(context).accent1,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
|
@ -870,8 +773,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
.bodyMediumFamily),
|
||||||
),
|
),
|
||||||
validator: _model.textController6Validator
|
validator: _model.textController6Validator
|
||||||
|
@ -881,49 +783,10 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Container(
|
].divide(const SizedBox(height: 0.0)),
|
||||||
width: double.infinity,
|
|
||||||
height: 22.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context).secondaryBackground,
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(25.0),
|
|
||||||
bottomRight: Radius.circular(25.0),
|
|
||||||
topLeft: Radius.circular(0.0),
|
|
||||||
topRight: Radius.circular(0.0),
|
|
||||||
),
|
),
|
||||||
),
|
IconButton(
|
||||||
),
|
onPressed: () async {
|
||||||
]
|
|
||||||
.divide(const SizedBox(height: 30.0))
|
|
||||||
.addToStart(const SizedBox(height: 100.0)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0),
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: 35.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(0.0),
|
|
||||||
bottomRight: Radius.circular(0.0),
|
|
||||||
topLeft: Radius.circular(0.0),
|
|
||||||
topRight: Radius.circular(0.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: InkWell(
|
|
||||||
splashColor: Colors.transparent,
|
|
||||||
focusColor: Colors.transparent,
|
|
||||||
hoverColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
onTap: () async {
|
|
||||||
_model.postScheduleVisit =
|
_model.postScheduleVisit =
|
||||||
await PhpGroup.postScheduleVisitCall.call(
|
await PhpGroup.postScheduleVisitCall.call(
|
||||||
devUUID: FFAppState().devUUID,
|
devUUID: FFAppState().devUUID,
|
||||||
|
@ -931,11 +794,11 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
atividade: 'putVisita',
|
atividade: 'putVisita',
|
||||||
devDesc: widget.visitObsStr,
|
devDesc: widget.visitObsStr,
|
||||||
idVisitante: widget.visitorStrList,
|
idVisitante: widget.visitorStrList,
|
||||||
dtInicio: widget.visitStartDate,
|
dtInicio:
|
||||||
dtFim: widget.visitEndDate,
|
_model.convertDateFormat(widget.visitStartDate ?? ''),
|
||||||
|
dtFim: _model.convertDateFormat(widget.visitEndDate ?? ''),
|
||||||
unica: widget.visitTempStr,
|
unica: widget.visitTempStr,
|
||||||
idMotivo:
|
idMotivo: extractIdToStr(widget.visitResonStr!),
|
||||||
extractIdToStr(widget.visitResonStr!),
|
|
||||||
idNAC: extractIdToStr(widget.visitLevelStr!),
|
idNAC: extractIdToStr(widget.visitLevelStr!),
|
||||||
obs: widget.visitObsStr,
|
obs: widget.visitObsStr,
|
||||||
cliID: FFAppState().cliUUID,
|
cliID: FFAppState().cliUUID,
|
||||||
|
@ -967,18 +830,16 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
child: Icon(
|
icon: Icon(
|
||||||
Icons.save_alt,
|
Icons.check,
|
||||||
color: FlutterFlowTheme.of(context).secondaryText,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
size: 24.0,
|
size: 15.0,
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,24 +1,43 @@
|
||||||
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'forgot_password_template_component_widget.dart'
|
import 'forgot_password_template_component_widget.dart'
|
||||||
show ForgotPasswordTemplateComponentWidget;
|
show ForgotPasswordTemplateComponentWidget;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ForgotPasswordTemplateComponentModel
|
class ForgotPasswordTemplateComponentModel
|
||||||
extends FlutterFlowModel<ForgotPasswordTemplateComponentWidget> {
|
extends FlutterFlowModel<ForgotPasswordTemplateComponentWidget> {
|
||||||
/// State fields for stateful widgets in this component.
|
/// State fields for stateful widgets in this component.
|
||||||
|
|
||||||
|
final formKey = GlobalKey<FormState>();
|
||||||
// State field(s) for emailAddress widget.
|
// State field(s) for emailAddress widget.
|
||||||
FocusNode? emailAddressFocusNode;
|
FocusNode? emailAddressFocusNode;
|
||||||
TextEditingController? emailAddressTextController;
|
TextEditingController? emailAddressTextController;
|
||||||
String? Function(BuildContext, String?)? emailAddressTextControllerValidator;
|
String? Function(BuildContext, String?)? emailAddressTextControllerValidator;
|
||||||
|
String? _emailAddressTextControllerValidator(
|
||||||
|
BuildContext context, String? val) {
|
||||||
|
if (val == null || val.isEmpty) {
|
||||||
|
return FFLocalizations.of(context).getText(
|
||||||
|
'3hqg8buh' /* E-mail é Obrigatório */,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ValidatorUtil.isValidEmail(val)) {
|
||||||
|
return FFLocalizations.of(context).getText(
|
||||||
|
'jh5r2b1w' /* E-mail Inválido */,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// Stores action output result for [Backend Call - API (forgotPassword)] action in Button-Login widget.
|
// Stores action output result for [Backend Call - API (forgotPassword)] action in Button-Login widget.
|
||||||
ApiCallResponse? req;
|
ApiCallResponse? req;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {
|
||||||
|
emailAddressTextControllerValidator = _emailAddressTextControllerValidator;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
|
|
|
@ -1,18 +1,21 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import '/flutter_flow/flutter_flow_widgets.dart';
|
import '/flutter_flow/flutter_flow_widgets.dart';
|
||||||
|
import 'package:easy_debounce/easy_debounce.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 'forgot_password_template_component_model.dart';
|
import 'forgot_password_template_component_model.dart';
|
||||||
export 'forgot_password_template_component_model.dart';
|
export 'forgot_password_template_component_model.dart';
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
class ForgotPasswordTemplateComponentWidget extends StatefulWidget {
|
class ForgotPasswordTemplateComponentWidget extends StatefulWidget {
|
||||||
const ForgotPasswordTemplateComponentWidget({super.key});
|
const ForgotPasswordTemplateComponentWidget({super.key});
|
||||||
|
|
||||||
|
@ -153,37 +156,33 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Form(
|
||||||
|
key: _model.formKey,
|
||||||
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
|
child: 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(
|
||||||
controller: _model.emailAddressTextController,
|
controller: _model.emailAddressTextController,
|
||||||
focusNode: _model.emailAddressFocusNode,
|
focusNode: _model.emailAddressFocusNode,
|
||||||
|
onChanged: (_) => EasyDebounce.debounce(
|
||||||
|
'_model.emailAddressTextController',
|
||||||
|
const Duration(milliseconds: 500),
|
||||||
|
() => setState(() {}),
|
||||||
|
),
|
||||||
|
autofocus: true,
|
||||||
autofillHints: const [AutofillHints.email],
|
autofillHints: const [AutofillHints.email],
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'mtz8l7ft' /* Email */,
|
'mtz8l7ft' /* E-mail */,
|
||||||
),
|
),
|
||||||
labelStyle:
|
labelStyle:
|
||||||
FlutterFlowTheme.of(context).labelMedium.override(
|
FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
fontSize: 14.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
|
||||||
hintText: FFLocalizations.of(context).getText(
|
|
||||||
'w7y5wlnv' /* digite o seu email..... */,
|
|
||||||
),
|
|
||||||
hintStyle:
|
|
||||||
FlutterFlowTheme.of(context).labelMedium.override(
|
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
|
@ -191,40 +190,38 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
.containsKey('Plus Jakarta Sans'),
|
.containsKey('Plus Jakarta Sans'),
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: const BorderSide(
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
color: Colors.black,
|
||||||
width: 2.0,
|
width: 2.00,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context).accent3,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
width: 2.0,
|
width: 2.00,
|
||||||
),
|
),
|
||||||
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.00,
|
||||||
),
|
),
|
||||||
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.00,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
),
|
),
|
||||||
filled: true,
|
contentPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
24.0, 24.0, 20.0, 24.0),
|
||||||
contentPadding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0),
|
|
||||||
suffixIcon: Icon(
|
suffixIcon: Icon(
|
||||||
Icons.email,
|
Icons.email,
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
size: 22.0,
|
size: 22.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -239,47 +236,43 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
keyboardType: TextInputType.emailAddress,
|
keyboardType: TextInputType.emailAddress,
|
||||||
cursorColor: const Color(0xFF6F61EF),
|
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||||
validator: _model.emailAddressTextControllerValidator
|
validator: _model.emailAddressTextControllerValidator
|
||||||
.asValidator(context),
|
.asValidator(context),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
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: (_model.emailAddressTextController.text == '' || !ValidatorUtil.isValidEmail(_model.emailAddressTextController.text))
|
||||||
|
? null
|
||||||
|
: () async {
|
||||||
|
|
||||||
|
try {
|
||||||
_model.req = await PhpGroup.forgotPasswordCall.call(
|
_model.req = await PhpGroup.forgotPasswordCall.call(
|
||||||
email: _model.emailAddressTextController.text,
|
email: _model.emailAddressTextController.text,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (PhpGroup.forgotPasswordCall.error(
|
if (PhpGroup.forgotPasswordCall.error((_model.req?.jsonBody ?? '')) == false) {
|
||||||
(_model.req?.jsonBody ?? ''),
|
await DialogUtil.success(context, FFLocalizations.of(context).getVariableText(
|
||||||
) ==
|
enText: "Send E-mail Successful!",
|
||||||
false) {
|
ptText: "E-mail Enviado com Sucesso!"
|
||||||
|
));
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
} else {
|
} else {
|
||||||
await showModalBottomSheet(
|
await DialogUtil.error(context, PhpGroup.forgotPasswordCall.msg((_model.req?.jsonBody ?? ''))!);
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
enableDrag: false,
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return Padding(
|
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
|
||||||
child: ThrowExceptionWidget(
|
|
||||||
msg: PhpGroup.forgotPasswordCall.msg(
|
|
||||||
(_model.req?.jsonBody ?? ''),
|
|
||||||
)!,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
).then((value) => safeSetState(() {}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|
||||||
|
} catch (error, stack) {
|
||||||
|
LogUtil.requestAPIFailed("iforgot.php", _model.emailAddressTextController.text, "Recuperar Senha", error, stack);
|
||||||
|
await DialogUtil.errorDefault(context);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context).getText(
|
text: FFLocalizations.of(context).getText(
|
||||||
'74rnd5bu' /* Enviar */,
|
'74rnd5bu' /* Enviar */,
|
||||||
|
@ -290,7 +283,7 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
iconPadding:
|
iconPadding:
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
color: const Color(0xFF1AAB5F),
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
|
@ -305,8 +298,14 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
),
|
),
|
||||||
|
disabledColor:
|
||||||
|
FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
|
.customColor5,
|
||||||
|
disabledTextColor:
|
||||||
|
Colors.white,
|
||||||
),
|
),
|
||||||
showLoadingIndicator: false,
|
showLoadingIndicator: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,17 +1,21 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'dart:typed_data';
|
import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
||||||
|
import 'package:hub/custom_code/actions/convert_image_file_to_base64.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
|
||||||
|
import '/backend/api_requests/api_calls.dart';
|
||||||
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
import '/flutter_flow/form_field_controller.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
|
||||||
import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart';
|
import 'regisiter_vistor_template_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
|
||||||
import 'package:hub/flutter_flow/form_field_controller.dart';
|
|
||||||
import 'package:hub/flutter_flow/uploaded_file.dart';
|
|
||||||
|
|
||||||
class RegisiterVistorTemplateComponentModel
|
class RegisiterVistorTemplateComponentModel
|
||||||
extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
||||||
/// State fields for stateful widgets in this component.
|
/// State fields for stateful widgets in this page.
|
||||||
|
|
||||||
|
final unfocusNode = FocusNode();
|
||||||
bool isDataUploading = false;
|
bool isDataUploading = false;
|
||||||
FFUploadedFile uploadedLocalFile =
|
FFUploadedFile uploadedLocalFile =
|
||||||
FFUploadedFile(bytes: Uint8List.fromList([]));
|
FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||||
|
@ -20,31 +24,116 @@ class RegisiterVistorTemplateComponentModel
|
||||||
FocusNode? textFieldFocusNode1;
|
FocusNode? textFieldFocusNode1;
|
||||||
TextEditingController? textController1;
|
TextEditingController? textController1;
|
||||||
String? Function(BuildContext, String?)? textController1Validator;
|
String? Function(BuildContext, String?)? textController1Validator;
|
||||||
// State field(s) for DropDown widget.
|
String? _textController1Validator(BuildContext context, String? val) {
|
||||||
String? dropDownValue;
|
if (val == null || val.isEmpty) {
|
||||||
FormFieldController<String>? dropDownValueController;
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'This field is required',
|
||||||
|
ptText: 'Este campo é obrigatório',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool?> getVisitanteByDocument(
|
||||||
|
String document, BuildContext context) async {
|
||||||
|
final response = await PhpGroup.getVisitorByDocCall.call(
|
||||||
|
devUUID: FFAppState().devUUID,
|
||||||
|
userUUID: FFAppState().userUUID,
|
||||||
|
cliID: FFAppState().cliUUID,
|
||||||
|
atividade: 'getVisitante',
|
||||||
|
documento: document,
|
||||||
|
);
|
||||||
|
log('${response.jsonBody}');
|
||||||
|
if (response.jsonBody['visitante']['VTE_ID'] != '0' &&
|
||||||
|
response.jsonBody['error'] != 'false') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// State field(s) for TextField widget.
|
// State field(s) for TextField widget.
|
||||||
FocusNode? textFieldFocusNode2;
|
FocusNode? textFieldFocusNode2;
|
||||||
TextEditingController? textController2;
|
TextEditingController? textController2;
|
||||||
String? Function(BuildContext, String?)? textController2Validator;
|
String? Function(BuildContext, String?)? textController2Validator;
|
||||||
|
String? _textController2Validator(BuildContext context, String? val) {
|
||||||
|
if (val == null || val.isEmpty) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'This field is required',
|
||||||
|
ptText: 'Este campo é obrigatório',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// State field(s) for DropDown widget.
|
||||||
|
String? dropDownValue;
|
||||||
|
FormFieldController<String>? dropDownValueController;
|
||||||
// State field(s) for TextField widget.
|
// State field(s) for TextField widget.
|
||||||
FocusNode? textFieldFocusNode3;
|
FocusNode? textFieldFocusNode3;
|
||||||
TextEditingController? textController3;
|
TextEditingController? textController3;
|
||||||
String? Function(BuildContext, String?)? textController3Validator;
|
String? Function(BuildContext, String?)? textController3Validator;
|
||||||
|
String? _textController3Validator(BuildContext context, String? val) {
|
||||||
|
if (val == null || val.isEmpty) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'This field is required',
|
||||||
|
ptText: 'Este campo é obrigatório',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// State field(s) for TextField widget.
|
// State field(s) for TextField widget.
|
||||||
FocusNode? textFieldFocusNode4;
|
FocusNode? textFieldFocusNode4;
|
||||||
TextEditingController? textController4;
|
TextEditingController? textController4;
|
||||||
String? Function(BuildContext, String?)? textController4Validator;
|
String? Function(BuildContext, String?)? textController4Validator;
|
||||||
|
String? _textController4Validator(BuildContext context, String? val) {
|
||||||
|
if (val == null || val.isEmpty) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'This field is required',
|
||||||
|
ptText: 'Este campo é obrigatório',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (!val.contains('@') || !val.contains('.')) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Invalid email',
|
||||||
|
ptText: 'Email inválido',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget.
|
// Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget.
|
||||||
String? imgBase64;
|
String? imgBase64;
|
||||||
// Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget.
|
// Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget.
|
||||||
ApiCallResponse? registerVisitor;
|
ApiCallResponse? scheduleVisitor;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {
|
||||||
|
textFieldFocusNode1 = FocusNode();
|
||||||
|
textController1 = TextEditingController();
|
||||||
|
textController1Validator = _textController1Validator;
|
||||||
|
|
||||||
|
textFieldFocusNode2 = FocusNode();
|
||||||
|
textController2 = TextEditingController();
|
||||||
|
textController2Validator = _textController2Validator;
|
||||||
|
|
||||||
|
dropDownValue = '';
|
||||||
|
// dropDownValueController = FormFieldController<String>(initialValue: dropDownValue);
|
||||||
|
|
||||||
|
textFieldFocusNode3 = FocusNode();
|
||||||
|
textController3 = TextEditingController();
|
||||||
|
textController3Validator = _textController3Validator;
|
||||||
|
|
||||||
|
textFieldFocusNode4 = FocusNode();
|
||||||
|
textController4 = TextEditingController();
|
||||||
|
textController4Validator = _textController4Validator;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
|
unfocusNode.dispose();
|
||||||
textFieldFocusNode1?.dispose();
|
textFieldFocusNode1?.dispose();
|
||||||
textController1?.dispose();
|
textController1?.dispose();
|
||||||
|
|
||||||
|
@ -58,4 +147,3 @@ class RegisiterVistorTemplateComponentModel
|
||||||
textController4?.dispose();
|
textController4?.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -8,6 +8,7 @@ class SignInTemplateComponentModel
|
||||||
/// State fields for stateful widgets in this component.
|
/// State fields for stateful widgets in this component.
|
||||||
|
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
|
final unfocusNode = FocusNode();
|
||||||
// State field(s) for emailAddress widget.
|
// State field(s) for emailAddress widget.
|
||||||
FocusNode? emailAddressFocusNode;
|
FocusNode? emailAddressFocusNode;
|
||||||
TextEditingController? emailAddressTextController;
|
TextEditingController? emailAddressTextController;
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
||||||
|
import 'package:hub/shared/components/atoms/atom_terms_of_use.dart';
|
||||||
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
import '/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart';
|
import '/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart';
|
||||||
import '/flutter_flow/flutter_flow_animations.dart';
|
import '/flutter_flow/flutter_flow_animations.dart';
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
@ -93,6 +99,18 @@ class _SignInTemplateComponentWidgetState
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool _isFormInvalid() {
|
||||||
|
if (_model.emailAddressTextController.text == '' || _model.passwordTextController.text == '') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Row(
|
return Row(
|
||||||
|
@ -113,8 +131,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 35.0),
|
0.0, 35.0, 0.0, 35.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 548.0,
|
width: 548.0,
|
||||||
height: 112.0,
|
height: 112.0,
|
||||||
|
@ -130,7 +148,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
alignment:
|
||||||
|
const AlignmentDirectional(0.0, 1.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(3.0),
|
padding: const EdgeInsets.all(3.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -166,12 +185,7 @@ class _SignInTemplateComponentWidgetState
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
child: Image.network(
|
child: const AtomImageSvgTheme(filename: 'login', width: 600, height: 155),
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/sr43ucngg4a4/Vector.png',
|
|
||||||
width: 603.0,
|
|
||||||
height: 155.0,
|
|
||||||
fit: BoxFit.contain,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
|
@ -205,12 +219,13 @@ class _SignInTemplateComponentWidgetState
|
||||||
Form(
|
Form(
|
||||||
key: _model.formKey,
|
key: _model.formKey,
|
||||||
autovalidateMode:
|
autovalidateMode:
|
||||||
AutovalidateMode.always,
|
AutovalidateMode.onUserInteraction,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
0.0, 0.0, 0.0, 16.0),
|
0.0, 0.0, 0.0, 16.0),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
|
@ -223,7 +238,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
onChanged: (_) =>
|
onChanged: (_) =>
|
||||||
EasyDebounce.debounce(
|
EasyDebounce.debounce(
|
||||||
'_model.emailAddressTextController',
|
'_model.emailAddressTextController',
|
||||||
const Duration(milliseconds: 500),
|
const Duration(
|
||||||
|
milliseconds: 500),
|
||||||
() => setState(() {}),
|
() => setState(() {}),
|
||||||
),
|
),
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
|
@ -351,7 +367,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
0.0, 0.0, 0.0, 16.0),
|
0.0, 0.0, 0.0, 16.0),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
|
@ -364,7 +381,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
onChanged: (_) =>
|
onChanged: (_) =>
|
||||||
EasyDebounce.debounce(
|
EasyDebounce.debounce(
|
||||||
'_model.passwordTextController',
|
'_model.passwordTextController',
|
||||||
const Duration(milliseconds: 500),
|
const Duration(
|
||||||
|
milliseconds: 500),
|
||||||
() => setState(() {}),
|
() => setState(() {}),
|
||||||
),
|
),
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
|
@ -417,7 +435,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
focusedBorder:
|
focusedBorder:
|
||||||
OutlineInputBorder(
|
OutlineInputBorder(
|
||||||
borderSide: const BorderSide(
|
borderSide:
|
||||||
|
const BorderSide(
|
||||||
color:
|
color:
|
||||||
Color(0xFF1AAB5F),
|
Color(0xFF1AAB5F),
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
|
@ -428,7 +447,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
errorBorder:
|
errorBorder:
|
||||||
OutlineInputBorder(
|
OutlineInputBorder(
|
||||||
borderSide: const BorderSide(
|
borderSide:
|
||||||
|
const BorderSide(
|
||||||
color:
|
color:
|
||||||
Color(0xFFFF5963),
|
Color(0xFFFF5963),
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
|
@ -439,7 +459,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
focusedErrorBorder:
|
focusedErrorBorder:
|
||||||
OutlineInputBorder(
|
OutlineInputBorder(
|
||||||
borderSide: const BorderSide(
|
borderSide:
|
||||||
|
const BorderSide(
|
||||||
color:
|
color:
|
||||||
Color(0xFFFF5963),
|
Color(0xFFFF5963),
|
||||||
width: 0.25,
|
width: 0.25,
|
||||||
|
@ -514,16 +535,12 @@ class _SignInTemplateComponentWidgetState
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
0.0, 0.0, 0.0, 16.0),
|
0.0, 0.0, 0.0, 16.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
onPressed: ((_model.emailAddressTextController
|
onPressed: _isFormInvalid()
|
||||||
.text ==
|
|
||||||
'') &&
|
|
||||||
(_model.passwordTextController
|
|
||||||
.text ==
|
|
||||||
''))
|
|
||||||
? null
|
? null
|
||||||
: () async {
|
: () async {
|
||||||
await action_blocks
|
await action_blocks
|
||||||
|
@ -548,18 +565,12 @@ class _SignInTemplateComponentWidgetState
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsetsDirectional
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(0.0,
|
||||||
0.0,
|
0.0, 0.0, 0.0),
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0),
|
|
||||||
iconPadding:
|
iconPadding:
|
||||||
const EdgeInsetsDirectional
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(0.0,
|
||||||
0.0,
|
0.0, 0.0, 0.0),
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0),
|
|
||||||
color:
|
color:
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(
|
||||||
context)
|
context)
|
||||||
|
@ -586,7 +597,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
'Plus Jakarta Sans'),
|
'Plus Jakarta Sans'),
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide:
|
||||||
|
const BorderSide(
|
||||||
color:
|
color:
|
||||||
Colors.transparent,
|
Colors.transparent,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
|
@ -605,7 +617,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
0.0, 0.0, 0.0, 16.0),
|
0.0, 0.0, 0.0, 16.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
|
@ -624,18 +637,12 @@ class _SignInTemplateComponentWidgetState
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsetsDirectional
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(0.0,
|
||||||
0.0,
|
0.0, 0.0, 0.0),
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0),
|
|
||||||
iconPadding:
|
iconPadding:
|
||||||
const EdgeInsetsDirectional
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(0.0,
|
||||||
0.0,
|
0.0, 0.0, 0.0),
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0),
|
|
||||||
color:
|
color:
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(
|
||||||
context)
|
context)
|
||||||
|
@ -662,7 +669,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
'Plus Jakarta Sans'),
|
'Plus Jakarta Sans'),
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide:
|
||||||
|
const BorderSide(
|
||||||
color:
|
color:
|
||||||
Colors.transparent,
|
Colors.transparent,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
|
@ -689,23 +697,10 @@ class _SignInTemplateComponentWidgetState
|
||||||
.fromSTEB(0.0, 0.0,
|
.fromSTEB(0.0, 0.0,
|
||||||
0.0, 16.0),
|
0.0, 16.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
onPressed: (((_model.emailAddressTextController
|
onPressed: _isFormInvalid()
|
||||||
.text ==
|
|
||||||
'') ||
|
|
||||||
((_model.emailAddressFocusNode
|
|
||||||
?.hasFocus ??
|
|
||||||
false) !=
|
|
||||||
null)) &&
|
|
||||||
((_model.emailAddressTextController
|
|
||||||
.text ==
|
|
||||||
'') ||
|
|
||||||
((_model.passwordTextController.text ==
|
|
||||||
'') ||
|
|
||||||
((_model.passwordFocusNode?.hasFocus ??
|
|
||||||
false) !=
|
|
||||||
null))))
|
|
||||||
? null
|
? null
|
||||||
: () async {
|
: () async {
|
||||||
|
try {
|
||||||
await action_blocks
|
await action_blocks
|
||||||
.singInLoginAction(
|
.singInLoginAction(
|
||||||
context,
|
context,
|
||||||
|
@ -717,6 +712,10 @@ class _SignInTemplateComponentWidgetState
|
||||||
.text,
|
.text,
|
||||||
);
|
);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
} catch (e, s) {
|
||||||
|
await DialogUtil.errorDefault(context);
|
||||||
|
LogUtil.requestAPIFailed('login.php', _model.emailAddressTextController.text, "Login", e, s);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(
|
text: FFLocalizations.of(
|
||||||
context)
|
context)
|
||||||
|
@ -728,18 +727,12 @@ class _SignInTemplateComponentWidgetState
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsetsDirectional
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(0.0,
|
||||||
0.0,
|
0.0, 0.0, 0.0),
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0),
|
|
||||||
iconPadding:
|
iconPadding:
|
||||||
const EdgeInsetsDirectional
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(0.0,
|
||||||
0.0,
|
0.0, 0.0, 0.0),
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0),
|
|
||||||
color:
|
color:
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(
|
||||||
context)
|
context)
|
||||||
|
@ -767,7 +760,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
'Plus Jakarta Sans'),
|
'Plus Jakarta Sans'),
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide:
|
||||||
|
const BorderSide(
|
||||||
color: Colors
|
color: Colors
|
||||||
.transparent,
|
.transparent,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
|
@ -776,10 +770,10 @@ class _SignInTemplateComponentWidgetState
|
||||||
BorderRadius
|
BorderRadius
|
||||||
.circular(12.0),
|
.circular(12.0),
|
||||||
disabledColor:
|
disabledColor:
|
||||||
const Color(0xE81AAB5F),
|
const Color(
|
||||||
|
0xE81AAB5F),
|
||||||
),
|
),
|
||||||
showLoadingIndicator:
|
showLoadingIndicator: true,
|
||||||
false,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -805,18 +799,12 @@ class _SignInTemplateComponentWidgetState
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsetsDirectional
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(0.0,
|
||||||
0.0,
|
0.0, 0.0, 0.0),
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0),
|
|
||||||
iconPadding:
|
iconPadding:
|
||||||
const EdgeInsetsDirectional
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(
|
.fromSTEB(0.0,
|
||||||
0.0,
|
0.0, 0.0, 0.0),
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0),
|
|
||||||
color:
|
color:
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(
|
||||||
context)
|
context)
|
||||||
|
@ -844,7 +832,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
'Plus Jakarta Sans'),
|
'Plus Jakarta Sans'),
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide:
|
||||||
|
const BorderSide(
|
||||||
color: Colors
|
color: Colors
|
||||||
.transparent,
|
.transparent,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
|
@ -858,7 +847,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
].divide(const SizedBox(width: 7.0)),
|
].divide(
|
||||||
|
const SizedBox(width: 7.0)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -866,8 +856,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
|
|
||||||
// You will have to add an action on this rich text to go to your login page.
|
// You will have to add an action on this rich text to go to your login page.
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional
|
||||||
0.0, 12.0, 0.0, 12.0),
|
.fromSTEB(0.0, 12.0, 0.0, 12.0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
|
@ -876,21 +866,15 @@ class _SignInTemplateComponentWidgetState
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await showModalBottomSheet(
|
await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
backgroundColor:
|
backgroundColor: Colors.transparent,
|
||||||
Colors.transparent,
|
|
||||||
enableDrag: false,
|
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding:
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
MediaQuery.viewInsetsOf(
|
child: const ForgotPasswordTemplateComponentWidget(),
|
||||||
context),
|
|
||||||
child:
|
|
||||||
const ForgotPasswordTemplateComponentWidget(),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).then(
|
).then((value) => safeSetState(() {}));
|
||||||
(value) => safeSetState(() {}));
|
|
||||||
},
|
},
|
||||||
child: RichText(
|
child: RichText(
|
||||||
textScaler: MediaQuery.of(context)
|
textScaler: MediaQuery.of(context)
|
||||||
|
@ -936,29 +920,23 @@ class _SignInTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
mouseCursor:
|
mouseCursor:
|
||||||
SystemMouseCursors.click,
|
SystemMouseCursors.click,
|
||||||
recognizer:
|
// recognizer: TapGestureRecognizer()
|
||||||
TapGestureRecognizer()
|
// ..onTap = () async {
|
||||||
..onTap = () async {
|
// await showModalBottomSheet(
|
||||||
await showModalBottomSheet(
|
// isScrollControlled: true,
|
||||||
isScrollControlled:
|
// backgroundColor: Colors.transparent,
|
||||||
true,
|
// context: context,
|
||||||
backgroundColor:
|
// useRootNavigator: true,
|
||||||
Colors
|
// builder: (context) {
|
||||||
.transparent,
|
// return Padding(
|
||||||
context: context,
|
// padding: MediaQuery.viewInsetsOf(context),
|
||||||
builder: (context) {
|
// child: const ForgotPasswordTemplateComponentWidget(),
|
||||||
return Padding(
|
// );
|
||||||
padding: MediaQuery
|
// },
|
||||||
.viewInsetsOf(
|
// ).then((value) =>
|
||||||
context),
|
// safeSetState(
|
||||||
child:
|
// () {}));
|
||||||
const ForgotPasswordTemplateComponentWidget(),
|
// },
|
||||||
);
|
|
||||||
},
|
|
||||||
).then((value) =>
|
|
||||||
safeSetState(
|
|
||||||
() {}));
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
style:
|
style:
|
||||||
|
@ -981,29 +959,7 @@ class _SignInTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
const AtomTermsOfUse(),
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'olf967cj' /* Termo de Uso */,
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
fontSize: 14.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -101,8 +101,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
TextEditingController(text: widget.visitStartDate);
|
TextEditingController(text: widget.visitStartDate);
|
||||||
_model.textFieldFocusNode2 ??= FocusNode();
|
_model.textFieldFocusNode2 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController3 ??=
|
_model.textController3 ??= TextEditingController(text: widget.visitEndDate);
|
||||||
TextEditingController(text: widget.visitEndDate);
|
|
||||||
_model.textFieldFocusNode3 ??= FocusNode();
|
_model.textFieldFocusNode3 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController4 ??=
|
_model.textController4 ??=
|
||||||
|
@ -212,20 +211,26 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
Navigator.pop(context);
|
// Navigator.pop(context);
|
||||||
await showModalBottomSheet(
|
// await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
// isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
// backgroundColor: Colors.transparent,
|
||||||
useSafeArea: true,
|
// useSafeArea: true,
|
||||||
context: context,
|
// context: context,
|
||||||
builder: (context) {
|
// builder: (context) {
|
||||||
return Padding(
|
// return Padding(
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
// padding: MediaQuery.viewInsetsOf(context),
|
||||||
child:
|
// child:
|
||||||
const VisitorDetailsModalTemplateComponentWidget(),
|
// const VisitorDetailsModalTemplateComponentWidget(
|
||||||
);
|
// visitorImageURL: '',
|
||||||
},
|
// visitorEmail: '',
|
||||||
).then((value) => safeSetState(() {}));
|
// visitorName: '',
|
||||||
|
// visitorPhone: '',
|
||||||
|
// visitorType: '',
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ).then((value) => safeSetState(() {}));
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
|
@ -870,7 +875,6 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
Share.share(
|
Share.share(
|
||||||
'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.',
|
'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.',
|
||||||
);
|
);
|
||||||
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
||||||
import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart';
|
import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart';
|
||||||
|
@ -74,9 +71,7 @@ class _VisitDetailsModalTemplateComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Align(
|
return Builder(
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
|
||||||
child: Builder(
|
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
if (widget.visitStatusStr != null && widget.visitStatusStr != '') {
|
if (widget.visitStatusStr != null && widget.visitStatusStr != '') {
|
||||||
return wrapWithModel(
|
return wrapWithModel(
|
||||||
|
@ -117,7 +112,6 @@ class _VisitDetailsModalTemplateComponentWidgetState
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -6,7 +6,19 @@ import 'visitor_details_modal_template_component_model.dart';
|
||||||
export 'visitor_details_modal_template_component_model.dart';
|
export 'visitor_details_modal_template_component_model.dart';
|
||||||
|
|
||||||
class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget {
|
class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget {
|
||||||
const VisitorDetailsModalTemplateComponentWidget({super.key});
|
const VisitorDetailsModalTemplateComponentWidget(
|
||||||
|
{super.key,
|
||||||
|
required this.visitorImageURL,
|
||||||
|
required this.visitorName,
|
||||||
|
required this.visitorType,
|
||||||
|
required this.visitorPhone,
|
||||||
|
required this.visitorEmail});
|
||||||
|
|
||||||
|
final String? visitorImageURL;
|
||||||
|
final String? visitorName;
|
||||||
|
final String? visitorType;
|
||||||
|
final String? visitorPhone;
|
||||||
|
final String? visitorEmail;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<VisitorDetailsModalTemplateComponentWidget> createState() =>
|
State<VisitorDetailsModalTemplateComponentWidget> createState() =>
|
||||||
|
@ -50,11 +62,10 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
),
|
),
|
||||||
child: Stack(
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Container(
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 34.0,
|
height: 34.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
@ -62,8 +73,29 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(0.0),
|
bottomLeft: Radius.circular(0.0),
|
||||||
bottomRight: Radius.circular(0.0),
|
bottomRight: Radius.circular(0.0),
|
||||||
topLeft: Radius.circular(0.0),
|
topLeft: Radius.circular(25.0),
|
||||||
topRight: Radius.circular(0.0),
|
topRight: Radius.circular(25.0),
|
||||||
|
),
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
),
|
||||||
|
child: Align(
|
||||||
|
alignment: const AlignmentDirectional(1.0, -1.0),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
10.0, 5.0, 15.0, 0.0),
|
||||||
|
child: InkWell(
|
||||||
|
splashColor: Colors.transparent,
|
||||||
|
focusColor: Colors.transparent,
|
||||||
|
hoverColor: Colors.transparent,
|
||||||
|
highlightColor: Colors.transparent,
|
||||||
|
onTap: () async {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Icon(
|
||||||
|
Icons.close,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
size: 24.0,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -71,21 +103,21 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
alignment: const AlignmentDirectional(0.0, -1.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(20.0, 40.0, 20.0, 0.0),
|
20.0, 40.0, 20.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
),
|
),
|
||||||
child: Stack(
|
child: Padding(
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
0.0, 10.0, 0.0, 0.0),
|
0.0, 10.0, 0.0, 0.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
if (widget.visitorImageURL != '' &&
|
||||||
|
widget.visitorImageURL != null)
|
||||||
Container(
|
Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 100.0,
|
height: 100.0,
|
||||||
|
@ -94,7 +126,7 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
child: Image.network(
|
child: Image.network(
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
widget.visitorImageURL!,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -104,15 +136,12 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
20.0, 0.0, 20.0, 0.0),
|
20.0, 0.0, 20.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
widget.visitorName ?? '',
|
||||||
'kqzf7nx2' /* Nome do Visitante */,
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
fontSize: 24.0,
|
fontSize: 24.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
|
@ -138,8 +167,7 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
@ -160,7 +188,8 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
alignment:
|
||||||
|
const AlignmentDirectional(-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
20.0, 0.0, 20.0, 0.0),
|
20.0, 0.0, 20.0, 0.0),
|
||||||
|
@ -177,11 +206,9 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(context)
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
.bodyMediumFamily),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -198,7 +225,8 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
alignment:
|
||||||
|
const AlignmentDirectional(-1.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
20.0, 0.0, 20.0, 0.0),
|
20.0, 0.0, 20.0, 0.0),
|
||||||
|
@ -215,11 +243,9 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(context)
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
.bodyMediumFamily),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -230,49 +256,25 @@ class _VisitorDetailsModalTemplateComponentWidgetState
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(-1.0, -1.0),
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: 34.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(0.0),
|
|
||||||
bottomRight: Radius.circular(0.0),
|
|
||||||
topLeft: Radius.circular(25.0),
|
|
||||||
topRight: Radius.circular(25.0),
|
|
||||||
),
|
|
||||||
shape: BoxShape.rectangle,
|
|
||||||
),
|
|
||||||
child: Align(
|
|
||||||
alignment: const AlignmentDirectional(1.0, -1.0),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(10.0, 5.0, 15.0, 0.0),
|
|
||||||
child: InkWell(
|
|
||||||
splashColor: Colors.transparent,
|
|
||||||
focusColor: Colors.transparent,
|
|
||||||
hoverColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
onTap: () async {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
child: Icon(
|
|
||||||
Icons.close,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
// Align(
|
||||||
|
// alignment: const AlignmentDirectional(0.0, 1.0),
|
||||||
|
// child: Container(
|
||||||
|
// width: double.infinity,
|
||||||
|
// height: 34.0,
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
// borderRadius: const BorderRadius.only(
|
||||||
|
// bottomLeft: Radius.circular(0.0),
|
||||||
|
// bottomRight: Radius.circular(0.0),
|
||||||
|
// topLeft: Radius.circular(0.0),
|
||||||
|
// topRight: Radius.circular(0.0),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart';
|
import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart';
|
||||||
import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart';
|
import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart';
|
||||||
|
@ -9,8 +8,6 @@ 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/internationalization.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:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
@ -50,12 +47,6 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
|
|
||||||
_model.textController ??= TextEditingController();
|
_model.textController ??= TextEditingController();
|
||||||
_model.textFieldFocusNode ??= FocusNode();
|
_model.textFieldFocusNode ??= FocusNode();
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) => setState(() {
|
|
||||||
_model.textController?.text = FFLocalizations.of(context).getText(
|
|
||||||
'oj12tamm' /* test */,
|
|
||||||
);
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -69,12 +60,10 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<FFAppState>();
|
context.watch<FFAppState>();
|
||||||
|
|
||||||
return Align(
|
return Padding(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 50.0, 0.0, 0.0),
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 300.0, 0.0, 0.0),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: MediaQuery.of(context).size.width,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
|
@ -89,18 +78,15 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 10.0, 16.0, 0.0),
|
padding:
|
||||||
|
const EdgeInsetsDirectional.fromSTEB(16.0, 10.0, 16.0, 0.0),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: _model.textController,
|
controller: _model.textController,
|
||||||
focusNode: _model.textFieldFocusNode,
|
focusNode: _model.textFieldFocusNode,
|
||||||
onFieldSubmitted: (_) async {
|
onFieldSubmitted: (_) async {
|
||||||
setState(() {
|
setState(() {
|
||||||
_model.textController?.text = valueOrDefault<String>(
|
_model.textController?.text = _model.textController.text;
|
||||||
_model.textController.text,
|
_model.textController?.selection = TextSelection.collapsed(
|
||||||
'69696777',
|
|
||||||
);
|
|
||||||
_model.textController?.selection =
|
|
||||||
TextSelection.collapsed(
|
|
||||||
offset: _model.textController!.text.length);
|
offset: _model.textController!.text.length);
|
||||||
});
|
});
|
||||||
_model.getVisitorByDoc =
|
_model.getVisitorByDoc =
|
||||||
|
@ -116,22 +102,27 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
(_model.getVisitorByDoc?.jsonBody ?? ''),
|
(_model.getVisitorByDoc?.jsonBody ?? ''),
|
||||||
) !=
|
) !=
|
||||||
'0') {
|
'0') {
|
||||||
_model
|
_model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante(
|
||||||
.addToVisitors(PhpGroup.getVisitorByDocCall.visitante(
|
|
||||||
(_model.getVisitorByDoc?.jsonBody ?? ''),
|
(_model.getVisitorByDoc?.jsonBody ?? ''),
|
||||||
));
|
));
|
||||||
setState(() {});
|
setState(() {});
|
||||||
_model.addToDocs(_model.textController.text);
|
_model.addToDocs(_model.textController.text);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
} else {
|
} else {
|
||||||
await showModalBottomSheet(
|
await showAdaptiveDialog(
|
||||||
isScrollControlled: true,
|
useSafeArea: true,
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Padding(
|
return Dialog(
|
||||||
|
child: Padding(
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
child: const VisitorNotFoundComponentWidget(),
|
child: Container(
|
||||||
|
color: Colors.transparent,
|
||||||
|
// width: MediaQuery.of(context).size.height * 0.1,
|
||||||
|
// height:
|
||||||
|
// MediaQuery.of(context).size.height * 0.4,
|
||||||
|
child: const VisitorNotFoundComponentWidget()),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).then((value) => safeSetState(() {}));
|
).then((value) => safeSetState(() {}));
|
||||||
|
@ -147,9 +138,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'cjlpru1m' /* Procure pelo documento do visi... */,
|
'cjlpru1m' /* Procure pelo documento do visi... */,
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
@ -216,24 +205,23 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
),
|
),
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
validator:
|
validator: _model.textControllerValidator.asValidator(context),
|
||||||
_model.textControllerValidator.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (_model.visitors.isNotEmpty && _model.visitors.length > 0)
|
||||||
Row(
|
Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 0.0, 0.0),
|
16.0, 12.0, 0.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'9coywebh' /* Visitantes encontrados */,
|
'9coywebh' /* Visitantes encontrados */,
|
||||||
|
@ -249,12 +237,10 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(4.0, 12.0, 16.0, 0.0),
|
4.0, 12.0, 16.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
_model.visitors.length.toString(),
|
||||||
'6f5p0fv6' /* 24 */,
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
|
@ -271,13 +257,12 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
if (_model.visitors.isNotEmpty) {
|
if (_model.visitors.isNotEmpty) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(8.0, 8.0, 8.0, 0.0),
|
8.0, 8.0, 8.0, 0.0),
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
final visitor =
|
final visitor =
|
||||||
_model.visitors.map((e) => e).toList();
|
_model.visitors.map((e) => e).toList();
|
||||||
|
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
|
@ -293,39 +278,42 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await showModalBottomSheet(
|
// await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
// isScrollControlled: true,
|
||||||
enableDrag: false,
|
// enableDrag: true,
|
||||||
context: context,
|
// isDismissible: true,
|
||||||
builder: (context) {
|
// context: context,
|
||||||
return Padding(
|
// builder: (context) {
|
||||||
padding: MediaQuery.viewInsetsOf(
|
// return Padding(
|
||||||
context),
|
// padding:
|
||||||
child: const SizedBox(
|
// MediaQuery.viewInsetsOf(context),
|
||||||
height: 610.0,
|
// child: SizedBox(
|
||||||
child:
|
// height: 610.0,
|
||||||
VisitorDetailsModalTemplateComponentWidget(),
|
// child:
|
||||||
),
|
// VisitorDetailsModalTemplateComponentWidget(
|
||||||
);
|
// visitorImageURL:
|
||||||
},
|
// "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
||||||
).then((value) => safeSetState(() {}));
|
// visitorItem,
|
||||||
|
// r'''$.VTE_DOCUMENTO''',
|
||||||
|
// ).toString()}&tipo=E",
|
||||||
|
// visitorEmail: '',
|
||||||
|
// visitorName: getJsonField(
|
||||||
|
// visitorItem,
|
||||||
|
// r'''$.VTE_NOME''',
|
||||||
|
// )?.toString(),
|
||||||
|
// visitorPhone: '',
|
||||||
|
// visitorType: '',
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ).then((value) => safeSetState(() {}));
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context)
|
color: FlutterFlowTheme.of(context)
|
||||||
.secondaryBackground,
|
.primaryBackground,
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
blurRadius: 0.0,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.alternate,
|
|
||||||
offset: const Offset(
|
|
||||||
0.0,
|
|
||||||
1.0,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
@ -338,18 +326,15 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(40.0),
|
BorderRadius.circular(40.0),
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
fadeInDuration:
|
fadeInDuration: const Duration(
|
||||||
const Duration(milliseconds: 500),
|
milliseconds: 500),
|
||||||
fadeOutDuration:
|
fadeOutDuration: const Duration(
|
||||||
const Duration(milliseconds: 500),
|
milliseconds: 500),
|
||||||
imageUrl:
|
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=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
|
||||||
visitorItem,
|
visitorItem,
|
||||||
r'''$.VTE_DOCUMENTO''',
|
r'''$.VTE_DOCUMENTO''',
|
||||||
).toString()}&tipo=E',
|
).toString()}&tipo=E",
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
|
||||||
),
|
|
||||||
width: 60.0,
|
width: 60.0,
|
||||||
height: 60.0,
|
height: 60.0,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
|
@ -358,14 +343,16 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.center,
|
||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsetsDirectional
|
const EdgeInsetsDirectional
|
||||||
.fromSTEB(12.0, 0.0,
|
.fromSTEB(
|
||||||
0.0, 0.0),
|
12.0, 0.0, 0.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
valueOrDefault<String>(
|
valueOrDefault<String>(
|
||||||
getJsonField(
|
getJsonField(
|
||||||
|
@ -374,76 +361,24 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
)?.toString(),
|
)?.toString(),
|
||||||
'NOT FOUND',
|
'NOT FOUND',
|
||||||
),
|
),
|
||||||
style:
|
style: FlutterFlowTheme.of(
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
context)
|
||||||
.bodyLarge
|
.bodyLarge
|
||||||
.override(
|
.override(
|
||||||
fontFamily: FlutterFlowTheme.of(
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(
|
||||||
context)
|
context)
|
||||||
.bodyLargeFamily,
|
.bodyLargeFamily,
|
||||||
letterSpacing:
|
letterSpacing: 0.0,
|
||||||
0.0,
|
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts
|
||||||
.asMap()
|
.asMap()
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
.bodyLargeFamily),
|
.bodyLargeFamily),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(4.0, 4.0,
|
|
||||||
0.0, 0.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize:
|
|
||||||
MainAxisSize.max,
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment
|
|
||||||
.start,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(
|
|
||||||
0.0, -1.0),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
10.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0),
|
|
||||||
child: Text(
|
|
||||||
getJsonField(
|
|
||||||
visitorItem,
|
|
||||||
r'''$.VTE_TELEFONE''',
|
|
||||||
).toString(),
|
|
||||||
style: FlutterFlowTheme
|
|
||||||
.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.primary,
|
|
||||||
letterSpacing:
|
|
||||||
0.0,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -452,10 +387,10 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
borderWidth: 1.0,
|
borderWidth: 1.0,
|
||||||
buttonSize: 40.0,
|
buttonSize: 40.0,
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.restore_from_trash,
|
Icons.close,
|
||||||
color:
|
color:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.primary,
|
.customColor6,
|
||||||
size: 20.0,
|
size: 20.0,
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
@ -480,14 +415,17 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 100.0,
|
height: 100.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color:
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
FlutterFlowTheme.of(context).secondaryBackground,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
FFButtonWidget(
|
FFButtonWidget(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await widget.getVisitors?.call(
|
await widget.getVisitors?.call(
|
||||||
|
@ -498,15 +436,17 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
);
|
);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context).getText(
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
'ug6qzyla' /* Adicionar */,
|
enText: 'Add',
|
||||||
|
ptText: 'Adicionar',
|
||||||
),
|
),
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
height: 30.0,
|
height: MediaQuery.of(context).size.width * 0.1,
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
iconPadding:
|
24.0, 0.0, 24.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: FlutterFlowTheme.of(context).primary,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
|
@ -522,15 +462,19 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
),
|
),
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(0.0),
|
bottomLeft: Radius.circular(15),
|
||||||
bottomRight: Radius.circular(0.0),
|
bottomRight: Radius.circular(15),
|
||||||
topLeft: Radius.circular(0.0),
|
topLeft: Radius.circular(15),
|
||||||
topRight: Radius.circular(0.0),
|
topRight: Radius.circular(15),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10.0,
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -13,7 +13,6 @@ import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../main.dart';
|
import '../main.dart';
|
||||||
|
|
||||||
|
|
||||||
export 'keep_alive_wrapper.dart';
|
export 'keep_alive_wrapper.dart';
|
||||||
export 'lat_lng.dart';
|
export 'lat_lng.dart';
|
||||||
export 'place.dart';
|
export 'place.dart';
|
||||||
|
@ -87,6 +86,46 @@ Theme wrapInMaterialDatePickerTheme(
|
||||||
|
|
||||||
return Theme(
|
return Theme(
|
||||||
data: baseTheme.copyWith(
|
data: baseTheme.copyWith(
|
||||||
|
textSelectionTheme: baseTheme.textSelectionTheme.copyWith(
|
||||||
|
cursorColor: headerBackgroundColor,
|
||||||
|
selectionColor: headerBackgroundColor.withOpacity(0.4),
|
||||||
|
selectionHandleColor: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
inputDecorationTheme: baseTheme.inputDecorationTheme.copyWith(
|
||||||
|
isDense: true,
|
||||||
|
hoverColor: headerBackgroundColor.withOpacity(0.04),
|
||||||
|
floatingLabelStyle: baseTheme.textTheme.labelMedium!.copyWith(
|
||||||
|
color: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
labelStyle: baseTheme.textTheme.labelMedium!.copyWith(
|
||||||
|
color: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: headerBackgroundColor.withOpacity(0.6),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
errorBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
colorScheme: baseTheme.colorScheme.copyWith(
|
colorScheme: baseTheme.colorScheme.copyWith(
|
||||||
onSurface: pickerForegroundColor,
|
onSurface: pickerForegroundColor,
|
||||||
),
|
),
|
||||||
|
@ -149,9 +188,54 @@ Theme wrapInMaterialTimePickerTheme(
|
||||||
final baseTheme = Theme.of(context);
|
final baseTheme = Theme.of(context);
|
||||||
return Theme(
|
return Theme(
|
||||||
data: baseTheme.copyWith(
|
data: baseTheme.copyWith(
|
||||||
|
focusColor: headerBackgroundColor,
|
||||||
iconTheme: baseTheme.iconTheme.copyWith(
|
iconTheme: baseTheme.iconTheme.copyWith(
|
||||||
size: iconSize,
|
size: iconSize,
|
||||||
),
|
),
|
||||||
|
textSelectionTheme: baseTheme.textSelectionTheme.copyWith(
|
||||||
|
cursorColor: headerBackgroundColor,
|
||||||
|
selectionColor: headerBackgroundColor.withOpacity(0.4),
|
||||||
|
selectionHandleColor: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
inputDecorationTheme: baseTheme.inputDecorationTheme.copyWith(
|
||||||
|
isDense: true,
|
||||||
|
focusColor: headerBackgroundColor,
|
||||||
|
hoverColor: headerBackgroundColor.withOpacity(0.04),
|
||||||
|
floatingLabelStyle: baseTheme.textTheme.labelMedium!.copyWith(
|
||||||
|
color: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
labelStyle: baseTheme.textTheme.labelMedium!.copyWith(
|
||||||
|
color: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
outlineBorder: BorderSide(
|
||||||
|
color: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: headerBackgroundColor.withOpacity(0.6),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
errorBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: headerBackgroundColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
textButtonTheme: TextButtonThemeData(
|
textButtonTheme: TextButtonThemeData(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
foregroundColor: WidgetStatePropertyAll(
|
foregroundColor: WidgetStatePropertyAll(
|
||||||
|
@ -169,6 +253,7 @@ Theme wrapInMaterialTimePickerTheme(
|
||||||
})),
|
})),
|
||||||
),
|
),
|
||||||
timePickerTheme: baseTheme.timePickerTheme.copyWith(
|
timePickerTheme: baseTheme.timePickerTheme.copyWith(
|
||||||
|
hourMinuteColor: selectedDateTimeBackgroundColor,
|
||||||
backgroundColor: pickerBackgroundColor,
|
backgroundColor: pickerBackgroundColor,
|
||||||
hourMinuteTextColor: pickerForegroundColor,
|
hourMinuteTextColor: pickerForegroundColor,
|
||||||
dialHandColor: selectedDateTimeBackgroundColor,
|
dialHandColor: selectedDateTimeBackgroundColor,
|
||||||
|
|
|
@ -569,8 +569,8 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
// throwException
|
// throwException
|
||||||
{
|
{
|
||||||
'e58xxxiq': {
|
'e58xxxiq': {
|
||||||
'pt': 'ERRO',
|
'pt': 'Falha :(',
|
||||||
'en': 'ERROR',
|
'en': 'Fail :(',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// regisiterVistorTemplateComponent
|
// regisiterVistorTemplateComponent
|
||||||
|
@ -873,28 +873,28 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
'en': 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT',
|
'en': 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT',
|
||||||
},
|
},
|
||||||
'1ltg0ylb': {
|
'1ltg0ylb': {
|
||||||
'pt': 'Email',
|
'pt': 'E-mail',
|
||||||
'en': 'Email',
|
'en': 'E-mail',
|
||||||
},
|
},
|
||||||
'2x19ce8k': {
|
'2x19ce8k': {
|
||||||
'pt': 'Senha',
|
'pt': 'Senha',
|
||||||
'en': 'Password',
|
'en': 'Password',
|
||||||
},
|
},
|
||||||
'xhnawzcb': {
|
'xhnawzcb': {
|
||||||
'pt': 'Campo é necessário',
|
'pt': 'E-mail é Obrigatório',
|
||||||
'en': 'Field is required',
|
'en': 'E-mail is required',
|
||||||
},
|
},
|
||||||
's3j1hjqx': {
|
's3j1hjqx': {
|
||||||
'pt': 'E-mail Inv',
|
'pt': 'E-mail Inválido',
|
||||||
'en': '',
|
'en': 'Invalid E-mail',
|
||||||
},
|
},
|
||||||
'2ib9bf67': {
|
'2ib9bf67': {
|
||||||
'pt': 'Please choose an option from the dropdown',
|
'pt': 'Please choose an option from the dropdown',
|
||||||
'en': '',
|
'en': '',
|
||||||
},
|
},
|
||||||
'9cs5wlmc': {
|
'9cs5wlmc': {
|
||||||
'pt': 'Campo é necessário',
|
'pt': 'Senha é Obrigatório',
|
||||||
'en': 'Field is required',
|
'en': 'Password is required',
|
||||||
},
|
},
|
||||||
'rkxwb0sg': {
|
'rkxwb0sg': {
|
||||||
'pt': 'Please choose an option from the dropdown',
|
'pt': 'Please choose an option from the dropdown',
|
||||||
|
@ -922,7 +922,7 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
},
|
},
|
||||||
'p5c6d54y': {
|
'p5c6d54y': {
|
||||||
'pt': ' Recupere aqui',
|
'pt': ' Recupere aqui',
|
||||||
'en': ' recover here',
|
'en': ' Recover here',
|
||||||
},
|
},
|
||||||
'olf967cj': {
|
'olf967cj': {
|
||||||
'pt': 'Termo de Uso',
|
'pt': 'Termo de Uso',
|
||||||
|
@ -1032,12 +1032,24 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
'Don\'t worry, we will help you, enter the email registered in the application and click send.',
|
'Don\'t worry, we will help you, enter the email registered in the application and click send.',
|
||||||
},
|
},
|
||||||
'mtz8l7ft': {
|
'mtz8l7ft': {
|
||||||
'pt': 'Email',
|
'pt': 'E-mail',
|
||||||
'en': 'Email',
|
'en': 'E-mail',
|
||||||
},
|
},
|
||||||
'w7y5wlnv': {
|
'w7y5wlnv': {
|
||||||
'pt': 'digite o seu email.....',
|
'pt': '',
|
||||||
'en': 'enter your email.....',
|
'en': '',
|
||||||
|
},
|
||||||
|
'3hqg8buh': {
|
||||||
|
'pt': 'E-mail é Obrigatório',
|
||||||
|
'en': 'E-mail is Required',
|
||||||
|
},
|
||||||
|
'jh5r2b1w': {
|
||||||
|
'pt': 'E-mail Inválido',
|
||||||
|
'en': 'Invalid E-mail',
|
||||||
|
},
|
||||||
|
'1p76vmkn': {
|
||||||
|
'pt': 'Please choose an option from the dropdown',
|
||||||
|
'en': '',
|
||||||
},
|
},
|
||||||
'74rnd5bu': {
|
'74rnd5bu': {
|
||||||
'pt': 'Enviar',
|
'pt': 'Enviar',
|
||||||
|
|
|
@ -52,8 +52,8 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheet({
|
||||||
required bool allowPhoto,
|
required bool allowPhoto,
|
||||||
bool allowVideo = false,
|
bool allowVideo = false,
|
||||||
String pickerFontFamily = 'Roboto',
|
String pickerFontFamily = 'Roboto',
|
||||||
Color textColor = const Color(0xFF111417),
|
// Color textColor = const Color(0xFF111417),
|
||||||
Color backgroundColor = const Color(0xFFF5F5F5),
|
// Color backgroundColor = const Color(0xFFF5F5F5),
|
||||||
bool includeDimensions = false,
|
bool includeDimensions = false,
|
||||||
bool includeBlurHash = false,
|
bool includeBlurHash = false,
|
||||||
}) async {
|
}) async {
|
||||||
|
@ -63,12 +63,12 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheet({
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: GoogleFonts.getFont(
|
style: GoogleFonts.getFont(
|
||||||
pickerFontFamily,
|
pickerFontFamily,
|
||||||
color: textColor,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
tileColor: backgroundColor,
|
tileColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
dense: false,
|
dense: false,
|
||||||
onTap: () => Navigator.pop(
|
onTap: () => Navigator.pop(
|
||||||
context,
|
context,
|
||||||
|
@ -77,7 +77,7 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheet({
|
||||||
);
|
);
|
||||||
final mediaSource = await showModalBottomSheet<MediaSource>(
|
final mediaSource = await showModalBottomSheet<MediaSource>(
|
||||||
context: context,
|
context: context,
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
@ -91,13 +91,15 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheet({
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: GoogleFonts.getFont(
|
style: GoogleFonts.getFont(
|
||||||
pickerFontFamily,
|
pickerFontFamily,
|
||||||
color: textColor.withOpacity(0.65),
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.primaryText
|
||||||
|
.withOpacity(0.65),
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
tileColor: backgroundColor,
|
tileColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
dense: false,
|
dense: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Divider(),
|
const Divider(),
|
||||||
|
@ -360,14 +362,22 @@ void showUploadMessage(
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
valueColor: Theme.of(context).brightness == Brightness.dark
|
valueColor: Theme.of(context).brightness == Brightness.dark
|
||||||
? AlwaysStoppedAnimation<Color>(
|
? AlwaysStoppedAnimation<Color>(
|
||||||
FlutterFlowTheme.of(context).accent4)
|
FlutterFlowTheme.of(context).info)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(message),
|
Text(message, style: FlutterFlowTheme.of(context).bodyMedium),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
duration: showLoading ? const Duration(days: 1) : const Duration(seconds: 4),
|
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
shape: const RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(15),
|
||||||
|
topRight: Radius.circular(15),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
duration:
|
||||||
|
showLoading ? const Duration(days: 1) : const Duration(seconds: 4),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
||||||
import 'package:hub/app_state.dart';
|
import 'package:hub/app_state.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
|
@ -29,6 +30,8 @@ void main() async {
|
||||||
|
|
||||||
Future<void> initializeApp() async {
|
Future<void> initializeApp() async {
|
||||||
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
||||||
|
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
|
||||||
|
|
||||||
await FlutterFlowTheme.initialize();
|
await FlutterFlowTheme.initialize();
|
||||||
await FFLocalizations.initialize();
|
await FFLocalizations.initialize();
|
||||||
final appState = FFAppState();
|
final appState = FFAppState();
|
||||||
|
@ -57,6 +60,9 @@ class _MyAppState extends State<MyApp> {
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
|
FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
|
||||||
|
|
||||||
_appStateNotifier = AppStateNotifier.instance;
|
_appStateNotifier = AppStateNotifier.instance;
|
||||||
_router = createRouter(_appStateNotifier);
|
_router = createRouter(_appStateNotifier);
|
||||||
Future.delayed(const Duration(milliseconds: 1000),
|
Future.delayed(const Duration(milliseconds: 1000),
|
||||||
|
|
|
@ -22,17 +22,11 @@ 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 {
|
||||||
const HomePageWidget({super.key});
|
const HomePageWidget({super.key});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<HomePageWidget> createState() => _HomePageWidgetState();
|
State<HomePageWidget> createState() => _HomePageWidgetState();
|
||||||
}
|
}
|
||||||
|
@ -42,7 +36,6 @@ 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,
|
||||||
|
@ -58,9 +51,6 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
SchedulerBinding.instance.addPostFrameCallback((_) async {
|
SchedulerBinding.instance.addPostFrameCallback((_) async {
|
||||||
await PushNotificationService().initialize(context);
|
await PushNotificationService().initialize(context);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
@ -105,7 +95,6 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
context.watch<FFAppState>();
|
context.watch<FFAppState>();
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => _model.unfocusNode.canRequestFocus
|
onTap: () => _model.unfocusNode.canRequestFocus
|
||||||
|
@ -217,57 +206,43 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(0.0, 1.0),
|
||||||
const AlignmentDirectional(0.0, 1.0),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 50.0,
|
height: 50.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
const AlignmentDirectional(
|
|
||||||
-1.0, 0.0),
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
10.0, 0.0, 0.0, 0.0),
|
10.0, 0.0, 0.0, 0.0),
|
||||||
child: FlutterFlowIconButton(
|
child: FlutterFlowIconButton(
|
||||||
borderRadius: 20.0,
|
borderRadius: 20.0,
|
||||||
borderWidth: 1.0,
|
borderWidth: 1.0,
|
||||||
buttonSize: 40.0,
|
buttonSize: 40.0,
|
||||||
fillColor:
|
fillColor: FlutterFlowTheme.of(context).primary,
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primary,
|
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.menu_rounded,
|
Icons.menu_rounded,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
size: 28.0,
|
size: 28.0,
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
scaffoldKey.currentState!
|
scaffoldKey.currentState!.openDrawer();
|
||||||
.openDrawer();
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
const AlignmentDirectional(
|
|
||||||
-1.0, 0.0),
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
60.0, 15.0, 0.0, 0.0),
|
60.0, 15.0, 0.0, 0.0),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
child: Image.network(
|
child: Image.network(
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png',
|
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png',
|
||||||
width: 50.0,
|
width: 50.0,
|
||||||
|
@ -278,36 +253,24 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
const AlignmentDirectional(
|
|
||||||
0.0, 0.0),
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
0.0, 15.0, 0.0, 0.0),
|
0.0, 15.0, 0.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context)
|
FFLocalizations.of(context).getText(
|
||||||
.getText(
|
|
||||||
'rg9pzkpz' /* FRE ACCESS */,
|
'rg9pzkpz' /* FRE ACCESS */,
|
||||||
),
|
),
|
||||||
style:
|
style: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily:
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
color: FlutterFlowTheme
|
color: FlutterFlowTheme.of(context).info,
|
||||||
.of(context)
|
|
||||||
.info,
|
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
.containsKey(
|
||||||
FlutterFlowTheme.of(
|
FlutterFlowTheme.of(context)
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
.bodyMediumFamily),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -319,23 +282,20 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(0.0, 1.0),
|
||||||
const AlignmentDirectional(0.0, 1.0),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 50.0,
|
height: 50.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment:
|
alignment: const AlignmentDirectional(1.0, 1.0),
|
||||||
const AlignmentDirectional(1.0, 1.0),
|
|
||||||
child: FlutterFlowIconButton(
|
child: FlutterFlowIconButton(
|
||||||
borderRadius: 20.0,
|
borderRadius: 20.0,
|
||||||
borderWidth: 1.0,
|
borderWidth: 1.0,
|
||||||
buttonSize: 40.0,
|
buttonSize: 40.0,
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.notifications_sharp,
|
Icons.notifications_sharp,
|
||||||
color:
|
color: FlutterFlowTheme.of(context).info,
|
||||||
FlutterFlowTheme.of(context).info,
|
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
@ -415,24 +375,20 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
width: 150.0,
|
width: 150.0,
|
||||||
child: Text(
|
child: Text(
|
||||||
valueOrDefault<String>(
|
valueOrDefault<String>(
|
||||||
convertToUppercase(
|
convertToUppercase(FFAppState().local),
|
||||||
FFAppState().local),
|
|
||||||
'NOME DO LOCAL',
|
'NOME DO LOCAL',
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
.bodyLarge
|
.bodyLarge
|
||||||
.override(
|
.override(
|
||||||
fontFamily: 'Nunito Sans',
|
fontFamily: 'Nunito Sans',
|
||||||
color:
|
color: FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
.primaryText,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
GoogleFonts.asMap()
|
.containsKey('Nunito Sans'),
|
||||||
.containsKey(
|
|
||||||
'Nunito Sans'),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -461,8 +417,8 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
size: 20.0,
|
size: 20.0,
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (scaffoldKey.currentState!
|
if (scaffoldKey
|
||||||
.isDrawerOpen ||
|
.currentState!.isDrawerOpen ||
|
||||||
scaffoldKey.currentState!
|
scaffoldKey.currentState!
|
||||||
.isEndDrawerOpen) {
|
.isEndDrawerOpen) {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
|
@ -505,12 +461,11 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
.override(
|
.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
.labelMediumFamily,
|
.labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context)
|
color:
|
||||||
.primaryText,
|
FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
.labelMediumFamily),
|
||||||
),
|
),
|
||||||
alignLabelWithHint: false,
|
alignLabelWithHint: false,
|
||||||
|
@ -521,14 +476,13 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
.labelMediumFamily,
|
.labelMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey(
|
.containsKey(FlutterFlowTheme.of(context)
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
.labelMediumFamily),
|
||||||
),
|
),
|
||||||
enabledBorder: UnderlineInputBorder(
|
enabledBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context)
|
color:
|
||||||
.customColor1,
|
FlutterFlowTheme.of(context).customColor1,
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(2.0),
|
borderRadius: BorderRadius.circular(2.0),
|
||||||
|
@ -564,8 +518,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
.bodyMediumFamily,
|
.bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(context)
|
||||||
.bodyMediumFamily),
|
.bodyMediumFamily),
|
||||||
),
|
),
|
||||||
|
@ -616,8 +569,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
iconPadding:
|
iconPadding:
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
||||||
color: const Color(0x00D70000),
|
color: const Color(0x00D70000),
|
||||||
textStyle:
|
textStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
FlutterFlowTheme.of(context).labelMedium.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,
|
||||||
|
@ -633,7 +585,6 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
borderRadius: BorderRadius.circular(50.0),
|
borderRadius: BorderRadius.circular(50.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
].addToEnd(const SizedBox(height: 64.0)),
|
].addToEnd(const SizedBox(height: 64.0)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -836,6 +787,5 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
// );
|
// );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/flutter_flow/request_manager.dart';
|
import 'package:hub/flutter_flow/request_manager.dart';
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/pages/message_history_page/message_history_page_widget.dart';
|
import 'package:hub/pages/message_history_page/message_history_page_widget.dart';
|
||||||
|
|
||||||
class MessageHistoryPageModel extends FlutterFlowModel<MessageHistoryPageWidget> {
|
class MessageHistoryPageModel
|
||||||
|
extends FlutterFlowModel<MessageHistoryPageWidget> {
|
||||||
/// State fields for stateful widgets in this page.
|
/// State fields for stateful widgets in this page.
|
||||||
///
|
///
|
||||||
|
|
||||||
|
@ -49,7 +50,6 @@ class MessageHistoryPageModel extends FlutterFlowModel<MessageHistoryPageWidget>
|
||||||
textController?.dispose();
|
textController?.dispose();
|
||||||
tabBarController?.dispose();
|
tabBarController?.dispose();
|
||||||
|
|
||||||
|
|
||||||
/// Dispose query cache managers for this widget.
|
/// Dispose query cache managers for this widget.
|
||||||
|
|
||||||
clearGetLiberationsCache();
|
clearGetLiberationsCache();
|
||||||
|
|
|
@ -12,7 +12,6 @@ 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:hub/pages/message_history_page/message_history_page_model.dart';
|
import 'package:hub/pages/message_history_page/message_history_page_model.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';
|
||||||
|
@ -26,7 +25,8 @@ class MessageHistoryPageWidget extends StatefulWidget {
|
||||||
_MessageHistoryPageWidgetState();
|
_MessageHistoryPageWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget> with TickerProviderStateMixin {
|
class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget>
|
||||||
|
with TickerProviderStateMixin {
|
||||||
late MessageHistoryPageModel _model;
|
late MessageHistoryPageModel _model;
|
||||||
|
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
@ -106,8 +106,7 @@ PreferredSizeWidget appBarMessage(BuildContext context) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget bodyMessage(
|
Widget bodyMessage(BuildContext context, MessageHistoryPageModel _model) {
|
||||||
BuildContext context, MessageHistoryPageModel _model) {
|
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
top: true,
|
top: true,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
@ -155,33 +154,26 @@ Widget bodyMessage(
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(child: TabBarView(
|
Expanded(
|
||||||
controller: _model.tabBarController,
|
child: TabBarView(controller: _model.tabBarController, children: [
|
||||||
children: [
|
|
||||||
liberationDynamicListView(context, _model, 'P'),
|
liberationDynamicListView(context, _model, 'P'),
|
||||||
liberationDynamicListView(context, _model, 'A'),
|
liberationDynamicListView(context, _model, 'A'),
|
||||||
liberationDynamicListView(context, _model, 'T'),
|
liberationDynamicListView(context, _model, 'T'),
|
||||||
]
|
])),
|
||||||
)),
|
|
||||||
].addToStart(const SizedBox(height: 0)),
|
].addToStart(const SizedBox(height: 0)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Widget liberationDynamicListView(
|
Widget liberationDynamicListView(
|
||||||
BuildContext context,
|
BuildContext context, MessageHistoryPageModel _model, String DestIndex) {
|
||||||
MessageHistoryPageModel _model,
|
|
||||||
String DestIndex
|
|
||||||
) {
|
|
||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: FutureBuilder<ApiCallResponse>(
|
child: FutureBuilder<ApiCallResponse>(
|
||||||
future: PhpGroup.getMessagesCall.call(
|
future: PhpGroup.getMessagesCall
|
||||||
|
.call(
|
||||||
devUUID: FFAppState().devUUID.toString(),
|
devUUID: FFAppState().devUUID.toString(),
|
||||||
userUUID: FFAppState().userUUID.toString(),
|
userUUID: FFAppState().userUUID.toString(),
|
||||||
cliID: FFAppState().cliUUID.toString(),
|
cliID: FFAppState().cliUUID.toString(),
|
||||||
|
@ -189,7 +181,8 @@ Widget liberationDynamicListView(
|
||||||
pageSize: '100',
|
pageSize: '100',
|
||||||
pageNumber: '1',
|
pageNumber: '1',
|
||||||
tipoDestino: DestIndex,
|
tipoDestino: DestIndex,
|
||||||
).catchError((error) {
|
)
|
||||||
|
.catchError((error) {
|
||||||
log('Error: ${error.toString()}');
|
log('Error: ${error.toString()}');
|
||||||
return Future.delayed(Duration(seconds: 1), () {
|
return Future.delayed(Duration(seconds: 1), () {
|
||||||
return Center(
|
return Center(
|
||||||
|
@ -217,8 +210,15 @@ Widget liberationDynamicListView(
|
||||||
child: Text('Erro ao carregar mensagens'),
|
child: Text('Erro ao carregar mensagens'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
final mensagens = snapshot.data!.jsonBody['mensagens'];
|
||||||
|
final totalRows = snapshot.data!.jsonBody['total_rows'];
|
||||||
|
if (totalRows == 0 || mensagens == null || mensagens.isEmpty) {
|
||||||
|
return const Center(
|
||||||
|
child: Text('Nenhuma mensagem encontrada'),
|
||||||
|
);
|
||||||
|
}
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
itemCount: snapshot.data!.jsonBody['total_rows'],
|
itemCount: totalRows,
|
||||||
addAutomaticKeepAlives: false,
|
addAutomaticKeepAlives: false,
|
||||||
addRepaintBoundaries: true,
|
addRepaintBoundaries: true,
|
||||||
cacheExtent: 1000.0,
|
cacheExtent: 1000.0,
|
||||||
|
@ -234,8 +234,7 @@ Widget liberationDynamicListView(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget messageHistoryItem(
|
Widget messageHistoryItem(BuildContext context, dynamic jsonBody) {
|
||||||
BuildContext context, dynamic jsonBody) {
|
|
||||||
log(jsonBody.toString());
|
log(jsonBody.toString());
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
|
@ -249,6 +248,10 @@ Widget messageHistoryItem(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 15.0),
|
padding: const EdgeInsets.only(left: 15.0),
|
||||||
|
@ -256,49 +259,50 @@ Widget messageHistoryItem(
|
||||||
jsonBody['MSG_DATE'].toString(),
|
jsonBody['MSG_DATE'].toString(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 16,
|
fontSize: 10,
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
color: FlutterFlowTheme.of(context).customColor6,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
||||||
|
child: Text(
|
||||||
|
jsonBody['MSG_ORIGEM_DESC'].toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 12,
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
),
|
||||||
|
),
|
||||||
Icon(
|
Icon(
|
||||||
jsonBody['MSG_DESTINO_TP'] == 'T'
|
jsonBody['MSG_DESTINO_TP'] == 'T'
|
||||||
? Icons.group
|
? Icons.group
|
||||||
: Icons.person,
|
: Icons.person,
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 8),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
|
||||||
child: Text(
|
|
||||||
jsonBody['MSG_ORIGEM_DESC'].toString(),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 16,
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
),
|
),
|
||||||
overflow: TextOverflow.fade,
|
],
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 8),
|
SizedBox(height: 8),
|
||||||
Text(jsonBody['MSG_TEXTO'].toString(),),
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(
|
||||||
|
jsonBody['MSG_TEXTO'].toString(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 8),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,23 +1,20 @@
|
||||||
|
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart';
|
import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_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:share_plus/share_plus.dart';
|
||||||
|
|
||||||
class PreferencesPageModel with ChangeNotifier {
|
class PreferencesPageModel with ChangeNotifier {
|
||||||
final unfocusNode = FocusNode();
|
final unfocusNode = FocusNode();
|
||||||
|
|
||||||
|
|
||||||
Future<void> toggleFingerprint(BuildContext context) async {
|
Future<void> toggleFingerprint(BuildContext context) async {
|
||||||
|
|
||||||
// FFAppState().checkBiometrics()
|
// FFAppState().checkBiometrics()
|
||||||
// .then((value) => FFAppState().authenticateBiometric()
|
// .then((value) => FFAppState().authenticateBiometric()
|
||||||
// .then( (value) {
|
// .then( (value) {
|
||||||
|
@ -26,7 +23,7 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
// })
|
// })
|
||||||
// .whenComplete(() => notifyListeners()));
|
// .whenComplete(() => notifyListeners()));
|
||||||
|
|
||||||
if(FFAppState().fingerprint) {
|
if (FFAppState().fingerprint) {
|
||||||
FFAppState().fingerprint = false;
|
FFAppState().fingerprint = false;
|
||||||
FFAppState().deleteFingerprintPass();
|
FFAppState().deleteFingerprintPass();
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
@ -38,10 +35,8 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding:
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
MediaQuery.viewInsetsOf(context),
|
child: PassKeyTemplateWidget(
|
||||||
child:
|
|
||||||
PassKeyTemplateWidget(
|
|
||||||
toggleActionStatus: (key) async {
|
toggleActionStatus: (key) async {
|
||||||
log(key);
|
log(key);
|
||||||
FFAppState().fingerprintPass = key;
|
FFAppState().fingerprintPass = key;
|
||||||
|
@ -52,43 +47,80 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
},
|
},
|
||||||
).whenComplete(() => notifyListeners());
|
).whenComplete(() => notifyListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void enablePerson(BuildContext context) {
|
void enablePerson(BuildContext context) {
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
Share.share(
|
||||||
|
FFAppState().userDevUUID,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void toggleNotify(BuildContext context) {
|
||||||
|
FFAppState().notify = !FFAppState().notify;
|
||||||
|
PhpGroup.changeNotifica
|
||||||
|
.call(
|
||||||
|
userUUID: FFAppState().userUUID,
|
||||||
|
devUUID: FFAppState().devUUID,
|
||||||
|
cliID: FFAppState().cliUUID,
|
||||||
|
atividade: 'updVisitado',
|
||||||
|
notifica: FFAppState().notify ? 'S' : 'N',
|
||||||
|
)
|
||||||
|
.catchError((err) {
|
||||||
|
log(err.toString());
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(FFAppState().userDevUUID, style: TextStyle(color: FlutterFlowTheme.of(context).info) ),
|
content: Text(
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
FFLocalizations.of(context).getVariableText(
|
||||||
duration: const Duration(seconds: 1),
|
enText: 'Error changing notification',
|
||||||
|
ptText: 'Erro ao alterar notificação',
|
||||||
|
),
|
||||||
|
style: TextStyle(color: FlutterFlowTheme.of(context).info)),
|
||||||
|
backgroundColor: FlutterFlowTheme.of(context).error,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
behavior: SnackBarBehavior.floating,
|
behavior: SnackBarBehavior.floating,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(30),
|
borderRadius: BorderRadius.circular(30),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
|
|
||||||
void toggleNotify() {
|
|
||||||
FFAppState().notify = !FFAppState().notify;
|
|
||||||
PhpGroup.changeNotifica.call(
|
|
||||||
userUUID: FFAppState().userUUID,
|
|
||||||
devUUID: FFAppState().devUUID,
|
|
||||||
cliID: FFAppState().cliUUID,
|
|
||||||
atividade: 'updVisitado',
|
|
||||||
notifica: FFAppState().notify ? 'S' : 'N',
|
|
||||||
);
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
void localLogout(){
|
void localUnlink(BuildContext context) {
|
||||||
PhpGroup.resopndeVinculo.call(
|
PhpGroup.resopndeVinculo
|
||||||
|
.call(
|
||||||
userUUID: FFAppState().userUUID,
|
userUUID: FFAppState().userUUID,
|
||||||
devUUID: FFAppState().devUUID,
|
devUUID: FFAppState().devUUID,
|
||||||
cliID: FFAppState().cliUUID,
|
cliID: FFAppState().cliUUID,
|
||||||
tarefa: 'I',
|
tarefa: 'I',
|
||||||
|
)
|
||||||
|
.catchError((err) {
|
||||||
|
log(err.toString());
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Error unlinking device',
|
||||||
|
ptText: 'Erro ao desvincular dispositivo',
|
||||||
|
),
|
||||||
|
style: TextStyle(color: FlutterFlowTheme.of(context).info)),
|
||||||
|
backgroundColor: FlutterFlowTheme.of(context).error,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).then(
|
||||||
|
(value) {
|
||||||
|
FFAppState().deleteCliUUID();
|
||||||
|
FFAppState().deleteLocal();
|
||||||
|
FFAppState().deleteOwnerUUID();
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
@ -108,10 +140,9 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Future<void> togglePass(BuildContext context) async {
|
Future<void> togglePass(BuildContext context) async {
|
||||||
debugPrint('pass: ${FFAppState().pass}');
|
debugPrint('pass: ${FFAppState().pass}');
|
||||||
if(FFAppState().pass) {
|
if (FFAppState().pass) {
|
||||||
FFAppState().pass = false;
|
FFAppState().pass = false;
|
||||||
FFAppState().deleteAccessPass();
|
FFAppState().deleteAccessPass();
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
@ -123,15 +154,14 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding:
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
MediaQuery.viewInsetsOf(context),
|
child: PassKeyTemplateWidget(
|
||||||
child:
|
|
||||||
PassKeyTemplateWidget(
|
|
||||||
toggleActionStatus: (key) async {
|
toggleActionStatus: (key) async {
|
||||||
FFAppState().accessPass = key;
|
FFAppState().accessPass = key;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
debugPrint('key: $key');
|
debugPrint('key: $key');
|
||||||
await PhpGroup.changePass.call(
|
await PhpGroup.changePass
|
||||||
|
.call(
|
||||||
userUUID: FFAppState().userUUID,
|
userUUID: FFAppState().userUUID,
|
||||||
devUUID: FFAppState().devUUID,
|
devUUID: FFAppState().devUUID,
|
||||||
cliID: FFAppState().cliUUID,
|
cliID: FFAppState().cliUUID,
|
||||||
|
@ -142,18 +172,62 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
FFAppState().pass = true;
|
FFAppState().pass = true;
|
||||||
// var error = jsonDecode(value.jsonBody['error'].toString());
|
// var error = jsonDecode(value.jsonBody['error'].toString());
|
||||||
// log('${jsonDecode(value.jsonBody['error'].toString())}');
|
// log('${jsonDecode(value.jsonBody['error'].toString())}');
|
||||||
if(jsonDecode(value.jsonBody['error'].toString()) == false) {
|
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
||||||
FFAppState().pass = true;
|
FFAppState().pass = true;
|
||||||
} else {
|
} else {
|
||||||
FFAppState().pass = false;
|
FFAppState().pass = false;
|
||||||
}
|
}
|
||||||
})
|
}).onError((error, StackTrace) {
|
||||||
.onError((error, StackTrace) {
|
|
||||||
FFAppState().pass = false;
|
FFAppState().pass = false;
|
||||||
log(error.toString());
|
log(error.toString());
|
||||||
log(StackTrace.toString());
|
log(StackTrace.toString());
|
||||||
})
|
}).whenComplete(() => notifyListeners());
|
||||||
.whenComplete(() => notifyListeners());
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> togglePanic(BuildContext context) async {
|
||||||
|
if (FFAppState().panic) {
|
||||||
|
FFAppState().panic = false;
|
||||||
|
FFAppState().deletePanicPass();
|
||||||
|
notifyListeners();
|
||||||
|
} else {
|
||||||
|
await showModalBottomSheet(
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
useSafeArea: true,
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return Padding(
|
||||||
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
|
child: PassKeyTemplateWidget(
|
||||||
|
toggleActionStatus: (key) async {
|
||||||
|
FFAppState().panicPass = key;
|
||||||
|
notifyListeners();
|
||||||
|
await PhpGroup.changePass
|
||||||
|
.call(
|
||||||
|
userUUID: FFAppState().userUUID,
|
||||||
|
devUUID: FFAppState().devUUID,
|
||||||
|
cliID: FFAppState().cliUUID,
|
||||||
|
atividade: 'updVisitado',
|
||||||
|
newSenha: FFAppState().panicPass,
|
||||||
|
)
|
||||||
|
.then((value) {
|
||||||
|
FFAppState().panic = true;
|
||||||
|
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
||||||
|
FFAppState().panic = true;
|
||||||
|
} else {
|
||||||
|
FFAppState().panic = false;
|
||||||
|
}
|
||||||
|
}).onError((e, s) {
|
||||||
|
FFAppState().panic = false;
|
||||||
|
log(e.toString());
|
||||||
|
log(s.toString());
|
||||||
|
}).whenComplete(() => notifyListeners());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -9,7 +9,6 @@ import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart';
|
import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
|
||||||
class PreferencesPageWidget extends StatelessWidget {
|
class PreferencesPageWidget extends StatelessWidget {
|
||||||
const PreferencesPageWidget({super.key});
|
const PreferencesPageWidget({super.key});
|
||||||
|
|
||||||
|
@ -74,7 +73,7 @@ class PreferencesPageWidget extends StatelessWidget {
|
||||||
// childAspectRatio: 1.0,
|
// childAspectRatio: 1.0,
|
||||||
// mainAxisExtent: 100.0,
|
// mainAxisExtent: 100.0,
|
||||||
// ),
|
// ),
|
||||||
itemCount: 6, // Assuming 4 items for simplicity
|
itemCount: 7, // Assuming 4 items for simplicity
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
@ -90,19 +89,22 @@ class PreferencesPageWidget extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildIconButton(BuildContext context, int index, PreferencesPageModel model) {
|
Widget _buildIconButton(
|
||||||
|
BuildContext context, int index, PreferencesPageModel model) {
|
||||||
IconData icon;
|
IconData icon;
|
||||||
Function() onPressed =() => {};
|
Function() onPressed = () => {};
|
||||||
bool isEnabled;
|
bool isEnabled;
|
||||||
String content;
|
String content;
|
||||||
|
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
icon = Icons.fingerprint;
|
icon = Icons.fingerprint;
|
||||||
onPressed = () => model.toggleFingerprint(context); // Disable if fingerprint is false
|
onPressed = () =>
|
||||||
|
model.toggleFingerprint(context); // Disable if fingerprint is false
|
||||||
isEnabled = FFAppState().fingerprint;
|
isEnabled = FFAppState().fingerprint;
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Ative a autenticação por impressão digital para login seguro.',
|
ptText:
|
||||||
|
'Ative a autenticação por impressão digital para login seguro.',
|
||||||
enText: 'Enable fingerprint authentication for secure login.',
|
enText: 'Enable fingerprint authentication for secure login.',
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
@ -111,13 +113,13 @@ class PreferencesPageWidget extends StatelessWidget {
|
||||||
onPressed = () => model.enablePerson(context);
|
onPressed = () => model.enablePerson(context);
|
||||||
isEnabled = FFAppState().person;
|
isEnabled = FFAppState().person;
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Exibir código de identificação remota',
|
ptText: 'Compartilhe o código de identificação remota',
|
||||||
enText: 'Display remote identification code',
|
enText: 'Share the remote identification code',
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
icon = Icons.notifications;
|
icon = Icons.notifications;
|
||||||
onPressed = model.toggleNotify;
|
onPressed = () => model.toggleNotify(context);
|
||||||
isEnabled = FFAppState().notify;
|
isEnabled = FFAppState().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',
|
||||||
|
@ -125,7 +127,7 @@ class PreferencesPageWidget extends StatelessWidget {
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
icon = Icons.lock_clock_sharp;
|
icon = Icons.lock;
|
||||||
// onLongPress = model.togglePass(context, model);
|
// onLongPress = model.togglePass(context, model);
|
||||||
isEnabled = FFAppState().pass;
|
isEnabled = FFAppState().pass;
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -134,20 +136,30 @@ class PreferencesPageWidget extends StatelessWidget {
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
icon = Icons.landscape;
|
icon = Icons.lock_clock_sharp;
|
||||||
onPressed = model.localLogout;
|
// onLongPress = model.togglePass(context, model);
|
||||||
isEnabled = false;
|
isEnabled = FFAppState().panic;
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Ative para se desvincular do local selecionado',
|
ptText: 'Ative para inserir uma credencial de pânico para o QRCode',
|
||||||
enText: 'Enable to unlink from the selected location',
|
enText: 'Enable to enter an panic credential for the QRCode',
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
|
icon = Icons.landscape;
|
||||||
|
onPressed = () => model.localUnlink(context);
|
||||||
|
isEnabled = true;
|
||||||
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Desative para se desvincular do local selecionado',
|
||||||
|
enText: 'Enable to unlink from the selected location',
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
icon = Icons.delete;
|
icon = Icons.delete;
|
||||||
onPressed = () => model.deleteAccount(context);
|
onPressed = () => model.deleteAccount(context);
|
||||||
isEnabled = false;
|
isEnabled = true;
|
||||||
content = FFLocalizations.of(context).getVariableText(
|
content = FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Delete sua conta e todos os dados associados permanentemente.',
|
ptText:
|
||||||
|
'Delete sua conta e todos os dados associados permanentemente.',
|
||||||
enText: 'Delete your account and all associated data permanently.',
|
enText: 'Delete your account and all associated data permanently.',
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
@ -155,17 +167,32 @@ class PreferencesPageWidget extends StatelessWidget {
|
||||||
throw Exception('Invalid index: $index');
|
throw Exception('Invalid index: $index');
|
||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
return SizedBox(
|
||||||
height: 100,
|
height: 100,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: index != 3 ? onPressed : () {model.togglePass(context);},
|
onTap: () {
|
||||||
|
switch (index) {
|
||||||
|
case 3:
|
||||||
|
model.togglePass(context);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
model.togglePanic(context);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
onPressed();
|
||||||
|
}
|
||||||
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
CircleAvatar(
|
CircleAvatar(
|
||||||
backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate,
|
backgroundColor: isEnabled
|
||||||
|
? FlutterFlowTheme.of(context).primary
|
||||||
|
: FlutterFlowTheme.of(context).alternate,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
icon,
|
icon,
|
||||||
color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary,
|
color: isEnabled
|
||||||
|
? FlutterFlowTheme.of(context).primaryBackground
|
||||||
|
: FlutterFlowTheme.of(context).primary,
|
||||||
// icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0),
|
// icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0),
|
||||||
// onPressed: index != 3 ? onPressed : () {model.togglePass(context);},
|
// onPressed: index != 3 ? onPressed : () {model.togglePass(context);},
|
||||||
// borderRadius: 20.0,
|
// borderRadius: 20.0,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import '/flutter_flow/form_field_controller.dart';
|
import '/flutter_flow/form_field_controller.dart';
|
||||||
|
@ -8,51 +10,12 @@ class RegisterVisitorPageModel
|
||||||
extends FlutterFlowModel<RegisterVisitorPageWidget> {
|
extends FlutterFlowModel<RegisterVisitorPageWidget> {
|
||||||
/// State fields for stateful widgets in this page.
|
/// State fields for stateful widgets in this page.
|
||||||
|
|
||||||
final unfocusNode = FocusNode();
|
late RegisiterVistorTemplateComponentModel
|
||||||
bool isDataUploading = false;
|
regisiterVistorTemplateComponentModel;
|
||||||
FFUploadedFile uploadedLocalFile =
|
|
||||||
FFUploadedFile(bytes: Uint8List.fromList([]));
|
|
||||||
|
|
||||||
// State field(s) for TextField widget.
|
|
||||||
FocusNode? textFieldFocusNode1;
|
|
||||||
TextEditingController? textController1;
|
|
||||||
String? Function(BuildContext, String?)? textController1Validator;
|
|
||||||
// State field(s) for TextField widget.
|
|
||||||
FocusNode? textFieldFocusNode2;
|
|
||||||
TextEditingController? textController2;
|
|
||||||
String? Function(BuildContext, String?)? textController2Validator;
|
|
||||||
// State field(s) for DropDown widget.
|
|
||||||
String? dropDownValue;
|
|
||||||
FormFieldController<String>? dropDownValueController;
|
|
||||||
// State field(s) for TextField widget.
|
|
||||||
FocusNode? textFieldFocusNode3;
|
|
||||||
TextEditingController? textController3;
|
|
||||||
String? Function(BuildContext, String?)? textController3Validator;
|
|
||||||
// State field(s) for TextField widget.
|
|
||||||
FocusNode? textFieldFocusNode4;
|
|
||||||
TextEditingController? textController4;
|
|
||||||
String? Function(BuildContext, String?)? textController4Validator;
|
|
||||||
// Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget.
|
|
||||||
String? imgBase64;
|
|
||||||
// Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget.
|
|
||||||
ApiCallResponse? scheduleVisitor;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {}
|
||||||
unfocusNode.dispose();
|
|
||||||
textFieldFocusNode1?.dispose();
|
|
||||||
textController1?.dispose();
|
|
||||||
|
|
||||||
textFieldFocusNode2?.dispose();
|
|
||||||
textController2?.dispose();
|
|
||||||
|
|
||||||
textFieldFocusNode3?.dispose();
|
|
||||||
textController3?.dispose();
|
|
||||||
|
|
||||||
textFieldFocusNode4?.dispose();
|
|
||||||
textController4?.dispose();
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,17 +1,10 @@
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
|
||||||
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_drop_down.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_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 '/flutter_flow/form_field_controller.dart';
|
|
||||||
import '/flutter_flow/upload_data.dart';
|
|
||||||
import '/custom_code/actions/index.dart' as actions;
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'register_visitor_page_model.dart';
|
import 'register_visitor_page_model.dart';
|
||||||
export 'register_visitor_page_model.dart';
|
export 'register_visitor_page_model.dart';
|
||||||
|
@ -33,18 +26,6 @@ class _RegisterVisitorPageWidgetState extends State<RegisterVisitorPageWidget> {
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => RegisterVisitorPageModel());
|
_model = createModel(context, () => RegisterVisitorPageModel());
|
||||||
|
|
||||||
_model.textController1 ??= TextEditingController();
|
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
|
||||||
|
|
||||||
_model.textController2 ??= TextEditingController();
|
|
||||||
_model.textFieldFocusNode2 ??= FocusNode();
|
|
||||||
|
|
||||||
_model.textController3 ??= TextEditingController();
|
|
||||||
_model.textFieldFocusNode3 ??= FocusNode();
|
|
||||||
|
|
||||||
_model.textController4 ??= TextEditingController();
|
|
||||||
_model.textFieldFocusNode4 ??= FocusNode();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -57,14 +38,7 @@ class _RegisterVisitorPageWidgetState extends State<RegisterVisitorPageWidget> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<FFAppState>();
|
context.watch<FFAppState>();
|
||||||
|
return Scaffold(
|
||||||
return GestureDetector(
|
|
||||||
onTap: () => _model.unfocusNode.canRequestFocus
|
|
||||||
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
|
||||||
: FocusScope.of(context).unfocus(),
|
|
||||||
child: Scaffold(
|
|
||||||
key: scaffoldKey,
|
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
|
@ -99,795 +73,11 @@ class _RegisterVisitorPageWidgetState extends State<RegisterVisitorPageWidget> {
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
elevation: 0.0,
|
elevation: 0.0,
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: const SafeArea(
|
||||||
top: true,
|
top: true,
|
||||||
child: Align(
|
child: RegisiterVistorTemplateComponentWidget(
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
source: 'RegisterVisitorPage',
|
||||||
child: Container(
|
)),
|
||||||
width: double.infinity,
|
|
||||||
height: double.infinity,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(0.0),
|
|
||||||
bottomRight: Radius.circular(0.0),
|
|
||||||
topLeft: Radius.circular(25.0),
|
|
||||||
topRight: Radius.circular(25.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Builder(
|
|
||||||
builder: (context) {
|
|
||||||
if ((_model.uploadedLocalFile.bytes?.isNotEmpty ??
|
|
||||||
false)) {
|
|
||||||
return InkWell(
|
|
||||||
splashColor: Colors.transparent,
|
|
||||||
focusColor: Colors.transparent,
|
|
||||||
hoverColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
onTap: () async {
|
|
||||||
setState(() {
|
|
||||||
_model.isDataUploading = false;
|
|
||||||
_model.uploadedLocalFile = FFUploadedFile(
|
|
||||||
bytes: Uint8List.fromList([]));
|
|
||||||
});
|
|
||||||
},
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
child: Image.memory(
|
|
||||||
_model.uploadedLocalFile.bytes ??
|
|
||||||
Uint8List.fromList([]),
|
|
||||||
width: 300.0,
|
|
||||||
height: 200.0,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return Stack(
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.01, 0.0),
|
|
||||||
child: FFButtonWidget(
|
|
||||||
onPressed: () async {
|
|
||||||
final selectedMedia =
|
|
||||||
await selectMediaWithSourceBottomSheet(
|
|
||||||
context: context,
|
|
||||||
maxWidth: 300.00,
|
|
||||||
maxHeight: 300.00,
|
|
||||||
imageQuality: 0,
|
|
||||||
allowPhoto: true,
|
|
||||||
includeDimensions: true,
|
|
||||||
);
|
|
||||||
if (selectedMedia != null &&
|
|
||||||
selectedMedia.every((m) =>
|
|
||||||
validateFileFormat(
|
|
||||||
m.storagePath, context))) {
|
|
||||||
setState(
|
|
||||||
() => _model.isDataUploading = true);
|
|
||||||
var selectedUploadedFiles =
|
|
||||||
<FFUploadedFile>[];
|
|
||||||
|
|
||||||
try {
|
|
||||||
showUploadMessage(
|
|
||||||
context,
|
|
||||||
'Uploading file...',
|
|
||||||
showLoading: true,
|
|
||||||
);
|
|
||||||
selectedUploadedFiles = selectedMedia
|
|
||||||
.map((m) => FFUploadedFile(
|
|
||||||
name: m.storagePath
|
|
||||||
.split('/')
|
|
||||||
.last,
|
|
||||||
bytes: m.bytes,
|
|
||||||
height: m.dimensions?.height,
|
|
||||||
width: m.dimensions?.width,
|
|
||||||
blurHash: m.blurHash,
|
|
||||||
))
|
|
||||||
.toList();
|
|
||||||
} finally {
|
|
||||||
ScaffoldMessenger.of(context)
|
|
||||||
.hideCurrentSnackBar();
|
|
||||||
_model.isDataUploading = false;
|
|
||||||
}
|
|
||||||
if (selectedUploadedFiles.length ==
|
|
||||||
selectedMedia.length) {
|
|
||||||
setState(() {
|
|
||||||
_model.uploadedLocalFile =
|
|
||||||
selectedUploadedFiles.first;
|
|
||||||
});
|
|
||||||
showUploadMessage(context, 'Success!');
|
|
||||||
} else {
|
|
||||||
setState(() {});
|
|
||||||
showUploadMessage(
|
|
||||||
context, 'Failed to upload data');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
text: '',
|
|
||||||
icon: Icon(
|
|
||||||
Icons.photo_camera,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
size: 30.0,
|
|
||||||
),
|
|
||||||
options: FFButtonOptions(
|
|
||||||
width: 300.0,
|
|
||||||
height: 80.0,
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 0.0),
|
|
||||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
14.0, 0.0, 0.0, 20.0),
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
|
||||||
textStyle: FlutterFlowTheme.of(context)
|
|
||||||
.titleSmall
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.titleSmallFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
fontSize: 16.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.titleSmallFamily),
|
|
||||||
),
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context).accent1,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 50.0, 0.0, 0.0),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'p4ftwxcy' /* Clique para adicionar a foto p... */,
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
20.0, 30.0, 0.0, 15.0),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'zazj5d8b' /* Preencha o formulário com os d... */,
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.start,
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _model.textController1,
|
|
||||||
focusNode: _model.textFieldFocusNode1,
|
|
||||||
autofocus: false,
|
|
||||||
textInputAction: TextInputAction.next,
|
|
||||||
obscureText: false,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
isDense: true,
|
|
||||||
labelText: FFLocalizations.of(context).getText(
|
|
||||||
'v7g73yik' /* Nome */,
|
|
||||||
),
|
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).customColor6,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
suffixIcon: Icon(
|
|
||||||
Icons.person,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
maxLines: null,
|
|
||||||
keyboardType: TextInputType.name,
|
|
||||||
validator: _model.textController1Validator
|
|
||||||
.asValidator(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _model.textController2,
|
|
||||||
focusNode: _model.textFieldFocusNode2,
|
|
||||||
autofocus: false,
|
|
||||||
textCapitalization: TextCapitalization.none,
|
|
||||||
textInputAction: TextInputAction.next,
|
|
||||||
obscureText: false,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
isDense: true,
|
|
||||||
labelText: FFLocalizations.of(context).getText(
|
|
||||||
'rl8tvwnr' /* Documento */,
|
|
||||||
),
|
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).customColor6,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
suffixIcon: Icon(
|
|
||||||
Icons.document_scanner,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
validator: _model.textController2Validator
|
|
||||||
.asValidator(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
|
||||||
child: Container(
|
|
||||||
width: MediaQuery.sizeOf(context).width * 0.95,
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 7.0),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'yp23q90m' /* Selecione o tipo: */,
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 5.0),
|
|
||||||
child: FlutterFlowDropDown<String>(
|
|
||||||
controller: _model.dropDownValueController ??=
|
|
||||||
FormFieldController<String>(null),
|
|
||||||
options: [
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'n8vddmcq' /* Visitante */,
|
|
||||||
),
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'9luaa09e' /* Prestador de Serviço */,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
onChanged: (val) =>
|
|
||||||
setState(() => _model.dropDownValue = val),
|
|
||||||
width: 200.0,
|
|
||||||
height: 44.0,
|
|
||||||
textStyle: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
hintText: FFLocalizations.of(context).getText(
|
|
||||||
'pmezihb4' /* Selecione... */,
|
|
||||||
),
|
|
||||||
icon: Icon(
|
|
||||||
Icons.keyboard_arrow_down_rounded,
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context).primaryText,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
elevation: 2.0,
|
|
||||||
borderColor:
|
|
||||||
FlutterFlowTheme.of(context).customColor6,
|
|
||||||
borderWidth: 0.5,
|
|
||||||
borderRadius: 8.0,
|
|
||||||
margin: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
16.0, 0.0, 16.0, 0.0),
|
|
||||||
hidesUnderline: true,
|
|
||||||
isOverButton: true,
|
|
||||||
isSearchable: false,
|
|
||||||
isMultiSelect: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
.divide(const SizedBox(width: 19.0))
|
|
||||||
.addToStart(const SizedBox(width: 30.0)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(-1.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
20.0, 0.0, 0.0, 15.0),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'bqpucwh0' /* Contatos */,
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.start,
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _model.textController3,
|
|
||||||
focusNode: _model.textFieldFocusNode3,
|
|
||||||
autofocus: false,
|
|
||||||
textInputAction: TextInputAction.next,
|
|
||||||
obscureText: false,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
isDense: true,
|
|
||||||
labelText: FFLocalizations.of(context).getText(
|
|
||||||
'h84ls2r6' /* Telefone */,
|
|
||||||
),
|
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).customColor6,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
suffixIcon: Icon(
|
|
||||||
Icons.phone,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
validator: _model.textController3Validator
|
|
||||||
.asValidator(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _model.textController4,
|
|
||||||
focusNode: _model.textFieldFocusNode4,
|
|
||||||
autofocus: false,
|
|
||||||
textInputAction: TextInputAction.done,
|
|
||||||
obscureText: false,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
isDense: true,
|
|
||||||
labelText: FFLocalizations.of(context).getText(
|
|
||||||
'fqp7qmka' /* Email */,
|
|
||||||
),
|
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.labelMediumFamily),
|
|
||||||
),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).customColor6,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
),
|
|
||||||
suffixIcon: Icon(
|
|
||||||
Icons.email,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
keyboardType: TextInputType.emailAddress,
|
|
||||||
validator: _model.textController4Validator
|
|
||||||
.asValidator(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
|
||||||
child: FFButtonWidget(
|
|
||||||
onPressed: () async {
|
|
||||||
if (((_model.uploadedLocalFile.bytes
|
|
||||||
?.isNotEmpty ??
|
|
||||||
false)) &&
|
|
||||||
(_model.textController1.text != '') &&
|
|
||||||
(_model.dropDownValue != null &&
|
|
||||||
_model.dropDownValue != '') &&
|
|
||||||
(_model.textController2.text != '')) {
|
|
||||||
_model.imgBase64 =
|
|
||||||
await actions.convertImageFileToBase64(
|
|
||||||
_model.uploadedLocalFile,
|
|
||||||
);
|
|
||||||
_model.scheduleVisitor =
|
|
||||||
await PhpGroup.postScheduleVisitorCall.call(
|
|
||||||
devUUID: FFAppState().devUUID,
|
|
||||||
userUUID: FFAppState().userUUID,
|
|
||||||
cliID: FFAppState().cliUUID,
|
|
||||||
atividade: 'putVisitante',
|
|
||||||
documento: '7654553234232342',
|
|
||||||
nome: 'Test',
|
|
||||||
tipo: 'V',
|
|
||||||
foto: 'base64;jpeg,klajsalkjslkajslkajl',
|
|
||||||
);
|
|
||||||
|
|
||||||
if (PhpGroup.postScheduleVisitorCall.error(
|
|
||||||
(_model.scheduleVisitor?.jsonBody ?? ''),
|
|
||||||
) ==
|
|
||||||
false) {
|
|
||||||
setState(() {
|
|
||||||
_model.textController1?.clear();
|
|
||||||
_model.textController2?.clear();
|
|
||||||
_model.textController3?.clear();
|
|
||||||
_model.textController4?.clear();
|
|
||||||
});
|
|
||||||
setState(() {
|
|
||||||
_model.dropDownValueController?.reset();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
await showModalBottomSheet(
|
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
enableDrag: false,
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () => _model
|
|
||||||
.unfocusNode.canRequestFocus
|
|
||||||
? FocusScope.of(context)
|
|
||||||
.requestFocus(_model.unfocusNode)
|
|
||||||
: FocusScope.of(context).unfocus(),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
MediaQuery.viewInsetsOf(context),
|
|
||||||
child: ThrowExceptionWidget(
|
|
||||||
msg:
|
|
||||||
'\\devUUID=${FFAppState().devUUID}\\userUUID=${FFAppState().userUUID}\\cliID=${FFAppState().cliUUID}\\Documento=${_model.textController2.text}\\Nome=${_model.textController1.text}\\dropdown${_model.dropDownValue}\\${PhpGroup.postScheduleVisitorCall.errorMsg(
|
|
||||||
(_model.scheduleVisitor?.jsonBody ??
|
|
||||||
''),
|
|
||||||
)}',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
).then((value) => safeSetState(() {}));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
await showModalBottomSheet(
|
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
enableDrag: false,
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () => _model
|
|
||||||
.unfocusNode.canRequestFocus
|
|
||||||
? FocusScope.of(context)
|
|
||||||
.requestFocus(_model.unfocusNode)
|
|
||||||
: FocusScope.of(context).unfocus(),
|
|
||||||
child: Padding(
|
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
|
||||||
child: ThrowExceptionWidget(
|
|
||||||
msg:
|
|
||||||
'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento estão foram preenchidos corretamente.- devUUID=${FFAppState().devUUID}- userUUID=${FFAppState().userUUID}- cliID=${FFAppState().cliUUID}- Documento=${_model.textController2.text}- Nome=${_model.textController1.text}- Tipo=${_model.dropDownValue}',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
).then((value) => safeSetState(() {}));
|
|
||||||
}
|
|
||||||
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
text: FFLocalizations.of(context).getText(
|
|
||||||
'okbw0aiu' /* Cadastrar */,
|
|
||||||
),
|
|
||||||
options: FFButtonOptions(
|
|
||||||
width: 250.0,
|
|
||||||
height: 36.0,
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
80.0, 0.0, 80.0, 0.0),
|
|
||||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 0.0),
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
textStyle: FlutterFlowTheme.of(context)
|
|
||||||
.titleSmall
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.titleSmallFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).info,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(FlutterFlowTheme.of(context)
|
|
||||||
.titleSmallFamily),
|
|
||||||
),
|
|
||||||
borderSide: const BorderSide(
|
|
||||||
color: Colors.transparent,
|
|
||||||
width: 30.0,
|
|
||||||
),
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(15.0),
|
|
||||||
bottomRight: Radius.circular(15.0),
|
|
||||||
topLeft: Radius.circular(15.0),
|
|
||||||
topRight: Radius.circular(15.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
.divide(const SizedBox(height: 10.0))
|
|
||||||
.addToStart(const SizedBox(height: 30.0)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,12 +1,14 @@
|
||||||
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/flutter_flow/form_field_controller.dart';
|
import 'package:hub/flutter_flow/form_field_controller.dart';
|
||||||
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'package:hub/flutter_flow/request_manager.dart';
|
import 'package:hub/flutter_flow/request_manager.dart';
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart';
|
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
class ScheduleCompleteVisitPageModel
|
class ScheduleCompleteVisitPageModel
|
||||||
extends FlutterFlowModel<ScheduleCompleteVisitPageWidget> {
|
extends FlutterFlowModel<ScheduleCompleteVisitPageWidget> {
|
||||||
|
@ -38,6 +40,18 @@ class ScheduleCompleteVisitPageModel
|
||||||
visitorJsonList[index] = updateFn(visitorJsonList[index]);
|
visitorJsonList[index] = updateFn(visitorJsonList[index]);
|
||||||
|
|
||||||
String visitorStrList = '0';
|
String visitorStrList = '0';
|
||||||
|
bool? dropDownValidator1;
|
||||||
|
bool? dropDownValidator2;
|
||||||
|
|
||||||
|
bool isValid() {
|
||||||
|
if ((textController1!.text != '') &&
|
||||||
|
(textController2!.text != '') &&
|
||||||
|
(dropDownValue1 != null && dropDownValue1 != '') &&
|
||||||
|
(dropDownValue2 != null && dropDownValue2 != '')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// State fields for stateful widgets in this page.
|
/// State fields for stateful widgets in this page.
|
||||||
|
|
||||||
|
@ -51,15 +65,78 @@ class ScheduleCompleteVisitPageModel
|
||||||
FocusNode? textFieldFocusNode1;
|
FocusNode? textFieldFocusNode1;
|
||||||
TextEditingController? textController1;
|
TextEditingController? textController1;
|
||||||
String? Function(BuildContext, String?)? textController1Validator;
|
String? Function(BuildContext, String?)? textController1Validator;
|
||||||
|
String? _textController1Validator(BuildContext context, String? val) {
|
||||||
|
if (val == null || val.isEmpty) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'This field is required.',
|
||||||
|
ptText: 'Este campo é obrigatório.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (val != null) {
|
||||||
|
try {
|
||||||
|
DateTime startDate = DateFormat('d/M/y H:mm:ss').parse(val);
|
||||||
|
DateTime endDate =
|
||||||
|
DateFormat('d/M/y H:mm:ss').parse(textController2!.text);
|
||||||
|
if (startDate.isAfter(endDate)) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'A data de início deve ser anterior à data de término.',
|
||||||
|
enText: 'Start date must be before end date.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (startDate.isBefore(DateTime.now())) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Start date must be after current date.',
|
||||||
|
ptText: 'A data de início deve ser posterior à data atual.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return '$e';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
DateTime? datePicked1;
|
DateTime? datePicked1;
|
||||||
// State field(s) for TextField widget.
|
// State field(s) for TextField widget.
|
||||||
FocusNode? textFieldFocusNode2;
|
FocusNode? textFieldFocusNode2;
|
||||||
TextEditingController? textController2;
|
TextEditingController? textController2;
|
||||||
String? Function(BuildContext, String?)? textController2Validator;
|
String? Function(BuildContext, String?)? textController2Validator;
|
||||||
|
String? _textController2Validator(BuildContext context, String? val) {
|
||||||
|
if (val == null || val.isEmpty) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'This field is required.',
|
||||||
|
ptText: 'Este campo é obrigatório.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (val != null) {
|
||||||
|
try {
|
||||||
|
DateTime endDate = DateFormat('d/M/y H:mm:ss').parse(val);
|
||||||
|
DateTime startDate =
|
||||||
|
DateFormat('d/M/y H:mm:ss').parse(textController1!.text);
|
||||||
|
if (endDate.isBefore(startDate)) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'End date must be after start date.',
|
||||||
|
ptText: 'A data de término deve ser posterior à data de início.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (endDate.isBefore(DateTime.now())) {
|
||||||
|
return FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'End date must be after current date.',
|
||||||
|
ptText: 'A data de término deve ser posterior à data atual.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return '$e';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
DateTime? datePicked2;
|
DateTime? datePicked2;
|
||||||
// State field(s) for DropDown widget.
|
// State field(s) for DropDown widget.
|
||||||
String? dropDownValue1;
|
String? dropDownValue1;
|
||||||
FormFieldController<String>? dropDownValueController1;
|
FormFieldController<String>? dropDownValueController1;
|
||||||
|
|
||||||
// State field(s) for DropDown widget.
|
// State field(s) for DropDown widget.
|
||||||
String? dropDownValue2;
|
String? dropDownValue2;
|
||||||
FormFieldController<String>? dropDownValueController2;
|
FormFieldController<String>? dropDownValueController2;
|
||||||
|
@ -69,9 +146,35 @@ class ScheduleCompleteVisitPageModel
|
||||||
FocusNode? textFieldFocusNode3;
|
FocusNode? textFieldFocusNode3;
|
||||||
TextEditingController? textController3;
|
TextEditingController? textController3;
|
||||||
String? Function(BuildContext, String?)? textController3Validator;
|
String? Function(BuildContext, String?)? textController3Validator;
|
||||||
|
String? _textController3Validator(BuildContext context, String? val) {
|
||||||
|
// if (val == null || val.isEmpty) {
|
||||||
|
// return FFLocalizations.of(context).getVariableText(
|
||||||
|
// enText: 'This field is required.',
|
||||||
|
// ptText: 'Este campo é obrigatório.',
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {
|
||||||
|
tabBarController = TabController(
|
||||||
|
vsync: Navigator.of(context),
|
||||||
|
length: 2,
|
||||||
|
);
|
||||||
|
|
||||||
|
textFieldFocusNode1 = FocusNode();
|
||||||
|
textController1 = TextEditingController();
|
||||||
|
textController1Validator = _textController1Validator;
|
||||||
|
|
||||||
|
textFieldFocusNode2 = FocusNode();
|
||||||
|
textController2 = TextEditingController();
|
||||||
|
textController2Validator = _textController2Validator;
|
||||||
|
|
||||||
|
textFieldFocusNode3 = FocusNode();
|
||||||
|
textController3 = TextEditingController();
|
||||||
|
textController3Validator = _textController3Validator;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,40 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
|
import '../../../flutter_flow/flutter_flow_theme.dart';
|
||||||
|
import '../../../flutter_flow/flutter_flow_util.dart';
|
||||||
|
|
||||||
|
class AtomTermsOfUse extends StatelessWidget {
|
||||||
|
|
||||||
|
const AtomTermsOfUse({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return InkWell(
|
||||||
|
child: Text(
|
||||||
|
FFLocalizations.of(context).getText(
|
||||||
|
'olf967cj' /* Termo de Uso */,
|
||||||
|
),
|
||||||
|
style: FlutterFlowTheme.of(context)
|
||||||
|
.bodyMedium
|
||||||
|
.override(
|
||||||
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMediumFamily,
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.primaryText,
|
||||||
|
fontSize: 14.0,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts
|
||||||
|
.asMap()
|
||||||
|
.containsKey(
|
||||||
|
FlutterFlowTheme.of(
|
||||||
|
context)
|
||||||
|
.bodyMediumFamily),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () => launchURL('https://freaccess.com.br/pp'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
enum EnumThrowException {
|
||||||
|
success,
|
||||||
|
error,
|
||||||
|
warning
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
import 'package:hub/shared/enums/enum_throw_exception.dart';
|
||||||
|
|
||||||
|
class DialogUtil {
|
||||||
|
static const double _height = 350;
|
||||||
|
|
||||||
|
static Future<dynamic> errorDefault(BuildContext context) {
|
||||||
|
return error(context, FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.",
|
||||||
|
enText: "Failed to perform operation, please try again later."
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<dynamic> error(BuildContext context, String message) async {
|
||||||
|
return await showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return Dialog(
|
||||||
|
child: SizedBox(
|
||||||
|
height: _height,
|
||||||
|
child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.error))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<dynamic> warning(BuildContext context, String message) async {
|
||||||
|
return await showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return Dialog(
|
||||||
|
child: SizedBox(
|
||||||
|
height: _height,
|
||||||
|
child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.warning))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<dynamic> success(BuildContext context, String message) async {
|
||||||
|
return await showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return Dialog(
|
||||||
|
child: SizedBox(
|
||||||
|
height: _height,
|
||||||
|
child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.success))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
||||||
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
|
|
||||||
|
class LogUtil {
|
||||||
|
|
||||||
|
static void requestAPIFailed(String url, String body, String reason, dynamic error, StackTrace stack) async {
|
||||||
|
FirebaseCrashlytics.instance.setCustomKey('URL', "${PhpGroup.getBaseUrl()}/$url");
|
||||||
|
FirebaseCrashlytics.instance.setCustomKey('Body', body);
|
||||||
|
|
||||||
|
await FirebaseCrashlytics.instance.recordError(error, stack, reason: reason);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
class ValidatorUtil {
|
||||||
|
|
||||||
|
static bool isValidEmail(String email) {
|
||||||
|
if (RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$').hasMatch(email)) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
16
pubspec.lock
16
pubspec.lock
|
@ -345,6 +345,22 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.17.2"
|
version: "2.17.2"
|
||||||
|
firebase_crashlytics:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: firebase_crashlytics
|
||||||
|
sha256: ad7510d9bcf1f40fc895944942f553a4c5603acb4715c0d6386dd587f82f6ae5
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.1"
|
||||||
|
firebase_crashlytics_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: firebase_crashlytics_platform_interface
|
||||||
|
sha256: "318589f1da3bb858872002fa20170234566f0fb080669a8256c85a81513a802a"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.6.37"
|
||||||
firebase_messaging:
|
firebase_messaging:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -107,6 +107,7 @@ dependencies:
|
||||||
flutter_riverpod: ^2.5.1
|
flutter_riverpod: ^2.5.1
|
||||||
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
|
||||||
|
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
http: 1.2.1
|
http: 1.2.1
|
||||||
|
|
Loading…
Reference in New Issue