From af95679fa13454c50efef90603d51bbe1a64793a Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 22 Aug 2024 17:22:06 -0300 Subject: [PATCH] =?UTF-8?q?Feat:=20Cria=C3=A7=C3=A3o=20da=20Pagina=20de=20?= =?UTF-8?q?Recep=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"