Merge pull request #9 from FRE-Informatica/fix/login

FIX: Tela de Login & Modal de Esqueci Minha Senha
This commit is contained in:
Jônatas Antunes Messias 2024-07-30 11:03:43 -03:00 committed by GitHub
commit 1ee6c90520
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 624 additions and 421 deletions

View File

@ -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

View File

@ -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>";

View File

@ -14,6 +14,7 @@ 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';
@ -21,6 +22,8 @@ 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,92 +111,89 @@ Future singInLoginAction(
String? emailAdress, String? emailAdress,
String? password, String? password,
}) async { }) async {
String? devUUID;
ApiCallResponse? loginCall;
await Future.wait([ try {
Future(() async { String? devUUID;
FFAppState().email = emailAdress!; ApiCallResponse? loginCall;
}),
Future(() async {
FFAppState().passwd = password!;
}),
]);
if ((FFAppState().email != '') && (FFAppState().passwd != '')) {
devUUID = await getDevUUID();
FFAppState().devUUID = devUUID!;
loginCall = await PhpGroup.loginCall.call(
email: FFAppState().email,
password: FFAppState().passwd,
uuid: FFAppState().devUUID,
type: FFAppState().device,
description: randomString(
10,
10,
true,
false,
false,
),
);
if (PhpGroup.loginCall.error( await Future.wait([
Future(() async {
FFAppState().email = emailAdress!;
}),
Future(() async {
FFAppState().passwd = password!;
}),
]);
if ((FFAppState().email != '') && (FFAppState().passwd != '')) {
devUUID = await getDevUUID();
FFAppState().devUUID = devUUID!;
loginCall = await PhpGroup.loginCall.call(
email: FFAppState().email,
password: FFAppState().passwd,
uuid: FFAppState().devUUID,
type: FFAppState().device,
description: randomString(
10,
10,
true,
false,
false,
),
);
if (PhpGroup.loginCall.error((loginCall.jsonBody ?? '')) == false) {
FFAppState().userUUID = PhpGroup.loginCall.userUUID(
(loginCall.jsonBody ?? ''), (loginCall.jsonBody ?? ''),
) == )!;
false) {
FFAppState().userUUID = PhpGroup.loginCall.userUUID(
(loginCall.jsonBody ?? ''),
)!;
// FFAppState().token = await FirebaseMessaging.instance.getToken();
FFAppState().createdAt = dateTimeFormat(
'd/M/y H:mm:ss',
getCurrentTimestamp,
locale: FFLocalizations.of(context).languageCode,
);
FFAppState().updatedAt = '00/00/0000 00:00:00';
FFAppState().status = PhpGroup.loginCall.userStatus(
(loginCall.jsonBody ?? ''),
)!;
FFAppState().userDevUUID = PhpGroup.loginCall.userDeviceId(
(loginCall.jsonBody ?? ''),
)!;
FFAppState().name = PhpGroup.loginCall.userName(
(loginCall.jsonBody ?? ''),
)!;
FFAppState().serialNumber = await getSerialNumber() ?? '';
FFAppState().isLogged = true;
await toggleHomePage(context);
return;
} else {
await showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
useSafeArea: true,
context: context,
builder: (context) {
return Padding(
padding: MediaQuery.viewInsetsOf(context),
child: ThrowExceptionWidget(
msg: PhpGroup.loginCall.msg(
(loginCall?.jsonBody ?? ''),
)!,
),
);
},
);
FFAppState().deleteEmail(); FFAppState().createdAt = dateTimeFormat(
FFAppState().email = ''; 'd/M/y H:mm:ss',
getCurrentTimestamp,
locale: FFLocalizations.of(context).languageCode,
);
FFAppState().deletePasswd(); FFAppState().updatedAt = '00/00/0000 00:00:00';
FFAppState().passwd = '';
FFAppState().update(() {}); FFAppState().status = PhpGroup.loginCall.userStatus((loginCall.jsonBody ?? ''))!;
FFAppState().userDevUUID = PhpGroup.loginCall.userDeviceId((loginCall.jsonBody ?? ''))!;
FFAppState().name = PhpGroup.loginCall.userName((loginCall.jsonBody ?? ''))!;
FFAppState().serialNumber = await getSerialNumber() ?? '';
FFAppState().isLogged = true;
await toggleHomePage(context);
} else {
if (PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')) == null) {
DialogUtil.errorDefault(context);
} else {
DialogUtil.error(context, PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')).toString());
}
FFAppState().deleteEmail();
FFAppState().email = '';
FFAppState().deletePasswd();
FFAppState().passwd = '';
FFAppState().update(() {});
}
} }
return; return;
} else {
return; } catch (e, s) {
DialogUtil.errorDefault(context);
LogUtil.requestAPIFailed('login.php', emailAdress.toString(), "Login", e, s);
} }
} }
Future<bool> signUpRegisterAction( Future<bool> signUpRegisterAction(

View File

@ -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,16 @@ 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, required this.msg,
this.type = EnumThrowException.error
}); });
final String? msg; final String? msg;
EnumThrowException type;
@override @override
State<ThrowExceptionWidget> createState() => _ThrowExceptionWidgetState(); State<ThrowExceptionWidget> createState() => _ThrowExceptionWidgetState();
@ -61,6 +64,39 @@ 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,85 +113,62 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
onTap: () async { onTap: () async {
Navigator.pop(context); Navigator.pop(context);
}, },
child: Container( child: Column(
height: 400.0, mainAxisSize: MainAxisSize.max,
decoration: BoxDecoration( mainAxisAlignment: MainAxisAlignment.center,
color: FlutterFlowTheme.of(context).primaryBackground, children: [
borderRadius: const BorderRadius.only( Stack(
bottomLeft: Radius.circular(10.0), children: [
bottomRight: Radius.circular(10.0), Align(
topLeft: Radius.circular(10.0), alignment: const AlignmentDirectional(0.0, 0.0),
topRight: Radius.circular(10.0), child: Icon(
), _getIconByType(context),
), color: _getColorByType(context),
child: Column( size: 150.0,
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Stack(
children: [
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: Icon(
Icons.circle_outlined,
color: FlutterFlowTheme.of(context).error,
size: 200.0,
),
), ),
Align( ),
alignment: const AlignmentDirectional(0.0, 0.0), ],
child: Icon( ).animateOnPageLoad(
Icons.close_outlined, animationsMap['stackOnPageLoadAnimation']!),
color: FlutterFlowTheme.of(context).error, Column(
size: 200.0, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
_getTitleByType(context),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
fontSize: 20.0,
letterSpacing: 0.0,
fontWeight: FontWeight.bold,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context)
.bodyMediumFamily),
),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
child: Text(
valueOrDefault<String>(
widget.msg,
'Message Not Found',
), ),
), style: FlutterFlowTheme.of(context)
], .bodyMedium
).animateOnPageLoad( .override(
animationsMap['stackOnPageLoadAnimation']!), fontFamily: FlutterFlowTheme.of(context)
Column( .bodyMediumFamily,
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
FFLocalizations.of(context).getText(
'e58xxxiq' /* ERRO */,
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
fontSize: 20.0,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.bold,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.bodyMediumFamily), .bodyMediumFamily),
), ),
), ),
Padding( ),
padding: ].addToStart(const SizedBox(height: 20.0)),
const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), ),
child: Text( ],
valueOrDefault<String>(
widget.msg,
'Message Not Found',
),
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: FlutterFlowTheme.of(context)
.bodyMediumFamily,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context)
.bodyMediumFamily),
),
),
),
].addToStart(const SizedBox(height: 50.0)),
),
],
),
), ),
), ),
), ),

