From fca35f919dd4b06a8b3ee2b4e07aca11c5ab14ae Mon Sep 17 00:00:00 2001 From: "J. A. Messias" Date: Mon, 11 Nov 2024 10:14:54 -0300 Subject: [PATCH] fix get secure android id --- android/app/src/debug/AndroidManifest.xml | 129 ++- android/app/src/main/AndroidManifest.xml | 208 ++--- .../kotlin/com/freaccess/hub/MainActivity.kt | 50 +- integration_test/app_test.dart | 12 +- lib/backend/api_requests/api_calls.dart | 279 ++---- .../notifications/notification_service.dart | 3 +- .../menu_button_item_widget.dart | 8 +- .../menu_card_item/menu_card_item.dart | 8 +- .../shared_components_atoms/custom_input.dart | 2 +- .../custom_select.dart | 16 +- .../media_upload_button.dart | 238 +++-- .../menu_item/menu_item.dart | 2 +- .../message_opt_modal/opt_modal_widget.dart | 26 +- .../order_filter_modal_widget.dart | 15 +- .../throw_exception_widget.dart | 128 +-- ..._arrow_linked_locals_component_widget.dart | 16 +- .../local_profile_component_widget.dart | 7 +- .../menu_staggered_view_component_widget.dart | 6 +- .../details_component_widget.dart | 13 +- ...ot_password_template_component_widget.dart | 107 +-- .../provisional_shcedule_template_widget.dart | 119 +-- ...de_pass_key_template_component_widget.dart | 92 +- ...siter_vistor_template_component_model.dart | 2 +- ...iter_vistor_template_component_widget.dart | 76 +- .../sign_in_template_component_widget.dart | 834 +++++------------- .../sign_up_template_component_widget.dart | 80 +- ...search_modal_template_component_model.dart | 2 +- ...earch_modal_template_component_widget.dart | 28 +- .../welcome_template_component_widget.dart | 58 +- lib/flutter_flow/flutter_flow_util.dart | 22 +- lib/flutter_flow/flutter_flow_widgets.dart | 1 - lib/flutter_flow/nav/nav.dart | 14 +- lib/flutter_flow/upload_data.dart | 10 +- lib/main.dart | 10 +- .../acess_history_page_widget.dart | 5 +- .../fast_pass_page/fast_pass_page_widget.dart | 12 +- lib/pages/home_page/home_page_widget.dart | 7 +- .../message_history_page_widget.dart | 18 +- .../package_order_page.dart | 47 +- lib/pages/pets_page/pets_history_screen.dart | 21 +- lib/pages/pets_page/pets_page_model.dart | 3 +- lib/pages/pets_page/pets_page_widget.dart | 706 +++++++-------- .../preferences_settings_model.dart | 14 +- .../preferences_settings_widget.dart | 1 - .../qr_code_page/qr_code_page_model.dart | 3 +- .../qr_code_page/qr_code_page_widget.dart | 71 +- .../reception_page/reception_page_widget.dart | 26 +- .../reservation_page_widget.dart | 9 +- .../schedule_complete_visit_page_model.dart | 3 +- .../schedule_complete_visit_page_widget.dart | 752 +++++----------- .../visit_history_page_widget.dart | 23 +- .../components/atoms/atom_terms_of_use.dart | 3 +- lib/shared/helpers/sqlite_storage.dart | 20 +- lib/shared/helpers/storage_helper.dart | 4 - .../authentication_service.dart | 5 +- .../localization/localization_service.dart | 17 +- lib/shared/utils/device_util.dart | 39 +- lib/shared/utils/limited_text_size.dart | 14 +- lib/shared/utils/text_util.dart | 5 +- 59 files changed, 1794 insertions(+), 2655 deletions(-) diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 288304cb..f548d112 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,7 +1,124 @@ - - - + + package="com.freaccess.hub" + + xmlns:tools="http://schemas.android.com/tools"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 46d26daf..f548d112 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,118 +1,124 @@ - - - - - - - - - - + package="com.freaccess.hub" - + xmlns:tools="http://schemas.android.com/tools"> + + + + + + + + + + - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + + + + - + + + + + + + + + + + + - - + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/freaccess/hub/MainActivity.kt b/android/app/src/main/kotlin/com/freaccess/hub/MainActivity.kt index 10a40dac..2cf5fe44 100644 --- a/android/app/src/main/kotlin/com/freaccess/hub/MainActivity.kt +++ b/android/app/src/main/kotlin/com/freaccess/hub/MainActivity.kt @@ -1,5 +1,53 @@ package com.freaccess.hub +import android.os.Bundle + +import android.provider.Settings + import io.flutter.embedding.android.FlutterFragmentActivity -class MainActivity: FlutterFragmentActivity() {} +import io.flutter.embedding.engine.FlutterEngine + +import io.flutter.plugin.common.MethodChannel + +class MainActivity: FlutterFragmentActivity() { + + private val CHANNEL = "com.freaccess.hub/getAndroidId" + + override fun configureFlutterEngine(flutterEngine: FlutterEngine) { + + super.configureFlutterEngine(flutterEngine) + + MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler { call, result -> + + if (call.method == "getAndroidId") { + + val androidId = getAndroidId() + + if (androidId != null) { + + result.success(androidId) + + } else { + + result.error("UNAVAILABLE", "Android ID not available.", null) + + } + + } else { + + result.notImplemented() + + } + + } + + } + + private fun getAndroidId(): String? { + + return Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID) + + } + +} \ No newline at end of file diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart index 76beccc8..e9ffa21c 100644 --- a/integration_test/app_test.dart +++ b/integration_test/app_test.dart @@ -14,8 +14,8 @@ void main() { group('Initialization', () { group('Navigation', () { - setUpAll(() async => await initializeApp().then( - (_) async => StorageHelper().set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage))); + setUpAll(() async => await initializeApp() + .then((_) async => StorageHelper().set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage))); testWidgets('Test Welcome', (WidgetTester tester) async { widget = tester; await _testWelcome(); @@ -26,16 +26,16 @@ void main() { }); group('Authentication', () { group('Sign in', () { - setUpAll(() async => await initializeApp().then( - (_) async => StorageHelper().set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage))); + setUpAll(() async => await initializeApp() + .then((_) async => StorageHelper().set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage))); testWidgets('Test Sign In', (WidgetTester tester) async { widget = tester; await _testSignIn(); }); }); group('Sign up', () { - setUpAll(() async => await initializeApp().then( - (_) async => StorageHelper().set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage))); + setUpAll(() async => await initializeApp() + .then((_) async => StorageHelper().set(SecureStorageKey.isLogged.value, 'false', Storage.SecureStorage))); testWidgets('Test Sign Up', (WidgetTester tester) async { widget = tester; await _testSignUp(); diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index eb44686e..e1dac19a 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -61,10 +61,8 @@ class PhpGroup { class UnregisterDevice { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; return ApiManager.instance.makeApiCall( callName: 'unregisterDevice', @@ -91,12 +89,9 @@ class UnregisterDevice { class DeletePet { Future call({final int? petID = 0}) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'excluirPet'; return ApiManager.instance.makeApiCall( @@ -139,12 +134,9 @@ class UpdatePet { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'atualizarPet'; return ApiManager.instance.makeApiCall( @@ -188,12 +180,9 @@ class GetPets { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'consultaPets'; return ApiManager.instance.makeApiCall( @@ -225,12 +214,9 @@ class GetPetPhoto { Future call({final int? petId}) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'consultaFotoPet'; return ApiManager.instance.makeApiCall( @@ -271,12 +257,9 @@ class RegisterPet { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'cadastrarPet'; return ApiManager.instance.makeApiCall( @@ -319,12 +302,9 @@ class BuscaEnconcomendas { final String? adresseeType, final String? status, }) async { - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'getEncomendas'; final String baseUrl = PhpGroup.getBaseUrl(); @@ -366,12 +346,9 @@ class CancelaVisita { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'cancelaVisita'; return ApiManager.instance.makeApiCall( @@ -403,10 +380,8 @@ class CancelaVisita { class DeleteAccount { Future call() async { - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; final String baseUrl = PhpGroup.getBaseUrl(); return ApiManager.instance.makeApiCall( @@ -437,12 +412,9 @@ class ChangePanic { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'updVisitado'; return ApiManager.instance.makeApiCall( @@ -476,12 +448,9 @@ class ChangePass { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'updVisitado'; return ApiManager.instance.makeApiCall( @@ -515,12 +484,9 @@ class RespondeVinculo { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; return ApiManager.instance.makeApiCall( callName: 'respondeVinculo', @@ -552,12 +518,9 @@ class ChangeNotifica { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'updVisitado'; return ApiManager.instance.makeApiCall( @@ -589,14 +552,10 @@ class UpdateIDE { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliUUID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; - final String newIde = - (await StorageHelper().get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String newIde = (await StorageHelper().get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'updVisitado'; return ApiManager.instance.makeApiCall( @@ -628,10 +587,8 @@ class UpdToken { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; final String token = (await StorageHelper().get(SecureStorageKey.token.value, Storage.SecureStorage)) ?? ''; return ApiManager.instance.makeApiCall( @@ -659,23 +616,20 @@ class UpdToken { class LoginCall { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; final String email = (await StorageHelper().get(SecureStorageKey.email.value, Storage.SecureStorage)) ?? ''; - final String password = - (await StorageHelper().get(SecureStorageKey.password.value, Storage.SecureStorage)) ?? ''; - final String type = - (await StorageHelper().get(SecureStorageKey.deviceType.value, Storage.SecureStorage)) ?? ''; + final String password = (await StorageHelper().get(SecureStorageKey.password.value, Storage.SecureStorage)) ?? ''; + final String type = (await StorageHelper().get(SecureStorageKey.deviceType.value, Storage.SecureStorage)) ?? ''; final String description = (await StorageHelper().get(SecureStorageKey.deviceDescription.value, Storage.SecureStorage)) ?? ''; late final String token; try { token = await FirebaseMessagingService.getToken(); - if(token == null || token.isEmpty) throw Exception('Token is empty'); } - catch (e, s) { + if (token == null || token.isEmpty) throw Exception('Token is empty'); + } catch (e, s) { token = ''; log('Error getting token', error: e, stackTrace: s); - LogUtil.requestAPIFailed('login.php', email, "Login", e, s); + LogUtil.requestAPIFailed('login.php', email, "Login", e, s); } return ApiManager.instance.makeApiCall( @@ -750,12 +704,9 @@ class ChangePasswordCall { required final String psswd, }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; return ApiManager.instance.makeApiCall( callName: 'changePassword', @@ -854,12 +805,9 @@ class PostScheduleVisitorCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'putVisitante'; return ApiManager.instance.makeApiCall( @@ -912,12 +860,9 @@ class PostScheduleVisitCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'putVisita'; return ApiManager.instance.makeApiCall( @@ -969,12 +914,9 @@ class GetScheduleVisitCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliUUID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'getVisitas'; return ApiManager.instance.makeApiCall( @@ -1246,12 +1188,9 @@ class GetDadosCall { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliUUID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'getDados'; return ApiManager.instance.makeApiCall( @@ -1482,12 +1421,9 @@ class GetVisitorByDocCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'getVisitante'; return ApiManager.instance.makeApiCall( @@ -1539,12 +1475,9 @@ class GetFotoVisitanteCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'getFotoVisitante'; return ApiManager.instance.makeApiCall( @@ -1581,12 +1514,9 @@ class PostProvVisitSchedulingCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'putAgendamentoProv'; return ApiManager.instance.makeApiCall( @@ -1633,12 +1563,9 @@ class GetVisitsCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'getVisitas'; return ApiManager.instance.makeApiCall( @@ -1899,12 +1826,9 @@ class DeleteVisitCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'cancelaVisita'; return ApiManager.instance.makeApiCall( @@ -1945,14 +1869,10 @@ class GetPessoasLocalCall { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String ownerUUID = - (await StorageHelper().get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliUUID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String ownerUUID = (await StorageHelper().get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; return ApiManager.instance.makeApiCall( callName: 'getPessoasLocal', @@ -2015,12 +1935,9 @@ class RespondeSolicitacaoCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliUUID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'respondeSolicitacao'; return ApiManager.instance.makeApiCall( @@ -2068,12 +1985,9 @@ class GetAccessCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliUUID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'getAcessos'; return ApiManager.instance.makeApiCall( @@ -2320,10 +2234,8 @@ class GetLiberationsCall { final StreamController controller = StreamController(); Future.microtask(() async { - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'getSolicitacoes'; @@ -2515,12 +2427,9 @@ class GetMessagesCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliUUID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'getMensagens'; return ApiManager.instance.makeApiCall( diff --git a/lib/backend/notifications/notification_service.dart b/lib/backend/notifications/notification_service.dart index 4254183d..53d7eaff 100644 --- a/lib/backend/notifications/notification_service.dart +++ b/lib/backend/notifications/notification_service.dart @@ -271,8 +271,7 @@ class NotificationService { await AwesomeNotifications().isNotificationAllowed().then((isAllowed) async { final bool requestOSnotification = - (await StorageHelper().get(SQLiteStorageKey.requestOSNotification.value, Storage.SQLiteStorage)) == - 'true'; + (await StorageHelper().get(SQLiteStorageKey.requestOSNotification.value, Storage.SQLiteStorage)) == 'true'; if (requestOSnotification == false) { if (isAllowed == false) { 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 32471006..453e89be 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 @@ -44,9 +44,13 @@ class _MenuButtonWidgetState extends State { onTap: _isProcessing ? null : () async { - setState(() { _isProcessing = true; }); + setState(() { + _isProcessing = true; + }); await widget.action.call(); - setState(() { _isProcessing = false; }); + setState(() { + _isProcessing = false; + }); }, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0), diff --git a/lib/components/atomic_components/menu_card_item/menu_card_item.dart b/lib/components/atomic_components/menu_card_item/menu_card_item.dart index 83afb4d6..77d351d9 100644 --- a/lib/components/atomic_components/menu_card_item/menu_card_item.dart +++ b/lib/components/atomic_components/menu_card_item/menu_card_item.dart @@ -39,9 +39,13 @@ class _MenuCardItemState extends State { onTap: _isProcessing ? null : () async { - setState(() { _isProcessing = true; }); + setState(() { + _isProcessing = true; + }); await widget.action.call(); - setState(() { _isProcessing = false; }); + setState(() { + _isProcessing = false; + }); }, child: Card( elevation: 0, 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 51d0fbad..cac159f4 100644 --- a/lib/components/atomic_components/shared_components_atoms/custom_input.dart +++ b/lib/components/atomic_components/shared_components_atoms/custom_input.dart @@ -99,7 +99,7 @@ class _CustomInputUtilState extends State { helperStyle: TextStyle( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, fontSize: limitedInputTextSize, - ), + ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).customColor6, 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 e21a0d80..8898a47b 100644 --- a/lib/components/atomic_components/shared_components_atoms/custom_select.dart +++ b/lib/components/atomic_components/shared_components_atoms/custom_select.dart @@ -41,8 +41,7 @@ class _CustomSelectState extends State { @override Widget build(BuildContext context) { - - double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); + double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); return Padding( padding: const EdgeInsetsDirectional.fromSTEB(0, 0.0, 0, 10.0), @@ -110,13 +109,12 @@ class _CustomSelectState extends State { ptText: 'Este campo é obrigatório', ), style: FlutterFlowTheme.of(context).bodySmall.override( - fontFamily: FlutterFlowTheme.of(context).bodySmallFamily, - color: FlutterFlowTheme.of(context).customColor6, - letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodySmallFamily), - fontSize: limitedInputFontSize - )), + fontFamily: FlutterFlowTheme.of(context).bodySmallFamily, + color: FlutterFlowTheme.of(context).customColor6, + letterSpacing: 0.0, + useGoogleFonts: + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodySmallFamily), + fontSize: limitedInputFontSize)), ), ], ), 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 4f44136d..7b712455 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 @@ -38,8 +38,7 @@ class _MediaUploadButtonUtilState extends State { return Builder( builder: (context) { - if (widget.uploadedFiles != null && - widget.uploadedFiles!.bytes!.isNotEmpty) { + if (widget.uploadedFiles != null && widget.uploadedFiles!.bytes!.isNotEmpty) { { return InkWell( splashColor: Colors.transparent, @@ -49,8 +48,7 @@ class _MediaUploadButtonUtilState extends State { onTap: () async { setState(() { widget.isUploading = false; - widget.uploadedFiles = - FFUploadedFile(bytes: Uint8List.fromList([])); + widget.uploadedFiles = FFUploadedFile(bytes: Uint8List.fromList([])); widget.onUploadComplete(widget.uploadedFiles!); }); }, @@ -70,133 +68,117 @@ class _MediaUploadButtonUtilState extends State { children: [ Align( alignment: const AlignmentDirectional(0.0, 0.0), - child: GestureDetector( - onTap: () async { - setState(() { - _isLoading = true; - }); - final selectedMedia = await selectMediaWithSourceBottomSheet( - context: context, - imageQuality: 100, - allowPhoto: true, - includeDimensions: true, + child: GestureDetector( + onTap: () async { + setState(() { + _isLoading = true; + }); + final selectedMedia = await selectMediaWithSourceBottomSheet( + context: context, + imageQuality: 100, + allowPhoto: true, + includeDimensions: true, + ); + if (selectedMedia != null) { + setState(() => widget.isUploading = true); + var selectedUploadedFiles = []; + + try { + final message = FFLocalizations.of(context) + .getVariableText(enText: 'Uploading file...', ptText: 'Enviando arquivo...'); + showUploadMessage( + context, + message, + showLoading: true, ); - if (selectedMedia != null) { - setState(() => widget.isUploading = true); - var selectedUploadedFiles = []; - - try { - final message = FFLocalizations.of(context) - .getVariableText( - enText: 'Uploading file...', - ptText: 'Enviando arquivo...'); - showUploadMessage( - context, - message, - showLoading: true, - ); - selectedUploadedFiles = selectedMedia - .map((m) => FFUploadedFile( - name: m.storagePath.split('/').last, - bytes: m.bytes, - height: m.dimensions?.height, - width: m.dimensions?.width, - // blurHash: m.blurHash, - )) - .toList(); - } finally { - ScaffoldMessenger.of(context).hideCurrentSnackBar(); - widget.isUploading = false; - } - if (selectedUploadedFiles.length == - selectedMedia.length) { - setState(() { - widget.uploadedFiles = selectedUploadedFiles.first; - }); - widget.onUploadComplete(widget.uploadedFiles!); - final message = FFLocalizations.of(context) - .getVariableText( - enText: 'Success!', ptText: 'Sucesso!'); - showUploadMessage(context, message); - } else { - setState(() { - _isLoading = false; - }); - final message = FFLocalizations.of(context) - .getVariableText( - enText: 'Failed to upload data', - ptText: 'Falha ao enviar dados'); - showUploadMessage(context, message); - return; - } }else{ - setState(() { - _isLoading = false; - }); - } - }, - child: Center( - child: Container( - width: MediaQuery.of(context).size.width * 0.8, - height: 120, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.0), - border: Border.all( - color: FlutterFlowTheme.of(context).customColor6, - width: 1.0, - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - _isLoading - ? SizedBox( - width: 30.0, - height: 30.0, - child: CircularProgressIndicator( - valueColor: - AlwaysStoppedAnimation( - FlutterFlowTheme.of(context) - .primary, - ), - ), - ) - : Icon( - Icons.photo_camera, - color: FlutterFlowTheme.of(context) - .primary, - size: 30.0, - ), - Padding( - padding: - const EdgeInsets.fromLTRB(0, 15, 0, 0), - child: Text( - FFLocalizations.of(context).getText( - 'p4ftwxcy', - ), - textAlign: TextAlign.center, - style: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: limitedInputTextSize, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - ), - ) - ], - ), - ), + selectedUploadedFiles = selectedMedia + .map((m) => FFUploadedFile( + name: m.storagePath.split('/').last, + bytes: m.bytes, + height: m.dimensions?.height, + width: m.dimensions?.width, + // blurHash: m.blurHash, + )) + .toList(); + } finally { + ScaffoldMessenger.of(context).hideCurrentSnackBar(); + widget.isUploading = false; + } + if (selectedUploadedFiles.length == selectedMedia.length) { + setState(() { + widget.uploadedFiles = selectedUploadedFiles.first; + }); + widget.onUploadComplete(widget.uploadedFiles!); + final message = + FFLocalizations.of(context).getVariableText(enText: 'Success!', ptText: 'Sucesso!'); + showUploadMessage(context, message); + } else { + setState(() { + _isLoading = false; + }); + final message = FFLocalizations.of(context) + .getVariableText(enText: 'Failed to upload data', ptText: 'Falha ao enviar dados'); + showUploadMessage(context, message); + return; + } + } else { + setState(() { + _isLoading = false; + }); + } + }, + child: Center( + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + height: 120, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + border: Border.all( + color: FlutterFlowTheme.of(context).customColor6, + width: 1.0, ), ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _isLoading + ? SizedBox( + width: 30.0, + height: 30.0, + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, + ), + ), + ) + : Icon( + Icons.photo_camera, + color: FlutterFlowTheme.of(context).primary, + size: 30.0, + ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 15, 0, 0), + child: Text( + FFLocalizations.of(context).getText( + 'p4ftwxcy', + ), + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: FlutterFlowTheme.of(context).titleSmallFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedInputTextSize, + letterSpacing: 0.0, + useGoogleFonts: + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily), + ), + ), + ) + ], + ), + ), + ), + ), ), ], ); diff --git a/lib/components/molecular_components/menu_item/menu_item.dart b/lib/components/molecular_components/menu_item/menu_item.dart index 790b3fb4..8030ad6d 100644 --- a/lib/components/molecular_components/menu_item/menu_item.dart +++ b/lib/components/molecular_components/menu_item/menu_item.dart @@ -11,4 +11,4 @@ abstract class MenuEntry extends StatefulWidget { final Function() action; final String title; final IconData icon; -} \ No newline at end of file +} 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 db8cd7e4..bba2ea01 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 @@ -78,8 +78,7 @@ class _OptModalWidgetState extends State { context.pop(filterResult); } - Widget _buildCheckboxListTile( - String key, List> options, double fontsize) { + Widget _buildCheckboxListTile(String key, List> options, double fontsize) { double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); return Column( children: [ @@ -169,7 +168,6 @@ class _OptModalWidgetState extends State { Widget build(BuildContext context) { double screenWidth = MediaQuery.of(context).size.width; - return Center( child: Container( width: screenWidth - (screenWidth * 0.35), @@ -193,8 +191,7 @@ class _OptModalWidgetState extends State { style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedFontSizeUtil.getHeaderFontSize( - context), + fontSize: LimitedFontSizeUtil.getHeaderFontSize(context), letterSpacing: 0.0, fontWeight: FontWeight.bold, useGoogleFonts: @@ -223,15 +220,16 @@ class _OptModalWidgetState extends State { foregroundColor: FlutterFlowTheme.of(context).info, backgroundColor: FlutterFlowTheme.of(context).primary, ), - child: Text(FFLocalizations.of(context).getText('88kshkph'), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).info, - fontSize: LimitedFontSizeUtil.getInputFontSize(context), - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - )), + child: Text(FFLocalizations.of(context).getText('88kshkph'), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).info, + fontSize: LimitedFontSizeUtil.getInputFontSize(context), + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + )), ), ], ), 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 de1a19dd..46f268bf 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 @@ -29,13 +29,11 @@ class _OrderFilterModalWidgetState extends State { late Map selected; final List> adresseeTypeOptions = [ { - 'title': - FFLocalizations.of(StorageHelper().context!).getVariableText(enText: 'Resident', ptText: 'Morador'), + 'title': FFLocalizations.of(StorageHelper().context!).getVariableText(enText: 'Resident', ptText: 'Morador'), 'value': 'MOR' }, { - 'title': FFLocalizations.of(StorageHelper().context!) - .getVariableText(enText: 'Property', ptText: 'Propriedade'), + 'title': FFLocalizations.of(StorageHelper().context!).getVariableText(enText: 'Property', ptText: 'Propriedade'), 'value': 'PRO' }, ]; @@ -46,8 +44,7 @@ class _OrderFilterModalWidgetState extends State { 'value': 'notPickedUp' }, { - 'title': - FFLocalizations.of(StorageHelper().context!).getVariableText(ptText: 'Retirado', enText: 'Picked Up'), + 'title': FFLocalizations.of(StorageHelper().context!).getVariableText(ptText: 'Retirado', enText: 'Picked Up'), 'value': 'pickedUp' }, ]; @@ -213,8 +210,7 @@ class _OrderFilterModalWidgetState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - _buildCheckboxListTile( - 'adresseeType', adresseeTypeOptions, limitedBodyFontSize), + _buildCheckboxListTile('adresseeType', adresseeTypeOptions, limitedBodyFontSize), _buildCheckboxListTile('status', statusOptions, limitedBodyFontSize), ], ), @@ -227,7 +223,8 @@ class _OrderFilterModalWidgetState extends State { foregroundColor: FlutterFlowTheme.of(context).info, backgroundColor: FlutterFlowTheme.of(context).primary, ), - child: Text(FFLocalizations.of(context).getText('88kshkph'), style: TextStyle(fontSize: limitedBodyFontSize)), + child: Text(FFLocalizations.of(context).getText('88kshkph'), + style: TextStyle(fontSize: limitedBodyFontSize)), ), ], ), 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 39cfea2b..981f1db5 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart @@ -92,76 +92,80 @@ class _ThrowExceptionWidgetState extends State with Ticker super.dispose(); } - @override Widget build(BuildContext context) { + + @override + Widget build(BuildContext context) { double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); - return InkWell( - key: const ValueKey('ThrowExceptionWidget'), - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - context.pop(); - }, - child: DecoratedBox( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: BorderRadius.circular(20.0), // Ajuste o valor conforme necessário - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const SizedBox(height: 20.0), - Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - _getIconByType(context), - color: _getColorByType(context), - size: 150.0, + return InkWell( + key: const ValueKey('ThrowExceptionWidget'), + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + context.pop(); + }, + child: DecoratedBox( + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: BorderRadius.circular(20.0), // Ajuste o valor conforme necessário + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const SizedBox(height: 20.0), + 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: limitedHeaderFontSize, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(15.0, 10.0, 15.0, 0.0), - child: Text( - valueOrDefault(widget.msg, 'Message Not Found'), - overflow: TextOverflow.clip, - textAlign: TextAlign.center, + ], + ).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: limitedHeaderFontSize, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - fontSize: limitedBodyFontSize, + fontWeight: FontWeight.bold, + useGoogleFonts: + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), ), - ), - ], - ), - ], + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(15.0, 10.0, 15.0, 0.0), + child: Text( + valueOrDefault(widget.msg, 'Message Not Found'), + overflow: TextOverflow.clip, + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedBodyFontSize, + ), + ), + ), + ], + ), + ], + ), ), ), - ), - ); -} + ); + } } 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 6ee4b9ee..1565e678 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 @@ -53,8 +53,14 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State value == true ? onUpdate() : null); + await LocalizationService.selectLocal(context) + .then((value) => value == true ? onUpdate() : null); }, child: ClipRRect( borderRadius: BorderRadius.circular(200.0), @@ -143,8 +143,7 @@ class _LocalProfileComponentWidgetState extends State= 26 ? 1 : scaledFontSize >= 18 ? 2 : 3; + final int crossAxisCount = scaledFontSize >= 26 + ? 1 + : scaledFontSize >= 18 + ? 2 + : 3; return Column( children: [ 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 39e73c6a..a598eb13 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -8,7 +8,6 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/shared/utils/limited_text_size.dart'; - class DetailsComponentWidget extends StatefulWidget { const DetailsComponentWidget({ Key? key, @@ -176,7 +175,6 @@ class _DetailsComponentWidgetState extends State { return TextFormField( readOnly: true, initialValue: '$value', - style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, @@ -186,9 +184,7 @@ class _DetailsComponentWidgetState extends State { ), fontSize: limitedBodyFontSize, ), - decoration: InputDecoration( - labelText: key, filled: true, fillColor: FlutterFlowTheme.of(context).primaryBackground, @@ -205,14 +201,9 @@ class _DetailsComponentWidgetState extends State { useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily, ), - ), - - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, + hintStyle: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( 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 33008753..ad951ae3 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 @@ -83,8 +83,7 @@ class _ForgotPasswordTemplateComponentWidgetState extends State('BackButton'), splashColor: Colors.transparent, @@ -98,8 +97,7 @@ class _ForgotPasswordTemplateComponentWidgetState extends State('SendButtonWidget'), - onPressed: (_model.emailAddressTextController.text == - '' || - !ValidatorUtil.isValidEmail( - _model.emailAddressTextController.text)) + onPressed: (_model.emailAddressTextController.text == '' || + !ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) ? null - : () async => AuthenticationService.forgotPassword( - context, _model.emailAddressTextController.text), + : () async => + AuthenticationService.forgotPassword(context, _model.emailAddressTextController.text), text: FFLocalizations.of(context).getText( '74rnd5bu' /* Enviar */, ), options: FFButtonOptions( width: 270.0, height: 50.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), color: FlutterFlowTheme.of(context).primary, - textStyle: - FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: Colors.white, - fontSize: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), + textStyle: FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: 'Plus Jakarta Sans', + color: Colors.white, + fontSize: limitedInputFontSize, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + ), elevation: 3.0, borderSide: const BorderSide( color: Colors.transparent, width: 1.0, ), - disabledColor: - FlutterFlowTheme.of(context).customColor5, + disabledColor: FlutterFlowTheme.of(context).customColor5, disabledTextColor: Colors.white, ), showLoadingIndicator: true, 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 c1ae573c..35f8a6fd 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 @@ -70,11 +70,8 @@ class _ScheduleProvisionalVisitPageWidgetState extends State( - 'emailTextFormField'), - controller: _model - .emailAddressTextController, - focusNode: _model - .emailAddressFocusNode, - cursorColor: - FlutterFlowTheme.of(context) - .primary, - onChanged: (_) => - EasyDebounce.debounce( + key: const ValueKey('emailTextFormField'), + controller: _model.emailAddressTextController, + focusNode: _model.emailAddressFocusNode, + cursorColor: FlutterFlowTheme.of(context).primary, + onChanged: (_) => EasyDebounce.debounce( '_model.emailAddressTextController', - const Duration( - milliseconds: 500), + const Duration(milliseconds: 500), () => setState(() {}), ), autofocus: true, - autofillHints: const [ - AutofillHints.email - ], - textCapitalization: - TextCapitalization.none, - textInputAction: - TextInputAction.next, + autofillHints: const [AutofillHints.email], + textCapitalization: TextCapitalization.none, + textInputAction: TextInputAction.next, obscureText: false, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of( - context) - .getText( + labelText: FFLocalizations.of(context).getText( '1ltg0ylb' /* Email */, ), - labelStyle: FlutterFlowTheme - .of(context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of( - context) - .primaryText, + labelStyle: FlutterFlowTheme.of(context).labelLarge.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedInputFontSize, letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), ), - enabledBorder: - OutlineInputBorder( + enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .customColor1, + color: FlutterFlowTheme.of(context).customColor1, width: 0.25, ), - borderRadius: - BorderRadius.circular( - 12.0), + borderRadius: BorderRadius.circular(12.0), ), - focusedBorder: - OutlineInputBorder( + focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .success, + color: FlutterFlowTheme.of(context).success, width: 0.25, ), - borderRadius: - BorderRadius.circular( - 12.0), + borderRadius: BorderRadius.circular(12.0), ), - errorBorder: - OutlineInputBorder( + errorBorder: OutlineInputBorder( borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .error, + color: FlutterFlowTheme.of(context).error, width: 0.25, ), - - borderRadius: - BorderRadius.circular( - 12.0), + borderRadius: BorderRadius.circular(12.0), ), errorStyle: TextStyle( - color: - FlutterFlowTheme.of( - context) - .error, - fontSize: limitedInputFontSize, - fontWeight: FontWeight.w500, - ), - focusedErrorBorder: - OutlineInputBorder( + color: FlutterFlowTheme.of(context).error, + fontSize: limitedInputFontSize, + fontWeight: FontWeight.w500, + ), + focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .error, + color: FlutterFlowTheme.of(context).error, width: 0.25, ), - borderRadius: - BorderRadius.circular( - 12.0), + borderRadius: BorderRadius.circular(12.0), ), suffixIcon: Icon( Icons.email, - color: FlutterFlowTheme.of( - context) - .accent1, + color: FlutterFlowTheme.of(context).accent1, size: 22.0, ), ), - style: - FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme - .of(context) - .primaryText, - fontSize: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - keyboardType: - TextInputType.emailAddress, - validator: _model - .emailAddressTextControllerValidator - .asValidator(context), + style: FlutterFlowTheme.of(context).bodyLarge.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedInputFontSize, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + ), + keyboardType: TextInputType.emailAddress, + validator: + _model.emailAddressTextControllerValidator.asValidator(context), ), ), ), 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( - 'passwordTextFormField'), - controller: _model - .passwordTextController, - cursorColor: - FlutterFlowTheme.of(context) - .primary, - focusNode: - _model.passwordFocusNode, - onChanged: (_) => - EasyDebounce.debounce( - '_model.passwordTextController', - const Duration( - milliseconds: 500), - () => setState(() {})), + 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(() {})), 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) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme - .of(context) - .primaryText, - fontSize: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans')), - enabledBorder: - OutlineInputBorder( + labelText: + FFLocalizations.of(context).getText('2x19ce8k' /* Senha */), + labelStyle: FlutterFlowTheme.of(context).labelLarge.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedInputFontSize, + letterSpacing: 0.0, + 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), ), errorStyle: TextStyle( - color: - FlutterFlowTheme.of( - context) - .error, - fontSize: limitedInputFontSize, - fontWeight: FontWeight.w500, - ), + color: FlutterFlowTheme.of(context).error, + fontSize: limitedInputFontSize, + fontWeight: FontWeight.w500, + ), 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), + 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), ), - 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, + ? Icons.visibility_outlined + : Icons.visibility_off_outlined, + color: FlutterFlowTheme.of(context).accent1, size: 24.0), ), ), - style: - FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme - .of(context) - .primaryText, - fontSize: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - validator: _model - .passwordTextControllerValidator - .asValidator(context), + style: FlutterFlowTheme.of(context).bodyLarge.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedInputFontSize, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + ), + validator: _model.passwordTextControllerValidator.asValidator(context), ), ), ), @@ -507,151 +353,77 @@ class _SignInTemplateComponentWidgetState extends State( - 'SubmitButtonWidget'), + key: const ValueKey('SubmitButtonWidget'), onPressed: _isFormInvalid() ? null : () async { - await AuthenticationService - .signIn( + await AuthenticationService.signIn( context, _model, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, + 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), + 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: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans')), + 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: limitedInputFontSize, + 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( - key: const ValueKey( - 'toggleSignUpPage'), - onPressed: () async => - await widget - .toggleSignUpPage - ?.call(), - text: FFLocalizations.of( - context) - .getText( + 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), + 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) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme - .of(context) - .secondaryText, + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).customColor1, + textStyle: FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).secondaryText, fontSize: limitedInputFontSize, letterSpacing: 0.0, - fontWeight: - FontWeight.w500, + fontWeight: FontWeight.w500, useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), + 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, ), @@ -661,277 +433,158 @@ class _SignInTemplateComponentWidgetState extends State( - 'SubmitButtonWidget'), - onPressed: - _isFormInvalid() - ? null - : () async { - try { - await AuthenticationService - .signIn( - context, - _model, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); - setState( - () {}); - } catch (e, s) { - await DialogUtil - .errorDefault( - context); - LogUtil.requestAPIFailed( - 'login.php', - _model - .emailAddressTextController - .text, - "Login", - e, - s); - } - }, - text: FFLocalizations.of( - context) - .getText('1x926nsn'), + key: const ValueKey('SubmitButtonWidget'), + onPressed: _isFormInvalid() + ? null + : () async { + try { + await AuthenticationService.signIn( + context, + _model, + emailAdress: _model.emailAddressTextController.text, + password: _model.passwordTextController.text, + ); + setState(() {}); + } catch (e, s) { + await DialogUtil.errorDefault(context); + LogUtil.requestAPIFailed( + 'login.php', + _model.emailAddressTextController.text, + "Login", + e, + s); + } + }, + text: FFLocalizations.of(context).getText('1x926nsn'), options: FFButtonOptions( width: double.infinity, height: 44.0, padding: - const EdgeInsetsDirectional - .fromSTEB(0.0, - 0.0, 0.0, 0.0), + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), iconPadding: - const EdgeInsetsDirectional - .fromSTEB(0.0, - 0.0, 0.0, 0.0), - color: - FlutterFlowTheme.of( - context) - .accent1, - textStyle: - FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .info, - fontSize: limitedInputFontSize, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), + 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: limitedInputFontSize, + 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, ), ), ), Expanded( child: 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< - String>( - 'toggleSignUpPage'), - 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), + 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) - .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'), - ), + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).customColor1, + textStyle: 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'), + ), elevation: 3.0, - borderSide: - const BorderSide( - color: Colors - .transparent, + borderSide: const BorderSide( + color: Colors.transparent, width: 1.0, ), - borderRadius: - BorderRadius - .circular(12.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'), + key: const ValueKey('ForgotPassword'), splashColor: Colors.transparent, focusColor: Colors.transparent, hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: - Colors.transparent, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery - .viewInsetsOf( - context), - child: - const ForgotPasswordTemplateComponentWidget(), - ); - }) - .then((value) => - safeSetState(() {})); + isScrollControlled: true, + backgroundColor: Colors.transparent, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const ForgotPasswordTemplateComponentWidget(), + ); + }).then((value) => safeSetState(() {})); }, child: RichText( - textScaler: - MediaQuery.of(context).textScaler, + textScaler: MediaQuery.of(context).textScaler, text: TextSpan( children: [ TextSpan( - text: - FFLocalizations.of(context) - .getText( + text: FFLocalizations.of(context).getText( '05dx91ku' /* Você esqueceu a sua senha? */, ), style: TextStyle( - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: limitedInputFontSize, - ), - + color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedInputFontSize, + ), ), TextSpan( - text: FFLocalizations.of( - context) - .getText( - 'p5c6d54y' /* Recupere aqui */), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme - .of(context) - .primary, - fontSize: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: - FontWeight.normal, - useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - mouseCursor: - SystemMouseCursors.click, + text: FFLocalizations.of(context) + .getText('p5c6d54y' /* Recupere aqui */), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primary, + fontSize: limitedInputFontSize, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + ), + mouseCursor: SystemMouseCursors.click, ) ], - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - fontSize: limitedInputFontSize - ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedInputFontSize), ), ), ), @@ -941,8 +594,7 @@ class _SignInTemplateComponentWidgetState extends State createState() => _SignUpTemplateComponentWidgetState(); } -class _SignUpTemplateComponentWidgetState - extends State with TickerProviderStateMixin { +class _SignUpTemplateComponentWidgetState extends State with TickerProviderStateMixin { late SignUpTemplateComponentModel _model; final animationsMap = {}; late String _deviceType; @@ -160,17 +158,13 @@ class _SignUpTemplateComponentWidgetState '49609olv' /* INSIRA SEU EMAIL E SENHA, VAMO... */, ), textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( + style: FlutterFlowTheme.of(context).displaySmall.override( fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context) - .primaryText, + color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedHeaderFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), ), ), ), @@ -271,18 +265,13 @@ class _SignUpTemplateComponentWidgetState borderRadius: BorderRadius.circular(12.0), ), errorStyle: TextStyle( - fontFamily: - 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of( - context) - .error, + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).error, fontSize: limitedInputFontSize, fontWeight: FontWeight.w400, fontStyle: FontStyle.normal, ), - focusedErrorBorder: - OutlineInputBorder( + focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).error, width: 0.25, @@ -363,18 +352,13 @@ class _SignUpTemplateComponentWidgetState borderRadius: BorderRadius.circular(12.0), ), errorStyle: TextStyle( - fontFamily: - 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of( - context) - .error, + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).error, fontSize: limitedInputFontSize, fontWeight: FontWeight.w400, fontStyle: FontStyle.normal, ), - focusedErrorBorder: - OutlineInputBorder( + focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).error, width: 0.25, @@ -456,22 +440,15 @@ class _SignUpTemplateComponentWidgetState borderRadius: BorderRadius.circular(12.0), ), errorStyle: TextStyle( - fontFamily: - 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of( - context) - .error, + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).error, fontSize: limitedInputFontSize, fontWeight: FontWeight.w400, fontStyle: FontStyle.normal, ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: - const BorderSide( - color: - Color(0xFFFF5963), + focusedErrorBorder: OutlineInputBorder( + borderSide: const BorderSide( + color: Color(0xFFFF5963), width: 0.25, ), borderRadius: BorderRadius.circular(12.0), @@ -479,9 +456,7 @@ class _SignUpTemplateComponentWidgetState filled: true, fillColor: FlutterFlowTheme.of(context).primaryBackground, suffixIcon: InkWell( - key: const ValueKey< - String>( - 'passwordVisibilitySuffixIcon'), + key: const ValueKey('passwordVisibilitySuffixIcon'), onTap: () => setState( () => _model.passwordRegisterFormVisibility = !_model.passwordRegisterFormVisibility, @@ -516,8 +491,7 @@ class _SignUpTemplateComponentWidgetState Padding( padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - key: const ValueKey( - 'SubmitButtonWidget'), + key: const ValueKey('SubmitButtonWidget'), onPressed: isFormInvalid() ? null : () async { @@ -531,17 +505,12 @@ class _SignUpTemplateComponentWidgetState ); shouldSetState = true; if (_model.register == true) - - await widget - .toggleSignInPage - ?.call(); + await widget.toggleSignInPage?.call(); else { - if (shouldSetState) - setState(() {}); + if (shouldSetState) setState(() {}); return; } - if (shouldSetState) - setState(() {}); + if (shouldSetState) setState(() {}); }, text: FFLocalizations.of(context).getText( 'rnvdwzei' /* Cadastrar-se */, @@ -577,15 +546,12 @@ class _SignUpTemplateComponentWidgetState Padding( padding: const EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 12.0), child: InkWell( - key: const ValueKey( - 'toggleSignInPage'), + 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, text: TextSpan( 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 f9f4e6f5..eb9d3806 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 @@ -46,4 +46,4 @@ class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel createState() => _WelcomeTemplateComponentWidgetState(); } -class _WelcomeTemplateComponentWidgetState - extends State - with TickerProviderStateMixin { +class _WelcomeTemplateComponentWidgetState extends State with TickerProviderStateMixin { late WelcomeTemplateComponentModel _model; final animationsMap = {}; @@ -89,7 +87,7 @@ class _WelcomeTemplateComponentWidgetState @override Widget build(BuildContext context) { - double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); @@ -106,8 +104,7 @@ class _WelcomeTemplateComponentWidgetState mainAxisSize: MainAxisSize.min, children: [ Text( - FFLocalizations.of(context) - .getText('dsc9tuc8' /* UMA EXPERIÊCIA COMPLETA */), + FFLocalizations.of(context).getText('dsc9tuc8' /* UMA EXPERIÊCIA COMPLETA */), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).displaySmall.override( fontFamily: 'Plus Jakarta Sans', @@ -115,15 +112,13 @@ class _WelcomeTemplateComponentWidgetState fontSize: limitedHeaderFontSize, 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... */), + FFLocalizations.of(context).getText('5bgqn16z' /* COM CONFORTO ONDE VOCÊ ESTIVER... */), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).displaySmall.override( fontFamily: 'Plus Jakarta Sans', @@ -131,8 +126,7 @@ class _WelcomeTemplateComponentWidgetState fontSize: limitedSubHeaderFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), ), ), ), @@ -147,8 +141,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), ), ), ), @@ -182,20 +175,14 @@ 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(); }, @@ -203,17 +190,10 @@ class _WelcomeTemplateComponentWidgetState 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( + 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: limitedInputFontSize, @@ -254,7 +234,6 @@ class _WelcomeTemplateComponentWidgetState letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), elevation: 3.0, borderSide: const BorderSide( @@ -277,11 +256,9 @@ class _WelcomeTemplateComponentWidgetState child: Padding( 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(); + await widget.toggleSignInPage?.call(); }, text: FFLocalizations.of(context).getText( 'zvtay8ee' /* Entrar */, @@ -315,8 +292,7 @@ class _WelcomeTemplateComponentWidgetState child: Padding( padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - key: const ValueKey( - 'toggleSignUpPage'), + key: const ValueKey('toggleSignUpPage'), onPressed: () async { await widget.toggleSignUpPage?.call(); }, diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index 5ea3e45e..5f27409a 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -539,8 +539,7 @@ void showSnackbar( ); } -void showAlertDialog(BuildContext context, String title, String content, - Future Function() action) { +void showAlertDialog(BuildContext context, String title, String content, Future Function() action) { double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); @@ -550,10 +549,13 @@ void showAlertDialog(BuildContext context, String title, String content, builder: (context) { return AlertDialog( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - title: Text(title, style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedHeaderFontSize), textAlign: TextAlign.center), + title: Text(title, + style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedHeaderFontSize), + textAlign: TextAlign.center), content: Padding( padding: const EdgeInsets.all(8.0), - child: Text(content, style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedBodyFontSize)), + child: Text(content, + style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedBodyFontSize)), ), actions: [ Row( @@ -566,10 +568,8 @@ void showAlertDialog(BuildContext context, String title, String content, width: MediaQuery.of(context).size.width * 0.3, height: 50, color: FlutterFlowTheme.of(context).primaryBackground, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedInputFontSize - ), + textStyle: + TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedInputFontSize), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, width: 1, @@ -592,10 +592,8 @@ void showAlertDialog(BuildContext context, String title, String content, height: 50, color: FlutterFlowTheme.of(context).primaryBackground, elevation: 0, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedInputFontSize - ), + textStyle: + TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedInputFontSize), splashColor: const Color.fromARGB(255, 129, 129, 129), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, diff --git a/lib/flutter_flow/flutter_flow_widgets.dart b/lib/flutter_flow/flutter_flow_widgets.dart index 73bac9aa..1071e2af 100644 --- a/lib/flutter_flow/flutter_flow_widgets.dart +++ b/lib/flutter_flow/flutter_flow_widgets.dart @@ -99,7 +99,6 @@ class _FFButtonWidgetState extends State { textAlign: widget.options.textAlign, maxLines: maxLines, overflow: TextOverflow.ellipsis, - ); final onPressed = widget.onPressed != null diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 09826746..f891b962 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -80,10 +80,16 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) { builder: (context, _) { return FutureBuilder( future: () async { - final bool isLogged = await StorageHelper().get(SecureStorageKey.isLogged.value, Storage.SecureStorage) == 'true'; - final bool haveLocal = await StorageHelper().get(SecureStorageKey.haveLocal.value, Storage.SecureStorage) == 'true'; - final bool haveUserUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage))?.isNotEmpty ?? false; - final bool haveDevUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage))?.isNotEmpty ?? false; + final bool isLogged = + await StorageHelper().get(SecureStorageKey.isLogged.value, Storage.SecureStorage) == 'true'; + final bool haveLocal = + await StorageHelper().get(SecureStorageKey.haveLocal.value, Storage.SecureStorage) == 'true'; + final bool haveUserUUID = + (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage))?.isNotEmpty ?? + false; + final bool haveDevUUID = + (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage))?.isNotEmpty ?? + false; if (isLogged && haveDevUUID && haveUserUUID) { return haveLocal ? const HomePageWidget() : const ReceptionPageWidget(); diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index a76b4d3d..19b3388e 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -558,11 +558,11 @@ void showUploadMessage( : null, ), ), - - Text( - message, style: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedFontSizeUtil.getBodyFontSize(context), )), + Text(message, + style: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + )), ], ), backgroundColor: FlutterFlowTheme.of(context).primary, diff --git a/lib/main.dart b/lib/main.dart index 1bd75c56..24ebdf9b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -49,9 +49,11 @@ Future initializeApp() async { Future _initializeTracking() async { await AppTrackingTransparency.requestTrackingAuthorization(); } + Future _initializeFirebase() async { await Firebase.initializeApp(); } + Future _initializeNotificationService() async { await NotificationService.initialize(); } @@ -59,6 +61,7 @@ Future _initializeNotificationService() async { void _initializeUrlStrategy() { setUrlStrategy(PathUrlStrategy()); } + void _initializeSystemSettings() { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); if (kDebugMode) { @@ -77,6 +80,7 @@ Future _initializeFlutterFlow() async { GoRouter.optionURLReflectsImperativeAPIs = true; usePathUrlStrategy(); } + Future _foregroundHandlerMessage(RemoteMessage message) async { if (message.data['click_action'] == 'enroll_cond') { await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage); @@ -90,6 +94,7 @@ Future _foregroundHandlerMessage(RemoteMessage message) async { payload: Map.from(message.data)); } } + Future _backgroundHandlerMessage(RemoteMessage message) async { if (message.data['click_action'] == 'enroll_cond') { await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true', Storage.SecureStorage); @@ -105,6 +110,7 @@ class App extends StatefulWidget { static _AppState of(BuildContext context) => context.findAncestorStateOfType<_AppState>()!; } + class _AppState extends State with WidgetsBindingObserver { Locale? _locale = FFLocalizations.getStoredLocale(); ThemeMode _themeMode = FlutterFlowTheme.themeMode; @@ -253,7 +259,6 @@ class _AppState extends State with WidgetsBindingObserver { super.initState(); WidgetsBinding.instance.addObserver(this); - FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); _appStateNotifier = AppStateNotifier.instance; _router = createRouter(_appStateNotifier); @@ -273,7 +278,7 @@ class _AppState extends State with WidgetsBindingObserver { @override void didChangeAppLifecycleState(AppLifecycleState state) async { - if(state == AppLifecycleState.detached) { + if (state == AppLifecycleState.detached) { await LocalizationService.processLocals(context); FirebaseMessagingService().updateDeviceToken(); } @@ -295,4 +300,3 @@ class _AppState extends State with WidgetsBindingObserver { ); } } - diff --git a/lib/pages/acess_history_page/acess_history_page_widget.dart b/lib/pages/acess_history_page/acess_history_page_widget.dart index d475bc74..cb44168f 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -224,7 +224,10 @@ class _AccessHistoryState extends State { SnackBar( content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), - style: TextStyle(color: Colors.white, fontSize: LimitedFontSizeUtil.getBodyFontSize(context),), + style: TextStyle( + color: Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, diff --git a/lib/pages/fast_pass_page/fast_pass_page_widget.dart b/lib/pages/fast_pass_page/fast_pass_page_widget.dart index 58906122..c713c0a8 100644 --- a/lib/pages/fast_pass_page/fast_pass_page_widget.dart +++ b/lib/pages/fast_pass_page/fast_pass_page_widget.dart @@ -24,14 +24,10 @@ class _FastPassPageWidgetState extends State { Future> initVariables() async { final email = (await StorageHelper().get(hub.SecureStorageKey.email.value, hub.Storage.SecureStorage)) ?? ''; - final name = - (await StorageHelper().get(hub.SQLiteStorageKey.userName.value, hub.Storage.SQLiteStorage)) ?? ''; - final devUUID = - (await StorageHelper().get(hub.SQLiteStorageKey.devUUID.value, hub.Storage.SQLiteStorage)) ?? ''; - final userUUID = - (await StorageHelper().get(hub.SQLiteStorageKey.userUUID.value, hub.Storage.SQLiteStorage)) ?? ''; - final cliUUID = - (await StorageHelper().get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage)) ?? ''; + final name = (await StorageHelper().get(hub.SQLiteStorageKey.userName.value, hub.Storage.SQLiteStorage)) ?? ''; + final devUUID = (await StorageHelper().get(hub.SQLiteStorageKey.devUUID.value, hub.Storage.SQLiteStorage)) ?? ''; + final userUUID = (await StorageHelper().get(hub.SQLiteStorageKey.userUUID.value, hub.Storage.SQLiteStorage)) ?? ''; + final cliUUID = (await StorageHelper().get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage)) ?? ''; const createdAt = '0000-00-00 00:00:00'; final url = 'https://hub.freaccess.com.br/hub/fast-pass/$cliUUID'; final freUserData = diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index adb219c1..6fa3f5e6 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -20,7 +20,7 @@ class HomePageWidget extends StatefulWidget { } class _HomePageWidgetState extends State { - late HomePageModel _model; + late HomePageModel _model; final scaffoldKey = GlobalKey(); late LocalProfileComponentWidget _localProfileComponentWidget; @@ -42,13 +42,10 @@ class _HomePageWidgetState extends State { _model = createModel(context, () => HomePageModel()); _model.updateOnChange = true; - - _model.textController ??= TextEditingController(); _model.textFieldFocusNode ??= FocusNode(); } - @override Widget build(BuildContext context) { StorageHelper().context = context; @@ -137,7 +134,7 @@ class _HomePageWidgetState extends State { ), ); } - + Widget buildBody() { return Container( color: FlutterFlowTheme.of(context).primaryBackground, diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 345842d5..92e01bd5 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -226,13 +226,13 @@ class _MessageHistoryPageWidgetState extends State wit mainAxisSize: MainAxisSize.max, children: [ Center( - child: Text(FFLocalizations.of(context).getVariableText( - ptText: "Nenhuma mensagem encontrada!", - enText: "No message found"), + child: Text( + FFLocalizations.of(context) + .getVariableText(ptText: "Nenhuma mensagem encontrada!", enText: "No message found"), style: TextStyle( color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedSubHeaderFontSize,) - ), + fontSize: limitedSubHeaderFontSize, + )), ) ], ), @@ -287,7 +287,7 @@ class _MessageHistoryPageWidgetState extends State wit } Widget _item(BuildContext context, dynamic jsonBody) { - double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); + double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); return Padding( padding: const EdgeInsets.symmetric(horizontal: 15), @@ -349,8 +349,7 @@ class _MessageHistoryPageWidgetState extends State wit style: TextStyle( fontWeight: FontWeight.bold, fontSize: limitedBodyFontSize, - color: - FlutterFlowTheme.of(context).customColor6, + color: FlutterFlowTheme.of(context).customColor6, ), overflow: TextOverflow.ellipsis, ), @@ -374,8 +373,7 @@ class _MessageHistoryPageWidgetState extends State wit jsonBody['MSG_TEXTO'].toString(), style: TextStyle( fontSize: limitedBodyFontSize, - color: - FlutterFlowTheme.of(context).customColor6, + color: FlutterFlowTheme.of(context).customColor6, ), ), ), diff --git a/lib/pages/package_order_page/package_order_page.dart b/lib/pages/package_order_page/package_order_page.dart index 4f42294b..4e2f1246 100644 --- a/lib/pages/package_order_page/package_order_page.dart +++ b/lib/pages/package_order_page/package_order_page.dart @@ -163,31 +163,25 @@ class _PackageOrderPage extends State { child: IconButton( icon: const Icon(Icons.filter_list), onPressed: () async { - final Map? selectedFilter = - await showModalBottomSheet>( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => Navigator.of(context).pop(), - child: Container( - color: Colors.transparent, - child: GestureDetector( - onTap: () {}, - child: OrderFilterModalWidget( - defaultAdresseeType: _selectedTypeSubject - .value['adresseeType'] ?? - '.*', - defaultStatus: - _selectedTypeSubject.value['status'] ?? - '.*', - - ), - ), + final Map? selectedFilter = await showModalBottomSheet>( + isScrollControlled: true, + backgroundColor: Colors.transparent, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => Navigator.of(context).pop(), + child: Container( + color: Colors.transparent, + child: GestureDetector( + onTap: () {}, + child: OrderFilterModalWidget( + defaultAdresseeType: _selectedTypeSubject.value['adresseeType'] ?? '.*', + defaultStatus: _selectedTypeSubject.value['status'] ?? '.*', ), - ); - }); + ), + ), + ); + }); if (selectedFilter != null) { _updateFilterAction(selectedFilter); @@ -261,9 +255,8 @@ class _PackageOrderPage extends State { children: [ Center( child: Text( - FFLocalizations.of(context).getVariableText( - ptText: "Nenhuma encomenda encontrada!", - enText: "No orders found!"), + FFLocalizations.of(context) + .getVariableText(ptText: "Nenhuma encomenda encontrada!", enText: "No orders found!"), style: TextStyle( color: FlutterFlowTheme.of(context).primaryText, fontSize: LimitedFontSizeUtil.getHeaderFontSize(context), diff --git a/lib/pages/pets_page/pets_history_screen.dart b/lib/pages/pets_page/pets_history_screen.dart index bcd69dfc..1c497e52 100644 --- a/lib/pages/pets_page/pets_history_screen.dart +++ b/lib/pages/pets_page/pets_history_screen.dart @@ -106,7 +106,7 @@ class _PetsHistoryScreenState extends State with TickerProvid content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), style: TextStyle( - color :Colors.white, + color: Colors.white, fontSize: LimitedFontSizeUtil.getBodyFontSize(context), ), ), @@ -132,13 +132,13 @@ class _PetsHistoryScreenState extends State with TickerProvid mainAxisSize: MainAxisSize.max, children: [ Center( - child: Text(FFLocalizations.of(context).getVariableText( - ptText: "Nenhum Pet encontrado!", - enText: "No pets found"), + child: Text( + FFLocalizations.of(context) + .getVariableText(ptText: "Nenhum Pet encontrado!", enText: "No pets found"), style: TextStyle( fontFamily: 'Nunito', - fontSize: limitedHeaderTextSize,) - ), + fontSize: limitedHeaderTextSize, + )), ) ], ), @@ -250,12 +250,9 @@ class _PetsHistoryScreenState extends State with TickerProvid ], onTapCardItemAction: () async { final devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final cliUUID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; - final cliName = - (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? ''; + final userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? ''; await showDialog( useSafeArea: true, context: context, diff --git a/lib/pages/pets_page/pets_page_model.dart b/lib/pages/pets_page/pets_page_model.dart index 0027a8ee..8a4a07a5 100644 --- a/lib/pages/pets_page/pets_page_model.dart +++ b/lib/pages/pets_page/pets_page_model.dart @@ -106,8 +106,7 @@ class PetsPageModel extends FlutterFlowModel { devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; - petAmountRegister = - (await StorageHelper().get(SQLiteStorageKey.petAmount.value, Storage.SQLiteStorage)) ?? ''; + petAmountRegister = (await StorageHelper().get(SQLiteStorageKey.petAmount.value, Storage.SQLiteStorage)) ?? ''; safeSetState?.call(); } diff --git a/lib/pages/pets_page/pets_page_widget.dart b/lib/pages/pets_page/pets_page_widget.dart index 602bea91..2f238004 100644 --- a/lib/pages/pets_page/pets_page_widget.dart +++ b/lib/pages/pets_page/pets_page_widget.dart @@ -125,271 +125,195 @@ class _PetsPageWidgetState extends State with SingleTickerProvid useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), fontSize: limitedHeaderFontSize, ), - ), ), ), Form( key: _model.registerFormKey, autovalidateMode: AutovalidateMode.onUserInteraction, - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(0, 10, 0, 20), - child: MediaUploadButtonUtil( - onUploadComplete: _model.handleUploadComplete, - isUploading: _model.isDataUploading, - uploadedFiles: _model.uploadedLocalFile, - labelText: FFLocalizations.of(context).getVariableText( - ptText: 'Clique para adicionar a foto de seu Pet', - enText: 'Click to add your Pet\'s photo'), - ), - ), - CustomInputUtil( - controller: _model.textControllerName, - validator: _model.textControllerNameValidator - .asValidator(context), - focusNode: _model.textFieldFocusName, - labelText: FFLocalizations.of(context) - .getVariableText(ptText: 'Nome', enText: 'Name'), - hintText: FFLocalizations.of(context) - .getVariableText(ptText: 'Nome', enText: 'Name'), - suffixIcon: Symbols.format_color_text, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), - CustomInputUtil( - controller: _model.textControllerSpecies, - validator: _model.textControllerSpeciesValidator - .asValidator(context), - focusNode: _model.textFieldFocusSpecies, - labelText: FFLocalizations.of(context).getVariableText( - ptText: 'Espécie', enText: 'Species'), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Ex: Cachorro, Gato, Papagaio', - enText: 'e.g. Dog, Cat, Parrot'), - suffixIcon: Symbols.sound_detection_dog_barking, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), - CustomInputUtil( - controller: _model.textControllerRace, - validator: _model.textControllerRaceValidator - .asValidator(context), - focusNode: _model.textFieldFocusRace, - labelText: FFLocalizations.of(context) - .getVariableText(ptText: 'Raça', enText: 'Race'), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Ex: Labrador, Poodle, Siamês, Persa', - enText: 'e.g. Labrador, Poodle, Siamese, Persian'), - suffixIcon: Icons.pets_outlined, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), - CustomInputUtil( - controller: _model.textControllerColor, - validator: _model.textControllerColorValidator - .asValidator(context), - focusNode: _model.textFieldFocusColor, - labelText: FFLocalizations.of(context) - .getVariableText(ptText: 'Cor', enText: 'Color'), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Ex: Preto, Amarelo, Branco', - enText: 'e.g. Black, Yellow, White'), - suffixIcon: Symbols.palette, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - SizedBox( - width: MediaQuery.of(context).size.width, - height: 60.0, - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textControllerData, - focusNode: _model.textFieldFocusData, - cursorColor: - FlutterFlowTheme.of(context).primary, - readOnly: true, - autovalidateMode: - AutovalidateMode.onUserInteraction, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - fontSize: limitedInputFontSize, - ), - hintText: FFLocalizations.of(context) - .getVariableText( - ptText: 'Data de Nascimento', - enText: 'Date of Birth', + child: + Column(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ + Padding( + padding: const EdgeInsets.fromLTRB(0, 10, 0, 20), + child: MediaUploadButtonUtil( + onUploadComplete: _model.handleUploadComplete, + isUploading: _model.isDataUploading, + uploadedFiles: _model.uploadedLocalFile, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Clique para adicionar a foto de seu Pet', enText: 'Click to add your Pet\'s photo'), + ), + ), + CustomInputUtil( + controller: _model.textControllerName, + validator: _model.textControllerNameValidator.asValidator(context), + focusNode: _model.textFieldFocusName, + labelText: FFLocalizations.of(context).getVariableText(ptText: 'Nome', enText: 'Name'), + hintText: FFLocalizations.of(context).getVariableText(ptText: 'Nome', enText: 'Name'), + suffixIcon: Symbols.format_color_text, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, + ), + CustomInputUtil( + controller: _model.textControllerSpecies, + validator: _model.textControllerSpeciesValidator.asValidator(context), + focusNode: _model.textFieldFocusSpecies, + labelText: FFLocalizations.of(context).getVariableText(ptText: 'Espécie', enText: 'Species'), + hintText: FFLocalizations.of(context) + .getVariableText(ptText: 'Ex: Cachorro, Gato, Papagaio', enText: 'e.g. Dog, Cat, Parrot'), + suffixIcon: Symbols.sound_detection_dog_barking, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, + ), + CustomInputUtil( + controller: _model.textControllerRace, + validator: _model.textControllerRaceValidator.asValidator(context), + focusNode: _model.textFieldFocusRace, + labelText: FFLocalizations.of(context).getVariableText(ptText: 'Raça', enText: 'Race'), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Ex: Labrador, Poodle, Siamês, Persa', enText: 'e.g. Labrador, Poodle, Siamese, Persian'), + suffixIcon: Icons.pets_outlined, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, + ), + CustomInputUtil( + controller: _model.textControllerColor, + validator: _model.textControllerColorValidator.asValidator(context), + focusNode: _model.textFieldFocusColor, + labelText: FFLocalizations.of(context).getVariableText(ptText: 'Cor', enText: 'Color'), + hintText: FFLocalizations.of(context) + .getVariableText(ptText: 'Ex: Preto, Amarelo, Branco', enText: 'e.g. Black, Yellow, White'), + suffixIcon: Symbols.palette, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, + ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: 60.0, + child: Stack( + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textControllerData, + focusNode: _model.textFieldFocusData, + cursorColor: FlutterFlowTheme.of(context).primary, + readOnly: true, + autovalidateMode: AutovalidateMode.onUserInteraction, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedInputFontSize, ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - lineHeight: 1.0, - fontSize: limitedInputFontSize, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .customColor6, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: FlutterFlowTheme.of(context) - .accent1, + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Data de Nascimento', + enText: 'Date of Birth', + ), + hintStyle: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context).labelMediumFamily), + lineHeight: 1.0, + fontSize: limitedInputFontSize, ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).customColor6, + width: 0.5, ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - lineHeight: 1.8, - fontSize: limitedInputFontSize, - ), - textAlign: TextAlign.start, - validator: _model - .textControllerDataValidator - .asValidator(context), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: FlutterFlowTheme.of(context).accent1, ), ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final pickedDate = await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: DateTime(1990), - lastDate: DateTime.now(), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of(context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of(context) - .info, - headerTextStyle: - FlutterFlowTheme.of(context) - .headlineLarge - .override( - fontFamily: FlutterFlowTheme - .of(context) - .headlineLargeFamily, - fontSize: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of(context) - .primaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of(context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of(context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - iconSize: 24.0, - ); - }, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + lineHeight: 1.8, + fontSize: limitedInputFontSize, + ), + textAlign: TextAlign.start, + validator: _model.textControllerDataValidator.asValidator(context), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final pickedDate = await showDatePicker( + context: context, + initialDate: getCurrentTimestamp, + firstDate: DateTime(1990), + lastDate: DateTime.now(), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: FlutterFlowTheme.of(context).primary, + headerForegroundColor: FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of(context).headlineLarge.override( + fontFamily: FlutterFlowTheme.of(context).headlineLargeFamily, + fontSize: limitedInputFontSize, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context).headlineLargeFamily), + ), + pickerBackgroundColor: FlutterFlowTheme.of(context).primaryBackground, + pickerForegroundColor: FlutterFlowTheme.of(context).primaryText, + selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context).primary, + selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: FlutterFlowTheme.of(context).primaryText, + iconSize: 24.0, ); + }, + ); if (pickedDate != null) { setState(() { @@ -399,170 +323,134 @@ class _PetsPageWidgetState extends State with SingleTickerProvid pickedDate.day, ); - _model.textControllerData = - TextEditingController( - text: dateTimeFormat( - 'dd/MM/yyyy', - _model.selectedDate, - locale: FFLocalizations.of(context) - .languageCode, - )); - _model.textControllerData?.selection = - TextSelection.collapsed( - offset: _model.textControllerData! - .text.length, - ); - }); - } - }, - child: Container( - width: double.infinity, - height: 80.0, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(10.0), - ), - ), + _model.textControllerData = TextEditingController( + text: dateTimeFormat( + 'dd/MM/yyyy', + _model.selectedDate, + locale: FFLocalizations.of(context).languageCode, + )); + _model.textControllerData?.selection = TextSelection.collapsed( + offset: _model.textControllerData!.text.length, + ); + }); + } + }, + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.0), ), ), - ], + ), ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0, 0.0, 15), - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Selecione as opções disponíveis', - enText: 'Select the available options', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodySmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodySmallFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - fontSize: limitedSubHeaderFontSize, - ), + ], ), ), - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: CustomSelect( - options: const ['MAC', 'FEM'], - controller: _model.dropDownValueController1 ??= - FormFieldController( - _model.dropDownValue1 ??= ''), - isRequired: true, - changed: (val) => safeSetState(() { - _model.dropDownValue1 = val; - }), - dropDownValue: _model.dropDownValue1, - optionsLabel: [ - FFLocalizations.of(context).getVariableText( - ptText: 'Macho', enText: 'Male'), - FFLocalizations.of(context).getVariableText( - ptText: 'Fêmea', enText: 'Female') - ], - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Gênero do Pet', - enText: 'Gender of the Pet') - ), - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: CustomSelect( - options: const ['MIN', 'PEQ', 'MED', 'GRA', 'GIG'], - controller: _model.dropDownValueController2 ??= - FormFieldController( - _model.dropDownValue2 ??= ''), - isRequired: true, - changed: (val) => safeSetState(() { - _model.dropDownValue2 = val; - }), - dropDownValue: _model.dropDownValue2, - optionsLabel: [ - FFLocalizations.of(context).getVariableText( - ptText: 'Mini', enText: 'Mini'), - FFLocalizations.of(context).getVariableText( - ptText: 'Pequeno', enText: 'Small'), - FFLocalizations.of(context).getVariableText( - ptText: 'Médio', enText: 'Medium'), - FFLocalizations.of(context).getVariableText( - ptText: 'Grande', enText: 'Big'), - FFLocalizations.of(context).getVariableText( - ptText: 'Gigante', enText: 'Giant'), - ], - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Porte do Pet', - enText: 'Size of the Pet')), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0, 0.0, 15), - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Você tem alguma observação sobre o seu Pet?', - enText: - 'Do you have any observations about your Pet?', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodySmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodySmallFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - fontSize: limitedInputFontSize, - ), - ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0, 0.0, 15), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Selecione as opções disponíveis', + enText: 'Select the available options', ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodySmall.override( + fontFamily: FlutterFlowTheme.of(context).bodySmallFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedSubHeaderFontSize, + ), ), - CustomInputUtil( - controller: _model.textControllerObservation, - validator: _model.textControllerObservationValidator - .asValidator(context), - focusNode: _model.textFieldFocusObservation, - labelText: FFLocalizations.of(context).getVariableText( - ptText: 'Escreva as suas observações aqui...', - enText: 'Write your observations here...'), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Escreva as suas observações aqui...', - enText: 'Write your observations here...'), - suffixIcon: Icons.text_fields, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 250, + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), + child: CustomSelect( + options: const ['MAC', 'FEM'], + controller: _model.dropDownValueController1 ??= + FormFieldController(_model.dropDownValue1 ??= ''), + isRequired: true, + changed: (val) => safeSetState(() { + _model.dropDownValue1 = val; + }), + dropDownValue: _model.dropDownValue1, + optionsLabel: [ + FFLocalizations.of(context).getVariableText(ptText: 'Macho', enText: 'Male'), + FFLocalizations.of(context).getVariableText(ptText: 'Fêmea', enText: 'Female') + ], + hintText: FFLocalizations.of(context) + .getVariableText(ptText: 'Gênero do Pet', enText: 'Gender of the Pet')), + ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), + child: CustomSelect( + options: const ['MIN', 'PEQ', 'MED', 'GRA', 'GIG'], + controller: _model.dropDownValueController2 ??= + FormFieldController(_model.dropDownValue2 ??= ''), + isRequired: true, + changed: (val) => safeSetState(() { + _model.dropDownValue2 = val; + }), + dropDownValue: _model.dropDownValue2, + optionsLabel: [ + FFLocalizations.of(context).getVariableText(ptText: 'Mini', enText: 'Mini'), + FFLocalizations.of(context).getVariableText(ptText: 'Pequeno', enText: 'Small'), + FFLocalizations.of(context).getVariableText(ptText: 'Médio', enText: 'Medium'), + FFLocalizations.of(context).getVariableText(ptText: 'Grande', enText: 'Big'), + FFLocalizations.of(context).getVariableText(ptText: 'Gigante', enText: 'Giant'), + ], + hintText: FFLocalizations.of(context) + .getVariableText(ptText: 'Porte do Pet', enText: 'Size of the Pet')), + ), + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0, 0.0, 15), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Você tem alguma observação sobre o seu Pet?', + enText: 'Do you have any observations about your Pet?', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodySmall.override( + fontFamily: FlutterFlowTheme.of(context).bodySmallFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedInputFontSize, + ), ), - Padding( - padding: const EdgeInsets.fromLTRB(70, 20, 70, 30), - child: SubmitButtonUtil( - labelText: FFLocalizations.of(context) - .getVariableText( - ptText: 'Cadastrar', enText: 'Register'), - onPressed: _model.isFormValid(context) - ? _model.registerPet - : null), - ), - ])), + ), + ), + CustomInputUtil( + controller: _model.textControllerObservation, + validator: _model.textControllerObservationValidator.asValidator(context), + focusNode: _model.textFieldFocusObservation, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Escreva as suas observações aqui...', enText: 'Write your observations here...'), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Escreva as suas observações aqui...', enText: 'Write your observations here...'), + suffixIcon: Icons.text_fields, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 250, + ), + Padding( + padding: const EdgeInsets.fromLTRB(70, 20, 70, 30), + child: SubmitButtonUtil( + labelText: FFLocalizations.of(context).getVariableText(ptText: 'Cadastrar', enText: 'Register'), + onPressed: _model.isFormValid(context) ? _model.registerPet : null), + ), + ])), ], ), ); diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 18016c98..2b57ed67 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -23,8 +23,7 @@ class PreferencesPageModel with ChangeNotifier { late bool isPanic = false; Future _initialize() async { - isFingerprint = - await StorageHelper().get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true'; + isFingerprint = await StorageHelper().get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true'; isPerson = await StorageHelper().get(SQLiteStorageKey.person.value, Storage.SQLiteStorage) == 'true'; isNotify = await StorageHelper().get(SQLiteStorageKey.notify.value, Storage.SQLiteStorage) == 'true'; isAccess = await StorageHelper().get(SQLiteStorageKey.access.value, Storage.SQLiteStorage) == 'true'; @@ -89,8 +88,8 @@ class PreferencesPageModel with ChangeNotifier { ); SnackBarUtil.showSnackBar(context, content, isError: true); }) - .then((_) async => isNotify = - await StorageHelper().get(SQLiteStorageKey.notify.value, Storage.SQLiteStorage) == 'true') + .then((_) async => + isNotify = await StorageHelper().get(SQLiteStorageKey.notify.value, Storage.SQLiteStorage) == 'true') .whenComplete(() => notifyListeners()); context.pop(); } @@ -168,8 +167,8 @@ class PreferencesPageModel with ChangeNotifier { ); SnackBarUtil.showSnackBar(context, content, isError: true); }) - .then((_) async => isAccess = - await StorageHelper().get(SQLiteStorageKey.access.value, Storage.SQLiteStorage) == 'true') + .then((_) async => + isAccess = await StorageHelper().get(SQLiteStorageKey.access.value, Storage.SQLiteStorage) == 'true') .whenComplete(() => notifyListeners()); } @@ -228,8 +227,7 @@ class PreferencesPageModel with ChangeNotifier { .set(SQLiteStorageKey.fingerprint.value, isFingerprint ? 'true' : 'false', Storage.SQLiteStorage); notifyListeners(); SnackBarUtil.showSnackBar(context, content); - isFingerprint = - await StorageHelper().get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true'; + isFingerprint = await StorageHelper().get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true'; } isFingerprint ? onChange(null) : _showPassKey(context, onChange); diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart index 38877076..c8603a7a 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -22,7 +22,6 @@ class _PreferencesPageWidgetState extends State { super.initState(); } - @override Widget build(BuildContext context) { return ChangeNotifierProvider( diff --git a/lib/pages/qr_code_page/qr_code_page_model.dart b/lib/pages/qr_code_page/qr_code_page_model.dart index a35c02ef..514f99b2 100644 --- a/lib/pages/qr_code_page/qr_code_page_model.dart +++ b/lib/pages/qr_code_page/qr_code_page_model.dart @@ -29,8 +29,7 @@ class QrCodePageModel extends FlutterFlowModel { } Future initVariable() async { - isFingerprint = - await StorageHelper().get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true'; + isFingerprint = await StorageHelper().get(SQLiteStorageKey.fingerprint.value, Storage.SQLiteStorage) == 'true'; userDevUUID = await StorageHelper().get(SQLiteStorageKey.userDevUUID.value, Storage.SQLiteStorage) ?? ''; safeSetState?.call(); } diff --git a/lib/pages/qr_code_page/qr_code_page_widget.dart b/lib/pages/qr_code_page/qr_code_page_widget.dart index 4b56e466..43d904df 100644 --- a/lib/pages/qr_code_page/qr_code_page_widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -113,7 +113,7 @@ class _QrCodePageWidgetState extends State with TickerProvider children: [ if (_model.isAccess == true && _model.key != null) Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0 , 20), + padding: const EdgeInsets.fromLTRB(0, 0, 0, 20), child: Text( FFLocalizations.of(context).getVariableText( ptText: 'Use esse QR Code para acesso', @@ -125,9 +125,8 @@ class _QrCodePageWidgetState extends State with TickerProvider fontSize: limitedHeaderTextSize, letterSpacing: 0.0, fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - + useGoogleFonts: + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), ), ), @@ -141,7 +140,7 @@ class _QrCodePageWidgetState extends State with TickerProvider safeSetState(() async { _resetAnimationAndToggleAccess(); }); - + _model.isFingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context); @@ -207,21 +206,15 @@ class _QrCodePageWidgetState extends State with TickerProvider ), options: FFButtonOptions( height: 40.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .titleSmallFamily, + textStyle: FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: FlutterFlowTheme.of(context).titleSmallFamily, color: Colors.white, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .titleSmallFamily), + .containsKey(FlutterFlowTheme.of(context).titleSmallFamily), fontSize: LimitedFontSizeUtil.getCalculateFontSize(context, 12, 12, 10), ), elevation: 3.0, @@ -248,18 +241,16 @@ class _QrCodePageWidgetState extends State with TickerProvider visible: _model.isAccess == true, child: Text( FFLocalizations.of(context).getVariableText( - ptText: - 'Certifique-se de que o QRCode está visivel para o leitor', + ptText: 'Certifique-se de que o QRCode está visivel para o leitor', enText: 'Make sure the QRCode is visible to the reader', // '6z6kvmhl' /* Certifique-se de que o QRCode ... */, ), textAlign: TextAlign.center, 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), fontSize: limitedBodyFontSize, ), ), @@ -283,8 +274,7 @@ class _QrCodePageWidgetState extends State with TickerProvider children: [ Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getVariableText( ptText: 'Expirando QR code em', @@ -293,13 +283,11 @@ class _QrCodePageWidgetState extends State with TickerProvider ), textAlign: TextAlign.center, style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), + useGoogleFonts: + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 14), ), ), @@ -308,13 +296,11 @@ class _QrCodePageWidgetState extends State with TickerProvider Align( alignment: const AlignmentDirectional(0.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 20.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 20.0, 0.0), child: StreamBuilder( stream: getProgressValue(), builder: (context, snapshot) { - if (snapshot.connectionState == - ConnectionState.waiting) { + if (snapshot.connectionState == ConnectionState.waiting) { return const CircularProgressIndicator(); } else if (snapshot.hasError) { return Text('Error: ${snapshot.error}'); @@ -333,23 +319,16 @@ class _QrCodePageWidgetState extends State with TickerProvider onAnimationEnd: () { _resetAnimationAndToggleAccess(); }, - progressColor: - FlutterFlowTheme.of(context).primary, - backgroundColor: - FlutterFlowTheme.of(context).primaryText, + progressColor: FlutterFlowTheme.of(context).primary, + backgroundColor: FlutterFlowTheme.of(context).primaryText, center: Text( '${(progress * totalTimeInSeconds / 5).toStringAsFixed(1)}s', - style: FlutterFlowTheme.of(context) - .headlineSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .headlineSmallFamily, + style: FlutterFlowTheme.of(context).headlineSmall.override( + fontFamily: FlutterFlowTheme.of(context).headlineSmallFamily, fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 14), letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .headlineSmallFamily), + .containsKey(FlutterFlowTheme.of(context).headlineSmallFamily), ), ), startAngle: 20.0, @@ -373,7 +352,7 @@ class _QrCodePageWidgetState extends State with TickerProvider Future _showBiometricsAuth(BuildContext context) async { await BiometricHelper.checkBiometrics() .then((value) async => await BiometricHelper.authenticateBiometric().then((value) async { - if (value == false) throw Exception('Biometric authentication failed'); + if (value == false) throw Exception('Biometric authentication failed'); final key = await StorageHelper().get(SecureStorageKey.fingerprintPass.value, Storage.SecureStorage); if (key == null || key.isEmpty) throw Exception('No key found'); safeSetState(() { diff --git a/lib/pages/reception_page/reception_page_widget.dart b/lib/pages/reception_page/reception_page_widget.dart index 7a5ff99b..9cf5a0a8 100644 --- a/lib/pages/reception_page/reception_page_widget.dart +++ b/lib/pages/reception_page/reception_page_widget.dart @@ -122,8 +122,7 @@ class _ReceptionPageWidgetState extends State with WidgetsB enText: 'My Identifier'), textStyle: FlutterFlowTheme.of(context).labelSmall.override( fontFamily: 'Nunito Sans', - color: FlutterFlowTheme.of(context) - .secondaryText, + color: FlutterFlowTheme.of(context).secondaryText, fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -135,12 +134,9 @@ class _ReceptionPageWidgetState extends State with WidgetsB .getVariableText(ptText: 'Meu Identificador', enText: 'My Identifier'), options: FFButtonOptions( width: double.infinity, - height:30, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), + height: 30, + 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: 'Nunito Sans', @@ -187,16 +183,10 @@ class _ReceptionPageWidgetState extends State with WidgetsB options: FFButtonOptions( width: double.infinity, height: 30, - 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) - .titleSmall - .override( + 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).titleSmall.override( fontFamily: 'Nunito Sans', color: FlutterFlowTheme.of(context).primaryBackground, fontSize: limitedInputFontSize, diff --git a/lib/pages/reservation_page/reservation_page_widget.dart b/lib/pages/reservation_page/reservation_page_widget.dart index 246b8b48..c8e210c3 100644 --- a/lib/pages/reservation_page/reservation_page_widget.dart +++ b/lib/pages/reservation_page/reservation_page_widget.dart @@ -23,12 +23,9 @@ class _ReservationPageWidgetState extends State { Future> initVariables() async { final email = (await StorageHelper().get(hub.SecureStorageKey.email.value, hub.Storage.SecureStorage)) ?? ''; - final name = - (await StorageHelper().get(hub.SQLiteStorageKey.userName.value, hub.Storage.SQLiteStorage)) ?? ''; - final devUUID = - (await StorageHelper().get(hub.SQLiteStorageKey.devUUID.value, hub.Storage.SQLiteStorage)) ?? ''; - final userUUID = - (await StorageHelper().get(hub.SQLiteStorageKey.userUUID.value, hub.Storage.SQLiteStorage)) ?? ''; + final name = (await StorageHelper().get(hub.SQLiteStorageKey.userName.value, hub.Storage.SQLiteStorage)) ?? ''; + final devUUID = (await StorageHelper().get(hub.SQLiteStorageKey.devUUID.value, hub.Storage.SQLiteStorage)) ?? ''; + final userUUID = (await StorageHelper().get(hub.SQLiteStorageKey.userUUID.value, hub.Storage.SQLiteStorage)) ?? ''; final clientId = (await StorageHelper().get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage)) ?? ''; const createdAt = '0000-00-00 00:00:00'; diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index 4b2d819a..2acd9126 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -417,7 +417,6 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel ptText: 'Cancelar', enText: 'Cancel', ), - icon: const Icon(Icons.close), onPressed: () async { showAlertDialog( @@ -475,7 +474,7 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel }); }, options: FFButtonOptions( - width: MediaQuery.of(context).size.width * 0.3, + width: MediaQuery.of(context).size.width * 0.3, height: 40, color: FlutterFlowTheme.of(context).primaryBackground, elevation: 0, diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 6777162f..db495eb5 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -154,8 +154,7 @@ class _ScheduleCompleteVisitPageWidgetState extends State e).toList(); + final visitorListView = model.visitorJsonList.map((e) => e).toList(); return ListView.separated( padding: const EdgeInsets.fromLTRB( 0, @@ -801,20 +668,16 @@ class _ScheduleCompleteVisitPageWidgetState extends State - const SizedBox(height: 5.0), + separatorBuilder: (_, __) => const SizedBox(height: 5.0), itemBuilder: (context, visitorListViewIndex) { - final visitorListViewItem = - visitorListView[visitorListViewIndex]; + final visitorListViewItem = visitorListView[visitorListViewIndex]; return Padding( - padding: - const EdgeInsets.symmetric(horizontal: 30), + padding: const EdgeInsets.symmetric(horizontal: 30), child: Container( width: MediaQuery.of(context).size.width, height: 70.0, decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, + color: FlutterFlowTheme.of(context).primaryBackground, ), child: Row( mainAxisSize: MainAxisSize.max, @@ -828,10 +691,8 @@ class _ScheduleCompleteVisitPageWidgetState extends State model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(model.unfocusNode) + ? FocusScope.of(context).requestFocus(model.unfocusNode) : FocusScope.of(context).unfocus(), child: SizedBox( - height: MediaQuery.of(context).size.height * 0.8, + height: MediaQuery.of(context).size.height * 0.8, width: MediaQuery.of(context).size.width, child: Padding( padding: MediaQuery.viewInsetsOf(context), child: VisitorSearchModalTemplateComponentWidget( - getVisitors: (visitorsParam) async { - model.visitorJsonList = visitorsParam!.toList().cast(); - model.visitorJsonList = visitorsParam!.toList().cast(); - safeSetState(() {}); - }, - getDocs: (docsParam) async { - model.visitorStrList = strListToStr(docsParam!.toList()); - model.visitorStrList = strListToStr(docsParam!.toList()); - safeSetState(() {}); - }, + getVisitors: (visitorsParam) async { + model.visitorJsonList = visitorsParam!.toList().cast(); + model.visitorJsonList = visitorsParam!.toList().cast(); + safeSetState(() {}); + }, + getDocs: (docsParam) async { + model.visitorStrList = strListToStr(docsParam!.toList()); + model.visitorStrList = strListToStr(docsParam!.toList()); + safeSetState(() {}); + }, ), ), ), @@ -950,41 +796,30 @@ class _ScheduleCompleteVisitPageWidgetState extends State( - FlutterFlowTheme.of(context) - .primary, + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, ), ), ) : Icon( Icons.add, - color: FlutterFlowTheme.of(context) - .primary, + color: FlutterFlowTheme.of(context).primary, size: 30.0, ), Padding( - padding: - const EdgeInsets.fromLTRB(0, 15, 0, 0), + padding: const EdgeInsets.fromLTRB(0, 15, 0, 0), child: Text( FFLocalizations.of(context).getText( 'r8soavtz', ), textAlign: TextAlign.center, - style: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, + style: FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: FlutterFlowTheme.of(context).titleSmallFamily, + color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedInputFontSize, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), + .containsKey(FlutterFlowTheme.of(context).titleSmallFamily), ), ), ) @@ -1003,23 +838,18 @@ class _ScheduleCompleteVisitPageWidgetState extends State( future: PhpGroup.getDadosCall.call(), @@ -1047,66 +876,47 @@ class _ScheduleCompleteVisitPageWidgetState extends State( - fillColor: FlutterFlowTheme.of(context) - .primaryBackground, - controller: - model.dropDownValueController1, + fillColor: FlutterFlowTheme.of(context).primaryBackground, + controller: model.dropDownValueController1, options: model.reasonsDropDown1, optionLabels: reasonsOptionLabels, - onChanged: (val) => safeSetState( - () => model.dropDownValue1 = val), + onChanged: (val) => safeSetState(() => model.dropDownValue1 = val), width: double.infinity, height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, + textStyle: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), fontSize: limitedInputFontSize, ), - hintText: - FFLocalizations.of(context).getVariableText(enText: 'Reason for Visit', ptText: 'Motivo da Visita' - ), - + hintText: FFLocalizations.of(context) + .getVariableText(enText: 'Reason for Visit', ptText: 'Motivo da Visita'), icon: Icon( Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, + color: FlutterFlowTheme.of(context).accent1, size: 24.0, ), elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context) - .customColor6, + borderColor: FlutterFlowTheme.of(context).customColor6, borderWidth: 0.5, borderRadius: 10.0, - margin: const EdgeInsetsDirectional - .fromSTEB(16.0, 0.0, 16.0, 0.0), + margin: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 0.0), hidesUnderline: true, isOverButton: true, isSearchable: false, @@ -1126,8 +936,7 @@ class _ScheduleCompleteVisitPageWidgetState extends State( future: PhpGroup.getDadosCall.call(), @@ -1167,66 +974,49 @@ class _ScheduleCompleteVisitPageWidgetState extends State( - controller: - model.dropDownValueController2, + controller: model.dropDownValueController2, options: model.lavelsDropDown2, optionLabels: lavelsOptionLabels, - onChanged: (val) => safeSetState( - () => model.dropDownValue2 = val), + onChanged: (val) => safeSetState(() => model.dropDownValue2 = val), width: double.infinity, height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, + textStyle: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), fontSize: limitedInputFontSize, ), - hintText: - FFLocalizations.of(context).getVariableText( - enText: 'Level of access', - ptText: 'Nível de acesso', + hintText: FFLocalizations.of(context).getVariableText( + enText: 'Level of access', + ptText: 'Nível de acesso', ), icon: Icon( Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, + color: FlutterFlowTheme.of(context).accent1, size: 24.0, ), elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context) - .customColor6, + borderColor: FlutterFlowTheme.of(context).customColor6, borderWidth: 0.5, borderRadius: 10.0, - margin: const EdgeInsetsDirectional - .fromSTEB(16.0, 0.0, 16.0, 0.0), + margin: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 0.0), hidesUnderline: true, - fillColor: FlutterFlowTheme.of(context) - .primaryBackground, + fillColor: FlutterFlowTheme.of(context).primaryBackground, isOverButton: true, isSearchable: false, isMultiSelect: false, @@ -1245,8 +1035,7 @@ class _ScheduleCompleteVisitPageWidgetState extends State scheduleVisit() async { @@ -1516,17 +1268,14 @@ class _ScheduleCompleteVisitPageWidgetState extends State - await DialogUtil.errorDefault(context)) + .catchError((e) async => await DialogUtil.errorDefault(context)) .then((value) async { if (PhpGroup.postScheduleVisitCall.error( (value.jsonBody ?? ''), @@ -1534,22 +1283,20 @@ class _ScheduleCompleteVisitPageWidgetState extends State(''); - model.dropDownValueController2 = FormFieldController(''); - model.visitorStrList = ''; - model.visitorJsonList = []; + model.dropDownValue1 = null; + model.dropDownValue2 = null; + model.dropDownValueController1 = FormFieldController(''); + model.dropDownValueController2 = FormFieldController(''); + model.visitorStrList = ''; + model.visitorJsonList = []; ToastUtil.showToast( - message: FFLocalizations.of(context) - .getVariableText( - ptText: 'Visitante já adicionado!', - enText: 'Visitor already added!'), - gravity: ToastGravity.TOP, - backgroundColor: Colors.green, - fontSize: LimitedFontSizeUtil.getBodyFontSize(context), - ); + message: FFLocalizations.of(context) + .getVariableText(ptText: 'Visitante já adicionado!', enText: 'Visitor already added!'), + gravity: ToastGravity.TOP, + backgroundColor: Colors.green, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ); await ShareUtil.showShare(value.jsonBody); } else { @@ -1567,12 +1314,9 @@ class _ScheduleCompleteVisitPageWidgetState extends State model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(model.unfocusNode) + ? FocusScope.of(context).requestFocus(model.unfocusNode) : FocusScope.of(context).unfocus(), child: Dialog( alignment: Alignment.topCenter, @@ -1591,8 +1334,7 @@ class _ScheduleCompleteVisitPageWidgetState extends State.from({ - FFLocalizations.of(context) - .getVariableText( + FFLocalizations.of(context).getVariableText( ptText: 'Inativo', enText: 'Inactive', ): FlutterFlowTheme.of(context).success, @@ -1667,11 +1399,11 @@ class _ScheduleCompleteVisitPageWidgetState extends State with TickerProv @override Widget build(BuildContext context) { - double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); return Column( @@ -143,14 +142,13 @@ class _VisitHistoryWidgetState extends State with TickerProv mainAxisSize: MainAxisSize.max, children: [ Center( - child: Text(FFLocalizations.of(context) - .getVariableText(ptText: "Nenhuma visita encontrada!", enText: "No visit found"), + child: Text( + FFLocalizations.of(context) + .getVariableText(ptText: "Nenhuma visita encontrada!", enText: "No visit found"), style: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedHeaderFontSize, - fontWeight: FontWeight.bold - ) - ), + color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedHeaderFontSize, + fontWeight: FontWeight.bold)), ) ], ), @@ -248,12 +246,9 @@ class _VisitHistoryWidgetState extends State with TickerProv ], onTapCardItemAction: () async { final devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final cliUUID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; - final cliName = - (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? ''; + final userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? ''; await showDialog( useSafeArea: true, diff --git a/lib/shared/components/atoms/atom_terms_of_use.dart b/lib/shared/components/atoms/atom_terms_of_use.dart index 645691a1..b9f14a30 100644 --- a/lib/shared/components/atoms/atom_terms_of_use.dart +++ b/lib/shared/components/atoms/atom_terms_of_use.dart @@ -18,8 +18,7 @@ class AtomTermsOfUse extends StatelessWidget { style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedFontSizeUtil.getInputFontSize( - context), + fontSize: LimitedFontSizeUtil.getInputFontSize(context), letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), diff --git a/lib/shared/helpers/sqlite_storage.dart b/lib/shared/helpers/sqlite_storage.dart index ed9af1da..774a9afe 100644 --- a/lib/shared/helpers/sqlite_storage.dart +++ b/lib/shared/helpers/sqlite_storage.dart @@ -15,7 +15,8 @@ class SQLiteStorage implements BaseStorage { late final _database; - @override Future init() async { + @override + Future init() async { _database = await openDatabase( join(await getDatabasesPath(), _dbName), version: _dbVersion, @@ -29,10 +30,10 @@ class SQLiteStorage implements BaseStorage { _onCreate(Database database, int version) async { await database.execute(_tableKeychain); } + _onUpdate(Database database, int oldVersion, int newVersion) async {} _onDowngrade(Database database, int oldVersion, int newVersion) async {} - String get _tableKeychain => ''' CREATE TABLE keychain ( key TEXT UNIQUE, @@ -66,7 +67,8 @@ class SQLiteStorage implements BaseStorage { {'key': SQLiteStorageKey.petAmount.value, 'value': '', 'type': 'local'}, ]; - @override Future get(String key) async { + @override + Future get(String key) async { var response = await _database.query('keychain', where: 'key = ?', whereArgs: [key]); if (response.isEmpty) { return null; @@ -74,7 +76,8 @@ class SQLiteStorage implements BaseStorage { return response.first['value']; } - @override Future set(String key, String value) async { + @override + Future set(String key, String value) async { var date = DateTime.now().toIso8601String(); await _database.insert( tableKeychain, @@ -86,15 +89,16 @@ class SQLiteStorage implements BaseStorage { 'resolvedAt': date, 'createdAt': date, }, - conflictAlgorithm: ConflictAlgorithm.replace - ); + conflictAlgorithm: ConflictAlgorithm.replace); } - @override Future delete(String key) async { + @override + Future delete(String key) async { await _database.delete('keychain', where: 'key = ?', whereArgs: [key]); } - @override Future clearAll() async { + @override + Future clearAll() async { await _database.delete('keychain'); } } diff --git a/lib/shared/helpers/storage_helper.dart b/lib/shared/helpers/storage_helper.dart index 5dc29a47..582a3b4b 100644 --- a/lib/shared/helpers/storage_helper.dart +++ b/lib/shared/helpers/storage_helper.dart @@ -4,13 +4,11 @@ import 'package:hub/shared/helpers/secure_storage.dart'; import 'package:hub/shared/helpers/shared_preferences_storage.dart'; import 'package:hub/shared/helpers/sqlite_storage.dart'; - class StorageHelper { static final StorageHelper _instance = StorageHelper._internal(); factory StorageHelper() => _instance; StorageHelper._internal(); - late BuildContext? _context; late bool _isRecovered = false; BuildContext? get context => _context; @@ -75,6 +73,4 @@ class StorageHelper { return SQLiteStorage.instance.clearAll(); } } - - } diff --git a/lib/shared/services/authentication/authentication_service.dart b/lib/shared/services/authentication/authentication_service.dart index b81eb6d2..25529e38 100644 --- a/lib/shared/services/authentication/authentication_service.dart +++ b/lib/shared/services/authentication/authentication_service.dart @@ -84,7 +84,8 @@ class AuthenticationService { DialogUtil.error(context, response.jsonBody['error_msg'].toString()); } } - } return; + } + return; } catch (e, s) { DialogUtil.errorDefault(context); LogUtil.requestAPIFailed('login.php', emailAdress.toString(), "Login", e, s); @@ -219,4 +220,4 @@ class AuthenticationService { SnackBarUtil.showSnackBar(context, content, isError: true); } } -} \ No newline at end of file +} diff --git a/lib/shared/services/localization/localization_service.dart b/lib/shared/services/localization/localization_service.dart index bfee18f3..7e716409 100644 --- a/lib/shared/services/localization/localization_service.dart +++ b/lib/shared/services/localization/localization_service.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/shared/helpers/base_storage.dart'; import 'package:hub/shared/helpers/storage_helper.dart'; +import 'package:hub/shared/utils/device_util.dart'; import 'package:hub/shared/utils/dialog_util.dart'; import '../../../backend/api_requests/api_calls.dart'; @@ -203,7 +204,7 @@ class LocalizationService { final String userUUID = await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage) ?? ''; final bool isAuthenticated = userUUID.isNotEmpty && devUUID.isNotEmpty; final bool isDevLinked = !errorMsg.contains('Esse dispositivo nao pertence a esse usuario'); - log('() => isLinked: $errorMsg'); + log('() => isLinked: $errorMsg'); if (!isAuthenticated) { errorMsg = FFLocalizations.of(context).getVariableText( ptText: 'Erro ao obter credenciais de autenticação', @@ -222,7 +223,6 @@ class LocalizationService { return; } await DialogUtil.error(context, errorMsg).whenComplete(() async => await selectLocal(context)); - } static Future _handleUnavailable(BuildContext context, List locals) async { @@ -279,8 +279,7 @@ class LocalizationService { static Future _isUnselected() async { String cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; String cliName = (await StorageHelper().get(SQLiteStorageKey.clientName.value, Storage.SQLiteStorage)) ?? ''; - String ownerUUID = - (await StorageHelper().get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? ''; + String ownerUUID = (await StorageHelper().get(SQLiteStorageKey.ownerUUID.value, Storage.SQLiteStorage)) ?? ''; return cliUUID.isEmpty && cliName.isEmpty && ownerUUID.isEmpty; } @@ -307,10 +306,8 @@ class LocalizationService { SQLiteStorageKey.petAmount.value, jsonBody['petAmountRegister'] != null && jsonBody['petAmountRegister'].toString().isEmpty ? '0' - : jsonBody['petAmountRegister'].toString(), - Storage.SQLiteStorage - ); - await StorageHelper() - .set(SQLiteStorageKey.userName.value, jsonBody['visitado']['VDO_NOME'], Storage.SQLiteStorage); + : jsonBody['petAmountRegister'].toString(), + Storage.SQLiteStorage); + await StorageHelper().set(SQLiteStorageKey.userName.value, jsonBody['visitado']['VDO_NOME'], Storage.SQLiteStorage); } -} \ No newline at end of file +} diff --git a/lib/shared/utils/device_util.dart b/lib/shared/utils/device_util.dart index 8d52fcc2..c2807f31 100644 --- a/lib/shared/utils/device_util.dart +++ b/lib/shared/utils/device_util.dart @@ -2,42 +2,73 @@ import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; +import 'package:flutter/services.dart'; + class DeviceUtil { + static const MethodChannel _channel = MethodChannel("com.freaccess.hub/getAndroidId"); + + static Future getAndroidId() async { + try { + final String? androidId = await _channel.invokeMethod('getAndroidId'); + + return androidId; + } on PlatformException catch (e) { + print("Failed to get Android ID: '${e.message}'."); + + return null; + } + } + static Future getDevUUID() async { var deviceInfo = DeviceInfoPlugin(); + if (Platform.isIOS) { - // import 'dart:io' var iosDeviceInfo = await deviceInfo.iosInfo; - return iosDeviceInfo.identifierForVendor; // unique ID on iOS + return iosDeviceInfo.identifierForVendor; } else if (Platform.isAndroid) { - var androidDeviceInfo = await deviceInfo.androidInfo; - return androidDeviceInfo.id; // unique ID on Android + try { + final String? secureAndroidId = await getAndroidId(); + return secureAndroidId; + } catch (e) { + final build = await deviceInfo.androidInfo; + return build.id; + } } + return null; } static Future getSerialNumber() async { var deviceInfo = DeviceInfoPlugin(); + if (Platform.isIOS) { // import 'dart:io' + var iosDeviceInfo = await deviceInfo.iosInfo; + return iosDeviceInfo.identifierForVendor; // unique ID on iOS } else if (Platform.isAndroid) { var androidDeviceInfo = await deviceInfo.androidInfo; + return androidDeviceInfo.serialNumber; // unique ID on Android } + return null; } static Future getDeviceOSVersion() async { var deviceInfo = DeviceInfoPlugin(); + if (Platform.isIOS) { var iosDeviceInfo = await deviceInfo.iosInfo; + return iosDeviceInfo.systemVersion; // unique ID on iOS. e.g. 14.5 } else if (Platform.isAndroid) { var androidDeviceInfo = await deviceInfo.androidInfo; + return androidDeviceInfo.version.release; // unique ID on Android. e.g . 11 } + return null; } } diff --git a/lib/shared/utils/limited_text_size.dart b/lib/shared/utils/limited_text_size.dart index e0771033..199dd83b 100644 --- a/lib/shared/utils/limited_text_size.dart +++ b/lib/shared/utils/limited_text_size.dart @@ -1,7 +1,8 @@ import 'package:flutter/material.dart'; class LimitedFontSizeUtil { - static double getCalculateFontSize(BuildContext context, double baseFontSize, double maxFontSize, double limitedFontSize) { + static double getCalculateFontSize( + BuildContext context, double baseFontSize, double maxFontSize, double limitedFontSize) { final textScaler = MediaQuery.textScalerOf(context); final double scaledFontSize = baseFontSize * textScaler.scale(1); return scaledFontSize > maxFontSize ? limitedFontSize : scaledFontSize; @@ -9,18 +10,19 @@ class LimitedFontSizeUtil { static double getNoResizeFont(BuildContext context, double baseFontSize) { final textScaler = MediaQuery.textScalerOf(context); - final double noscaledFontSize = baseFontSize / textScaler.scale(1); + final double noscaledFontSize = baseFontSize / textScaler.scale(1); return noscaledFontSize; } - - static double getScaledSizedBoxSize(BuildContext context, double baseFontSize, double maxFontSize, double sizeIfExceeded, double sizeIfNotExceeded) { + + static double getScaledSizedBoxSize( + BuildContext context, double baseFontSize, double maxFontSize, double sizeIfExceeded, double sizeIfNotExceeded) { final textScaler = MediaQuery.textScalerOf(context); final double scaledFontSize = baseFontSize * textScaler.scale(1); return scaledFontSize > maxFontSize ? sizeIfExceeded : sizeIfNotExceeded; } static double getBodyFontSize(BuildContext context) { - final textScaler = MediaQuery.textScalerOf(context); + final textScaler = MediaQuery.textScalerOf(context); final double scaledFontSize = 12 * textScaler.scale(1); return scaledFontSize > 12 ? 10 : scaledFontSize; } @@ -42,4 +44,4 @@ class LimitedFontSizeUtil { final double scaledFontSize = 14 * textScaler.scale(1); return scaledFontSize > 14 ? 12 : scaledFontSize; } -} \ No newline at end of file +} diff --git a/lib/shared/utils/text_util.dart b/lib/shared/utils/text_util.dart index d2876a0b..344279e9 100644 --- a/lib/shared/utils/text_util.dart +++ b/lib/shared/utils/text_util.dart @@ -16,9 +16,8 @@ class TextUtil extends StatelessWidget { Widget build(BuildContext context) { var textScale = MediaQuery.textScalerOf(context); var scaledTextSize = textScale.scale(style?.fontSize ?? 14); - double limitedTextSize = scaledTextSize > (style?.fontSize ?? 14) * 2 - ? (style?.fontSize ?? 14) * 2 - : scaledTextSize; + double limitedTextSize = + scaledTextSize > (style?.fontSize ?? 14) * 2 ? (style?.fontSize ?? 14) * 2 : scaledTextSize; return Text( text,