From 787d179856113a934bef842428d98007b141fd68 Mon Sep 17 00:00:00 2001 From: LucasMartin Date: Wed, 21 Aug 2024 17:27:46 -0300 Subject: [PATCH 1/8] =?UTF-8?q?Cria=C3=A7=C3=A3o=20do=20Reception=20Page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/reception_page/reception_page_model.dart | 0 lib/pages/reception_page/reception_page_widget.dart | 12 ++++++++++++ 2 files changed, 12 insertions(+) create mode 100644 lib/pages/reception_page/reception_page_model.dart create mode 100644 lib/pages/reception_page/reception_page_widget.dart diff --git a/lib/pages/reception_page/reception_page_model.dart b/lib/pages/reception_page/reception_page_model.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/reception_page/reception_page_widget.dart b/lib/pages/reception_page/reception_page_widget.dart new file mode 100644 index 00000000..bf6e05f0 --- /dev/null +++ b/lib/pages/reception_page/reception_page_widget.dart @@ -0,0 +1,12 @@ +import 'package:flutter/material.dart'; + +class ReceptionPageWidget extends StatelessWidget { + const ReceptionPageWidget({super.key}); + + @override + Widget build(BuildContext context) { + return const Scaffold( + body: Text('Olá mundo!'), + ); + } +} From af95679fa13454c50efef90603d51bbe1a64793a Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 22 Aug 2024 17:22:06 -0300 Subject: [PATCH 2/8] =?UTF-8?q?Feat:=20Cria=C3=A7=C3=A3o=20da=20Pagina=20d?= =?UTF-8?q?e=20Recep=C3=A7=C3=A3o=20do=20App(funcional)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/.tool-versions | 4 - assets/images/dark/reception.svg | 22 ++ assets/images/light/reception.svg | 22 ++ lib/flutter_flow/nav/nav.dart | 10 +- .../preferences_settings_widget.dart | 7 - .../reception_page/reception_page_model.dart | 17 ++ .../reception_page/reception_page_widget.dart | 191 +++++++++++++++++- pubspec.lock | 40 ++-- 8 files changed, 274 insertions(+), 39 deletions(-) delete mode 100644 android/.tool-versions create mode 100644 assets/images/dark/reception.svg create mode 100644 assets/images/light/reception.svg diff --git a/android/.tool-versions b/android/.tool-versions deleted file mode 100644 index d673a119..00000000 --- a/android/.tool-versions +++ /dev/null @@ -1,4 +0,0 @@ -gradle 7.6.3 -flutter 3.24.0-stable -java openjdk-19 -kotlin 2.0.10 diff --git a/assets/images/dark/reception.svg b/assets/images/dark/reception.svg new file mode 100644 index 00000000..f5b8fe42 --- /dev/null +++ b/assets/images/dark/reception.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/light/reception.svg b/assets/images/light/reception.svg new file mode 100644 index 00000000..bb6d64de --- /dev/null +++ b/assets/images/light/reception.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index a023abb9..ba1ab412 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -5,6 +5,7 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/fast_pass_page/fast_pass_page_widget.dart'; import 'package:hub/pages/message_history_page/message_history_page_widget.dart'; import 'package:hub/pages/preferences_settings_page/preferences_settings_widget.dart'; +import 'package:hub/pages/reception_page/reception_page_widget.dart'; import 'package:provider/provider.dart'; import '../../main.dart'; @@ -79,11 +80,10 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( builder: (context, params) => params.isEmpty ? const HomePageWidget() : const HomePageWidget(), ), - // FFRoute( - // name: 'visitHistoryPage', - // path: '/visitHistoryPage', - // builder: (context, params) => const VisitHistoryPageWidget(), - // ), + FFRoute( + name: 'receptionPage', + path: '/receptionPage', + builder: (context, params) => const ReceptionPageWidget()), FFRoute( name: 'messageHistoryPage', path: '/messageHistoryPage', diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart index 8f0d6fd1..76ca0a99 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -66,13 +66,6 @@ class PreferencesPageWidget extends StatelessWidget { Expanded( flex: 2, child: ListView.builder( - // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - // crossAxisCount: 3, - // crossAxisSpacing: 12.0, - // mainAxisSpacing: 12.0, - // childAspectRatio: 1.0, - // mainAxisExtent: 100.0, - // ), itemCount: 7, // Assuming 4 items for simplicity padding: const EdgeInsets.symmetric(horizontal: 20.0), physics: const AlwaysScrollableScrollPhysics(), diff --git a/lib/pages/reception_page/reception_page_model.dart b/lib/pages/reception_page/reception_page_model.dart index e69de29b..47dc15a9 100644 --- a/lib/pages/reception_page/reception_page_model.dart +++ b/lib/pages/reception_page/reception_page_model.dart @@ -0,0 +1,17 @@ +import 'package:flutter/material.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:share_plus/share_plus.dart'; + +class ReceptionPageModel with ChangeNotifier { + void getIdenfifier(BuildContext context) { + notifyListeners(); + Share.share( + FFLocalizations.of(context).getVariableText( + ptText: + 'Este é o meu identificador de acesso: ${AppState().userDevUUID}', + enText: 'This is my access identifier: ${AppState().userDevUUID}', + ), + ); + } +} diff --git a/lib/pages/reception_page/reception_page_widget.dart b/lib/pages/reception_page/reception_page_widget.dart index bf6e05f0..ee020787 100644 --- a/lib/pages/reception_page/reception_page_widget.dart +++ b/lib/pages/reception_page/reception_page_widget.dart @@ -1,12 +1,197 @@ import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/reception_page/reception_page_model.dart'; +import 'package:provider/provider.dart'; -class ReceptionPageWidget extends StatelessWidget { +class ReceptionPageWidget extends StatefulWidget { const ReceptionPageWidget({super.key}); + @override + State createState() => _ReceptionPageWidgetState(); +} + +class _ReceptionPageWidgetState extends State { @override Widget build(BuildContext context) { - return const Scaffold( - body: Text('Olá mundo!'), + return ChangeNotifierProvider( + create: (context) => ReceptionPageModel(), + child: Scaffold( + body: Consumer( + builder: (context, ReceptionPageModel model, child) { + return SafeArea( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15.0), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Falta pouco para você\nutilizar o FRE Access Hub...', + enText: + 'You are close to using the FRE Access Hub...'), + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context).displayLarge.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).accent1, + fontSize: 20.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w700, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), + ), + const AtomImageSvgTheme( + filename: 'reception', width: 180, height: 180), + Padding( + padding: const EdgeInsets.fromLTRB(70, 30, 70.0, 60), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Envie seu identificador para seu condomínio para vincularem sua conta aos nossos sistemas.', + enText: + 'Send your identifier to your condominium to link your account to our systems.'), + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context).displaySmall.override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), + ), + Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB(30, 0, 10, 0), + child: Tooltip( + message: FFLocalizations.of(context).getVariableText( + ptText: + 'Seu identificador é utilizado para efetuar\no vinculo do seu APP com o condominio.', + enText: 'My Identifier'), + textStyle: FlutterFlowTheme.of(context) + .labelSmall + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context) + .secondaryText, + fontSize: 10.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + child: FFButtonWidget( + onPressed: () => model.getIdenfifier(context), + text: FFLocalizations.of(context).getVariableText( + ptText: 'Meu Identificador', + enText: 'My Identifier'), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).primary, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context) + .primaryBackground, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + showLoadingIndicator: false, + ), + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB(10, 0, 30, 0), + child: FFButtonWidget( + onPressed: () async { + AppState().deleteAll(); + setState(() {}); + + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }, + text: FFLocalizations.of(context).getVariableText( + ptText: 'Sair da Conta', enText: 'Logout'), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).customColor1, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context) + .primaryBackground, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + showLoadingIndicator: false, + ), + ), + ), + ], + ), + ], + ), + ); + }, + ), + ), ); } } diff --git a/pubspec.lock b/pubspec.lock index 5c474b93..49fbc8b6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -817,18 +817,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.4" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.3" leak_tracker_testing: dependency: transitive description: @@ -905,10 +905,10 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.8.0" maybe_just_nothing: dependency: transitive description: @@ -921,10 +921,10 @@ packages: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.12.0" mime: dependency: transitive description: @@ -1286,10 +1286,10 @@ packages: dependency: transitive description: name: sqflite_common - sha256: "7b41b6c3507854a159e24ae90a8e3e9cc01eb26a477c118d6dca065b5f55453e" + sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4" url: "https://pub.dev" source: hosted - version: "2.5.4+2" + version: "2.5.4" stack_trace: dependency: transitive description: @@ -1342,10 +1342,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.0" timeago: dependency: "direct main" description: @@ -1510,10 +1510,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" url: "https://pub.dev" source: hosted - version: "14.2.4" + version: "14.2.1" web: dependency: transitive description: @@ -1526,10 +1526,10 @@ packages: dependency: "direct main" description: name: webview_flutter - sha256: ec81f57aa1611f8ebecf1d2259da4ef052281cb5ad624131c93546c79ccc7736 + sha256: "6869c8786d179f929144b4a1f86e09ac0eddfe475984951ea6c634774c16b522" url: "https://pub.dev" source: hosted - version: "4.9.0" + version: "4.8.0" webview_flutter_android: dependency: transitive description: @@ -1550,10 +1550,10 @@ packages: dependency: transitive description: name: webview_flutter_wkwebview - sha256: "1942a12224ab31e9508cf00c0c6347b931b023b8a4f0811e5dec3b06f94f117d" + sha256: "9c62cc46fa4f2d41e10ab81014c1de470a6c6f26051a2de32111b2ee55287feb" url: "https://pub.dev" source: hosted - version: "3.15.0" + version: "3.14.0" win32: dependency: "direct overridden" description: @@ -1595,5 +1595,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.5.0 <4.0.0" - flutter: ">=3.24.0" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.22.0" From a2c76286e6bd996347a31f3f998fd497d2154ce6 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 23 Aug 2024 11:05:28 -0300 Subject: [PATCH 3/8] =?UTF-8?q?Feat:=20Configura=C3=A7=C3=A3o=20de=20Rotas?= =?UTF-8?q?=20e=20Ajuste=20na=20pagina=20de=20Reception?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/actions/actions.dart | 77 +++++---- lib/app_state.dart | 7 + .../sign_in_template_component_model.dart | 4 + .../sign_in_template_component_widget.dart | 2 + lib/flutter_flow/nav/nav.dart | 6 +- lib/pages/home_page/home_page_widget.dart | 2 - .../reception_page/reception_page_widget.dart | 153 +++++++++--------- 7 files changed, 136 insertions(+), 115 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index 1d454af9..bff8a1f3 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:flutter/material.dart'; // import 'package:hub/components/organisms/bottom_arrow_linked_locals/bottom_arrow_linked_locals_component_widget.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; @@ -96,7 +98,8 @@ Future manageStatusColorAction( } Future singInLoginAction( - BuildContext context, { + BuildContext context, + FlutterFlowModel model, { String? emailAdress, String? password, }) async { @@ -158,7 +161,11 @@ Future singInLoginAction( AppState().isLogged = true; - await toggleHomePage(context); + bool _haveLocal = await checkLocals(context: context, model: model); + print(await checkLocals(context: context, model: model)); + AppState().haveLocal = _haveLocal; + + await toggleApp(context, AppState().haveLocal); } else { if (PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')) == null) { DialogUtil.errorDefault(context); @@ -302,16 +309,27 @@ Future toggleSignUpPage(BuildContext context) async { ); } -Future toggleHomePage(BuildContext context) async { - context.goNamed( - 'homePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); +Future toggleApp(BuildContext context, bool haveLocal) async { + if (haveLocal == true) + context.goNamed( + 'homePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); + else + context.goNamed( + 'receptionPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ) + }, + ); } Future visitCancelAction(BuildContext context, @@ -370,8 +388,7 @@ Future snackbar(BuildContext context, {required bool opt}) async { Future checkLocals({ String? cliUUID, required BuildContext context, - required HomePageModel model, - required void Function(void Function()) safeSetState, + required FlutterFlowModel model, }) async { // A chamada para a API permanece a mesma, assumindo que é necessária sempre. final response = await PhpGroup.getLocalsCall.call( @@ -386,32 +403,26 @@ Future checkLocals({ // Uso eficiente de coleções para verificar a condição desejada. final String uuid = cliUUID ?? AppState().cliUUID; - final bool itemFound = response.jsonBody['locais'].any( - (local) => local['CLI_ID'] == uuid && local['CLU_STATUS'] == "A", - ); - - // Log e retorno condicional baseado no resultado da busca. + final bool itemFound = + response.jsonBody['locais'].any((local) => local['CLI_ID'] == uuid); if (itemFound) { - return true; - } else { - // A chamada para showModalBottomSheet permanece, mas a atualização da UI é otimizada. + if (response.jsonBody['locais'] + .any((local) => local['CLU_STATUS'] == "A")) { + return true; + } await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, enableDrag: false, + isDismissible: false, context: context, - builder: (context) => GestureDetector( - onTap: () => model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const BottomArrowLinkedLocalsComponentWidget(), - ), + builder: (context) => Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const BottomArrowLinkedLocalsComponentWidget(), ), - ); - safeSetState( - () {}); // Chamada otimizada fora do then para evitar encadeamentos desnecessários. + ); // Chamada oti + return false; + } else { return false; } } diff --git a/lib/app_state.dart b/lib/app_state.dart index 7d2a5df8..71aa445c 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -380,6 +380,13 @@ class AppState extends ChangeNotifier { secureStorage.setBool('ff_isLogged', value); } + bool _haveLocal = false; + bool get haveLocal => _haveLocal; + set haveLocal(bool value) { + _haveLocal = value; + secureStorage.setBool('ff_local', value); + } + void deleteIsLogged() { secureStorage.delete(key: 'ff_isLogged'); } diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart index e1010ec7..165de263 100644 --- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart @@ -1,3 +1,5 @@ +import 'package:hub/pages/home_page/home_page_model.dart'; + import '/flutter_flow/flutter_flow_util.dart'; import 'sign_in_template_component_widget.dart' show SignInTemplateComponentWidget; @@ -13,6 +15,8 @@ class SignInTemplateComponentModel FocusNode? emailAddressFocusNode; TextEditingController? emailAddressTextController; String? Function(BuildContext, String?)? emailAddressTextControllerValidator; + + SignInTemplateComponentModel(); String? _emailAddressTextControllerValidator( BuildContext context, String? val) { if (val == null || val.isEmpty) { diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart index 37658f1b..419b80f9 100644 --- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart @@ -548,6 +548,7 @@ class _SignInTemplateComponentWidgetState await action_blocks .singInLoginAction( context, + _model, emailAdress: _model .emailAddressTextController .text, @@ -707,6 +708,7 @@ class _SignInTemplateComponentWidgetState await action_blocks .singInLoginAction( context, + _model, emailAdress: _model .emailAddressTextController .text, diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index ba1ab412..a54d3f73 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -71,7 +71,9 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( name: '_initialize', path: '/', builder: (context, _) => AppState().isLogged - ? const HomePageWidget() + ? AppState().haveLocal + ? const HomePageWidget() + : const ReceptionPageWidget() : const WelcomePageWidget(), ), FFRoute( @@ -133,7 +135,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( FFRoute( name: 'acessHistoryPage', path: '/acessHistoryPage', - builder: (context, params) => AcessHistoryPageWidget(opt: { + builder: (context, params) => AcessHistoryPageWidget(opt: const { 'personType': '.*', 'accessType': '.*', 'search': '.*', diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index 9a78b86c..849ae66b 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -29,12 +29,10 @@ class _HomePageWidgetState extends State { bool localStatus = false; final scaffoldKey = GlobalKey(); - Future checkLocalStatus() async { localStatus = await checkLocals( context: context, model: _model, - safeSetState: safeSetState, ); } diff --git a/lib/pages/reception_page/reception_page_widget.dart b/lib/pages/reception_page/reception_page_widget.dart index ee020787..4f7e31ed 100644 --- a/lib/pages/reception_page/reception_page_widget.dart +++ b/lib/pages/reception_page/reception_page_widget.dart @@ -72,87 +72,34 @@ class _ReceptionPageWidgetState extends State { ), ), ), - Row( + Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(30, 0, 10, 0), - child: Tooltip( - message: FFLocalizations.of(context).getVariableText( - ptText: - 'Seu identificador é utilizado para efetuar\no vinculo do seu APP com o condominio.', - enText: 'My Identifier'), - textStyle: FlutterFlowTheme.of(context) - .labelSmall - .override( - fontFamily: 'Nunito Sans', - color: FlutterFlowTheme.of(context) - .secondaryText, - fontSize: 10.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - child: FFButtonWidget( - onPressed: () => model.getIdenfifier(context), - text: FFLocalizations.of(context).getVariableText( - ptText: 'Meu Identificador', - enText: 'My Identifier'), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: 'Nunito Sans', - color: FlutterFlowTheme.of(context) - .primaryBackground, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: BorderRadius.circular(12.0), + Padding( + padding: const EdgeInsets.fromLTRB(60, 0, 60, 10), + child: Tooltip( + message: FFLocalizations.of(context).getVariableText( + ptText: + 'Seu identificador é utilizado para efetuar\no vinculo do seu APP com o condominio.', + enText: 'My Identifier'), + textStyle: FlutterFlowTheme.of(context) + .labelSmall + .override( + fontFamily: 'Nunito Sans', + color: + FlutterFlowTheme.of(context).secondaryText, + fontSize: 10.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), ), - showLoadingIndicator: false, - ), - ), - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(10, 0, 30, 0), child: FFButtonWidget( - onPressed: () async { - AppState().deleteAll(); - setState(() {}); - - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - }, + onPressed: () => model.getIdenfifier(context), text: FFLocalizations.of(context).getVariableText( - ptText: 'Sair da Conta', enText: 'Logout'), + ptText: 'Meu Identificador', + enText: 'My Identifier'), options: FFButtonOptions( width: double.infinity, height: 44.0, @@ -160,7 +107,7 @@ class _ReceptionPageWidgetState extends State { 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, + color: FlutterFlowTheme.of(context).primary, textStyle: FlutterFlowTheme.of(context) .titleSmall .override( @@ -184,6 +131,56 @@ class _ReceptionPageWidgetState extends State { ), ), ), + Padding( + padding: const EdgeInsets.fromLTRB(60, 0, 60, 0), + child: FFButtonWidget( + onPressed: () async { + AppState().deleteAll(); + setState(() {}); + + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }, + text: FFLocalizations.of(context).getVariableText( + ptText: 'Sair da Conta', enText: 'Logout'), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).customColor1, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context) + .primaryBackground, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + showLoadingIndicator: false, + ), + ), ], ), ], From 0e6bb9a03aeb6f5f3bca1412b43b919dd0467b21 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 23 Aug 2024 15:13:33 -0300 Subject: [PATCH 4/8] Fix: Arrumado conflitos e alterada a logica no checkLocal --- lib/actions/actions.dart | 88 ++++--------------- lib/app_state.dart | 5 +- lib/flutter_flow/nav/nav.dart | 16 ---- lib/pages/home_page/home_page_widget.dart | 4 - .../preferences_settings_widget.dart | 11 --- pubspec.lock | 2 +- 6 files changed, 22 insertions(+), 104 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index e9e8b45f..262d3df9 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -1,4 +1,4 @@ -import 'dart:math'; +import 'dart:developer'; import 'package:flutter/material.dart'; // import 'package:hub/components/organisms/bottom_arrow_linked_locals/bottom_arrow_linked_locals_component_widget.dart'; @@ -160,12 +160,8 @@ Future singInLoginAction( AppState().serialNumber = await getSerialNumber() ?? ''; AppState().isLogged = true; - - bool _haveLocal = await checkLocals(context: context, model: model); - print(await checkLocals(context: context, model: model)); - AppState().haveLocal = _haveLocal; - - await toggleApp(context, AppState().haveLocal); + AppState().haveLocal = + await checkLocals(context: context, model: model); } else { if (PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')) == null) { DialogUtil.errorDefault(context); @@ -320,7 +316,7 @@ Future toggleApp(BuildContext context, bool haveLocal) async { ), }, ); - else + else if (haveLocal == false) context.goNamed( 'receptionPage', extra: { @@ -390,24 +386,22 @@ Future checkLocals({ required BuildContext context, required FlutterFlowModel model, }) async { - bool itemFound = false; - var modalResult; + final response = await PhpGroup.getLocalsCall.call( + devUUID: AppState().devUUID, + userUUID: AppState().userUUID, + ); + log(response.jsonBody.toString()); -<<<<<<< HEAD // Verificação rápida de erro para evitar processamento desnecessário. if (response.jsonBody['error']) { + DialogUtil.errorDefault(context); return false; } - - // Uso eficiente de coleções para verificar a condição desejada. - final String uuid = cliUUID ?? AppState().cliUUID; - final bool itemFound = - response.jsonBody['locais'].any((local) => local['CLI_ID'] == uuid); - if (itemFound) { - if (response.jsonBody['locais'] - .any((local) => local['CLU_STATUS'] == "A")) { - return true; - } + List locals = response.jsonBody['locais'] ?? []; + if (locals != null && locals.isEmpty) { + await toggleApp(context, false); + return false; + } else if (locals.where((local) => local['CLU_STATUS'] != 'A').isNotEmpty) { await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, @@ -419,57 +413,9 @@ Future checkLocals({ child: const BottomArrowLinkedLocalsComponentWidget(), ), ); // Chamada oti - return false; - } else { - return false; } -======= - do { - // A chamada para a API permanece a mesma, assumindo que é necessária sempre. - final response = await PhpGroup.getLocalsCall.call( - devUUID: AppState().devUUID, - userUUID: AppState().userUUID, - ); - - // Verificação rápida de erro para evitar processamento desnecessário. - if (response.jsonBody['error']) { - return false; - } - - // Uso eficiente de coleções para verificar a condição desejada. - final String uuid = cliUUID ?? AppState().cliUUID; - itemFound = response.jsonBody['locais'].any( - (local) => local['CLI_ID'] == uuid && local['CLU_STATUS'] == "A", - ); - - // Log e retorno condicional baseado no resultado da busca. - if (itemFound) { - return true; - } else { - // A chamada para showModalBottomSheet permanece, mas a atualização da UI é otimizada. - modalResult = await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - isDismissible: false, - context: context, - builder: (context) => GestureDetector( - onTap: () => model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const BottomArrowLinkedLocalsComponentWidget(), - ), - ), - ); - safeSetState( - () {}); // Chamada otimizada fora do then para evitar encadeamentos desnecessários. - } - } while (modalResult != true); - - return false; ->>>>>>> main + await toggleApp(context, true); + return true; } Future answersRequest(BuildContext context, String? ref, String? task, diff --git a/lib/app_state.dart b/lib/app_state.dart index 5db6acee..3c6f0587 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -159,6 +159,9 @@ class AppState extends ChangeNotifier { await _safeInitAsync(() async { _whatsapp = await secureStorage.getBool('whatsapp') ?? _whatsapp; }); + await _safeInitAsync(() async { + _haveLocal = await secureStorage.getBool('ff_have_local') ?? _haveLocal; + }); } void update(VoidCallback callback) { @@ -412,7 +415,7 @@ class AppState extends ChangeNotifier { bool get haveLocal => _haveLocal; set haveLocal(bool value) { _haveLocal = value; - secureStorage.setBool('ff_local', value); + secureStorage.setBool('ff_have_local', value); } void deleteIsLogged() { diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 53dd29fa..74dacafd 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -4,12 +4,8 @@ import 'package:flutter/material.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/fast_pass_page/fast_pass_page_widget.dart'; import 'package:hub/pages/message_history_page/message_history_page_widget.dart'; -<<<<<<< HEAD import 'package:hub/pages/preferences_settings_page/preferences_settings_widget.dart'; import 'package:hub/pages/reception_page/reception_page_widget.dart'; -======= -import 'package:hub/pages/no_connection_page/no_connection_page.dart'; ->>>>>>> main import 'package:provider/provider.dart'; import '/backend/schema/structs/index.dart'; @@ -85,21 +81,9 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( params.isEmpty ? const HomePageWidget() : const HomePageWidget(), ), FFRoute( -<<<<<<< HEAD name: 'receptionPage', path: '/receptionPage', builder: (context, params) => const ReceptionPageWidget()), -======= - name: 'no-connection', - path: '/no-connection', - builder: (context, params) => const NoConnectionScreen(), - ), - // FFRoute( - // name: 'visitHistoryPage', - // path: '/visitHistoryPage', - // builder: (context, params) => const VisitHistoryPageWidget(), - // ), ->>>>>>> main FFRoute( name: 'messageHistoryPage', path: '/messageHistoryPage', diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index ae78222d..fa31da21 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -28,7 +28,6 @@ class _HomePageWidgetState extends State { bool localStatus = false; final scaffoldKey = GlobalKey(); -<<<<<<< HEAD Future checkLocalStatus() async { localStatus = await checkLocals( context: context, @@ -36,8 +35,6 @@ class _HomePageWidgetState extends State { ); } -======= ->>>>>>> main @override void initState() { super.initState(); @@ -80,7 +77,6 @@ class _HomePageWidgetState extends State { localStatus = await checkLocals( context: context, model: _model, - safeSetState: safeSetState, ); if (AppState().cliUUID.isEmpty) { diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart index c9f228c4..180c1cc2 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -65,18 +65,7 @@ class PreferencesPageWidget extends StatelessWidget { Expanded( flex: 2, child: ListView.builder( -<<<<<<< HEAD itemCount: 7, // Assuming 4 items for simplicity -======= - // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - // crossAxisCount: 3, - // crossAxisSpacing: 12.0, - // mainAxisSpacing: 12.0, - // childAspectRatio: 1.0, - // mainAxisExtent: 100.0, - // ), - itemCount: 8, // Assuming 4 items for simplicity ->>>>>>> main padding: const EdgeInsets.symmetric(horizontal: 20.0), physics: const AlwaysScrollableScrollPhysics(), itemBuilder: (BuildContext context, int index) { diff --git a/pubspec.lock b/pubspec.lock index ab70e828..49fbc8b6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -66,7 +66,7 @@ packages: source: hosted version: "2.0.3" bloc: - dependency: "direct main" + dependency: transitive description: name: bloc sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e" From 43cd04707f053c7d2236d243ecf8a359a015155b Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 23 Aug 2024 17:32:00 -0300 Subject: [PATCH 5/8] Fix: Arrumado bug de aparecer modal na tela de login --- lib/actions/actions.dart | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index 262d3df9..37f9ae4e 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -401,21 +401,23 @@ Future checkLocals({ if (locals != null && locals.isEmpty) { await toggleApp(context, false); return false; - } else if (locals.where((local) => local['CLU_STATUS'] != 'A').isNotEmpty) { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - isDismissible: false, - context: context, - builder: (context) => Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const BottomArrowLinkedLocalsComponentWidget(), - ), - ); // Chamada oti + } else { + // else if (locals.where((local) => local['CLU_STATUS'] != 'A').isNotEmpty) { + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + // isDismissible: false, + // context: context, + // builder: (context) => Padding( + // padding: MediaQuery.viewInsetsOf(context), + // child: const BottomArrowLinkedLocalsComponentWidget(), + // ), + // ); + // } + await toggleApp(context, true); + return true; } - await toggleApp(context, true); - return true; } Future answersRequest(BuildContext context, String? ref, String? task, From 515800ac30f7bc5716912b3708225c0e57a62d6e Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 26 Aug 2024 10:17:05 -0300 Subject: [PATCH 6/8] Fix: Ajuste de margin do titulo da pagina --- lib/pages/reception_page/reception_page_widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/reception_page/reception_page_widget.dart b/lib/pages/reception_page/reception_page_widget.dart index 4f7e31ed..a702ef90 100644 --- a/lib/pages/reception_page/reception_page_widget.dart +++ b/lib/pages/reception_page/reception_page_widget.dart @@ -31,7 +31,7 @@ class _ReceptionPageWidgetState extends State { mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15.0), + padding: const EdgeInsets.fromLTRB(50, 0, 50, 15.0), child: Text( FFLocalizations.of(context).getVariableText( ptText: From 74408e55cdc237c24746dc034cf7d3b58a157124 Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 26 Aug 2024 10:23:30 -0300 Subject: [PATCH 7/8] Fix: Tornando a tela Scrollavel --- .../reception_page/reception_page_widget.dart | 258 +++++++++--------- 1 file changed, 132 insertions(+), 126 deletions(-) diff --git a/lib/pages/reception_page/reception_page_widget.dart b/lib/pages/reception_page/reception_page_widget.dart index a702ef90..3729663a 100644 --- a/lib/pages/reception_page/reception_page_widget.dart +++ b/lib/pages/reception_page/reception_page_widget.dart @@ -26,80 +26,136 @@ class _ReceptionPageWidgetState extends State { body: Consumer( builder: (context, ReceptionPageModel model, child) { return SafeArea( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(50, 0, 50, 15.0), - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Falta pouco para você\nutilizar o FRE Access Hub...', - enText: - 'You are close to using the FRE Access Hub...'), - textAlign: TextAlign.center, - style: FlutterFlowTheme.of(context).displayLarge.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).accent1, - fontSize: 20.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w700, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(50, 0, 50, 15.0), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Falta pouco para você\nutilizar o FRE Access Hub...', + enText: + 'You are close to using the FRE Access Hub...'), + textAlign: TextAlign.center, + style: + FlutterFlowTheme.of(context).displayLarge.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).accent1, + fontSize: 20.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w700, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), ), - ), - const AtomImageSvgTheme( - filename: 'reception', width: 180, height: 180), - Padding( - padding: const EdgeInsets.fromLTRB(70, 30, 70.0, 60), - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Envie seu identificador para seu condomínio para vincularem sua conta aos nossos sistemas.', - enText: - 'Send your identifier to your condominium to link your account to our systems.'), - textAlign: TextAlign.center, - style: FlutterFlowTheme.of(context).displaySmall.override( - fontFamily: 'Nunito Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), + const AtomImageSvgTheme( + filename: 'reception', width: 180, height: 180), + Padding( + padding: const EdgeInsets.fromLTRB(70, 30, 70.0, 60), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Envie seu identificador para seu condomínio para vincularem sua conta aos nossos sistemas.', + enText: + 'Send your identifier to your condominium to link your account to our systems.'), + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(60, 0, 60, 10), - child: Tooltip( - message: FFLocalizations.of(context).getVariableText( - ptText: - 'Seu identificador é utilizado para efetuar\no vinculo do seu APP com o condominio.', - enText: 'My Identifier'), - textStyle: FlutterFlowTheme.of(context) - .labelSmall - .override( - fontFamily: 'Nunito Sans', - color: - FlutterFlowTheme.of(context).secondaryText, - fontSize: 10.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - child: FFButtonWidget( - onPressed: () => model.getIdenfifier(context), - text: FFLocalizations.of(context).getVariableText( - ptText: 'Meu Identificador', + Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(60, 0, 60, 10), + child: Tooltip( + message: FFLocalizations.of(context).getVariableText( + ptText: + 'Seu identificador é utilizado para efetuar\no vinculo do seu APP com o condominio.', enText: 'My Identifier'), + textStyle: FlutterFlowTheme.of(context) + .labelSmall + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context) + .secondaryText, + fontSize: 10.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + child: FFButtonWidget( + onPressed: () => model.getIdenfifier(context), + text: FFLocalizations.of(context).getVariableText( + ptText: 'Meu Identificador', + enText: 'My Identifier'), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).primary, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context) + .primaryBackground, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + showLoadingIndicator: false, + ), + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(60, 0, 60, 0), + child: FFButtonWidget( + onPressed: () async { + AppState().deleteAll(); + setState(() {}); + + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }, + text: FFLocalizations.of(context).getVariableText( + ptText: 'Sair da Conta', enText: 'Logout'), options: FFButtonOptions( width: double.infinity, height: 44.0, @@ -107,7 +163,7 @@ class _ReceptionPageWidgetState extends State { 0.0, 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context).customColor1, textStyle: FlutterFlowTheme.of(context) .titleSmall .override( @@ -130,60 +186,10 @@ class _ReceptionPageWidgetState extends State { showLoadingIndicator: false, ), ), - ), - Padding( - padding: const EdgeInsets.fromLTRB(60, 0, 60, 0), - child: FFButtonWidget( - onPressed: () async { - AppState().deleteAll(); - setState(() {}); - - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - }, - text: FFLocalizations.of(context).getVariableText( - ptText: 'Sair da Conta', enText: 'Logout'), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).customColor1, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: 'Nunito Sans', - color: FlutterFlowTheme.of(context) - .primaryBackground, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - ], - ), - ], + ], + ), + ], + ), ), ); }, From f87641e5f475460df21e5eb4da1c4e9d99c511c6 Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 26 Aug 2024 10:34:37 -0300 Subject: [PATCH 8/8] Fix: Adicionado um center para manter a coluna centralizada --- .../reception_page/reception_page_widget.dart | 266 +++++++++--------- 1 file changed, 136 insertions(+), 130 deletions(-) diff --git a/lib/pages/reception_page/reception_page_widget.dart b/lib/pages/reception_page/reception_page_widget.dart index 3729663a..82fe4d3f 100644 --- a/lib/pages/reception_page/reception_page_widget.dart +++ b/lib/pages/reception_page/reception_page_widget.dart @@ -26,84 +26,139 @@ class _ReceptionPageWidgetState extends State { body: Consumer( builder: (context, ReceptionPageModel model, child) { return SafeArea( - child: SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(50, 0, 50, 15.0), - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Falta pouco para você\nutilizar o FRE Access Hub...', - enText: - 'You are close to using the FRE Access Hub...'), - textAlign: TextAlign.center, - style: - FlutterFlowTheme.of(context).displayLarge.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).accent1, - fontSize: 20.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w700, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), + child: Center( + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(45, 0, 45, 15.0), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Falta pouco para você utilizar o FRE Access Hub...', + enText: + 'You are close to using the FRE Access Hub...'), + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context) + .displayLarge + .override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).accent1, + fontSize: 20.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w700, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), ), - ), - const AtomImageSvgTheme( - filename: 'reception', width: 180, height: 180), - Padding( - padding: const EdgeInsets.fromLTRB(70, 30, 70.0, 60), - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Envie seu identificador para seu condomínio para vincularem sua conta aos nossos sistemas.', - enText: - 'Send your identifier to your condominium to link your account to our systems.'), - textAlign: TextAlign.center, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Nunito Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), + const AtomImageSvgTheme( + filename: 'reception', width: 180, height: 180), + Padding( + padding: const EdgeInsets.fromLTRB(70, 30, 70.0, 60), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Envie seu identificador para seu condomínio para vincularem sua conta aos nossos sistemas.', + enText: + 'Send your identifier to your condominium to link your account to our systems.'), + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(60, 0, 60, 10), - child: Tooltip( - message: FFLocalizations.of(context).getVariableText( - ptText: - 'Seu identificador é utilizado para efetuar\no vinculo do seu APP com o condominio.', - enText: 'My Identifier'), - textStyle: FlutterFlowTheme.of(context) - .labelSmall - .override( - fontFamily: 'Nunito Sans', - color: FlutterFlowTheme.of(context) - .secondaryText, - fontSize: 10.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - child: FFButtonWidget( - onPressed: () => model.getIdenfifier(context), - text: FFLocalizations.of(context).getVariableText( - ptText: 'Meu Identificador', + Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(60, 0, 60, 10), + child: Tooltip( + message: FFLocalizations.of(context).getVariableText( + ptText: + 'Seu identificador é utilizado para efetuar\no vinculo do seu APP com o condominio.', enText: 'My Identifier'), + textStyle: FlutterFlowTheme.of(context) + .labelSmall + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context) + .secondaryText, + fontSize: 10.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + child: FFButtonWidget( + onPressed: () => model.getIdenfifier(context), + text: FFLocalizations.of(context) + .getVariableText( + ptText: 'Meu Identificador', + enText: 'My Identifier'), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).primary, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context) + .primaryBackground, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + showLoadingIndicator: false, + ), + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(60, 0, 60, 0), + child: FFButtonWidget( + onPressed: () async { + AppState().deleteAll(); + setState(() {}); + + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }, + text: FFLocalizations.of(context).getVariableText( + ptText: 'Sair da Conta', enText: 'Logout'), options: FFButtonOptions( width: double.infinity, height: 44.0, @@ -112,7 +167,8 @@ class _ReceptionPageWidgetState extends State { iconPadding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, + color: + FlutterFlowTheme.of(context).customColor1, textStyle: FlutterFlowTheme.of(context) .titleSmall .override( @@ -135,60 +191,10 @@ class _ReceptionPageWidgetState extends State { showLoadingIndicator: false, ), ), - ), - Padding( - padding: const EdgeInsets.fromLTRB(60, 0, 60, 0), - child: FFButtonWidget( - onPressed: () async { - AppState().deleteAll(); - setState(() {}); - - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - }, - text: FFLocalizations.of(context).getVariableText( - ptText: 'Sair da Conta', enText: 'Logout'), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).customColor1, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: 'Nunito Sans', - color: FlutterFlowTheme.of(context) - .primaryBackground, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - ], - ), - ], + ], + ), + ], + ), ), ), );