View File

@ -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() {

View File

@ -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});
@ -101,19 +104,19 @@ class _ForgotPasswordTemplateComponentWidgetState
), ),
Padding( Padding(
padding: padding:
const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0),
child: Text( child: Text(
'', '',
style: style:
FlutterFlowTheme.of(context).bodyMedium.override( FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: 'Plus Jakarta Sans', fontFamily: 'Plus Jakarta Sans',
color: const Color(0xFF15161E), color: const Color(0xFF15161E),
fontSize: 14.0, fontSize: 14.0,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap() useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'), .containsKey('Plus Jakarta Sans'),
), ),
), ),
), ),
], ],
@ -127,13 +130,13 @@ class _ForgotPasswordTemplateComponentWidgetState
'xxm3ajsy' /* ESQUECEU SUA SENHA? */, 'xxm3ajsy' /* ESQUECEU SUA SENHA? */,
), ),
style: FlutterFlowTheme.of(context).headlineMedium.override( style: FlutterFlowTheme.of(context).headlineMedium.override(
fontFamily: 'Outfit', fontFamily: 'Outfit',
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: 24.0, fontSize: 24.0,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'),
), ),
), ),
), ),
Padding( Padding(
@ -143,105 +146,100 @@ class _ForgotPasswordTemplateComponentWidgetState
'wu2f7yzo' /* Não se preucupe nós vamos te a... */, 'wu2f7yzo' /* Não se preucupe nós vamos te a... */,
), ),
style: FlutterFlowTheme.of(context).labelMedium.override( style: FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts:
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
),
),
),
Form(
key: _model.formKey,
autovalidateMode: AutovalidateMode.onUserInteraction,
child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
child: SizedBox(
width: double.infinity,
child: TextFormField(
controller: _model.emailAddressTextController,
focusNode: _model.emailAddressFocusNode,
onChanged: (_) => EasyDebounce.debounce(
'_model.emailAddressTextController',
const Duration(milliseconds: 500),
() => setState(() {}),
),
autofocus: true,
autofillHints: const [AutofillHints.email],
obscureText: false,
decoration: InputDecoration(
isDense: true,
labelText: FFLocalizations.of(context).getText(
'mtz8l7ft' /* E-mail */,
),
labelStyle:
FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primary,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
enabledBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: Colors.black,
width: 2.00,
),
borderRadius: BorderRadius.circular(12.0),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).primary,
width: 2.00,
),
borderRadius: BorderRadius.circular(12.0),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error,
width: 2.00,
),
borderRadius: BorderRadius.circular(12.0),
),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error,
width: 2.00,
),
borderRadius: BorderRadius.circular(12.0),
),
contentPadding: const EdgeInsetsDirectional.fromSTEB(
24.0, 24.0, 20.0, 24.0),
suffixIcon: Icon(
Icons.email,
color: FlutterFlowTheme.of(context).primary,
size: 22.0,
),
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: 'Plus Jakarta Sans', fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0, fontSize: 14.0,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: useGoogleFonts: GoogleFonts.asMap()
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), .containsKey('Plus Jakarta Sans'),
),
),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
child: SizedBox(
width: double.infinity,
child: TextFormField(
controller: _model.emailAddressTextController,
focusNode: _model.emailAddressFocusNode,
autofillHints: const [AutofillHints.email],
obscureText: false,
decoration: InputDecoration(
isDense: true,
labelText: FFLocalizations.of(context).getText(
'mtz8l7ft' /* Email */,
),
labelStyle:
FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).accent1,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
hintText: FFLocalizations.of(context).getText(
'w7y5wlnv' /* digite o seu email..... */,
),
hintStyle:
FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).accent1,
width: 2.0,
),
borderRadius: BorderRadius.circular(12.0),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).accent3,
width: 2.0,
),
borderRadius: BorderRadius.circular(12.0),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error,
width: 2.0,
),
borderRadius: BorderRadius.circular(12.0),
),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error,
width: 2.0,
),
borderRadius: BorderRadius.circular(12.0),
),
filled: true,
fillColor: FlutterFlowTheme.of(context).primaryBackground,
contentPadding:
const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0),
suffixIcon: Icon(
Icons.email,
color: FlutterFlowTheme.of(context).accent1,
size: 22.0,
), ),
maxLines: null,
keyboardType: TextInputType.emailAddress,
cursorColor: FlutterFlowTheme.of(context).primary,
validator: _model.emailAddressTextControllerValidator
.asValidator(context),
), ),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
maxLines: null,
keyboardType: TextInputType.emailAddress,
cursorColor: const Color(0xFF6F61EF),
validator: _model.emailAddressTextControllerValidator
.asValidator(context),
), ),
), ),
), ),
@ -250,36 +248,31 @@ class _ForgotPasswordTemplateComponentWidgetState
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))
_model.req = await PhpGroup.forgotPasswordCall.call( ? null
email: _model.emailAddressTextController.text, : () async {
);
if (PhpGroup.forgotPasswordCall.error( try {
(_model.req?.jsonBody ?? ''), _model.req = await PhpGroup.forgotPasswordCall.call(
) == email: _model.emailAddressTextController.text,
false) { );
Navigator.pop(context);
} else { if (PhpGroup.forgotPasswordCall.error((_model.req?.jsonBody ?? '')) == false) {
await showModalBottomSheet( await DialogUtil.success(context, FFLocalizations.of(context).getVariableText(
isScrollControlled: true, enText: "Send E-mail Successful!",
backgroundColor: Colors.transparent, ptText: "E-mail Enviado com Sucesso!"
enableDrag: false, ));
context: context, Navigator.pop(context);
builder: (context) { } else {
return Padding( await DialogUtil.error(context, PhpGroup.forgotPasswordCall.msg((_model.req?.jsonBody ?? ''))!);
padding: MediaQuery.viewInsetsOf(context), }
child: ThrowExceptionWidget(
msg: PhpGroup.forgotPasswordCall.msg( setState(() {});
(_model.req?.jsonBody ?? ''),
)!, } catch (error, stack) {
), LogUtil.requestAPIFailed("iforgot.php", _model.emailAddressTextController.text, "Recuperar Senha", error, stack);
); await DialogUtil.errorDefault(context);
},
).then((value) => safeSetState(() {}));
} }
setState(() {});
}, },
text: FFLocalizations.of(context).getText( text: FFLocalizations.of(context).getText(
'74rnd5bu' /* Enviar */, '74rnd5bu' /* Enviar */,
@ -289,24 +282,30 @@ class _ForgotPasswordTemplateComponentWidgetState
height: 50.0, height: 50.0,
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
iconPadding: 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,
fontSize: 16.0, fontSize: 16.0,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap() useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'), .containsKey('Plus Jakarta Sans'),
), ),
elevation: 3.0, elevation: 3.0,
borderSide: const BorderSide( borderSide: const BorderSide(
color: Colors.transparent, color: Colors.transparent,
width: 1.0, width: 1.0,
), ),
disabledColor:
FlutterFlowTheme.of(
context)
.customColor5,
disabledTextColor:
Colors.white,
), ),
showLoadingIndicator: false, showLoadingIndicator: true,
), ),
), ),
), ),

