diff --git a/android/app/build.gradle b/android/app/build.gradle
index 00885235..42faf3d4 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -52,6 +52,7 @@ android {
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
+ consumerProguardFiles 'proguard.txt'
}
compileOptions {
diff --git a/android/app/proguard.txt b/android/app/proguard.txt
new file mode 100644
index 00000000..8f70253a
--- /dev/null
+++ b/android/app/proguard.txt
@@ -0,0 +1,15 @@
+# SPDX-FileCopyrightText: 2016, microG Project Team
+# SPDX-License-Identifier: CC0-1.0
+
+# Keep AutoSafeParcelables
+-keep public class * extends org.microg.safeparcel.AutoSafeParcelable {
+ @org.microg.safeparcel.SafeParcelable.Field *;
+ @org.microg.safeparcel.SafeParceled *;
+}
+
+# Keep asInterface method cause it's accessed from SafeParcel
+-keepattributes InnerClasses
+-keepclassmembers interface * extends android.os.IInterface {
+ public static class *;
+}
+-keep public class * extends android.os.Binder { public static *; }
\ No newline at end of file
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index a04b84f9..6f0588c1 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -49,15 +49,29 @@
/>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -86,7 +100,7 @@
-
+
diff --git a/android/app/src/main/kotlin/com/example/my_project/MainActivity.kt b/android/app/src/main/kotlin/com/freaccess/hub/MainActivity.kt
similarity index 64%
rename from android/app/src/main/kotlin/com/example/my_project/MainActivity.kt
rename to android/app/src/main/kotlin/com/freaccess/hub/MainActivity.kt
index a2cb04a0..10a40dac 100644
--- a/android/app/src/main/kotlin/com/example/my_project/MainActivity.kt
+++ b/android/app/src/main/kotlin/com/freaccess/hub/MainActivity.kt
@@ -2,5 +2,4 @@ package com.freaccess.hub
import io.flutter.embedding.android.FlutterFragmentActivity
-class MainActivity: FlutterFragmentActivity() {
-}
\ No newline at end of file
+class MainActivity: FlutterFragmentActivity() {}
diff --git a/android/gradle.properties b/android/gradle.properties
index ed508580..d1327d41 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -1,3 +1,5 @@
org.gradle.jvmargs=-Xmx4608m
android.useAndroidX=true
android.enableJetifier=true
+android.enableR8=true
+enableProguardInReleaseBuilds = true
diff --git a/android/proguard.txt b/android/proguard.txt
new file mode 100644
index 00000000..8f70253a
--- /dev/null
+++ b/android/proguard.txt
@@ -0,0 +1,15 @@
+# SPDX-FileCopyrightText: 2016, microG Project Team
+# SPDX-License-Identifier: CC0-1.0
+
+# Keep AutoSafeParcelables
+-keep public class * extends org.microg.safeparcel.AutoSafeParcelable {
+ @org.microg.safeparcel.SafeParcelable.Field *;
+ @org.microg.safeparcel.SafeParceled *;
+}
+
+# Keep asInterface method cause it's accessed from SafeParcel
+-keepattributes InnerClasses
+-keepclassmembers interface * extends android.os.IInterface {
+ public static class *;
+}
+-keep public class * extends android.os.Binder { public static *; }
\ No newline at end of file
diff --git a/assets/fonts/SFPRODISPLAYBOLD.OTF b/assets/fonts/SFPRODISPLAYBOLD.OTF
new file mode 100644
index 00000000..025b25c2
Binary files /dev/null and b/assets/fonts/SFPRODISPLAYBOLD.OTF differ
diff --git a/assets/fonts/SFPRODISPLAYMEDIUM.OTF b/assets/fonts/SFPRODISPLAYMEDIUM.OTF
new file mode 100644
index 00000000..b2f7daca
Binary files /dev/null and b/assets/fonts/SFPRODISPLAYMEDIUM.OTF differ
diff --git a/assets/fonts/SFPRODISPLAYREGULAR.OTF b/assets/fonts/SFPRODISPLAYREGULAR.OTF
new file mode 100644
index 00000000..09aaca9f
Binary files /dev/null and b/assets/fonts/SFPRODISPLAYREGULAR.OTF differ
diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart
index bb1a3f8e..57c1d623 100644
--- a/integration_test/app_test.dart
+++ b/integration_test/app_test.dart
@@ -1,48 +1,248 @@
import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
+import 'package:hub/flutter_flow/random_data_util.dart';
import 'package:hub/main.dart';
+import 'package:hub/shared/utils/storage_util.dart';
import 'package:integration_test/integration_test.dart';
+
+late WidgetTester widget;
+
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
- group('Authentication Tests', () {
- setUp(() async {
- await initializeApp();
+ group('Initialization', () {
+ setUpAll(() async => await initializeApp().then((_) => StorageUtil().isLogged = false));
+
+ testWidgets('Test Welcome', (WidgetTester tester) async {
+ widget = tester;
+
+ await widget.pumpWidget(const App());
+ await widget.pumpAndSettle();
+ await _navigateToSignIn();
+ await _navigateToSignUp();
+ await widget.pumpAndSettle();
+ await widget.pumpWidget(const App());
+ await widget.pumpAndSettle();
+ await _navigateToSignUp();
+ await _navigateToSignIn();
+ await widget.pumpAndSettle();
+
+
});
- testWidgets('Test MyApp', (WidgetTester tester) async {
- await tester.pumpWidget(const App());
- await _navToSignIn(tester);
- await _enterCredentialsAndSignIn(tester);
- await _login(tester);
- });
+ group('Terms of Use', (){});
+
});
+ group('Authentication', () {
+ group('Sign in', () {
+ setUpAll(() async =>
+ await initializeApp().then((_) => StorageUtil().isLogged = false));
+
+ testWidgets('Test Sign In', (WidgetTester tester) async {
+ widget = tester;
+
+ await widget.pumpWidget(const App());
+ await _navigateToSignIn();
+
+ await _auth({'emailTextFormField': 'erro@exemplo.com', 'passwordTextFormField': '12345678'});
+ await _auth({'emailTextFormField': 'email_app@exemplo.com','passwordTextFormField': '12345678'});
+ });
+ });
+ group('Sign up', () {
+ setUpAll(() async =>
+ await initializeApp().then((_) => StorageUtil().isLogged = false));
+
+
+ testWidgets('Test Sign Up', (WidgetTester tester) async {
+ widget = tester;
+ await tester.pumpWidget(const App());
+ late String name;
+ late String email;
+ late String password;
+ late Map credentials;
+
+ await _navigateToSignUp();
+
+ name = 'app';
+ email = 'email_app@exemplo.com';
+ password = '12345678';
+ credentials = {
+ 'nameTextFormField': name,
+ 'emailTextFormField': email,
+ 'passwordTextFormField': password
+ };
+ await _auth(credentials);
+
+
+ name = randomString(7, 7, true, true, true);
+ email = '$name@example.com';
+ password = '12345678';
+ credentials = {
+ 'nameTextFormField': name,
+ 'emailTextFormField': email,
+ 'passwordTextFormField': password
+ };
+ await _navigateToSignUp();
+ await _auth(credentials);
+ credentials = {
+ 'emailTextFormField': email,
+ 'passwordTextFormField': password
+ };
+ await _auth(credentials);
+
+ });
+ });
+ group('Sign Out', () {
+ // setUpAll(() async =>
+ // await initializeApp().then((_) => StorageUtil().isLogged = false));
+ });
+ group('Forgot Password', () {
+ setUpAll(() async => await initializeApp().then((_) => StorageUtil().isLogged = false));
+
+ testWidgets('Test Forgot Password', (WidgetTester tester) async {
+ widget = tester;
+ late final String addr = randomString(5, 5, true, true, true);
+ late Map credentials;
+
+ await tester.pumpWidget(const App());
+
+ await _navigateToSignIn();
+
+ await _recoveryPassword();
+ credentials = {'recoveryTextFormField': '$addr@exemple.com'};
+ await _send(credentials);
+
+ await Future.delayed(const Duration(seconds: 2));
+
+ await _recoveryPassword();
+ credentials = {'recoveryTextFormField': 'email_app@exemple.com'};
+ await _send(credentials);
+
+
+ });
+ });
+
+ });
+
+
+
+ group('Localization', (){
+
+ });
+ group('Networking', (){
+
+ });
+ group('Functionality', (){
+
+ });
+ group('Usability', (){
+
+ });
+ group('Performance', (){
+
+ });
+ group('Security', (){
+
+ });
+ group('Accessibility', (){
+
+ });
+ group('Compatibility', (){
+
+ });
+ group('Internationalization', (){
+
+ });
+
+
}
-Future _navToSignIn(WidgetTester tester) async {
- final navToSignIn = find.byKey(const Key('toggleSignInPage'));
- if (navToSignIn.evaluate().isNotEmpty) {
- await tester.tap(navToSignIn);
- await tester.pumpAndSettle();
+
+
+Future _navigateBackUsingSystemGesture() async =>
+ IntegrationTestWidgetsFlutterBinding.instance.keyboard.isLogicalKeyPressed(LogicalKeyboardKey.escape);
+
+
+Future _navigateToSignUp() async {
+ await widget.pumpAndSettle();
+ final Finder navToSignUp = find.byKey(const ValueKey('toggleSignUpPage'));
+ if (navToSignUp.evaluate().isNotEmpty) {
+ await widget.tap(navToSignUp);
+ await widget.pumpAndSettle();
}
}
-Future _enterCredentialsAndSignIn(WidgetTester tester) async {
- final emailField = find.byKey(const ValueKey('emailField'));
- await tester.enterText(emailField, 'test@example.com');
- await tester.pumpAndSettle();
-
- final passwordField = find.byKey(const ValueKey('passwordField'));
- await tester.enterText(passwordField, 'password123');
- await tester.pumpAndSettle();
+Future _navigateToSignIn() async {
+ await widget.pumpAndSettle();
+ final Finder navToSignIn = find.byKey(const ValueKey('toggleSignInPage'));
+ expect(navToSignIn, findsOneWidget);
+ if (navToSignIn.evaluate().isNotEmpty) {
+ await widget.tap(navToSignIn);
+ await widget.pumpAndSettle();
+ }
}
-Future _login(WidgetTester tester) async {
- // Encontre o botão de login e clique nele
- final signInButton = find.byKey(const Key('loginCallback'));
- // expect(signInButton, findsOneWidget);
- tester.press(signInButton);
+Future _recoveryPassword() async {
+ await widget.pumpAndSettle();
+ final Finder forgotPassword = find.byKey(const ValueKey('ForgotPassword'));
+ if (forgotPassword.evaluate().isNotEmpty) await widget.tap(forgotPassword);
+ await widget.ensureVisible(forgotPassword);
+ await widget.pumpAndSettle();
- await tester.pumpAndSettle();
}
+
+
+
+Future _auth(Map credentials) async {
+ await _enterCredentials(credentials);
+ await _submit('SubmitButtonWidget');
+}
+
+Future _send(Map credentials) async {
+ await _enterCredentials(credentials);
+ await _submit('SendButtonWidget');
+}
+
+
+
+Future _enterCredentials(Map credentials) async {
+ await widget.pumpAndSettle();
+
+ for (var entry in credentials.entries) {
+ final Finder field = find.byKey(ValueKey(entry.key));
+ await widget.pumpAndSettle();
+ expect(field, findsOneWidget);
+ await widget.enterText(field, entry.value);
+ await widget.pumpAndSettle();
+ }
+
+ await widget.pumpAndSettle();
+}
+
+Future _submit(String key) async {
+ await widget.pumpAndSettle();
+ final Finder submitButton = find.byKey(ValueKey(key));
+ await widget.pumpAndSettle();
+ if (submitButton.evaluate().isNotEmpty) {
+ await widget.tap(submitButton);
+ await widget.pumpAndSettle();
+ }
+
+
+ final Finder ThrowExceptionWidget = find.byKey(const ValueKey('ThrowExceptionWidget'));
+ await widget.pumpAndSettle();
+ if (ThrowExceptionWidget.evaluate().isNotEmpty) {
+ await widget.ensureVisible(ThrowExceptionWidget);
+ await widget.tap(ThrowExceptionWidget);
+ await widget.pumpAndSettle();
+ } else {
+ await _navigateBackUsingSystemGesture();
+ }
+
+
+}
+
+
+
diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart
index ab798326..0e86bf14 100644
--- a/lib/backend/api_requests/api_calls.dart
+++ b/lib/backend/api_requests/api_calls.dart
@@ -3,8 +3,6 @@ import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
-import 'package:hub/shared/helpers/secure_storage_helper.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
import 'package:hub/shared/utils/storage_util.dart';
import 'package:hub/shared/utils/validator_util.dart';
@@ -24,6 +22,7 @@ class PhpGroup {
static UpdToken updToken = UpdToken();
static RegisterCall registerCall = RegisterCall();
static ForgotPasswordCall forgotPasswordCall = ForgotPasswordCall();
+ static ChangePasswordCall changePasswordCall = ChangePasswordCall();
static GetLocalsCall getLocalsCall = GetLocalsCall();
static PostScheduleVisitorCall postScheduleVisitorCall =
PostScheduleVisitorCall();
@@ -660,12 +659,51 @@ class RegisterCall {
}
}
+
+class ChangePasswordCall {
+ Future call({
+ required final String email,
+ required final String token,
+ required final String psswd,
+ }) async {
+ final String baseUrl = PhpGroup.getBaseUrl();
+ final String devUUID = StorageUtil().devUUID;
+ final String userUUID = StorageUtil().userUUID;
+ final String cliID = StorageUtil().cliUUID;
+
+ return ApiManager.instance.makeApiCall(
+ callName: 'changePassword',
+ apiUrl: '$baseUrl/alterarSenha.php',
+ callType: ApiCallType.POST,
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ params: {
+ 'email': email,
+ 'token': token,
+ 'senha': psswd,
+ 'devUUID': devUUID,
+ 'userUUID': userUUID,
+ 'cliID': cliID,
+ },
+ bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
+ returnBody: true,
+ encodeBodyUtf8: false,
+ decodeUtf8: false,
+ cache: false,
+ isStreamingApi: false,
+ alwaysAllowBody: false,
+ );
+ }
+}
+
class ForgotPasswordCall {
Future call({
final String? email,
}) async {
final String baseUrl = PhpGroup.getBaseUrl();
+
return ApiManager.instance.makeApiCall(
callName: 'forgotPassword',
apiUrl: '$baseUrl/iforgot.php',
diff --git a/lib/backend/notifications/firebase_messaging_service.dart b/lib/backend/notifications/firebase_messaging_service.dart
index be23aad5..dfe76047 100644
--- a/lib/backend/notifications/firebase_messaging_service.dart
+++ b/lib/backend/notifications/firebase_messaging_service.dart
@@ -2,7 +2,6 @@ import 'dart:developer';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:hub/backend/api_requests/api_calls.dart';
-import 'package:hub/shared/helpers/secure_storage_helper.dart';
import 'package:hub/shared/utils/log_util.dart';
import 'package:hub/shared/utils/storage_util.dart';
diff --git a/lib/backend/notifications/notification_service.dart b/lib/backend/notifications/notification_service.dart
index 2b761b8c..8510eac6 100644
--- a/lib/backend/notifications/notification_service.dart
+++ b/lib/backend/notifications/notification_service.dart
@@ -1,26 +1,17 @@
-import 'dart:developer';
-
import 'package:awesome_notifications/awesome_notifications.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:hub/backend/api_requests/api_calls.dart';
-import 'package:hub/backend/api_requests/api_manager.dart';
-import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart';
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart';
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
-import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
import 'package:hub/flutter_flow/nav/nav.dart';
-import 'package:hub/shared/helpers/secure_storage_helper.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
import 'package:hub/shared/utils/dialog_util.dart';
import 'package:hub/shared/utils/storage_util.dart';
-import 'package:sqflite/sqflite.dart';
-Future onMessageReceived(
- Map payload, String? extra, String? handleClick) async {
+Future onMessageReceived(Map payload, String? extra, String? handleClick) async {
final localId = jsonDecode(payload['local']!)['CLI_ID'];
final cliUUID = StorageUtil().cliUUID;
diff --git a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart
index 317a3bfa..c1954b20 100644
--- a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart
+++ b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart
@@ -2,11 +2,9 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
import 'package:hub/shared/utils/dialog_util.dart';
import 'package:hub/shared/utils/storage_util.dart';
-import '../../../app_state.dart';
class MenuButtonWidget extends MenuEntry {
const MenuButtonWidget({
diff --git a/lib/components/atomic_components/shared_components_atoms/custom_datepicker.dart b/lib/components/atomic_components/shared_components_atoms/custom_datepicker.dart
index 596f50ce..cffebe05 100644
--- a/lib/components/atomic_components/shared_components_atoms/custom_datepicker.dart
+++ b/lib/components/atomic_components/shared_components_atoms/custom_datepicker.dart
@@ -1,10 +1,10 @@
-import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
+// ignore: must_be_immutable
class CustomDatePickerUtil extends StatefulWidget {
TextEditingController? controller;
final FocusNode? focusNode;
@@ -37,7 +37,6 @@ class CustomDatePickerUtil extends StatefulWidget {
class _CustomDatePickerState extends State {
DateTime? _selectedDate;
- TimeOfDay? _selectedTime;
@override
void initState() {
diff --git a/lib/components/atomic_components/shared_components_atoms/custom_input.dart b/lib/components/atomic_components/shared_components_atoms/custom_input.dart
index 748448b9..765c2c7e 100644
--- a/lib/components/atomic_components/shared_components_atoms/custom_input.dart
+++ b/lib/components/atomic_components/shared_components_atoms/custom_input.dart
@@ -2,10 +2,9 @@ import 'package:easy_debounce/easy_debounce.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart';
-import 'package:hub/components/atomic_components/shared_components_atoms/tabview.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
-import 'package:hub/flutter_flow/flutter_flow_util.dart';
+// ignore: must_be_immutable
class CustomInputUtil extends StatefulWidget {
final TextEditingController? controller;
final String? labelText;
diff --git a/lib/components/atomic_components/shared_components_atoms/custom_select.dart b/lib/components/atomic_components/shared_components_atoms/custom_select.dart
index 950d43de..d0822749 100644
--- a/lib/components/atomic_components/shared_components_atoms/custom_select.dart
+++ b/lib/components/atomic_components/shared_components_atoms/custom_select.dart
@@ -1,15 +1,12 @@
-import 'dart:developer';
-import 'dart:math';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
-import 'package:hub/components/organism_components/message_well_component/message_well_component_widget.dart';
import 'package:hub/flutter_flow/flutter_flow_drop_down.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
-import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
import 'package:hub/flutter_flow/form_field_controller.dart';
+// ignore: must_be_immutable
class CustomSelect extends StatefulWidget {
final List options;
final List optionsLabel;
@@ -61,9 +58,7 @@ class _CustomSelectState extends State {
decoration: const BoxDecoration(),
child: FlutterFlowDropDown(
fillColor: FlutterFlowTheme.of(context).primaryBackground,
- controller: widget.controller ??=
- FormFieldController(
- widget.dropDownValue ??= ''),
+ controller: widget.controller,
options: widget.options,
optionLabels: widget.optionsLabel,
onChanged: widget.changed,
diff --git a/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart b/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart
index 3dda5950..2377b458 100644
--- a/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart
+++ b/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart
@@ -1,14 +1,11 @@
-import 'dart:developer';
-import 'dart:typed_data';
-
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
import 'package:hub/flutter_flow/upload_data.dart';
-import 'package:hub/flutter_flow/uploaded_file.dart';
+// ignore: must_be_immutable
class MediaUploadButtonUtil extends StatefulWidget {
final Function(FFUploadedFile) onUploadComplete;
bool isUploading;
diff --git a/lib/components/atomic_components/shared_components_atoms/submit_button.dart b/lib/components/atomic_components/shared_components_atoms/submit_button.dart
index 08180f3d..4c1667fa 100644
--- a/lib/components/atomic_components/shared_components_atoms/submit_button.dart
+++ b/lib/components/atomic_components/shared_components_atoms/submit_button.dart
@@ -2,9 +2,8 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
-import 'package:hub/flutter_flow/internationalization.dart';
-import 'package:json_path/fun_sdk.dart';
+// ignore: must_be_immutable
class SubmitButtonUtil extends StatelessWidget {
final String labelText;
Future Function()? onPressed;
diff --git a/lib/components/atomic_components/shared_components_atoms/tabview.dart b/lib/components/atomic_components/shared_components_atoms/tabview.dart
index 6ec30597..3798d6d8 100644
--- a/lib/components/atomic_components/shared_components_atoms/tabview.dart
+++ b/lib/components/atomic_components/shared_components_atoms/tabview.dart
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
+// ignore: must_be_immutable
class TabViewUtil extends StatelessWidget {
final BuildContext context;
final dynamic model;
diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart
index fe501dc9..01ee6ea1 100644
--- a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart
+++ b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart
@@ -175,7 +175,6 @@ class _OptModalWidgetState extends State {
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
- double screenHeight = MediaQuery.of(context).size.height;
return Center(
child: Container(
diff --git a/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart b/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart
index ce905389..368ad6b9 100644
--- a/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart
+++ b/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart
@@ -4,6 +4,7 @@ import 'package:hub/components/molecular_components/order_filter_modal/order_fil
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/nav/nav.dart';
+// ignore: unused_import
import 'package:hub/shared/helpers/secure_storage_helper.dart';
import 'package:hub/shared/utils/storage_util.dart';
@@ -178,7 +179,6 @@ class _OrderFilterModalWidgetState extends State {
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
- double screenHeight = MediaQuery.of(context).size.height;
return Center(
child: Container(
diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart
index 324be78c..07008012 100644
--- a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart
+++ b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart
@@ -11,6 +11,7 @@ import 'throw_exception_model.dart';
export 'throw_exception_model.dart';
+// ignore: must_be_immutable
class ThrowExceptionWidget extends StatefulWidget {
ThrowExceptionWidget(
{super.key, required this.msg, this.type = EnumThrowException.error});
@@ -100,77 +101,63 @@ class _ThrowExceptionWidgetState extends State
@override
Widget build(BuildContext context) {
- return Column(
- mainAxisSize: MainAxisSize.max,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Padding(
- padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0),
- child: InkWell(
- splashColor: Colors.transparent,
- focusColor: Colors.transparent,
- hoverColor: Colors.transparent,
- highlightColor: Colors.transparent,
- onTap: () async {
- context.pop();
- },
- child: Column(
- mainAxisSize: MainAxisSize.max,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Stack(
- children: [
- Align(
- alignment: const AlignmentDirectional(0.0, 0.0),
- child: Icon(
- _getIconByType(context),
- color: _getColorByType(context),
- size: 150.0,
- ),
- ),
- ],
- ).animateOnPageLoad(animationsMap['stackOnPageLoadAnimation']!),
- Column(
- mainAxisSize: MainAxisSize.max,
- mainAxisAlignment: MainAxisAlignment.start,
- children: [
- Text(
- _getTitleByType(context),
- style: FlutterFlowTheme.of(context).bodyMedium.override(
- fontFamily:
- FlutterFlowTheme.of(context).bodyMediumFamily,
- fontSize: 20.0,
- letterSpacing: 0.0,
- fontWeight: FontWeight.bold,
- useGoogleFonts: GoogleFonts.asMap().containsKey(
- FlutterFlowTheme.of(context).bodyMediumFamily),
- ),
- ),
- Padding(
- padding: const EdgeInsetsDirectional.fromSTEB(
- 0.0, 10.0, 0.0, 0.0),
- child: Text(
- valueOrDefault(
- widget.msg,
- 'Message Not Found',
- ),
- style: FlutterFlowTheme.of(context).bodyMedium.override(
- fontFamily:
- FlutterFlowTheme.of(context).bodyMediumFamily,
- letterSpacing: 0.0,
- useGoogleFonts: GoogleFonts.asMap().containsKey(
- FlutterFlowTheme.of(context)
- .bodyMediumFamily),
- ),
- ),
- ),
- ].addToStart(const SizedBox(height: 20.0)),
+ return InkWell(
+ key: const ValueKey('ThrowExceptionWidget'),
+ splashColor: Colors.transparent,
+ focusColor: Colors.transparent,
+ hoverColor: Colors.transparent,
+ highlightColor: Colors.transparent,
+ onTap: () async {
+ context.pop();
+ },
+ child: SingleChildScrollView(
+ child: Column(
+ mainAxisSize: MainAxisSize.max,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Stack(
+ children: [
+ Align(
+ alignment: const AlignmentDirectional(0.0, 0.0),
+ child: Icon(
+ _getIconByType(context),
+ color: _getColorByType(context),
+ size: 150.0,
),
- ],
- ),
+ ),
+ ],
+ ).animateOnPageLoad(animationsMap['stackOnPageLoadAnimation']!),
+ const SizedBox(height: 20.0),
+ Column(
+ mainAxisSize: MainAxisSize.max,
+ mainAxisAlignment: MainAxisAlignment.start,
+ children: [
+ Text(
+ _getTitleByType(context),
+ style: FlutterFlowTheme.of(context).bodyMedium.override(
+ fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
+ fontSize: 20.0,
+ letterSpacing: 0.0,
+ fontWeight: FontWeight.bold,
+ useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
+ child: Text(
+ valueOrDefault(widget.msg, 'Message Not Found'),
+ style: FlutterFlowTheme.of(context).bodyMedium.override(
+ fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
+ letterSpacing: 0.0,
+ useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
+ ),
+ ),
+ ),
+ ],
),
- ),
- ],
- );
- }
+ ],
+ ),
+ ),
+ );
+}
}
diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart
index 6c498e52..d3c4fb23 100644
--- a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart
+++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart
@@ -3,11 +3,9 @@ import 'package:hub/components/organism_components/bottom_arrow_linked_locals_co
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/nav/nav.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
import 'package:hub/shared/utils/dialog_util.dart';
import 'package:hub/shared/utils/log_util.dart';
import 'package:hub/shared/utils/storage_util.dart';
-import 'package:provider/provider.dart';
import '/backend/api_requests/api_calls.dart';
import '/flutter_flow/flutter_flow_theme.dart';
diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart
index 02a1377a..3471b1af 100644
--- a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart
+++ b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart
@@ -1,18 +1,11 @@
-import 'dart:developer';
-
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
-import 'package:hub/backend/api_requests/api_calls.dart';
-import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.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/storage_util.dart';
import '/flutter_flow/custom_functions.dart' as functions;
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
+import '../../../shared/services/localization/localization_service.dart';
import 'local_profile_component_model.dart';
export 'local_profile_component_model.dart';
@@ -41,9 +34,10 @@ class _LocalProfileComponentWidgetState
_model = createModel(context, () => LocalProfileComponentModel());
_model.setOnUpdate(onUpdate: () => setState(() {}));
_model.setStateCallback = () => safeSetState(() {});
-
+ //
WidgetsBinding.instance
- .addPostFrameCallback((_) async => await processLocals());
+ .addPostFrameCallback((_) async => await LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null));
+
}
@override
@@ -53,152 +47,14 @@ class _LocalProfileComponentWidgetState
super.dispose();
}
- Future processData() async {
- try {
- final GetDadosCall callback = PhpGroup.getDadosCall;
-
- var response = await callback.call();
-
- final error = response.jsonBody['error'];
-
- if (error == false) {
- final bool whatsapp = response.jsonBody['whatsapp'] ?? false;
- final bool provisional = response.jsonBody['provisional'] ?? false;
- final bool pets = response.jsonBody['pet'] ?? false;
- final String petAmountRegister =
- response.jsonBody['petAmountRegister'].toString().isEmpty
- ? '0'
- : response.jsonBody['petAmountRegister'].toString();
- final String name = response.jsonBody['visitado']['VDO_NOME'];
-
- StorageUtil().whatsapp = whatsapp;
- StorageUtil().provisional = provisional;
- StorageUtil().pets = pets;
- StorageUtil().petAmountRegister = petAmountRegister;
- StorageUtil().userName = name;
-
- safeSetState(() {});
- return;
- } else if (error == true) {
- log('() => error: $error');
- DialogUtil.warningDefault(context).whenComplete(() => processLocals());
- safeSetState(() {});
- }
-
- return;
- } catch (e, s) {
- log('() => error: $e', stackTrace: s);
- DialogUtil.warningDefault(context).whenComplete(() => processLocals());
- }
- }
-
- Future processLocals() async {
- try {
- final GetLocalsCall callback = PhpGroup.getLocalsCall;
-
- final ApiCallResponse response = await callback.call();
-
- final List locals = response.jsonBody['locais'].toList() ?? [];
-
- for (var local in locals) {
- final String status = local['CLU_STATUS'];
- log('() => CLU_STATUS: $status');
- }
-
- final bool isActive = response.jsonBody['locais']
- .where((local) => local['CLU_STATUS'] == 'A')
- .toList()
- .isNotEmpty;
- final bool isInactived = response.jsonBody['locais']
- .where((local) =>
- local['CLU_STATUS'] != 'B' && local['CLU_STATUS'] != 'A')
- .toList()
- .isNotEmpty;
- final bool isUnique = locals.length == 1;
- final bool isBlocked = locals[0]['CLU_STATUS'] == 'B';
- final bool isEnabled = isUnique && isActive;
-
- final bool isDisabled = isUnique && isBlocked;
- final bool isUnselected = StorageUtil().cliUUID.isEmpty &&
- StorageUtil().cliName.isEmpty & StorageUtil().ownerUUID.isEmpty;
- final bool isSelected =
- StorageUtil().cliUUID.isNotEmpty && StorageUtil().cliName.isNotEmpty;
- final bool isUnavailable = isInactived && isUnselected && isUnique;
-
- if (!mounted) return;
-
- if (isDisabled) {
- if (mounted) context.go('/welcomePage');
- } else if (isUnavailable) {
- log('() => isUnavailable');
- try {
- StorageUtil().cliName = locals[0]['CLI_NOME'];
- StorageUtil().cliUUID = locals[0]['CLI_ID'];
- StorageUtil().ownerUUID = locals[0]['CLU_OWNER_ID'];
- var response = await PhpGroup.resopndeVinculo.call(tarefa: 'A');
- if (response.jsonBody['error'] == true) {
- StorageUtil().cliUUID = '';
- StorageUtil().cliName = '';
- StorageUtil().ownerUUID = '';
- }
- if (response.jsonBody['error'] == false) await processData();
- } catch (e, s) {
- DialogUtil.errorDefault(context);
- LogUtil.requestAPIFailed(
- 'responderVinculo.php', '', 'Responder Vínculo', e, s);
- }
- } else if (isEnabled) {
- log('() => isEnabled');
- StorageUtil().cliName = locals[0]['CLI_NOME'];
- StorageUtil().cliUUID = locals[0]['CLI_ID'];
- StorageUtil().ownerUUID = locals[0]['CLU_OWNER_ID'];
-
- await processData();
- } else if (isUnselected) {
- log('() => isUnselected');
- await showModalSelectLocal();
- } else if (isSelected) {
- log('() => isSelected');
- await processData();
- } else {
- log('() => else');
- await showModalSelectLocal();
- }
- } catch (e) {
- log('() => catch: $e');
- if (mounted) await showModalSelectLocal();
- }
- }
-
- Future showModalSelectLocal() async {
- await showModalBottomSheet(
- isScrollControlled: true,
- backgroundColor: Colors.transparent,
- enableDrag: false,
- isDismissible: false,
- showDragHandle: false,
- useSafeArea: true,
- context: context,
- builder: (context) => PopScope(
- canPop: false,
- child: Padding(
- padding: MediaQuery.viewInsetsOf(context),
- child: const BottomArrowLinkedLocalsComponentWidget(),
- ),
- ),
- ).then((_) async {
- onUpdate();
- });
-
- await processData();
- }
-
void onUpdate() {
safeSetState(() {
_model.getData();
});
}
+
+
@override
Widget build(BuildContext context) {
return Container(
@@ -230,7 +86,7 @@ class _LocalProfileComponentWidgetState
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: () async {
- showModalSelectLocal();
+ await LocalizationService.selectLocal(context).then((value) => value == true ? onUpdate() : null);
},
child: ClipRRect(
borderRadius: BorderRadius.circular(200.0),
diff --git a/lib/components/organism_components/menu_component/menu_component_model.dart b/lib/components/organism_components/menu_component/menu_component_model.dart
index e7578d45..e6f7c1cb 100644
--- a/lib/components/organism_components/menu_component/menu_component_model.dart
+++ b/lib/components/organism_components/menu_component/menu_component_model.dart
@@ -1,12 +1,9 @@
import 'package:flutter/material.dart';
-import 'package:hub/backend/api_requests/api_calls.dart';
import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart';
import 'package:hub/flutter_flow/nav/nav.dart';
import 'package:hub/shared/extensions/dialog_extensions.dart';
-import 'package:hub/shared/helpers/secure_storage_helper.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
+import 'package:hub/shared/services/authentication/authentication_service.dart';
import 'package:hub/shared/utils/storage_util.dart';
-import 'package:sqflite/sqflite.dart';
import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart';
import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart';
@@ -244,29 +241,20 @@ class MenuComponentModel extends FlutterFlowModel {
});
}
- Future signOut(BuildContext context) async {
+ Future Logout(BuildContext context) async {
+ final String title = FFLocalizations.of(context).getVariableText(
+ ptText: 'Sair',
+ enText: 'Logout',
+ );
+ final String content = FFLocalizations.of(context).getVariableText(
+ ptText: 'Tem certeza que deseja sair?',
+ enText: 'Are you sure you want to logout?',
+ );
showAlertDialog(
context,
- 'Logout',
- FFLocalizations.of(context).getVariableText(
- enText: 'Are you sure you want to logout?',
- ptText: 'Tem certeza',
- ), () async {
- PhpGroup.unregisterDevice.call();
- StorageUtil.purge();
-
- context.go(
- '/welcomePage',
- extra: {
- kTransitionInfoKey: const TransitionInfo(
- hasTransition: true,
- transitionType: PageTransitionType.scale,
- alignment: Alignment.bottomCenter,
- ),
- },
- );
- await SQLiteStorageHelper().purge();
- });
+ title,
+ content,
+ () async => await AuthenticationService.signOut(context));
}
Future openPreferencesSettings(BuildContext context) async {
diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart b/lib/components/organism_components/menu_component/menu_component_widget.dart
index 032ca758..cd940d59 100644
--- a/lib/components/organism_components/menu_component/menu_component_widget.dart
+++ b/lib/components/organism_components/menu_component/menu_component_widget.dart
@@ -3,7 +3,6 @@ import 'package:hub/backend/schema/enums/enums.dart';
import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart';
import 'package:hub/components/atomic_components/menu_card_item/menu_card_item.dart';
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart';
import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart';
@@ -555,7 +554,7 @@ class _MenuComponentWidgetState extends State {
MenuCardItem(
icon: Icons.logout,
action: () async {
- await _model.signOut(context);
+ await _model.Logout(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
diff --git a/lib/components/organism_components/message_well_component/message_well_component_widget.dart b/lib/components/organism_components/message_well_component/message_well_component_widget.dart
index 40005da6..ad05326e 100644
--- a/lib/components/organism_components/message_well_component/message_well_component_widget.dart
+++ b/lib/components/organism_components/message_well_component/message_well_component_widget.dart
@@ -1,14 +1,11 @@
import 'dart:async';
import 'dart:collection';
-import 'dart:developer';
import 'package:flutter/material.dart';
-import 'package:flutter/widgets.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:hub/backend/api_requests/api_calls.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart';
@@ -178,7 +175,7 @@ class _MessageWellComponentWidgetState
}
Widget _buildMessageItem(BuildContext context, dynamic message, int index) {
- final theme = FlutterFlowTheme.of(context);
+ FlutterFlowTheme.of(context);
String formatMessageOrigin(String messageOrigin) {
final words = messageOrigin.split(' ');
final formattedWords = words.map((word) {
diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart
index f594143b..672f7c4d 100644
--- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart
+++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart
@@ -1,9 +1,9 @@
-import 'package:hub/backend/api_requests/api_manager.dart';
-
import 'package:flutter/material.dart';
+import 'package:hub/backend/api_requests/api_manager.dart';
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
import 'package:hub/flutter_flow/flutter_flow_model.dart';
+// ignore: unused_import
import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
import 'package:hub/shared/utils/storage_util.dart';
import 'package:intl/intl.dart';
diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart
index 19bbfa3a..f64303fb 100644
--- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart
+++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart
@@ -2,13 +2,13 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/backend/api_requests/api_calls.dart';
-import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart';
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart';
import 'package:hub/flutter_flow/custom_functions.dart';
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/nav/nav.dart';
+import 'package:hub/shared/utils/dialog_util.dart';
class ScheduleVisitDetailWidget extends StatefulWidget {
const ScheduleVisitDetailWidget({
@@ -799,22 +799,12 @@ class _ScheduleVisitDetailWidgetState extends State {
false) {
context.pop();
} else {
- await showModalBottomSheet(
- isScrollControlled: true,
- backgroundColor: Colors.transparent,
- enableDrag: false,
- context: context,
- builder: (context) {
- return Padding(
- padding: MediaQuery.viewInsetsOf(context),
- child: ThrowExceptionWidget(
- msg: PhpGroup.postScheduleVisitCall.errorMsg(
- (_model.postScheduleVisit?.jsonBody ?? ''),
- )!,
- ),
- );
- },
- ).then((value) => safeSetState(() {}));
+ final String? msg = PhpGroup.postScheduleVisitCall.errorMsg(
+ (_model.postScheduleVisit?.jsonBody ?? ''),
+ );
+ await DialogUtil.error(context, msg!).then((value) => safeSetState(() {}));
+
+
}
setState(() {});
diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart
index 231bdfb6..58eb0783 100644
--- a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart
+++ b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart
@@ -1,8 +1,6 @@
+import 'package:flutter/material.dart';
import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart';
import 'package:hub/flutter_flow/flutter_flow_model.dart';
-
-import 'package:flutter/material.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
import 'package:hub/shared/utils/storage_util.dart';
class UpArrowLinkedLocalsComponentModel
diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart
index 6622fb27..3d747604 100644
--- a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart
+++ b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:hub/flutter_flow/nav/nav.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
import 'package:hub/shared/utils/storage_util.dart';
import '/backend/api_requests/api_calls.dart';
diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart
index 0c36f135..f306eff7 100644
--- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart
+++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart
@@ -3,7 +3,6 @@ import 'dart:collection';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
-import 'package:provider/provider.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart
index b709cc5b..fb2c4b57 100644
--- a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart
+++ b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart
@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/flutter_flow/nav/nav.dart';
-import 'package:hub/shared/helpers/secure_storage_helper.dart';
import 'package:hub/shared/utils/storage_util.dart';
import '/flutter_flow/flutter_flow_theme.dart';
diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart
index ee959e7f..fbfef1cb 100644
--- a/lib/components/templates_components/details_component/details_component_widget.dart
+++ b/lib/components/templates_components/details_component/details_component_widget.dart
@@ -1,15 +1,12 @@
import 'dart:collection';
-import 'dart:developer';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/components/templates_components/details_component/details_component_model.dart';
-import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
-import 'package:hub/flutter_flow/internationalization.dart';
-import 'package:provider/provider.dart';
+
class DetailsComponentWidget extends StatefulWidget {
const DetailsComponentWidget({
@@ -35,7 +32,7 @@ class _DetailsComponentWidgetState extends State {
late DetailsComponentModel _model;
LinkedHashMap get labelsLinkedHashMap =>
- LinkedHashMap.from(widget.labelsHashMap ?? {});
+ LinkedHashMap.from(widget.labelsHashMap);
List> get statusLinkedHashMap =>
widget.statusHashMap
diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart
index 88a2f4b8..70f2ede6 100644
--- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart
+++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart
@@ -1,17 +1,16 @@
-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 '/flutter_flow/flutter_flow_theme.dart';
-import '/flutter_flow/flutter_flow_util.dart';
-import '/flutter_flow/flutter_flow_widgets.dart';
import 'package:easy_debounce/easy_debounce.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
+import 'package:hub/flutter_flow/nav/nav.dart';
+import 'package:hub/shared/services/authentication/authentication_service.dart';
+import 'package:hub/shared/utils/validator_util.dart';
+
+import '/flutter_flow/flutter_flow_theme.dart';
+import '/flutter_flow/flutter_flow_util.dart';
+import '/flutter_flow/flutter_flow_widgets.dart';
import 'forgot_password_template_component_model.dart';
+
export 'forgot_password_template_component_model.dart';
//
@@ -74,7 +73,6 @@ class _ForgotPasswordTemplateComponentWidgetState
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well.
if (responsiveVisibility(
context: context,
phone: false,
@@ -84,6 +82,7 @@ class _ForgotPasswordTemplateComponentWidgetState
padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
child: InkWell(
+ key: const ValueKey('BackButton'),
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
@@ -104,19 +103,16 @@ class _ForgotPasswordTemplateComponentWidgetState
),
),
Padding(
- padding: const EdgeInsetsDirectional.fromSTEB(
- 12.0, 0.0, 0.0, 0.0),
+ padding: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0),
child: Text(
'',
- style:
- FlutterFlowTheme.of(context).bodyMedium.override(
+ style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: const Color(0xFF15161E),
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
- useGoogleFonts: GoogleFonts.asMap()
- .containsKey('Plus Jakarta Sans'),
+ useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
),
),
),
@@ -128,9 +124,7 @@ class _ForgotPasswordTemplateComponentWidgetState
padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
child: Text(
- FFLocalizations.of(context).getText(
- 'xxm3ajsy' /* ESQUECEU SUA SENHA? */,
- ),
+ FFLocalizations.of(context).getText('xxm3ajsy' /* ESQUECEU SUA SENHA? */),
style: FlutterFlowTheme.of(context).headlineMedium.override(
fontFamily: 'Outfit',
color: FlutterFlowTheme.of(context).primaryText,
@@ -145,9 +139,7 @@ class _ForgotPasswordTemplateComponentWidgetState
padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
child: Text(
- FFLocalizations.of(context).getText(
- 'wu2f7yzo' /* Não se preucupe nós vamos te a... */,
- ),
+ FFLocalizations.of(context).getText('wu2f7yzo' /* Não se preucupe nós vamos te a... */),
style: FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText,
@@ -168,6 +160,7 @@ class _ForgotPasswordTemplateComponentWidgetState
child: SizedBox(
width: double.infinity,
child: TextFormField(
+ key: const ValueKey('recoveryTextFormField'),
controller: _model.emailAddressTextController,
focusNode: _model.emailAddressFocusNode,
onChanged: (_) => EasyDebounce.debounce(
@@ -180,11 +173,8 @@ class _ForgotPasswordTemplateComponentWidgetState
obscureText: false,
decoration: InputDecoration(
isDense: true,
- labelText: FFLocalizations.of(context).getText(
- 'mtz8l7ft' /* E-mail */,
- ),
- labelStyle:
- FlutterFlowTheme.of(context).labelMedium.override(
+ 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,
@@ -253,39 +243,14 @@ class _ForgotPasswordTemplateComponentWidgetState
padding:
const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
child: FFButtonWidget(
+ key: const ValueKey('SendButtonWidget'),
onPressed: (_model.emailAddressTextController.text == '' ||
!ValidatorUtil.isValidEmail(
_model.emailAddressTextController.text))
? null
- : () async {
- try {
- _model.req = await PhpGroup.forgotPasswordCall.call(
- email: _model.emailAddressTextController.text,
- );
+ : () async => AuthenticationService.forgotPassword(context, _model.emailAddressTextController.text),
- if (_model.req?.jsonBody['error'] == false) {
- await DialogUtil.success(
- context,
- FFLocalizations.of(context).getVariableText(
- enText: "Send E-mail Successful!",
- ptText: "E-mail Enviado com Sucesso!"));
- context.pop();
- } else {
- await DialogUtil.error(
- context, _model.req?.jsonBody['error_msg']);
- }
- setState(() {});
- } catch (error, stack) {
- LogUtil.requestAPIFailed(
- "iforgot.php",
- _model.emailAddressTextController.text,
- "Recuperar Senha",
- error,
- stack);
- await DialogUtil.errorDefault(context);
- }
- },
text: FFLocalizations.of(context).getText(
'74rnd5bu' /* Enviar */,
),
diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart
index 63ce5b0e..db1f6d26 100644
--- a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart
+++ b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart
@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart';
import 'package:hub/flutter_flow/flutter_flow_model.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
import 'package:hub/shared/utils/storage_util.dart';
class LiberationHistoryItemDetailsTemplateComponentModel
diff --git a/lib/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart b/lib/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart
index 97b7b058..e9a7606c 100644
--- a/lib/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart
+++ b/lib/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:hub/backend/api_requests/api_manager.dart';
import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
import 'package:hub/shared/utils/storage_util.dart';
class ScheduleProvisionalVisitPageModel
diff --git a/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart b/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart
index ad763b85..d5af8a30 100644
--- a/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart
+++ b/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart
@@ -529,8 +529,7 @@ class _ScheduleProvisionalVisitPageWidgetState
initialDate:
getCurrentTimestamp,
firstDate:
- (getCurrentTimestamp ??
- DateTime(1900)),
+ (getCurrentTimestamp),
lastDate: DateTime(2050),
builder: (context, child) {
return wrapInMaterialDatePickerTheme(
diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart
index 2bde3236..0d45259f 100644
--- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart
+++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart
@@ -1,7 +1,6 @@
import 'dart:async';
import 'package:flutter/material.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
import 'package:hub/shared/utils/storage_util.dart';
import 'package:hub/shared/utils/validator_util.dart';
diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart
index cc58b32e..efb7adf1 100644
--- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart
+++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart
@@ -5,7 +5,6 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:hub/shared/utils/dialog_util.dart';
import 'package:hub/shared/utils/image_util.dart';
import 'package:hub/shared/utils/validator_util.dart';
-import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart';
import '/backend/api_requests/api_calls.dart';
diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart
index 8d2d1561..21b10011 100644
--- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart
+++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart
@@ -1,32 +1,19 @@
-import 'package:hub/backend/api_requests/api_calls.dart';
-import 'package:hub/flutter_flow/nav/nav.dart';
-import 'package:hub/flutter_flow/random_data_util.dart';
-import 'package:hub/shared/helpers/secure_storage_helper.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
-import 'package:hub/shared/utils/device_util.dart';
-import 'package:hub/shared/utils/dialog_util.dart';
-import 'package:hub/shared/utils/log_util.dart';
-import 'package:hub/shared/utils/storage_util.dart';
+import 'package:flutter/material.dart';
import '/flutter_flow/flutter_flow_util.dart';
import 'sign_in_template_component_widget.dart'
show SignInTemplateComponentWidget;
-import 'package:flutter/material.dart';
class SignInTemplateComponentModel
extends FlutterFlowModel {
- /// State fields for stateful widgets in this component.
final formKey = GlobalKey();
final unfocusNode = FocusNode();
- // State field(s) for emailAddress widget.
FocusNode? emailAddressFocusNode;
TextEditingController? emailAddressTextController;
String? Function(BuildContext, String?)? emailAddressTextControllerValidator;
-
SignInTemplateComponentModel();
- String? _emailAddressTextControllerValidator(
- BuildContext context, String? val) {
+ String? _emailAddressTextControllerValidator(BuildContext context, String? val) {
if (val == null || val.isEmpty) {
return FFLocalizations.of(context).getText(
'xhnawzcb' /* Campo é necessário */,
@@ -40,8 +27,6 @@ class SignInTemplateComponentModel
}
return null;
}
-
- // State field(s) for password widget.
FocusNode? passwordFocusNode;
TextEditingController? passwordTextController;
late bool passwordVisibility;
@@ -56,106 +41,10 @@ class SignInTemplateComponentModel
return null;
}
- Future checkLocals({
- String? cliUUID,
- required BuildContext context,
- required FlutterFlowModel model,
- }) async {
- final GetLocalsCall callback = PhpGroup.getLocalsCall;
- final response = await callback.call();
- if (response.jsonBody['error']) {
- DialogUtil.errorDefault(context);
- return false;
- }
- List locals = response.jsonBody['locais'] ?? [];
- if (locals.isEmpty) {
- return false;
- } else {
- return true;
- }
- }
- Future signInLoginAction(
- BuildContext context,
- FlutterFlowModel model, {
- String? emailAdress,
- String? password,
- }) async {
- try {
- final ApiCallResponse? response;
- final LoginCall callback = PhpGroup.loginCall;
- StorageUtil().deviceDescription = randomString(
- 10,
- 10,
- true,
- false,
- false,
- );
-
- final String? devUUID;
- final String userUUID;
- final String status;
- final String userDevUUID;
- final String userName;
- final String email;
- final String passwd;
-
- email = emailAdress!;
- passwd = password!;
-
- devUUID = await DeviceUtil.getDevUUID();
-
- if ((email != '') && (passwd != '')) {
- StorageUtil().email = email;
- StorageUtil().passwd = passwd;
- StorageUtil().devUUID = devUUID!;
- response = await callback.call();
-
- if (response.jsonBody['error'] == false) {
- userUUID = response.jsonBody['uid'];
- status = response.jsonBody['user']['status'];
- userDevUUID = response.jsonBody['user']['dev_id'];
- userName = response.jsonBody['user']['name'];
-
- StorageUtil().userUUID = userUUID;
- StorageUtil().userDevUUID = userDevUUID;
- StorageUtil().status = status;
- StorageUtil().userName = userName;
-
- await checkLocals(context: context, model: model).then((value) {
- StorageUtil().haveLocal = value;
- StorageUtil().isLogged = true;
- toggleApp(context);
- });
- } else {
- if (response.jsonBody['error'] == null) {
- DialogUtil.errorDefault(context);
- } else {
- DialogUtil.error(
- context, response.jsonBody['error_msg'].toString());
- }
- }
- }
-
- return;
- } catch (e, s) {
- DialogUtil.errorDefault(context);
- LogUtil.requestAPIFailed(
- 'login.php', emailAdress.toString(), "Login", e, s);
- }
- }
-
- Future toggleApp(BuildContext context) async {
- final haveLocal = StorageUtil().haveLocal;
- if (haveLocal == true) {
- context.go('/homePage');
- } else if (haveLocal == false) {
- context.go('/receptionPage');
- }
- }
@override
void initState(BuildContext context) {
diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart
index b9e0dc69..9bd0b5e1 100644
--- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart
+++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart
@@ -13,6 +13,7 @@ import '/flutter_flow/flutter_flow_animations.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/flutter_flow/flutter_flow_widgets.dart';
+import '../../../shared/services/authentication/authentication_service.dart';
import 'sign_in_template_component_model.dart';
export 'sign_in_template_component_model.dart';
@@ -99,15 +100,8 @@ class _SignInTemplateComponentWidgetState
}
bool _isFormInvalid() {
- if (_model.emailAddressTextController.text == '' ||
- _model.passwordTextController.text == '') {
- return true;
- }
-
- if (!ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) {
- return true;
- }
-
+ if (_model.emailAddressTextController.text == '' || _model.passwordTextController.text == '') return true;
+ if (!ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) return true;
return false;
}
@@ -131,14 +125,11 @@ class _SignInTemplateComponentWidgetState
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
- padding: const EdgeInsetsDirectional.fromSTEB(
- 0.0, 35.0, 0.0, 35.0),
+ padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 35.0),
child: Container(
width: 548.0,
height: 112.0,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(16.0),
- ),
+ decoration: BoxDecoration(borderRadius: BorderRadius.circular(16.0)),
alignment: const AlignmentDirectional(0.0, 0.0),
child: Padding(
padding: const EdgeInsets.all(20.0),
@@ -148,31 +139,24 @@ class _SignInTemplateComponentWidgetState
children: [
Expanded(
child: Align(
- alignment:
- const AlignmentDirectional(0.0, 1.0),
+ alignment: const AlignmentDirectional(0.0, 1.0),
child: Padding(
padding: const EdgeInsets.all(3.0),
child: Text(
- FFLocalizations.of(context)
- .getVariableText(
- ptText:
- 'VAMOS LÁ! ENTRE COM A SUA CONTA',
- enText:
- 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT',
+ FFLocalizations.of(context).getVariableText(
+ ptText: 'VAMOS LÁ! ENTRE COM A SUA CONTA',
+ enText: 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT',
),
textAlign: TextAlign.start,
style: FlutterFlowTheme.of(context)
.displaySmall
.override(
fontFamily: 'Plus Jakarta Sans',
- color: FlutterFlowTheme.of(context)
- .primaryText,
+ color: FlutterFlowTheme.of(context).primaryText,
fontSize: 24.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
- useGoogleFonts: GoogleFonts.asMap()
- .containsKey(
- 'Plus Jakarta Sans'),
+ useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
),
),
),
@@ -189,8 +173,7 @@ class _SignInTemplateComponentWidgetState
decoration: const BoxDecoration(),
child: ClipRRect(
borderRadius: BorderRadius.circular(8.0),
- child: const AtomImageSvgTheme(
- filename: 'login', width: 600, height: 155),
+ child: const AtomImageSvgTheme(filename: 'login', width: 600, height: 155),
),
),
Column(
@@ -199,16 +182,12 @@ class _SignInTemplateComponentWidgetState
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: Padding(
- padding: const EdgeInsetsDirectional.fromSTEB(
- 34.0, 0.0, 34.0, 0.0),
+ padding: const EdgeInsetsDirectional.fromSTEB(34.0, 0.0, 34.0, 0.0),
child: Container(
width: double.infinity,
- constraints: const BoxConstraints(
- maxWidth: 570.0,
- ),
+ constraints: const BoxConstraints(maxWidth: 570.0,),
decoration: BoxDecoration(
- color: FlutterFlowTheme.of(context)
- .primaryBackground,
+ color: FlutterFlowTheme.of(context).primaryBackground,
borderRadius: BorderRadius.circular(12.0),
shape: BoxShape.rectangle,
),
@@ -218,8 +197,7 @@ class _SignInTemplateComponentWidgetState
padding: const EdgeInsets.all(32.0),
child: Column(
mainAxisSize: MainAxisSize.max,
- crossAxisAlignment:
- CrossAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
children: [
Form(
key: _model.formKey,
@@ -237,7 +215,7 @@ class _SignInTemplateComponentWidgetState
width: double.infinity,
child: TextFormField(
key: const ValueKey(
- 'emailField'),
+ 'emailTextFormField'),
controller: _model
.emailAddressTextController,
focusNode: _model
@@ -378,324 +356,159 @@ class _SignInTemplateComponentWidgetState
),
),
Padding(
- padding:
- const EdgeInsetsDirectional
- .fromSTEB(
- 0.0, 0.0, 0.0, 16.0),
+ padding: const EdgeInsetsDirectional .fromSTEB(0.0, 0.0, 0.0, 16.0),
child: SizedBox(
width: double.infinity,
child: TextFormField(
- key: const ValueKey(
- 'passwordField'),
- controller: _model
- .passwordTextController,
- cursorColor:
- FlutterFlowTheme.of(
- context)
- .primary,
- focusNode:
- _model.passwordFocusNode,
- onChanged: (_) =>
- EasyDebounce.debounce(
+ key: const ValueKey('passwordTextFormField'),
+ controller: _model.passwordTextController,
+ cursorColor: FlutterFlowTheme.of(context).primary,
+ focusNode: _model.passwordFocusNode,
+ onChanged: (_) => EasyDebounce.debounce(
'_model.passwordTextController',
- const Duration(
- milliseconds: 500),
- () => setState(() {}),
+ const Duration(milliseconds: 500),
+ () => setState(() {})
),
autofocus: true,
- autofillHints: const [
- AutofillHints.password
- ],
- textInputAction:
- TextInputAction.send,
- obscureText: !_model
- .passwordVisibility,
+ autofillHints: const [AutofillHints.password],
+ textInputAction: TextInputAction.send,
+ obscureText: !_model.passwordVisibility,
decoration: InputDecoration(
isDense: true,
- labelText:
- FFLocalizations.of(
- context)
- .getText(
- '2x19ce8k' /* Senha */,
- ),
- labelStyle: FlutterFlowTheme
- .of(context)
+ labelText: FFLocalizations.of(context).getText('2x19ce8k' /* Senha */),
+ labelStyle: FlutterFlowTheme.of(context)
.labelLarge
.override(
- fontFamily:
- 'Plus Jakarta Sans',
- color: FlutterFlowTheme
- .of(context)
- .primaryText,
+ fontFamily: 'Plus Jakarta Sans',
+ color: FlutterFlowTheme.of(context).primaryText,
fontSize: 16.0,
letterSpacing: 0.0,
- fontWeight:
- FontWeight.w500,
- useGoogleFonts:
- GoogleFonts
- .asMap()
- .containsKey(
- 'Plus Jakarta Sans'),
- ),
- enabledBorder:
- OutlineInputBorder(
+ fontWeight: FontWeight.w500,
+ useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
+ enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
- color:
- FlutterFlowTheme.of(
- context)
- .customColor1,
- width: 0.25,
- ),
- borderRadius:
- BorderRadius.circular(
- 12.0),
+ color: FlutterFlowTheme.of(context).customColor1,
+ width: 0.25),
+ borderRadius: BorderRadius.circular(12.0),
),
- focusedBorder:
- OutlineInputBorder(
- borderSide:
- const BorderSide(
- color:
- Color(0xFF1AAB5F),
- width: 0.25,
- ),
- borderRadius:
- BorderRadius.circular(
- 12.0),
+ focusedBorder: OutlineInputBorder(
+ borderSide: const BorderSide(
+ color:Color(0xFF1AAB5F),
+ width: 0.25),
+ borderRadius: BorderRadius.circular(12.0)),
+ errorBorder: OutlineInputBorder(
+ borderSide: const BorderSide(
+ color: Color(0xFFFF5963),
+ width: 0.25),
+ borderRadius: BorderRadius.circular(12.0),
),
- errorBorder:
- OutlineInputBorder(
- borderSide:
- const BorderSide(
- color:
- Color(0xFFFF5963),
- width: 0.25,
- ),
- borderRadius:
- BorderRadius.circular(
- 12.0),
- ),
- focusedErrorBorder:
- OutlineInputBorder(
- borderSide:
- const BorderSide(
- color:
- Color(0xFFFF5963),
- width: 0.25,
- ),
- borderRadius:
- BorderRadius.circular(
- 12.0),
+ focusedErrorBorder: OutlineInputBorder(
+ borderSide: const BorderSide(
+ color: Color(0xFFFF5963),
+ width: 0.25),
+ borderRadius: BorderRadius.circular(12.0),
),
filled: true,
- fillColor:
- FlutterFlowTheme.of(
- context)
- .primaryBackground,
+ fillColor: FlutterFlowTheme.of(context).primaryBackground,
suffixIcon: InkWell(
- onTap: () => setState(
- () => _model
- .passwordVisibility =
- !_model
- .passwordVisibility,
- ),
- focusNode: FocusNode(
- skipTraversal: true),
+ onTap: () => setState(() => _model.passwordVisibility = !_model.passwordVisibility),
+ focusNode: FocusNode(skipTraversal: true),
child: Icon(
- _model.passwordVisibility
- ? Icons
- .visibility_outlined
- : Icons
- .visibility_off_outlined,
- color:
- FlutterFlowTheme.of(
- context)
- .accent1,
- size: 24.0,
- ),
+ _model.passwordVisibility ? Icons.visibility_outlined : Icons.visibility_off_outlined,
+ color:FlutterFlowTheme.of(context).accent1,
+ size: 24.0),
),
),
- style: FlutterFlowTheme.of(
- context)
+ style: FlutterFlowTheme.of(context)
.bodyLarge
.override(
- fontFamily:
- 'Plus Jakarta Sans',
- color:
- FlutterFlowTheme.of(
- context)
- .primaryText,
+ fontFamily: 'Plus Jakarta Sans',
+ color: FlutterFlowTheme.of(context).primaryText,
fontSize: 16.0,
letterSpacing: 0.0,
- fontWeight:
- FontWeight.w500,
- useGoogleFonts: GoogleFonts
- .asMap()
- .containsKey(
- 'Plus Jakarta Sans'),
+ fontWeight: FontWeight.w500,
+ useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
),
- validator: _model
- .passwordTextControllerValidator
- .asValidator(context),
+ validator: _model.passwordTextControllerValidator.asValidator(context),
),
),
),
],
),
),
+
+
Builder(
builder: (context) {
- if (MediaQuery.sizeOf(context).width <
- kBreakpointSmall
- ? true
- : false) {
+ if (MediaQuery.sizeOf(context).width < kBreakpointSmall ? true : false) {
return Column(
mainAxisSize: MainAxisSize.max,
children: [
Padding(
- padding:
- const EdgeInsetsDirectional
- .fromSTEB(
- 0.0, 0.0, 0.0, 16.0),
+ padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
child: FFButtonWidget(
+ key: const ValueKey('SubmitButtonWidget'),
onPressed: _isFormInvalid()
? null
: () async {
- await _model
- .signInLoginAction(
- context,
- _model,
- emailAdress: _model
- .emailAddressTextController
- .text,
- password: _model
- .passwordTextController
- .text,
+ await AuthenticationService.signIn(context, _model,
+ emailAdress: _model.emailAddressTextController.text,
+ password: _model.passwordTextController.text,
);
setState(() {});
},
- text: FFLocalizations.of(
- context)
- .getText(
- 'k44tm7wo' /* Entrar */,
- ),
+ text: FFLocalizations.of(context).getText('k44tm7wo' /* Entrar */),
options: FFButtonOptions(
width: double.infinity,
height: 44.0,
- padding:
- const EdgeInsetsDirectional
- .fromSTEB(0.0,
- 0.0, 0.0, 0.0),
- iconPadding:
- const EdgeInsetsDirectional
- .fromSTEB(0.0,
- 0.0, 0.0, 0.0),
- color:
- FlutterFlowTheme.of(
- context)
- .primary,
- textStyle:
- FlutterFlowTheme.of(
- context)
- .titleSmall
- .override(
- fontFamily:
- 'Plus Jakarta Sans',
- color: FlutterFlowTheme.of(
- context)
- .info,
+ padding: const EdgeInsetsDirectional.fromSTEB(0.0,0.0, 0.0, 0.0),
+ iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0,0.0, 0.0, 0.0),
+ color: FlutterFlowTheme.of(context).primary,
+ textStyle: FlutterFlowTheme.of(context).titleSmall.override(
+ fontFamily: 'Plus Jakarta Sans',
+ color: FlutterFlowTheme.of(context).info,
fontSize: 16.0,
- letterSpacing:
- 0.0,
- fontWeight:
- FontWeight
- .w500,
- useGoogleFonts: GoogleFonts
- .asMap()
- .containsKey(
- 'Plus Jakarta Sans'),
- ),
+ letterSpacing: 0.0,
+ fontWeight: FontWeight.w500,
+ useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans')),
elevation: 3.0,
- borderSide:
- const BorderSide(
- color:
- Colors.transparent,
- width: 1.0,
- ),
- borderRadius:
- BorderRadius.circular(
- 12.0),
- disabledColor:
- FlutterFlowTheme.of(
- context)
- .customColor5,
- disabledTextColor:
- Colors.white,
+ borderSide: const BorderSide(
+ color: Colors.transparent,
+ width: 1.0),
+ borderRadius: BorderRadius.circular(12.0),
+ disabledColor: FlutterFlowTheme.of(context).customColor5,
+ disabledTextColor: Colors.white,
),
showLoadingIndicator: false,
),
),
Padding(
- padding:
- const EdgeInsetsDirectional
- .fromSTEB(
- 0.0, 0.0, 0.0, 16.0),
+ padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
child: FFButtonWidget(
- onPressed: () async {
- await widget
- .toggleSignUpPage
- ?.call();
- },
- text: FFLocalizations.of(
- context)
- .getText(
- '14u7ipws' /* Cadastrar */,
+ key: const ValueKey('toggleSignUpPage'),
+ onPressed: () async => await widget.toggleSignUpPage?.call(),
+ text: FFLocalizations.of(context).getText('14u7ipws' /* Cadastrar */,
),
options: FFButtonOptions(
width: double.infinity,
height: 44.0,
- padding:
- const EdgeInsetsDirectional
- .fromSTEB(0.0,
- 0.0, 0.0, 0.0),
- iconPadding:
- const EdgeInsetsDirectional
- .fromSTEB(0.0,
- 0.0, 0.0, 0.0),
- color:
- FlutterFlowTheme.of(
- context)
- .customColor1,
+ padding: const EdgeInsetsDirectional.fromSTEB(0.0,0.0, 0.0, 0.0),
+ iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
+ color: FlutterFlowTheme.of(context).customColor1,
textStyle:
- FlutterFlowTheme.of(
- context)
+ FlutterFlowTheme.of(context)
.titleSmall
.override(
- fontFamily:
- 'Plus Jakarta Sans',
- color: FlutterFlowTheme.of(
- context)
- .secondaryText,
+ fontFamily: 'Plus Jakarta Sans',
+ color: FlutterFlowTheme.of(context).secondaryText,
fontSize: 16.0,
- letterSpacing:
- 0.0,
- fontWeight:
- FontWeight
- .w500,
- useGoogleFonts: GoogleFonts
- .asMap()
- .containsKey(
- 'Plus Jakarta Sans'),
+ letterSpacing: 0.0,
+ fontWeight: FontWeight.w500,
+ useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
),
elevation: 3.0,
- borderSide:
- const BorderSide(
- color:
- Colors.transparent,
- width: 1.0,
- ),
- borderRadius:
- BorderRadius.circular(
- 12.0),
+ borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
+ borderRadius: BorderRadius.circular(12.0),
),
showLoadingIndicator: false,
),
@@ -705,109 +518,59 @@ class _SignInTemplateComponentWidgetState
} else {
return Row(
mainAxisSize: MainAxisSize.max,
- mainAxisAlignment:
- MainAxisAlignment.spaceEvenly,
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expanded(
child: Padding(
padding:
const EdgeInsetsDirectional
- .fromSTEB(0.0, 0.0,
- 0.0, 16.0),
+ .fromSTEB(0.0, 0.0,0.0, 16.0),
child: FFButtonWidget(
- key: const ValueKey<
- String>(
- 'loginCallback'),
- onPressed:
- _isFormInvalid()
- ? null
- : () async {
+ key: const ValueKey('SubmitButtonWidget'),
+ onPressed: _isFormInvalid() ? null : () async {
try {
- await _model
- .signInLoginAction(
+ await AuthenticationService.signIn(
context,
_model,
- emailAdress: _model
- .emailAddressTextController
- .text,
- password: _model
- .passwordTextController
- .text,
+ emailAdress: _model.emailAddressTextController.text,
+ password: _model.passwordTextController.text,
);
- setState(
- () {});
+ setState(() {});
} catch (e, s) {
- await DialogUtil
- .errorDefault(
- context);
+ await DialogUtil.errorDefault(context);
LogUtil.requestAPIFailed(
'login.php',
- _model
- .emailAddressTextController
- .text,
+ _model.emailAddressTextController.text,
"Login",
- e,
- s);
+ e, s);
}
},
- text: FFLocalizations.of(
- context)
- .getText(
- '1x926nsn' /* Entrar */,
- ),
+ text: FFLocalizations.of(context).getText('1x926nsn'),
options: FFButtonOptions(
width: double.infinity,
height: 44.0,
- padding:
- const EdgeInsetsDirectional
- .fromSTEB(0.0,
- 0.0, 0.0, 0.0),
- iconPadding:
- const EdgeInsetsDirectional
- .fromSTEB(0.0,
- 0.0, 0.0, 0.0),
- color:
- FlutterFlowTheme.of(
- context)
- .accent1,
- textStyle:
- FlutterFlowTheme.of(
- context)
+ padding: const EdgeInsetsDirectional.fromSTEB(0.0,0.0, 0.0, 0.0),
+ iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
+ color: FlutterFlowTheme.of(context).accent1,
+ textStyle: FlutterFlowTheme.of(context)
.titleSmall
.override(
- fontFamily:
- 'Plus Jakarta Sans',
- color: FlutterFlowTheme.of(
- context)
- .info,
- fontSize:
- 16.0,
- letterSpacing:
- 0.0,
- fontWeight:
- FontWeight
- .w500,
- useGoogleFonts: GoogleFonts
- .asMap()
- .containsKey(
- 'Plus Jakarta Sans'),
+ fontFamily: 'Plus Jakarta Sans',
+ color: FlutterFlowTheme.of(context).info,
+ fontSize: 16.0,
+ letterSpacing: 0.0,
+ fontWeight: FontWeight.w500,
+ useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
),
elevation: 3.0,
- borderSide:
- const BorderSide(
- color: Colors
- .transparent,
+ borderSide: const BorderSide(
+ color: Colors.transparent,
width: 1.0,
),
- borderRadius:
- BorderRadius
- .circular(12.0),
- disabledColor:
- const Color(
- 0xE81AAB5F),
+ borderRadius: BorderRadius.circular(12.0),
+ disabledColor: const Color(0xE81AAB5F),
),
- showLoadingIndicator:
- true,
+ showLoadingIndicator: true,
),
),
),
@@ -818,79 +581,45 @@ class _SignInTemplateComponentWidgetState
.fromSTEB(0.0, 0.0,
0.0, 16.0),
child: FFButtonWidget(
- onPressed: () async {
- await widget
- .toggleSignUpPage
- ?.call();
- },
- text: FFLocalizations.of(
- context)
- .getText(
- 'jwvd4ai1' /* Cadastrar */,
- ),
+ key: const ValueKey('toggleSignUpPage'),
+ onPressed: () async => await widget.toggleSignUpPage?.call(),
+ text: FFLocalizations.of(context).getText('jwvd4ai1' /* Cadastrar */),
options: FFButtonOptions(
width: double.infinity,
height: 44.0,
- padding:
- const EdgeInsetsDirectional
- .fromSTEB(0.0,
- 0.0, 0.0, 0.0),
- iconPadding:
- const EdgeInsetsDirectional
- .fromSTEB(0.0,
- 0.0, 0.0, 0.0),
- color:
- FlutterFlowTheme.of(
- context)
- .customColor1,
+ padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
+ iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
+ color: FlutterFlowTheme.of(context).customColor1,
textStyle:
- FlutterFlowTheme.of(
- context)
+ FlutterFlowTheme
+ .of(context)
.titleSmall
.override(
- fontFamily:
- 'Plus Jakarta Sans',
- color: FlutterFlowTheme.of(
- context)
- .secondaryText,
- fontSize:
- 16.0,
- letterSpacing:
- 0.0,
- fontWeight:
- FontWeight
- .w500,
- useGoogleFonts: GoogleFonts
- .asMap()
- .containsKey(
- 'Plus Jakarta Sans'),
+ fontFamily: 'Plus Jakarta Sans',
+ color: FlutterFlowTheme.of(context).secondaryText,
+ fontSize: 16.0,
+ letterSpacing: 0.0,
+ fontWeight: FontWeight.w500,
+ useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
),
elevation: 3.0,
- borderSide:
- const BorderSide(
- color: Colors
- .transparent,
- width: 1.0,
- ),
- borderRadius:
- BorderRadius
- .circular(12.0),
+ borderSide: const BorderSide(color: Colors.transparent,width: 1.0,),
+ borderRadius: BorderRadius.circular(12.0),
),
- showLoadingIndicator:
- false,
+ showLoadingIndicator: false,
),
),
),
- ].divide(
- const SizedBox(width: 7.0)),
- );
+ ].divide(const SizedBox(width: 7.0)));
}
},
),
+
+
Padding(
- padding: const EdgeInsetsDirectional
- .fromSTEB(0.0, 12.0, 0.0, 12.0),
+ padding: const EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 12.0),
child: InkWell(
+ key: const ValueKey('ForgotPassword'),
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
@@ -898,100 +627,42 @@ class _SignInTemplateComponentWidgetState
onTap: () async {
await showModalBottomSheet(
isScrollControlled: true,
- backgroundColor:
- Colors.transparent,
+ backgroundColor: Colors.transparent,
context: context,
builder: (context) {
return Padding(
- padding:
- MediaQuery.viewInsetsOf(
- context),
- child:
- const ForgotPasswordTemplateComponentWidget(),
+ padding: MediaQuery.viewInsetsOf(context),
+ child: const ForgotPasswordTemplateComponentWidget(),
);
- },
- ).then(
- (value) => safeSetState(() {}));
- },
+ }).then((value) => safeSetState(() {}));
+ },
child: RichText(
- textScaler: MediaQuery.of(context)
- .textScaler,
+ textScaler: MediaQuery.of(context).textScaler,
text: TextSpan(
children: [
TextSpan(
- text: FFLocalizations.of(
- context)
- .getText(
- '05dx91ku' /* Você esqueceu a sua senha? */,
- ),
- style: TextStyle(
- color: FlutterFlowTheme.of(
- context)
- .primaryText,
- ),
+ text: FFLocalizations.of(context).getText('05dx91ku' /* Você esqueceu a sua senha? */,),
+ style: TextStyle(color: FlutterFlowTheme.of(context).primaryText),
),
TextSpan(
- text: FFLocalizations.of(
- context)
- .getText(
- 'p5c6d54y' /* Recupere aqui */,
- ),
- style: FlutterFlowTheme.of(
- context)
- .bodyMedium
- .override(
- fontFamily:
- 'Plus Jakarta Sans',
- color:
- FlutterFlowTheme.of(
- context)
- .primary,
+ text: FFLocalizations.of(context).getText('p5c6d54y' /* Recupere aqui */),
+ style: FlutterFlowTheme.of(context).bodyMedium.override(
+ fontFamily: 'Plus Jakarta Sans',
+ color: FlutterFlowTheme.of(context).primary,
fontSize: 14.0,
letterSpacing: 0.0,
- fontWeight:
- FontWeight.normal,
- useGoogleFonts: GoogleFonts
- .asMap()
- .containsKey(
- 'Plus Jakarta Sans'),
+ fontWeight: FontWeight.normal,
+ useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
),
- mouseCursor:
- SystemMouseCursors.click,
- // recognizer: TapGestureRecognizer()
- // ..onTap = () async {
- // await showModalBottomSheet(
- // isScrollControlled: true,
- // backgroundColor: Colors.transparent,
- // context: context,
- // useRootNavigator: true,
- // builder: (context) {
- // return Padding(
- // padding: MediaQuery.viewInsetsOf(context),
- // child: const ForgotPasswordTemplateComponentWidget(),
- // );
- // },
- // ).then((value) =>
- // safeSetState(
- // () {}));
- // },
+ mouseCursor: SystemMouseCursors.click,
)
],
- style:
- FlutterFlowTheme.of(context)
+ style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
- fontFamily:
- FlutterFlowTheme.of(
- context)
- .bodyMediumFamily,
+ fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
letterSpacing: 0.0,
- useGoogleFonts: GoogleFonts
- .asMap()
- .containsKey(
- FlutterFlowTheme.of(
- context)
- .bodyMediumFamily),
- ),
+ useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily)),
),
),
),
diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart
index c4f839da..c07deb16 100644
--- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart
+++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart
@@ -1,25 +1,17 @@
-import 'package:hub/backend/api_requests/api_calls.dart';
-import 'package:hub/flutter_flow/random_data_util.dart';
-import 'package:hub/shared/utils/dialog_util.dart';
-import 'package:hub/shared/utils/log_util.dart';
+import 'package:flutter/material.dart';
import '/flutter_flow/flutter_flow_util.dart';
import 'sign_up_template_component_widget.dart'
show SignUpTemplateComponentWidget;
-import 'package:flutter/material.dart';
class SignUpTemplateComponentModel
extends FlutterFlowModel {
- /// State fields for stateful widgets in this component.
final formKey = GlobalKey();
- // State field(s) for nameRegisterForm widget.
FocusNode? nameRegisterFormFocusNode;
TextEditingController? nameRegisterFormTextController;
- String? Function(BuildContext, String?)?
- nameRegisterFormTextControllerValidator;
- String? _nameRegisterFormTextControllerValidator(
- BuildContext context, String? val) {
+ String? Function(BuildContext, String?)? nameRegisterFormTextControllerValidator;
+ String? _nameRegisterFormTextControllerValidator(BuildContext context, String? val) {
if (val == null || val.isEmpty) {
return FFLocalizations.of(context).getText(
'3bs10dfq' /* Campo é necessário */,
@@ -29,13 +21,10 @@ class SignUpTemplateComponentModel
return null;
}
- // State field(s) for emailRegisterForm widget.
FocusNode? emailRegisterFormFocusNode;
TextEditingController? emailRegisterFormTextController;
- String? Function(BuildContext, String?)?
- emailRegisterFormTextControllerValidator;
- String? _emailRegisterFormTextControllerValidator(
- BuildContext context, String? val) {
+ String? Function(BuildContext, String?)? emailRegisterFormTextControllerValidator;
+ String? _emailRegisterFormTextControllerValidator(BuildContext context, String? val) {
if (val == null || val.isEmpty) {
return FFLocalizations.of(context).getText(
'mlvw63yj' /* Campo é necessário */,
@@ -50,14 +39,11 @@ class SignUpTemplateComponentModel
return null;
}
- // State field(s) for passwordRegisterForm widget.
FocusNode? passwordRegisterFormFocusNode;
TextEditingController? passwordRegisterFormTextController;
late bool passwordRegisterFormVisibility;
- String? Function(BuildContext, String?)?
- passwordRegisterFormTextControllerValidator;
- String? _passwordRegisterFormTextControllerValidator(
- BuildContext context, String? val) {
+ String? Function(BuildContext, String?)? passwordRegisterFormTextControllerValidator;
+ String? _passwordRegisterFormTextControllerValidator(BuildContext context, String? val) {
if (val == null || val.isEmpty) {
return FFLocalizations.of(context).getText(
'6nn79lmh' /* Campo é necessário */,
@@ -73,18 +59,14 @@ class SignUpTemplateComponentModel
return null;
}
- // Stores action output result for [Action Block - signUpRegisterAction] action in SignUpButtonRegisterForm widget.
- bool? signUp;
+ bool? register;
@override
void initState(BuildContext context) {
- nameRegisterFormTextControllerValidator =
- _nameRegisterFormTextControllerValidator;
- emailRegisterFormTextControllerValidator =
- _emailRegisterFormTextControllerValidator;
+ nameRegisterFormTextControllerValidator = _nameRegisterFormTextControllerValidator;
+ emailRegisterFormTextControllerValidator = _emailRegisterFormTextControllerValidator;
passwordRegisterFormVisibility = false;
- passwordRegisterFormTextControllerValidator =
- _passwordRegisterFormTextControllerValidator;
+ passwordRegisterFormTextControllerValidator = _passwordRegisterFormTextControllerValidator;
}
@override
@@ -99,61 +81,6 @@ class SignUpTemplateComponentModel
passwordRegisterFormTextController?.dispose();
}
- Future signUpRegisterAction(
- BuildContext context, {
- required String? name,
- String? passwd,
- required String? email,
- String? device,
- }) async {
- try {
- ApiCallResponse? response;
- if ((email != null && email != '') &&
- (passwd != null && passwd != '' && passwd.length > 7) &&
- (name != null && name != '')) {
- response = await PhpGroup.registerCall.call(
- name: name,
- password: passwd,
- email: email,
- token: randomString(
- 36,
- 36,
- false,
- false,
- true,
- ),
- uuid: randomString(
- 36,
- 36,
- false,
- false,
- true,
- ),
- tipo: device!,
- descricao: randomString(
- 36,
- 36,
- true,
- false,
- false,
- ),
- );
- if (response.jsonBody['error'] == false) {
- return true;
- }
- DialogUtil.error(context, response.jsonBody['error_msg']);
- return false;
- } else {
- DialogUtil.errorDefault(context);
- return false;
- }
- } catch (e, s) {
- DialogUtil.errorDefault(context);
- LogUtil.requestAPIFailed(
- 'registro.php', email.toString(), "Register", e, s);
- return false;
- }
- }
}
diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart
index 8dd9accf..14003cdb 100644
--- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart
+++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart
@@ -4,35 +4,26 @@ import 'package:flutter_animate/flutter_animate.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
import 'package:hub/shared/components/atoms/atom_terms_of_use.dart';
-import 'package:hub/shared/helpers/secure_storage_helper.dart';
import 'package:hub/shared/utils/storage_util.dart';
import 'package:hub/shared/utils/validator_util.dart';
-import 'package:provider/provider.dart';
import '/flutter_flow/flutter_flow_animations.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/flutter_flow/flutter_flow_widgets.dart';
+import '../../../shared/services/authentication/authentication_service.dart';
import 'sign_up_template_component_model.dart';
export 'sign_up_template_component_model.dart';
class SignUpTemplateComponentWidget extends StatefulWidget {
- const SignUpTemplateComponentWidget({
- super.key,
- required this.toggleSignInPage,
- });
+ const SignUpTemplateComponentWidget({super.key, required this.toggleSignInPage});
final Future Function()? toggleSignInPage;
-
- @override
- State createState() =>
- _SignUpTemplateComponentWidgetState();
+ @override State createState() => _SignUpTemplateComponentWidgetState();
}
-class _SignUpTemplateComponentWidgetState
- extends State with TickerProviderStateMixin {
+class _SignUpTemplateComponentWidgetState extends State with TickerProviderStateMixin {
late SignUpTemplateComponentModel _model;
-
final animationsMap = {};
@override
@@ -246,6 +237,8 @@ class _SignUpTemplateComponentWidgetState
child: SizedBox(
width: double.infinity,
child: TextFormField(
+ key: const ValueKey(
+ 'nameTextFormField'),
controller: _model
.nameRegisterFormTextController,
focusNode: _model
@@ -388,6 +381,8 @@ class _SignUpTemplateComponentWidgetState
child: SizedBox(
width: double.infinity,
child: TextFormField(
+ key: const ValueKey(
+ 'emailTextFormField'),
controller: _model
.emailRegisterFormTextController,
focusNode: _model
@@ -532,6 +527,8 @@ class _SignUpTemplateComponentWidgetState
child: SizedBox(
width: double.infinity,
child: TextFormField(
+ key: const ValueKey(
+ 'passwordTextFormField'),
controller: _model
.passwordRegisterFormTextController,
focusNode: _model
@@ -631,6 +628,7 @@ class _SignUpTemplateComponentWidgetState
context)
.primaryBackground,
suffixIcon: InkWell(
+ key: const ValueKey('passwordVisibilitySuffixIcon'),
onTap: () => setState(
() => _model
.passwordRegisterFormVisibility =
@@ -685,41 +683,24 @@ class _SignUpTemplateComponentWidgetState
padding: const EdgeInsetsDirectional
.fromSTEB(0.0, 0.0, 0.0, 16.0),
child: FFButtonWidget(
+ key: const ValueKey('SubmitButtonWidget'),
onPressed: isFormInvalid()
? null
: () async {
var shouldSetState = false;
- _model.signUp = await _model
- .signUpRegisterAction(
- context,
- name: _model
- .nameRegisterFormTextController
- .text,
- passwd: _model
- .passwordRegisterFormTextController
- .text,
- email: _model
- .emailRegisterFormTextController
- .text,
- device:
- StorageUtil()
- .deviceType,
+ _model.register = await AuthenticationService.signUp(context,
+ email: _model.emailRegisterFormTextController.text,
+ name: _model.nameRegisterFormTextController.text,
+ passwd: _model.passwordRegisterFormTextController.text,
+ device: StorageUtil().deviceType,
);
shouldSetState = true;
- if (_model.signUp == true) {
- await widget
- .toggleSignInPage
- ?.call();
- } else {
- if (shouldSetState) {
- setState(() {});
- }
+ if (_model.register == true) await widget.toggleSignInPage?.call();
+ else {
+ if (shouldSetState) setState(() {});
return;
}
-
- if (shouldSetState) {
- setState(() {});
- }
+ if (shouldSetState) setState(() {});
},
text: FFLocalizations.of(context)
.getText(
@@ -774,14 +755,12 @@ class _SignUpTemplateComponentWidgetState
padding: const EdgeInsetsDirectional
.fromSTEB(0.0, 12.0, 0.0, 12.0),
child: InkWell(
+ key: const ValueKey('toggleSignInPage'),
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
- onTap: () async {
- await widget.toggleSignInPage
- ?.call();
- },
+ onTap: () async => await widget.toggleSignInPage?.call(),
child: RichText(
textScaler: MediaQuery.of(context)
.textScaler,
diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart
index 1188b53b..15e64040 100644
--- a/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart
+++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart
@@ -1,10 +1,9 @@
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
+import 'package:flutter/material.dart';
import 'package:hub/shared/utils/storage_util.dart';
import '/backend/api_requests/api_calls.dart';
import '/flutter_flow/flutter_flow_util.dart';
import 'view_visit_detail_widget.dart' show ViewVisitDetailWidget;
-import 'package:flutter/material.dart';
class ViewVisitDetailModel extends FlutterFlowModel {
late final String devUUID;
diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart
index d0695010..a8efa6c4 100644
--- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart
+++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart
@@ -1,9 +1,7 @@
+import 'package:flutter/material.dart';
import 'package:hub/backend/api_requests/api_manager.dart';
import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart';
import 'package:hub/flutter_flow/flutter_flow_model.dart';
-
-import 'package:flutter/material.dart';
-import 'package:hub/shared/helpers/sqlite_storage_helper.dart';
import 'package:hub/shared/utils/storage_util.dart';
class VisitorSearchModalTemplateComponentModel
diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart
index 584b48fe..3978059b 100644
--- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart
+++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart
@@ -12,7 +12,6 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
import 'package:hub/flutter_flow/nav/nav.dart';
-import 'package:provider/provider.dart';
class VisitorSearchModalTemplateComponentWidget extends StatefulWidget {
const VisitorSearchModalTemplateComponentWidget({
@@ -34,7 +33,6 @@ class _VisitorSearchModalTemplateComponentWidgetState
with TickerProviderStateMixin {
late VisitorSearchModalTemplateComponentModel _model;
- @override
safeSetState(VoidCallback callback) {
super.setState(callback);
_model.onUpdate();
diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart
index 21411d4f..5c0f0aa0 100644
--- a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart
+++ b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart
@@ -26,11 +26,8 @@ class WelcomeTemplateComponentWidget extends StatefulWidget {
_WelcomeTemplateComponentWidgetState();
}
-class _WelcomeTemplateComponentWidgetState
- extends State
- with TickerProviderStateMixin {
+class _WelcomeTemplateComponentWidgetState extends State with TickerProviderStateMixin {
late WelcomeTemplateComponentModel _model;
-
final animationsMap = {};
@override
@@ -44,38 +41,39 @@ class _WelcomeTemplateComponentWidgetState
super.initState();
_model = createModel(context, () => WelcomeTemplateComponentModel());
- animationsMap.addAll({
- 'containerOnPageLoadAnimation': AnimationInfo(
- trigger: AnimationTrigger.onPageLoad,
- effectsBuilder: () => [
- VisibilityEffect(duration: 1.ms),
- FadeEffect(
- curve: Curves.easeInOut,
- delay: 0.0.ms,
- duration: 300.0.ms,
- begin: 0.0,
- end: 1.0,
- ),
- MoveEffect(
- curve: Curves.easeInOut,
- delay: 0.0.ms,
- duration: 300.0.ms,
- begin: const Offset(0.0, 140.0),
- end: const Offset(0.0, 0.0),
- ),
- ScaleEffect(
- curve: Curves.easeInOut,
- delay: 0.0.ms,
- duration: 300.0.ms,
- begin: const Offset(0.9, 0.9),
- end: const Offset(1.0, 1.0),
- ),
- TiltEffect(
- curve: Curves.easeInOut,
- delay: 0.0.ms,
- duration: 300.0.ms,
- begin: const Offset(-0.349, 0),
- end: const Offset(0, 0),
+ animationsMap.addAll(
+ {
+ 'containerOnPageLoadAnimation': AnimationInfo(
+ trigger: AnimationTrigger.onPageLoad,
+ effectsBuilder: () => [
+ VisibilityEffect(duration: 1.ms),
+ FadeEffect(
+ curve: Curves.easeInOut,
+ delay: 0.0.ms,
+ duration: 300.0.ms,
+ begin: 0.0,
+ end: 1.0,
+ ),
+ MoveEffect(
+ curve: Curves.easeInOut,
+ delay: 0.0.ms,
+ duration: 300.0.ms,
+ begin: const Offset(0.0, 140.0),
+ end: const Offset(0.0, 0.0),
+ ),
+ ScaleEffect(
+ curve: Curves.easeInOut,
+ delay: 0.0.ms,
+ duration: 300.0.ms,
+ begin: const Offset(0.9, 0.9),
+ end: const Offset(1.0, 1.0),
+ ),
+ TiltEffect(
+ curve: Curves.easeInOut,
+ delay: 0.0.ms,
+ duration: 300.0.ms,
+ begin: const Offset(-0.349, 0),
+ end: const Offset(0, 0),
),
],
),
@@ -85,7 +83,6 @@ class _WelcomeTemplateComponentWidgetState
@override
void dispose() {
_model.maybeDispose();
-
super.dispose();
}
@@ -115,10 +112,7 @@ class _WelcomeTemplateComponentWidgetState
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
- Text(
- FFLocalizations.of(context).getText(
- 'dsc9tuc8' /* UMA EXPERIÊCIA COMPLETA */,
- ),
+ Text( FFLocalizations.of(context).getText('dsc9tuc8' /* UMA EXPERIÊCIA COMPLETA */),
textAlign: TextAlign.start,
style: FlutterFlowTheme.of(context)
.displaySmall
@@ -128,28 +122,22 @@ class _WelcomeTemplateComponentWidgetState
fontSize: 24.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w600,
- useGoogleFonts: GoogleFonts.asMap()
- .containsKey('Plus Jakarta Sans'),
+ useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
),
),
Align(
alignment: const AlignmentDirectional(0.0, -1.0),
- child: Text(
- FFLocalizations.of(context).getText(
- '5bgqn16z' /* COM CONFORTO ONDE VOCÊ ESTIVER... */,
- ),
+ child: Text(FFLocalizations.of(context).getText('5bgqn16z' /* COM CONFORTO ONDE VOCÊ ESTIVER... */),
textAlign: TextAlign.start,
style: FlutterFlowTheme.of(context)
.displaySmall
.override(
fontFamily: 'Plus Jakarta Sans',
- color: FlutterFlowTheme.of(context)
- .primaryText,
+ color: FlutterFlowTheme.of(context).primaryText,
fontSize: 15.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w600,
- useGoogleFonts: GoogleFonts.asMap()
- .containsKey('Plus Jakarta Sans'),
+ useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
),
),
),
@@ -166,8 +154,7 @@ class _WelcomeTemplateComponentWidgetState
decoration: const BoxDecoration(),
child: ClipRRect(
borderRadius: BorderRadius.circular(0.0),
- child: const AtomImageSvgTheme(
- filename: 'welcome', width: 600, height: double.infinity),
+ child: const AtomImageSvgTheme(filename: 'welcome', width: 600, height: double.infinity),
),
),
Align(
@@ -184,10 +171,7 @@ class _WelcomeTemplateComponentWidgetState
BoxShadow(
blurRadius: 0.0,
color: Colors.transparent,
- offset: Offset(
- 0.0,
- 0.0,
- ),
+ offset: Offset(0.0,0.0),
)
],
borderRadius: BorderRadius.circular(12.0),
@@ -203,35 +187,23 @@ class _WelcomeTemplateComponentWidgetState
children: [
Builder(
builder: (context) {
- if (MediaQuery.sizeOf(context).width <
- kBreakpointSmall
- ? true
- : false) {
+ if (MediaQuery.sizeOf(context).width < kBreakpointSmall ? true : false) {
return Column(
mainAxisSize: MainAxisSize.max,
children: [
Padding(
- padding:
- const EdgeInsetsDirectional.fromSTEB(
- 0.0, 0.0, 0.0, 16.0),
+ padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
child: FFButtonWidget(
- key: const ValueKey(
- 'toggleSignInPage'),
+ key: const ValueKey('toggleSignInPage'),
onPressed: () async {
await widget.toggleSignInPage?.call();
},
- text:
- FFLocalizations.of(context).getText(
- 'dynet730' /* Entrar */,
- ),
+ text: FFLocalizations.of(context).getText( 'dynet730' /* Entrar */),
options: FFButtonOptions(
width: double.infinity,
height: 44.0,
- padding: const EdgeInsetsDirectional
- .fromSTEB(0.0, 0.0, 0.0, 0.0),
- iconPadding:
- const EdgeInsetsDirectional
- .fromSTEB(0.0, 0.0, 0.0, 0.0),
+ padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
+ iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
color: FlutterFlowTheme.of(context)
.primary,
textStyle: FlutterFlowTheme.of(
@@ -325,7 +297,10 @@ class _WelcomeTemplateComponentWidgetState
padding: const EdgeInsetsDirectional
.fromSTEB(0.0, 0.0, 0.0, 16.0),
child: FFButtonWidget(
+ key: const ValueKey('toggleSignInPage'),
+
onPressed: () async {
+
await widget.toggleSignInPage
?.call();
},
@@ -378,6 +353,7 @@ class _WelcomeTemplateComponentWidgetState
padding: const EdgeInsetsDirectional
.fromSTEB(0.0, 0.0, 0.0, 16.0),
child: FFButtonWidget(
+ key: const ValueKey('toggleSignUpPage'),
onPressed: () async {
await widget.toggleSignUpPage
?.call();
diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart
index fc8877a3..ffb64dcd 100644
--- a/lib/flutter_flow/internationalization.dart
+++ b/lib/flutter_flow/internationalization.dart
@@ -1321,8 +1321,8 @@ final kTranslationsMap =