View File

@ -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(
@ -166,12 +184,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,7 +218,7 @@ 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: [
@ -518,12 +531,7 @@ class _SignInTemplateComponentWidgetState
.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
@ -689,34 +697,25 @@ 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 {
await action_blocks try {
.singInLoginAction( await action_blocks
context, .singInLoginAction(
emailAdress: _model context,
.emailAddressTextController emailAdress: _model
.text, .emailAddressTextController
password: _model .text,
.passwordTextController password: _model
.text, .passwordTextController
); .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)
@ -778,8 +777,7 @@ class _SignInTemplateComponentWidgetState
disabledColor: disabledColor:
const Color(0xE81AAB5F), const Color(0xE81AAB5F),
), ),
showLoadingIndicator: showLoadingIndicator: true,
false,
), ),
), ),
), ),
@ -876,21 +874,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 +928,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 +967,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),
),
),
], ],
), ),
), ),

View File

@ -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',

View File

@ -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),

View File

@ -1773,7 +1773,7 @@ Widget scheduleVisit(
: FocusScope.of(context).unfocus(), : FocusScope.of(context).unfocus(),
child: Padding( child: Padding(
padding: MediaQuery.viewInsetsOf(context), padding: MediaQuery.viewInsetsOf(context),
child: const ThrowExceptionWidget( child: ThrowExceptionWidget(
msg: 'Campos obrigatórios imcompletos.', msg: 'Campos obrigatórios imcompletos.',
), ),
), ),

View File

@ -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'),
);
}
}

View File

@ -0,0 +1,5 @@
enum EnumThrowException {
success,
error,
warning
}

View File

@ -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))
)
);
}
);
}
}

View File

@ -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);
}
}

View File

@ -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;
}
}
}

View File

@ -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:

View File

@ -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